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,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**: 智能邮件发送功能
- 📅 **Calendar Action**: 会议日程管理
- 📄 **Document Action**: 文档创建和管理
- 🚀 **更多 Actions**: 持续扩展中...
⚠️ **重要说明**这是协议演示服务不是生产级业务服务。真实的DACP服务应该独立部署。
## 启动方式
## 设计目标
### 1. 独立启动 DACP 服务
- **协议验证**验证DACP协议标准的可行性
- **演示参考**为第三方DACP服务开发提供实现参考
- **最小复杂度**:聚焦协议本质,避免业务逻辑干扰
## 演示功能
### 1. Calculator (`calculate`)
- 中文自然语言数学表达式解析
- 智能运算符转换:`加/乘/减/除``+/*/-/÷`
- 标准数学运算和结果格式化
### 2. Email (`send_email`)
- 自然语言邮件需求理解
- 上下文感知内容生成
- 专业邮件格式化
## 快速开始
### 通过PromptX MCP启动推荐
```bash
./scripts/start-mcp.sh --with-dacp
```
### 独立启动
```bash
cd src/dacp/dacp-promptx-service
npm start
npm install
node server.js
```
服务将在 http://localhost:3002 启动。
服务地址:`http://localhost:3002`
### 2. 通过 MCP 自动启动(推荐)
## 基础测试
```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
{
"service_id": "dacp-promptx-service",
"action": "send_email",
"parameters": {
"user_request": "给张三发个会议提醒邮件",
"context": {
"urgency": "high"
}
}
}
```
### 扩展指导
- 真实DACP服务应独立部署
- 此演示提供标准协议实现参考
## 支持的 Actions
## 文档
1. **send_email** - 发送邮件
- 自然语言邮件内容解析
- 智能主题识别
- 专业邮件格式生成
详细的API调用指南请参考[DACP-API-GUIDE.md](./DACP-API-GUIDE.md)
2. **schedule_meeting** - 安排会议
- 时间解析
- 参会人员管理
- 会议议程生成
## 下一步
3. **create_document** - 创建文档
- 多种文档模板
- 智能内容生成
- Markdown 格式输出
## 开发指南
### 添加新的 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 列表
基于此演示框架开发独立部署的专业DACP服务
- `dacp-finance-service` (财务服务)
- `dacp-crm-service` (客户管理服务)
- `dacp-analytics-service` (数据分析服务)

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": {
"id": "dacp-promptx-service",
"name": "PromptX Unified DACP Service",
"name": "PromptX DACP Demo Service",
"version": "1.0.0",
"description": "Unified DACP service providing multiple demo actions for PromptX ecosystem",
"type": "unified",
"description": "DACP protocol demonstration service with calculator and email examples",
"type": "demo",
"status": "active"
},
"capabilities": {
"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",
"description": "Simple calculator for basic math operations",
"category": "utility"
"description": "Demo: Simple calculator for basic math operations",
"category": "demo"
},
{
"name": "send_email",
"description": "Demo: Send professional emails with AI-powered content generation",
"category": "demo"
}
],
"protocols": ["DACP/1.0"],

View File

