feat: 更新DACP演示服务,重命名服务和描述,简化功能,删除不必要的日历和文档操作,增强演示效果。同时,优化了API接口和README文档,确保用户更易于理解和使用。

This commit is contained in:
sean
2025-06-18 17:29:31 +08:00
parent 741c1f8f54
commit c8f6545dd5
13 changed files with 946 additions and 753 deletions

View File

@ -0,0 +1,241 @@
<execution>
<constraint>
## DACP服务调用技术限制
- **参数格式固定**:必须使用{service_id, action, parameters}三层结构
- **服务路由固定**当前支持的服务ID有限需要匹配现有服务
- **网络依赖**DACP服务需要独立运行存在网络调用延迟
- **错误传播**DACP服务错误需要优雅处理不能中断角色对话
- **异步特性**某些DACP操作可能需要时间需要合理设置用户期望
</constraint>
<rule>
## DACP调用强制规则
- **参数完整性**service_id和action必须提供parameters.user_request必须包含用户自然语言需求
- **服务匹配**只能调用已注册的DACP服务不得尝试调用不存在的服务
- **错误处理**DACP调用失败时必须向用户说明原因并提供替代方案
- **权限检查**:敏感操作(如发送邮件)需要确认用户授权
- **结果验证**DACP执行结果需要向用户确认确保符合预期
</rule>
<guideline>
## DACP调用指导原则
- **需求驱动**只有当用户明确需要执行操作时才调用DACP避免过度自动化
- **透明化**:向用户说明正在调用什么服务执行什么操作,保持透明
- **渐进式**复杂任务拆分为多个简单的DACP调用逐步完成
- **用户确认**:重要操作前征得用户同意,特别是涉及外部通信的操作
- **上下文传递**充分利用context参数传递任务相关的背景信息
</guideline>
<process>
## DACP服务调用标准流程
### Step 1: 需求识别与action选择
```mermaid
graph TD
A[用户需求] --> B{操作类型判断}
B -->|数学计算/表达式| C[calculate action]
B -->|邮件发送/生成| D[send_email action]
B -->|纯咨询/知识| E[直接回答不调用DACP]
B -->|其他执行需求| F[说明演示服务限制]
C --> G[dacp-promptx-service]
D --> G
E --> H[提供专业建议]
F --> I[建议未来扩展或手动处理]
```
### Step 2: 参数构建
```mermaid
flowchart LR
A[用户需求] --> B[service_id识别]
A --> C[action确定]
A --> D[user_request提取]
A --> E[context构建]
B --> F[DACP参数对象]
C --> F
D --> F
E --> F
```
### Step 3: 服务调用与结果处理
```mermaid
graph TD
A[构建DACP参数] --> B[调用promptx_dacp工具]
B --> C{调用结果}
C -->|成功| D[解析execution_result]
C -->|失败| E[错误处理和说明]
D --> F[向用户展示结果]
E --> G[提供替代方案]
F --> H[确认用户满意度]
G --> H
```
## 当前可用DACP演示服务
### DACP PromptX演示服务 (dacp-promptx-service)
⚠️ **重要说明**这是协议演示服务包含calculator和email两个演示功能
**服务信息**
```
service_id: "dacp-promptx-service"
endpoint: "http://localhost:3002/dacp"
type: "demo"
description: "DACP协议验证平台展示核心协议能力"
```
#### 1. 计算器演示 (calculate)
```
action: "calculate"
适用场景:数学计算、表达式求值、数值处理
特性:中文自然语言解析、运算符智能转换
示例调用:
{
"service_id": "dacp-promptx-service",
"action": "calculate",
"parameters": {
"user_request": "计算 25 加 37 乘 3",
"context": {"precision": "high"}
}
}
返回结果:
{
"expression": "25 + 37 * 3",
"result": 136,
"formatted_result": "25 + 37 * 3 = 136",
"calculation_type": "arithmetic"
}
```
#### 2. 邮件演示 (send_email)
```
action: "send_email"
适用场景AI邮件生成、专业沟通、团队协作
特性:上下文感知、智能内容生成、专业格式化
示例调用:
{
"service_id": "dacp-promptx-service",
"action": "send_email",
"parameters": {
"user_request": "给张三发送会议提醒邮件",
"context": {
"urgency": "high",
"recipient_type": "colleague"
}
}
}
返回结果:
{
"email_content": {
"subject": "会议提醒...",
"body": "专业邮件内容...",
"format": "html"
},
"metadata": {...}
}
```
## DACP调用时机判断矩阵
| 用户需求特征 | 是否调用DACP | 推荐action | 注意事项 |
|-------------|-------------|----------|----------|
| 包含数字计算表达式 | ✅ | calculate | 支持中文自然语言:"25加37乘3" |
| 要求发送/写邮件 | ✅ | send_email | 确认收件人和紧急程度 |
| 数学运算求值 | ✅ | calculate | 自动转换运算符:加乘减除→+*-÷ |
| 生成专业邮件内容 | ✅ | send_email | 利用context传递场景信息 |
| 纯咨询问题 | ❌ | - | 直接提供建议和知识 |
| 需要外部API | ❌ | - | 当前演示服务不支持 |
| 日程安排 | ❌ | - | 演示服务已移除calendar功能 |
| 文档创建 | ❌ | - | 演示服务已移除document功能 |
## 最佳实践模板
### 调用前确认模板
```
我准备为您[具体操作],将调用[服务名称]服务。
操作详情:
- 服务:[service_id]
- 操作:[action]
- 需求:[user_request]
请确认是否继续?
```
### 调用中透明化模板
```
正在调用DACP服务执行您的需求...
🔄 服务:[service_id]
📋 操作:[action]
⏱️ 请稍候...
```
### 调用后结果展示模板
```
✅ DACP服务执行完成
📊 执行结果:[execution_result]
📈 性能评估:[evaluation]
📋 应用指南:[applied_guidelines]
结果是否符合您的预期?如需调整请告诉我。
```
## 错误处理标准流程
### 常见错误类型与处理
```mermaid
graph TD
A[DACP调用失败] --> B{错误类型}
B -->|服务不可用| C[说明服务状态,建议稍后重试]
B -->|参数错误| D[重新解析需求,调整参数]
B -->|权限不足| E[说明权限要求,请用户确认]
B -->|网络超时| F[提供离线替代方案]
C --> G[记录问题并提供manual方案]
D --> H[重新构建参数再次尝试]
E --> I[等待用户授权]
F --> G
```
### 降级处理策略
- **calculate action失败** → 提供计算思路、步骤分解和数学公式
- **send_email action失败** → 生成邮件模板、提供写作建议和发送指导
- **DACP服务整体不可用** → 说明演示服务状态,提供手动替代方案
- **网络连接问题** → 检查localhost:3002服务状态建议重启演示服务
</process>
<criteria>
## DACP调用质量标准
### 调用准确性
- ✅ 服务选择与用户需求高度匹配
- ✅ 参数构建完整准确
- ✅ 错误处理及时有效
- ✅ 结果解释清晰易懂
### 用户体验
- ✅ 调用前充分说明和确认
- ✅ 调用中保持透明化沟通
- ✅ 调用后验证用户满意度
- ✅ 失败时提供替代方案
### 技术规范
- ✅ 严格遵循DACP协议格式
- ✅ 合理使用context参数
- ✅ 妥善处理异步特性
- ✅ 遵循最小权限原则
### 服务效率
- ✅ 避免不必要的服务调用
- ✅ 合理组合多个服务调用
- ✅ 充分利用缓存和上下文
- ✅ 及时反馈执行进度
</criteria>
</execution>