@ -80,23 +80,20 @@ app.post('/dacp', async (req, res) => {
}
// Find action handler
const actionParts = action.split('_');
const actionModule = actionParts[0]; // e.g., 'send' from 'send_email'
let handler = null;
// Try to find exact match first
if (actions[action]) {
handler = actions[action];
} else {
// Try to find by module name
for (const [moduleName, module] of Object.entries(actions)) {
if (module[action] && typeof module[action] === 'function') {
handler = module[action];
break;
}
// Try to find by module name first
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) {
return res.status(400).json({

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 RegistryData = require('../RegistryData')
const ResourceData = require('../ResourceData')
const ResourceFileNaming = require('../ResourceFileNaming')
const logger = require('../../../utils/logger')
const path = require('path')
const fs = require('fs-extra')
@ -243,26 +244,31 @@ class PackageDiscovery extends BaseDiscovery {
registryData.addResource(resourceData)
}
// 查找thought文件
// 查找thought文件 - 使用统一命名管理器
const thoughtDir = path.join(itemPath, 'thought')
if (await fs.pathExists(thoughtDir)) {
const thoughtFile = path.join(thoughtDir, `${item}.thought.md`)
if (await fs.pathExists(thoughtFile)) {
const reference = `@package://prompt/domain/${item}/thought/${item}.thought.md`
const resourceData = new ResourceData({
id: item,
source: 'package',
protocol: 'thought',
name: ResourceData._generateDefaultName(item, 'thought'),
description: ResourceData._generateDefaultDescription(item, 'thought'),
reference: reference,
metadata: {
scannedAt: new Date().toISOString()
}
})
registryData.addResource(resourceData)
const thoughtFiles = await ResourceFileNaming.scanTagFiles(thoughtDir, 'thought')
for (const thoughtFile of thoughtFiles) {
const thoughtId = ResourceFileNaming.extractResourceId(thoughtFile, 'thought')
if (thoughtId) {
const fileName = path.basename(thoughtFile)
const reference = `@package://prompt/domain/${item}/thought/${fileName}`
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": {
"version": "2.0.0",
"description": "package 级资源注册表",
"createdAt": "2025-06-17T07:57:37.732Z",
"updatedAt": "2025-06-17T07:57:37.738Z",
"resourceCount": 43
"createdAt": "2025-06-18T09:27:19.817Z",
"updatedAt": "2025-06-18T09:27:19.821Z",
"resourceCount": 46
},
"resources": [
{
@ -17,9 +17,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/assistant/assistant.role.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.734Z",
"updatedAt": "2025-06-17T07:57:37.734Z",
"scannedAt": "2025-06-17T07:57:37.734Z"
"createdAt": "2025-06-18T09:27:19.818Z",
"updatedAt": "2025-06-18T09:27:19.818Z",
"scannedAt": "2025-06-18T09:27:19.818Z"
}
},
{
@ -30,9 +30,9 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/domain/assistant/thought/assistant.thought.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.734Z",
"updatedAt": "2025-06-17T07:57:37.734Z",
"scannedAt": "2025-06-17T07:57:37.734Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -43,9 +43,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/assistant/execution/assistant.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.734Z",
"updatedAt": "2025-06-17T07:57:37.734Z",
"scannedAt": "2025-06-17T07:57:37.734Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -56,9 +56,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/frontend-developer/frontend-developer.role.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.734Z",
"updatedAt": "2025-06-17T07:57:37.734Z",
"scannedAt": "2025-06-17T07:57:37.734Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -69,9 +69,9 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/domain/frontend-developer/thought/frontend-developer.thought.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.734Z",
"updatedAt": "2025-06-17T07:57:37.734Z",
"scannedAt": "2025-06-17T07:57:37.734Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -82,9 +82,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/java-backend-developer/execution/code-quality.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.735Z",
"updatedAt": "2025-06-17T07:57:37.735Z",
"scannedAt": "2025-06-17T07:57:37.735Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -95,9 +95,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/frontend-developer/execution/frontend-developer.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.735Z",
"updatedAt": "2025-06-17T07:57:37.735Z",
"scannedAt": "2025-06-17T07:57:37.735Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -108,9 +108,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/frontend-developer/execution/technical-architecture.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.735Z",
"updatedAt": "2025-06-17T07:57:37.735Z",
"scannedAt": "2025-06-17T07:57:37.735Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -121,9 +121,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/frontend-developer/execution/user-experience.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.735Z",
"updatedAt": "2025-06-17T07:57:37.735Z",
"scannedAt": "2025-06-17T07:57:37.735Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -134,9 +134,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/frontend-developer/execution/wechat-miniprogram-development.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.735Z",
"updatedAt": "2025-06-17T07:57:37.735Z",
"scannedAt": "2025-06-17T07:57:37.735Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -147,9 +147,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/java-backend-developer/java-backend-developer.role.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.735Z",
"updatedAt": "2025-06-17T07:57:37.735Z",
"scannedAt": "2025-06-17T07:57:37.735Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -160,9 +160,9 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/domain/java-backend-developer/thought/java-backend-developer.thought.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.735Z",
"updatedAt": "2025-06-17T07:57:37.735Z",
"scannedAt": "2025-06-17T07:57:37.735Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -173,9 +173,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/java-backend-developer/execution/database-design.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.735Z",
"updatedAt": "2025-06-17T07:57:37.735Z",
"scannedAt": "2025-06-17T07:57:37.735Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -186,9 +186,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/java-backend-developer/execution/java-backend-developer.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.735Z",
"updatedAt": "2025-06-17T07:57:37.735Z",
"scannedAt": "2025-06-17T07:57:37.735Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -199,9 +199,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/java-backend-developer/execution/spring-ecosystem.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.735Z",
"updatedAt": "2025-06-17T07:57:37.735Z",
"scannedAt": "2025-06-17T07:57:37.735Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -212,9 +212,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/java-backend-developer/execution/system-architecture.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.735Z",
"updatedAt": "2025-06-17T07:57:37.735Z",
"scannedAt": "2025-06-17T07:57:37.735Z"
"createdAt": "2025-06-18T09:27:19.819Z",
"updatedAt": "2025-06-18T09:27:19.819Z",
"scannedAt": "2025-06-18T09:27:19.819Z"
}
},
{
@ -225,9 +225,22 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/nuwa/nuwa.role.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.736Z",
"updatedAt": "2025-06-17T07:57:37.736Z",
"scannedAt": "2025-06-17T07:57:37.736Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"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": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/nuwa/execution/dpml-authoring.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.736Z",
"updatedAt": "2025-06-17T07:57:37.736Z",
"scannedAt": "2025-06-17T07:57:37.736Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -251,9 +264,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/nuwa/execution/role-design-patterns.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.736Z",
"updatedAt": "2025-06-17T07:57:37.736Z",
"scannedAt": "2025-06-17T07:57:37.736Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -264,9 +277,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/nuwa/execution/role-generation.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.736Z",
"updatedAt": "2025-06-17T07:57:37.736Z",
"scannedAt": "2025-06-17T07:57:37.736Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -277,9 +290,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/nuwa/execution/visualization-enhancement.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.736Z",
"updatedAt": "2025-06-17T07:57:37.736Z",
"scannedAt": "2025-06-17T07:57:37.736Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -290,9 +303,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/product-manager/product-manager.role.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.736Z",
"updatedAt": "2025-06-17T07:57:37.736Z",
"scannedAt": "2025-06-17T07:57:37.736Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -303,9 +316,9 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/domain/product-manager/thought/product-manager.thought.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.736Z",
"updatedAt": "2025-06-17T07:57:37.736Z",
"scannedAt": "2025-06-17T07:57:37.736Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -316,9 +329,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/product-manager/execution/market-analysis.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.736Z",
"updatedAt": "2025-06-17T07:57:37.736Z",
"scannedAt": "2025-06-17T07:57:37.736Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -329,9 +342,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/product-manager/execution/product-manager.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.736Z",
"updatedAt": "2025-06-17T07:57:37.736Z",
"scannedAt": "2025-06-17T07:57:37.736Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -342,9 +355,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/product-manager/execution/user-research.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.736Z",
"updatedAt": "2025-06-17T07:57:37.736Z",
"scannedAt": "2025-06-17T07:57:37.736Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -355,9 +368,22 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/sean/sean.role.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.736Z",
"updatedAt": "2025-06-17T07:57:37.736Z",
"scannedAt": "2025-06-17T07:57:37.736Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"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": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/sean/execution/sean-decision-framework.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.736Z",
"updatedAt": "2025-06-17T07:57:37.736Z",
"scannedAt": "2025-06-17T07:57:37.736Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -381,9 +407,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://prompt/domain/xiaohongshu-marketer/xiaohongshu-marketer.role.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -394,9 +420,9 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/thought/xiaohongshu-marketer.thought.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -407,9 +433,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/brand-marketing.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -420,9 +446,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/community-building.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -433,9 +459,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/content-creation.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -446,9 +472,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/content-optimization.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -459,9 +485,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/data-analytics.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -472,9 +498,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/ecommerce-conversion.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -485,9 +511,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/performance-optimization.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -498,9 +524,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/platform-compliance.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -511,9 +537,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/team-collaboration.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.820Z",
"updatedAt": "2025-06-18T09:27:19.820Z",
"scannedAt": "2025-06-18T09:27:19.820Z"
}
},
{
@ -524,9 +550,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/user-operation.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.821Z",
"updatedAt": "2025-06-18T09:27:19.821Z",
"scannedAt": "2025-06-18T09:27:19.821Z"
}
},
{
@ -537,9 +563,22 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/xiaohongshu-marketer.execution.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.821Z",
"updatedAt": "2025-06-18T09:27:19.821Z",
"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的思考方式",
"reference": "@package://prompt/core/recall.thought.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.737Z",
"updatedAt": "2025-06-17T07:57:37.737Z",
"scannedAt": "2025-06-17T07:57:37.737Z"
"createdAt": "2025-06-18T09:27:19.821Z",
"updatedAt": "2025-06-18T09:27:19.821Z",
"scannedAt": "2025-06-18T09:27:19.821Z"
}
},
{
@ -563,21 +602,21 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://prompt/core/remember.thought.md",
"metadata": {
"createdAt": "2025-06-17T07:57:37.738Z",
"updatedAt": "2025-06-17T07:57:37.738Z",
"scannedAt": "2025-06-17T07:57:37.738Z"
"createdAt": "2025-06-18T09:27:19.821Z",
"updatedAt": "2025-06-18T09:27:19.821Z",
"scannedAt": "2025-06-18T09:27:19.821Z"
}
}
],
"stats": {
"totalResources": 43,
"totalResources": 46,
"byProtocol": {
"role": 7,
"thought": 7,
"execution": 29
"thought": 9,
"execution": 30
},
"bySource": {
"package": 43
"package": 46
}
}
}