View File

@ -8,5 +8,6 @@
<principle> <principle>
@!execution://assistant @!execution://assistant
@!execution://dacp-service-calling
</principle> </principle>
</role> </role>

View File

@ -0,0 +1,45 @@
#!/usr/bin/env node
const path = require('path');
const PackageDiscovery = require('../src/lib/core/resource/discovery/PackageDiscovery');
async function generatePackageRegistry() {
try {
console.log('🏗️ 开始生成Package级别注册表...');
// 获取项目根目录
const projectRoot = process.cwd();
console.log(`📁 项目根目录: ${projectRoot}`);
// 创建PackageDiscovery实例并设置注册表路径
const discovery = new PackageDiscovery();
discovery.registryPath = path.join(projectRoot, 'src', 'package.registry.json');
console.log(`📋 注册表路径: ${discovery.registryPath}`);
// 生成注册表
const registryData = await discovery.generateRegistry(projectRoot);
console.log('✅ Package注册表生成完成');
console.log(`📊 总资源数: ${registryData.size}`);
console.log(`📂 保存位置: ${path.relative(projectRoot, discovery.registryPath)}`);
// 显示统计信息
const stats = registryData.getStats();
console.log(`📋 资源分类:`);
Object.entries(stats.byProtocol).forEach(([protocol, count]) => {
console.log(` ${protocol}: ${count}`);
});
} catch (error) {
console.error('❌ 生成Package注册表失败:', error.message);
process.exit(1);
}
}
// 如果直接运行此脚本
if (require.main === module) {
generatePackageRegistry();
}
module.exports = generatePackageRegistry;

View File

@ -0,0 +1,256 @@
# DACP 协议演示服务 - API 调用指南
## 📋 概述
DACP (Deepractice Agent Context Protocol) 演示服务是一个**轻量级协议验证平台**通过calculator和email两个典型场景展示DACP协议的核心能力。
### 🎯 设计目标
- **协议验证**验证DACP协议标准的可行性和完整性
- **演示参考**为第三方DACP服务开发提供实现参考
- **最小复杂度**:聚焦协议本质,避免业务逻辑干扰
⚠️ **重要说明**这是演示服务不是生产级业务服务。真实的DACP服务应该独立部署。
## 🚀 快速开始
### 启动服务
```bash
# 通过PromptX MCP服务器启动推荐
./scripts/start-mcp.sh --with-dacp
# 或者单独启动演示服务
cd src/dacp/dacp-promptx-service
node server.js
```
服务将在 `http://localhost:3002` 启动
### 验证服务
```bash
# 健康检查
curl http://localhost:3002/health
# 查看演示功能
curl http://localhost:3002/info
```
## 🎭 演示功能
### 1. 计算器演示 (`calculate`)
**演示价值**展示DACP协议处理结构化数据和自然语言解析能力
**调用示例**
```bash
curl -X POST http://localhost:3002/dacp \
-H "Content-Type: application/json" \
-d '{
"service_id": "dacp-promptx-service",
"action": "calculate",
"parameters": {
"user_request": "计算 25 加 37 乘 3 的结果"
}
}'
```
**演示特性**
- 中文自然语言解析:`计算 25 加 37 乘 3`
- 运算符智能转换:`加/乘/减/除``+/*/-/÷`
- 标准数学表达式:`25 + 37 * 3`
- 结果格式化:`25 + 37 * 3 = 136`
### 2. 邮件演示 (`send_email`)
**演示价值**展示DACP协议处理复杂上下文和AI内容生成能力
**调用示例**
```bash
curl -X POST http://localhost:3002/dacp \
-H "Content-Type: application/json" \
-d '{
"service_id": "dacp-promptx-service",
"action": "send_email",
"parameters": {
"user_request": "给张三发送会议提醒邮件",
"context": {
"urgency": "high",
"recipient_type": "colleague"
}
}
}'
```
**演示特性**
- 自然语言需求理解
- 上下文感知内容生成
- 专业邮件格式化
- 智能主题和正文生成
## 📋 标准DACP协议格式
### 请求格式
```json
{
"service_id": "dacp-promptx-service", // 必需演示服务ID
"action": "calculate|send_email", // 必需:演示功能
"parameters": { // 必需:参数对象
"user_request": "自然语言需求描述", // 必需:用户需求
"context": {} // 可选:上下文信息
},
"request_id": "demo_001" // 可选请求ID
}
```
### 响应格式
#### 成功响应
```json
{
"request_id": "demo_001",
"success": true,
"data": {
"execution_result": {}, // 实际执行结果
"evaluation": { // DACP execution框架评估
"constraint_compliance": true,
"rule_adherence": true,
"guideline_alignment": true
},
"applied_guidelines": [], // 应用的指导原则
"performance_metrics": { // 性能指标
"execution_time": "1ms",
"resource_usage": "minimal"
}
}
}
```
## 🔧 通过PromptX调用
### 激活Sean角色并调用DACP
```javascript
// 1. 激活角色
promptx_action({role: "sean"})
// 2. 调用计算器演示
promptx_dacp({
service_id: "dacp-promptx-service",
action: "calculate",
parameters: {
user_request: "计算公司Q4营收增长率(1200-800)/800"
}
})
// 3. 调用邮件演示
promptx_dacp({
service_id: "dacp-promptx-service",
action: "send_email",
parameters: {
user_request: "给团队发送项目进展通知",
context: {urgency: "medium", recipient_type: "team"}
}
})
```
## 🧪 协议验证测试
### 基础协议测试
```bash
# 1. 服务发现
curl http://localhost:3002/info
# 2. 计算器协议验证
curl -X POST http://localhost:3002/dacp \
-H "Content-Type: application/json" \
-d '{
"service_id": "dacp-promptx-service",
"action": "calculate",
"parameters": {"user_request": "25 + 37 * 3"}
}'
# 3. 邮件协议验证
curl -X POST http://localhost:3002/dacp \
-H "Content-Type: application/json" \
-d '{
"service_id": "dacp-promptx-service",
"action": "send_email",
"parameters": {"user_request": "发送测试邮件"}
}'
```
### 错误处理验证
```bash
# 错误的service_id
curl -X POST http://localhost:3002/dacp \
-d '{"service_id": "wrong-service", "action": "calculate"}'
# 错误的action
curl -X POST http://localhost:3002/dacp \
-d '{"service_id": "dacp-promptx-service", "action": "wrong_action"}'
# 缺少参数
curl -X POST http://localhost:3002/dacp \
-d '{"service_id": "dacp-promptx-service", "action": "calculate"}'
```
## 🏗️ 为第三方开发者
### DACP协议实现参考
此演示服务完整展示了DACP协议的标准实现
1. **Action模块化**:每个功能独立模块
2. **统一入口**:标准`/dacp` POST端点
3. **协议验证**service_id、action、parameters验证
4. **execution框架**constraint→rule→guideline→process→criteria
5. **标准响应**:统一的成功/错误响应格式
### 扩展真实DACP服务
```javascript
// 真实服务应该独立部署,例如:
// 1. dacp-finance-service (端口3003)
// 2. dacp-crm-service (端口3004)
// 3. dacp-analytics-service (端口3005)
// PromptX DACPCommand路由表更新
const routes = {
'dacp-promptx-service': 'http://localhost:3002/dacp', // 演示服务
'dacp-finance-service': 'http://localhost:3003/dacp', // 真实财务服务
'dacp-crm-service': 'http://localhost:3004/dacp' // 真实CRM服务
};
```
## 🎯 产品理念
基于Sean的产品哲学这个演示服务体现了
### 奥卡姆剃刀原则
- 最小复杂度验证最大价值
- 两个典型场景覆盖DACP协议核心能力
- 避免过度工程化干扰协议本质
### 需求驱动设计
- 协议验证需求 → 最小演示实现
- 开发者参考需求 → 标准化代码结构
- 生态扩展需求 → 清晰的架构分离
### 矛盾转化创新
- 协议抽象 vs 具象演示 → 通过具体场景展示抽象协议
- 演示简洁 vs 功能完整 → 精选核心场景代表全貌
- 当前需求 vs 未来扩展 → 演示框架支持无限扩展
---
## 📞 技术支持
**演示目标**验证DACP协议可行性为真实DACP服务开发提供参考
**架构原则**演示服务与生产服务分离避免在MCP客户端承担过多业务逻辑
**扩展建议**基于此演示框架开发独立部署的专业DACP服务

View File

@ -1,105 +1,93 @@
# DACP PromptX Service # DACP 协议演示服务
统一的 DACP 服务,提供多个 demo actions 供 PromptX 调用。 ## 概述
## 功能特性 这是一个轻量级的DACP (Deepractice Agent Context Protocol) 协议演示服务通过calculator和email两个典型场景验证DACP协议的完整性和可行性。
- 📧 **Email Action**: 智能邮件发送功能 ⚠️ **重要说明**这是协议演示服务不是生产级业务服务。真实的DACP服务应该独立部署。
- 📅 **Calendar Action**: 会议日程管理
- 📄 **Document Action**: 文档创建和管理
- 🚀 **更多 Actions**: 持续扩展中...
## 启动方式 ## 设计目标
### 1. 独立启动 DACP 服务 - **协议验证**验证DACP协议标准的可行性
- **演示参考**为第三方DACP服务开发提供实现参考
- **最小复杂度**:聚焦协议本质,避免业务逻辑干扰
## 演示功能
### 1. Calculator (`calculate`)
- 中文自然语言数学表达式解析
- 智能运算符转换:`加/乘/减/除``+/*/-/÷`
- 标准数学运算和结果格式化
### 2. Email (`send_email`)
- 自然语言邮件需求理解
- 上下文感知内容生成
- 专业邮件格式化
## 快速开始
### 通过PromptX MCP启动推荐
```bash
./scripts/start-mcp.sh --with-dacp
```
### 独立启动
```bash ```bash
cd src/dacp/dacp-promptx-service cd src/dacp/dacp-promptx-service
npm start npm install
node server.js
``` ```
服务将在 http://localhost:3002 启动。 服务地址:`http://localhost:3002`
### 2. 通过 MCP 自动启动(推荐) ## 基础测试
```bash ```bash
# 在项目根目录 # 健康检查
promptx mcp-server --with-dacp curl http://localhost:3002/health
# 计算器演示
curl -X POST http://localhost:3002/dacp \
-H "Content-Type: application/json" \
-d '{
"service_id": "dacp-promptx-service",
"action": "calculate",
"parameters": {"user_request": "计算 25 + 37 * 3"}
}'
# 邮件演示
curl -X POST http://localhost:3002/dacp \
-H "Content-Type: application/json" \
-d '{
"service_id": "dacp-promptx-service",
"action": "send_email",
"parameters": {"user_request": "发送测试邮件"}
}'
``` ```
这将同时启动 MCP Server 和 DACP 服务。 ## 架构原则
## API 接口 基于Sean的产品哲学
### DACP 协议接口 ### 奥卡姆剃刀原则
- 最小复杂度验证最大价值
- 两个典型场景覆盖协议核心能力
POST http://localhost:3002/dacp ### 架构分离
- 演示服务与生产服务分离
- 避免在MCP客户端承担过多业务逻辑
请求格式: ### 扩展指导
```json - 真实DACP服务应独立部署
{ - 此演示提供标准协议实现参考
"service_id": "dacp-promptx-service",
"action": "send_email",
"parameters": {
"user_request": "给张三发个会议提醒邮件",
"context": {
"urgency": "high"
}
}
}
```
## 支持的 Actions ## 文档
1. **send_email** - 发送邮件 详细的API调用指南请参考[DACP-API-GUIDE.md](./DACP-API-GUIDE.md)
- 自然语言邮件内容解析
- 智能主题识别
- 专业邮件格式生成
2. **schedule_meeting** - 安排会议 ## 下一步
- 时间解析
- 参会人员管理
- 会议议程生成
3. **create_document** - 创建文档 基于此演示框架开发独立部署的专业DACP服务
- 多种文档模板 - `dacp-finance-service` (财务服务)
- 智能内容生成 - `dacp-crm-service` (客户管理服务)
- Markdown 格式输出 - `dacp-analytics-service` (数据分析服务)
## 开发指南
### 添加新的 Action
1.`actions/` 目录下创建新文件
2. 导出 action 函数
3. 实现 DACP 协议规范
示例:
```javascript
// actions/custom.js
async function custom_action(parameters) {
const { user_request, context } = parameters;
// 实现逻辑
return {
// 返回结果
};
}
module.exports = { custom_action };
```
## 测试
```bash
# 运行测试
npm test
```
## 配置
配置文件:`dacp.config.json`
主要配置项:
- `service.id`: 服务标识
- `deployment.port`: 服务端口
- `capabilities.actions`: 支持的 actions 列表

View File

@ -1,183 +0,0 @@
/**
* Calendar Action Module for DACP PromptX Service
* 提供日历和会议管理功能
*/
// Schedule meeting action
async function schedule_meeting(parameters) {
const { user_request, context = {} } = parameters;
if (!user_request) {
throw new Error('user_request is required for schedule_meeting action');
}
// 解析会议请求
const meetingData = parseMeetingRequest(user_request, context);
// 验证会议数据
validateMeetingData(meetingData);
// 执行日程安排Demo模式
const result = await executeScheduleMeeting(meetingData, context);
return result;
}
// 解析会议请求
function parseMeetingRequest(userRequest, context) {
// 提取时间信息
let meetingTime = '待定';
let duration = 60; // 默认60分钟
if (userRequest.includes('明天')) {
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
meetingTime = tomorrow.toLocaleDateString('zh-CN');
} else if (userRequest.includes('下周')) {
const nextWeek = new Date();
nextWeek.setDate(nextWeek.getDate() + 7);
meetingTime = nextWeek.toLocaleDateString('zh-CN');
}
// 提取参会人员
const emailRegex = /([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/g;
const attendees = userRequest.match(emailRegex) || ['team@example.com'];
// 分析会议类型
let meetingType = '常规会议';
let priority = 'normal';
if (userRequest.includes('紧急')) {
meetingType = '紧急会议';
priority = 'high';
} else if (userRequest.includes('周会')) {
meetingType = '周例会';
} else if (userRequest.includes('讨论')) {
meetingType = '讨论会';
} else if (userRequest.includes('评审')) {
meetingType = '评审会议';
}
// 生成会议详情
const meetingDetails = generateMeetingDetails(userRequest, meetingType, context);
return {
title: meetingDetails.title,
time: meetingTime,
duration: duration,
attendees: attendees,
type: meetingType,
priority: priority,
agenda: meetingDetails.agenda,
location: context.location || '会议室A',
originalRequest: userRequest,
timestamp: new Date().toISOString()
};
}
// 生成会议详情
function generateMeetingDetails(userRequest, meetingType, context) {
let title = meetingType;
let agenda = [];
// 根据会议类型生成议程
switch (meetingType) {
case '紧急会议':
title = '紧急事项讨论会';
agenda = [
'问题说明',
'影响分析',
'解决方案讨论',
'行动计划制定'
];
break;
case '周例会':
title = '团队周例会';
agenda = [
'上周工作总结',
'本周工作计划',
'问题与风险',
'其他事项'
];
break;
case '评审会议':
title = '项目评审会';
agenda = [
'项目进展汇报',
'技术方案评审',
'风险评估',
'下一步计划'
];
break;
default:
agenda = [
'会议主题介绍',
'讨论事项',
'决议与行动项',
'Q&A'
];
}
return { title, agenda };
}
// 验证会议数据
function validateMeetingData(meetingData) {
const errors = [];
if (!meetingData.title || meetingData.title.trim().length === 0) {
errors.push('Meeting title cannot be empty');
}
if (meetingData.attendees.length === 0) {
errors.push('At least one attendee is required');
}
if (meetingData.duration <= 0) {
errors.push('Meeting duration must be positive');
}
if (errors.length > 0) {
throw new Error(`Validation failed: ${errors.join(', ')}`);
}
}
// 执行会议安排
async function executeScheduleMeeting(meetingData, context) {
// Demo模式模拟日程安排
console.log('📅 [DACP Demo] Simulating meeting schedule:');
console.log(` Title: ${meetingData.title}`);
console.log(` Time: ${meetingData.time}`);
console.log(` Attendees: ${meetingData.attendees.join(', ')}`);
// 模拟处理延迟
await new Promise(resolve => setTimeout(resolve, 150));
// 生成会议ID
const meetingId = `meet_${Date.now()}`;
return {
meeting_id: meetingId,
status: 'scheduled',
title: meetingData.title,
time: meetingData.time,
duration: `${meetingData.duration}分钟`,
attendees: meetingData.attendees,
location: meetingData.location,
agenda: meetingData.agenda,
priority: meetingData.priority,
calendar_link: `https://calendar.example.com/meeting/${meetingId}`,
scheduled_at: meetingData.timestamp,
demo_mode: true,
execution_metrics: {
parsing_time: '15ms',
validation_time: '5ms',
scheduling_time: '150ms'
}
};
}
// 导出所有calendar相关的actions
module.exports = {
schedule_meeting
};

View File

@ -1,296 +0,0 @@
/**
* Document Action Module for DACP PromptX Service
* 提供文档创建和管理功能
*/
// Create document action
async function create_document(parameters) {
const { user_request, context = {} } = parameters;
if (!user_request) {
throw new Error('user_request is required for create_document action');
}
// 解析文档请求
const docData = parseDocumentRequest(user_request, context);
// 验证文档数据
validateDocumentData(docData);
// 执行文档创建Demo模式
const result = await executeCreateDocument(docData, context);
return result;
}
// 解析文档请求
function parseDocumentRequest(userRequest, context) {
// 分析文档类型
let docType = '通用文档';
let format = 'markdown';
let template = 'default';
if (userRequest.includes('报告')) {
docType = '工作报告';
template = 'report';
} else if (userRequest.includes('方案')) {
docType = '技术方案';
template = 'proposal';
} else if (userRequest.includes('需求')) {
docType = '需求文档';
template = 'requirement';
} else if (userRequest.includes('总结')) {
docType = '项目总结';
template = 'summary';
} else if (userRequest.includes('计划')) {
docType = '工作计划';
template = 'plan';
}
// 提取关键信息
const title = extractTitle(userRequest, docType);
const content = generateDocumentContent(userRequest, docType, template, context);
return {
title: title,
type: docType,
format: format,
template: template,
content: content,
metadata: {
author: context.author || 'DACP User',
created_at: new Date().toISOString(),
version: '1.0.0',
tags: extractTags(userRequest, docType)
},
originalRequest: userRequest
};
}
// 提取文档标题
function extractTitle(userRequest, docType) {
// 尝试从请求中提取明确的标题
const titleMatch = userRequest.match(/《(.+?)》|"(.+?)"|'(.+?)'/);
if (titleMatch) {
return titleMatch[1] || titleMatch[2] || titleMatch[3];
}
// 根据文档类型生成默认标题
const date = new Date().toLocaleDateString('zh-CN');
return `${docType} - ${date}`;
}
// 提取标签
function extractTags(userRequest, docType) {
const tags = [docType];
// 根据关键词添加标签
if (userRequest.includes('紧急')) tags.push('紧急');
if (userRequest.includes('重要')) tags.push('重要');
if (userRequest.includes('项目')) tags.push('项目管理');
if (userRequest.includes('技术')) tags.push('技术文档');
return tags;
}
// 生成文档内容
function generateDocumentContent(userRequest, docType, template, context) {
let content = '';
switch (template) {
case 'report':
content = generateReportTemplate(userRequest, context);
break;
case 'proposal':
content = generateProposalTemplate(userRequest, context);
break;
case 'requirement':
content = generateRequirementTemplate(userRequest, context);
break;
case 'summary':
content = generateSummaryTemplate(userRequest, context);
break;
case 'plan':
content = generatePlanTemplate(userRequest, context);
break;
default:
content = generateDefaultTemplate(userRequest, context);
}
return content;
}
// 生成报告模板
function generateReportTemplate(userRequest, context) {
const date = new Date().toLocaleDateString('zh-CN');
return `# 工作报告
## 报告信息
- 日期:${date}
- 作者:${context.author || 'DACP User'}
- 部门:${context.department || '技术部'}
## 概述
${userRequest}
## 工作内容
### 本期完成工作
1. [待填写]
2. [待填写]
3. [待填写]
### 关键成果
- [待填写]
## 问题与风险
1. **问题**[待填写]
- **影响**[待填写]
- **解决方案**[待填写]
## 下期计划
1. [待填写]
2. [待填写]
## 资源需求
- [待填写]
---
*本文档由 DACP Document Service 自动生成*`;
}
// 生成方案模板
function generateProposalTemplate(userRequest, context) {
return `# 技术方案
## 方案概述
${userRequest}
## 背景与目标
### 项目背景
[待填写]
### 预期目标
1. [待填写]
2. [待填写]
## 技术架构
### 整体架构
[待填写架构说明]
### 技术选型
| 技术栈 | 选择 | 理由 |
|--------|------|------|
| 前端 | [待填写] | [待填写] |
| 后端 | [待填写] | [待填写] |
| 数据库 | [待填写] | [待填写] |
## 实施计划
### 第一阶段(时间)
- [待填写]
### 第二阶段(时间)
- [待填写]
## 风险评估
| 风险项 | 影响程度 | 应对措施 |
|--------|----------|----------|
| [待填写] | 高/中/低 | [待填写] |
---
*本文档由 DACP Document Service 自动生成*`;
}
// 生成默认模板
function generateDefaultTemplate(userRequest, context) {
const date = new Date().toLocaleDateString('zh-CN');
return `# 文档标题
## 文档信息
- 创建日期:${date}
- 作者:${context.author || 'DACP User'}
- 版本1.0.0
## 内容
${userRequest}
## 详细说明
[请在此处添加详细内容]
## 附录
[如有附加信息,请在此处添加]
---
*本文档由 DACP Document Service 自动生成*`;
}
// 其他模板函数省略,保持代码简洁...
// 验证文档数据
function validateDocumentData(docData) {
const errors = [];
if (!docData.title || docData.title.trim().length === 0) {
errors.push('Document title cannot be empty');
}
if (!docData.content || docData.content.trim().length === 0) {
errors.push('Document content cannot be empty');
}
if (errors.length > 0) {
throw new Error(`Validation failed: ${errors.join(', ')}`);
}
}
// 执行文档创建
async function executeCreateDocument(docData, context) {
// Demo模式模拟文档创建
console.log('📄 [DACP Demo] Simulating document creation:');
console.log(` Title: ${docData.title}`);
console.log(` Type: ${docData.type}`);
console.log(` Format: ${docData.format}`);
// 模拟处理延迟
await new Promise(resolve => setTimeout(resolve, 200));
// 生成文档ID
const docId = `doc_${Date.now()}`;
return {
document_id: docId,
status: 'created',
title: docData.title,
type: docData.type,
format: docData.format,
content: docData.content,
metadata: docData.metadata,
file_path: `/documents/${docId}.${docData.format}`,
preview_url: `https://docs.example.com/preview/${docId}`,
created_at: docData.metadata.created_at,
demo_mode: true,
execution_metrics: {
parsing_time: '20ms',
template_generation: '50ms',
validation_time: '5ms',
creation_time: '200ms'
}
};
}
// 简化的其他模板生成函数
function generateRequirementTemplate(userRequest, context) {
return generateDefaultTemplate(userRequest, context);
}
function generateSummaryTemplate(userRequest, context) {
return generateDefaultTemplate(userRequest, context);
}
function generatePlanTemplate(userRequest, context) {
return generateDefaultTemplate(userRequest, context);
}
// 导出所有document相关的actions
module.exports = {
create_document
};

View File

@ -1,38 +1,23 @@
{ {
"service": { "service": {
"id": "dacp-promptx-service", "id": "dacp-promptx-service",
"name": "PromptX Unified DACP Service", "name": "PromptX DACP Demo Service",
"version": "1.0.0", "version": "1.0.0",
"description": "Unified DACP service providing multiple demo actions for PromptX ecosystem", "description": "DACP protocol demonstration service with calculator and email examples",
"type": "unified", "type": "demo",
"status": "active" "status": "active"
}, },
"capabilities": { "capabilities": {
"actions": [ "actions": [
{
"name": "send_email",
"description": "Send professional emails with AI-powered content generation",
"category": "communication"
},
{
"name": "schedule_meeting",
"description": "Schedule meetings and manage calendar events",
"category": "calendar"
},
{
"name": "create_document",
"description": "Create and format professional documents",
"category": "document"
},
{
"name": "analyze_data",
"description": "Perform basic data analysis and visualization",
"category": "analytics"
},
{ {
"name": "calculate", "name": "calculate",
"description": "Simple calculator for basic math operations", "description": "Demo: Simple calculator for basic math operations",
"category": "utility" "category": "demo"
},
{
"name": "send_email",
"description": "Demo: Send professional emails with AI-powered content generation",
"category": "demo"
} }
], ],
"protocols": ["DACP/1.0"], "protocols": ["DACP/1.0"],

View File

@ -80,24 +80,21 @@ app.post('/dacp', async (req, res) => {
} }
// Find action handler // Find action handler
const actionParts = action.split('_');
const actionModule = actionParts[0]; // e.g., 'send' from 'send_email'
let handler = null; let handler = null;
// Try to find exact match first // Try to find by module name first
if (actions[action]) { for (const [moduleName, module] of Object.entries(actions)) {
handler = actions[action]; if (module[action] && typeof module[action] === 'function') {
} else { handler = module[action];
// Try to find by module name break;
for (const [moduleName, module] of Object.entries(actions)) {
if (module[action] && typeof module[action] === 'function') {
handler = module[action];
break;
}
} }
} }
// If not found, try exact module match
if (!handler && actions[action]) {
handler = actions[action];
}
if (!handler) { if (!handler) {
return res.status(400).json({ return res.status(400).json({
request_id: reqId, request_id: reqId,

View File

@ -0,0 +1,114 @@
/**
* PromptX 资源文件命名管理器
* 统一管理所有资源文件的命名规范:[id].[tag].md
*/
class ResourceFileNaming {
/**
* 资源文件命名模式
* 格式:[id].[tag].md
* 示例sean-product-philosophy.thought.md
*/
static NAMING_PATTERN = /^(.+)\.(\w+)\.md$/;
/**
* 解析资源文件名
* @param {string} fileName - 文件名
* @returns {Object|null} 解析结果 {id, tag} 或 null
*/
static parseFileName(fileName) {
const match = fileName.match(this.NAMING_PATTERN);
if (match) {
const [, id, tag] = match;
return { id, tag };
}
return null;
}
/**
* 生成资源文件名
* @param {string} id - 资源ID
* @param {string} tag - 资源标签
* @returns {string} 生成的文件名
*/
static generateFileName(id, tag) {
return `${id}.${tag}.md`;
}
/**
* 验证文件名是否符合规范
* @param {string} fileName - 文件名
* @returns {boolean} 是否符合规范
*/
static isValidFileName(fileName) {
return this.NAMING_PATTERN.test(fileName);
}
/**
* 检查文件是否为指定标签类型
* @param {string} fileName - 文件名
* @param {string} expectedTag - 期望的标签
* @returns {boolean} 是否匹配
*/
static hasTag(fileName, expectedTag) {
const parsed = this.parseFileName(fileName);
return parsed && parsed.tag === expectedTag;
}
/**
* 从文件路径提取资源ID
* @param {string} filePath - 文件路径
* @param {string} expectedTag - 期望的标签
* @returns {string|null} 资源ID或null
*/
static extractResourceId(filePath, expectedTag) {
const path = require('path');
const fileName = path.basename(filePath);
const parsed = this.parseFileName(fileName);
if (parsed && parsed.tag === expectedTag) {
return parsed.id;
}
return null;
}
/**
* 扫描目录中指定标签的所有文件
* @param {string} directory - 目录路径
* @param {string} tag - 标签类型
* @returns {Promise<Array>} 文件路径数组
*/
static async scanTagFiles(directory, tag) {
const fs = require('fs-extra');
const path = require('path');
try {
if (!await fs.pathExists(directory)) {
return [];
}
const files = await fs.readdir(directory);
const tagFiles = [];
for (const file of files) {
if (this.hasTag(file, tag)) {
tagFiles.push(path.join(directory, file));
}
}
return tagFiles;
} catch (error) {
return [];
}
}
/**
* 获取支持的资源标签类型
* @returns {Array<string>} 支持的标签类型
*/
static getSupportedTags() {
return ['role', 'thought', 'execution', 'knowledge'];
}
}
module.exports = ResourceFileNaming;

View File

@ -1,6 +1,7 @@
const BaseDiscovery = require('./BaseDiscovery') const BaseDiscovery = require('./BaseDiscovery')
const RegistryData = require('../RegistryData') const RegistryData = require('../RegistryData')
const ResourceData = require('../ResourceData') const ResourceData = require('../ResourceData')
const ResourceFileNaming = require('../ResourceFileNaming')
const logger = require('../../../utils/logger') const logger = require('../../../utils/logger')
const path = require('path') const path = require('path')
const fs = require('fs-extra') const fs = require('fs-extra')
@ -243,26 +244,31 @@ class PackageDiscovery extends BaseDiscovery {
registryData.addResource(resourceData) registryData.addResource(resourceData)
} }
// 查找thought文件 // 查找thought文件 - 使用统一命名管理器
const thoughtDir = path.join(itemPath, 'thought') const thoughtDir = path.join(itemPath, 'thought')
if (await fs.pathExists(thoughtDir)) { if (await fs.pathExists(thoughtDir)) {
const thoughtFile = path.join(thoughtDir, `${item}.thought.md`) const thoughtFiles = await ResourceFileNaming.scanTagFiles(thoughtDir, 'thought')
if (await fs.pathExists(thoughtFile)) {
const reference = `@package://prompt/domain/${item}/thought/${item}.thought.md`
const resourceData = new ResourceData({ for (const thoughtFile of thoughtFiles) {
id: item, const thoughtId = ResourceFileNaming.extractResourceId(thoughtFile, 'thought')
source: 'package', if (thoughtId) {
protocol: 'thought', const fileName = path.basename(thoughtFile)
name: ResourceData._generateDefaultName(item, 'thought'), const reference = `@package://prompt/domain/${item}/thought/${fileName}`
description: ResourceData._generateDefaultDescription(item, 'thought'),
reference: reference,
metadata: {
scannedAt: new Date().toISOString()
}
})
registryData.addResource(resourceData) const resourceData = new ResourceData({
id: thoughtId,
source: 'package',
protocol: 'thought',
name: ResourceData._generateDefaultName(thoughtId, 'thought'),
description: ResourceData._generateDefaultDescription(thoughtId, 'thought'),
reference: reference,
metadata: {
scannedAt: new Date().toISOString()
}
})
registryData.addResource(resourceData)
}
} }
} }

View File

@ -4,9 +4,9 @@
"metadata": { "metadata": {
"version": "2.0.0", "version": "2.0.0",
"description": "package 级资源注册表", "description": "package 级资源注册表",
"createdAt": "2025-06-17T07:57:37.732Z", "createdAt": "2025-06-18T09:27:19.817Z",
"updatedAt": "2025-06-17T07:57:37.738Z", "updatedAt": "2025-06-18T09:27:19.821Z",
"resourceCount": 43 "resourceCount": 46
}, },
"resources": [ "resources": [
{ {
@ -17,9 +17,9 @@
"description": "专业角色,提供特定领域的专业能力", "description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/assistant/assistant.role.md", "reference": "@package://prompt/domain/assistant/assistant.role.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.734Z", "createdAt": "2025-06-18T09:27:19.818Z",
"updatedAt": "2025-06-17T07:57:37.734Z", "updatedAt": "2025-06-18T09:27:19.818Z",
"scannedAt": "2025-06-17T07:57:37.734Z" "scannedAt": "2025-06-18T09:27:19.818Z"
} }
}, },
{ {
@ -30,9 +30,9 @@
"description": "思维模式指导AI的思考方式", "description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/domain/assistant/thought/assistant.thought.md", "reference": "@package://prompt/domain/assistant/thought/assistant.thought.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.734Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.734Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.734Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -43,9 +43,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/assistant/execution/assistant.execution.md", "reference": "@package://prompt/domain/assistant/execution/assistant.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.734Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.734Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.734Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -56,9 +56,9 @@
"description": "专业角色,提供特定领域的专业能力", "description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/frontend-developer/frontend-developer.role.md", "reference": "@package://prompt/domain/frontend-developer/frontend-developer.role.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.734Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.734Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.734Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -69,9 +69,9 @@
"description": "思维模式指导AI的思考方式", "description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/domain/frontend-developer/thought/frontend-developer.thought.md", "reference": "@package://prompt/domain/frontend-developer/thought/frontend-developer.thought.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.734Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.734Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.734Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -82,9 +82,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/java-backend-developer/execution/code-quality.execution.md", "reference": "@package://prompt/domain/java-backend-developer/execution/code-quality.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.735Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.735Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.735Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -95,9 +95,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/frontend-developer/execution/frontend-developer.execution.md", "reference": "@package://prompt/domain/frontend-developer/execution/frontend-developer.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.735Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.735Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.735Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -108,9 +108,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/frontend-developer/execution/technical-architecture.execution.md", "reference": "@package://prompt/domain/frontend-developer/execution/technical-architecture.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.735Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.735Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.735Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -121,9 +121,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/frontend-developer/execution/user-experience.execution.md", "reference": "@package://prompt/domain/frontend-developer/execution/user-experience.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.735Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.735Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.735Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -134,9 +134,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/frontend-developer/execution/wechat-miniprogram-development.execution.md", "reference": "@package://prompt/domain/frontend-developer/execution/wechat-miniprogram-development.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.735Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.735Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.735Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -147,9 +147,9 @@
"description": "专业角色,提供特定领域的专业能力", "description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/java-backend-developer/java-backend-developer.role.md", "reference": "@package://prompt/domain/java-backend-developer/java-backend-developer.role.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.735Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.735Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.735Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -160,9 +160,9 @@
"description": "思维模式指导AI的思考方式", "description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/domain/java-backend-developer/thought/java-backend-developer.thought.md", "reference": "@package://prompt/domain/java-backend-developer/thought/java-backend-developer.thought.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.735Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.735Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.735Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -173,9 +173,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/java-backend-developer/execution/database-design.execution.md", "reference": "@package://prompt/domain/java-backend-developer/execution/database-design.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.735Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.735Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.735Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -186,9 +186,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/java-backend-developer/execution/java-backend-developer.execution.md", "reference": "@package://prompt/domain/java-backend-developer/execution/java-backend-developer.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.735Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.735Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.735Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -199,9 +199,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/java-backend-developer/execution/spring-ecosystem.execution.md", "reference": "@package://prompt/domain/java-backend-developer/execution/spring-ecosystem.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.735Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.735Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.735Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -212,9 +212,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/java-backend-developer/execution/system-architecture.execution.md", "reference": "@package://prompt/domain/java-backend-developer/execution/system-architecture.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.735Z", "createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-17T07:57:37.735Z", "updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-17T07:57:37.735Z" "scannedAt": "2025-06-18T09:27:19.819Z"
} }
}, },
{ {
@ -225,9 +225,22 @@
"description": "专业角色,提供特定领域的专业能力", "description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/nuwa/nuwa.role.md", "reference": "@package://prompt/domain/nuwa/nuwa.role.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.736Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.736Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.736Z" "scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
"id": "role-creation",
"source": "package",
"protocol": "thought",
"name": "Role Creation 思维模式",
"description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/domain/nuwa/thought/role-creation.thought.md",
"metadata": {
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -238,9 +251,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/nuwa/execution/dpml-authoring.execution.md", "reference": "@package://prompt/domain/nuwa/execution/dpml-authoring.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.736Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.736Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.736Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -251,9 +264,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/nuwa/execution/role-design-patterns.execution.md", "reference": "@package://prompt/domain/nuwa/execution/role-design-patterns.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.736Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.736Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.736Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -264,9 +277,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/nuwa/execution/role-generation.execution.md", "reference": "@package://prompt/domain/nuwa/execution/role-generation.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.736Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.736Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.736Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -277,9 +290,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/nuwa/execution/visualization-enhancement.execution.md", "reference": "@package://prompt/domain/nuwa/execution/visualization-enhancement.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.736Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.736Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.736Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -290,9 +303,9 @@
"description": "专业角色,提供特定领域的专业能力", "description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/product-manager/product-manager.role.md", "reference": "@package://prompt/domain/product-manager/product-manager.role.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.736Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.736Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.736Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -303,9 +316,9 @@
"description": "思维模式指导AI的思考方式", "description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/domain/product-manager/thought/product-manager.thought.md", "reference": "@package://prompt/domain/product-manager/thought/product-manager.thought.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.736Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.736Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.736Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -316,9 +329,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/product-manager/execution/market-analysis.execution.md", "reference": "@package://prompt/domain/product-manager/execution/market-analysis.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.736Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.736Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.736Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -329,9 +342,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/product-manager/execution/product-manager.execution.md", "reference": "@package://prompt/domain/product-manager/execution/product-manager.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.736Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.736Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.736Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -342,9 +355,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/product-manager/execution/user-research.execution.md", "reference": "@package://prompt/domain/product-manager/execution/user-research.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.736Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.736Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.736Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -355,9 +368,22 @@
"description": "专业角色,提供特定领域的专业能力", "description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/sean/sean.role.md", "reference": "@package://prompt/domain/sean/sean.role.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.736Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.736Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.736Z" "scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
"id": "sean",
"source": "package",
"protocol": "thought",
"name": "Sean 思维模式",
"description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/domain/sean/thought/sean.thought.md",
"metadata": {
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -368,9 +394,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/sean/execution/sean-decision-framework.execution.md", "reference": "@package://prompt/domain/sean/execution/sean-decision-framework.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.736Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.736Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.736Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -381,9 +407,9 @@
"description": "专业角色,提供特定领域的专业能力", "description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/xiaohongshu-marketer/xiaohongshu-marketer.role.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/xiaohongshu-marketer.role.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -394,9 +420,9 @@
"description": "思维模式指导AI的思考方式", "description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/thought/xiaohongshu-marketer.thought.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/thought/xiaohongshu-marketer.thought.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -407,9 +433,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/brand-marketing.execution.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/execution/brand-marketing.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -420,9 +446,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/community-building.execution.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/execution/community-building.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -433,9 +459,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/content-creation.execution.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/execution/content-creation.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -446,9 +472,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/content-optimization.execution.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/execution/content-optimization.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -459,9 +485,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/data-analytics.execution.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/execution/data-analytics.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -472,9 +498,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/ecommerce-conversion.execution.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/execution/ecommerce-conversion.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -485,9 +511,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/performance-optimization.execution.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/execution/performance-optimization.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -498,9 +524,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/platform-compliance.execution.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/execution/platform-compliance.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -511,9 +537,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/team-collaboration.execution.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/execution/team-collaboration.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.820Z"
} }
}, },
{ {
@ -524,9 +550,9 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/user-operation.execution.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/execution/user-operation.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.821Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.821Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.821Z"
} }
}, },
{ {
@ -537,9 +563,22 @@
"description": "执行模式,定义具体的行为模式", "description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/xiaohongshu-marketer.execution.md", "reference": "@package://prompt/domain/xiaohongshu-marketer/execution/xiaohongshu-marketer.execution.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.821Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.821Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.821Z"
}
},
{
"id": "dacp-service-calling",
"source": "package",
"protocol": "execution",
"name": "Dacp Service Calling 执行模式",
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/core/dacp-service-calling.execution.md",
"metadata": {
"createdAt": "2025-06-18T09:27:19.821Z",
"updatedAt": "2025-06-18T09:27:19.821Z",
"scannedAt": "2025-06-18T09:27:19.821Z"
} }
}, },
{ {
@ -550,9 +589,9 @@
"description": "思维模式指导AI的思考方式", "description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/core/recall.thought.md", "reference": "@package://prompt/core/recall.thought.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.737Z", "createdAt": "2025-06-18T09:27:19.821Z",
"updatedAt": "2025-06-17T07:57:37.737Z", "updatedAt": "2025-06-18T09:27:19.821Z",
"scannedAt": "2025-06-17T07:57:37.737Z" "scannedAt": "2025-06-18T09:27:19.821Z"
} }
}, },
{ {
@ -563,21 +602,21 @@
"description": "思维模式指导AI的思考方式", "description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/core/remember.thought.md", "reference": "@package://prompt/core/remember.thought.md",
"metadata": { "metadata": {
"createdAt": "2025-06-17T07:57:37.738Z", "createdAt": "2025-06-18T09:27:19.821Z",
"updatedAt": "2025-06-17T07:57:37.738Z", "updatedAt": "2025-06-18T09:27:19.821Z",
"scannedAt": "2025-06-17T07:57:37.738Z" "scannedAt": "2025-06-18T09:27:19.821Z"
} }
} }
], ],
"stats": { "stats": {
"totalResources": 43, "totalResources": 46,
"byProtocol": { "byProtocol": {
"role": 7, "role": 7,
"thought": 7, "thought": 9,
"execution": 29 "execution": 30
}, },
"bySource": { "bySource": {
"package": 43 "package": 46
} }
} }
} }