feat: 添加DACP邮件发送功能,支持真实发送与Demo模式,增强邮件发送的配置管理和错误提示,优化用户体验。
This commit is contained in:
@ -1,8 +1,11 @@
|
||||
/**
|
||||
* Email Action Module for DACP PromptX Service
|
||||
* 提供邮件发送功能
|
||||
* 提供邮件发送功能 - 支持Demo模式和真实发送
|
||||
*/
|
||||
|
||||
const nodemailer = require('nodemailer')
|
||||
const DACPConfigManager = require('../../../lib/utils/DACPConfigManager')
|
||||
|
||||
// Email action handler
|
||||
async function send_email(parameters) {
|
||||
const { user_request, context = {} } = parameters;
|
||||
@ -124,7 +127,39 @@ function validateEmailData(emailData) {
|
||||
|
||||
// 执行邮件发送
|
||||
async function executeSendEmail(emailData, context) {
|
||||
// Demo模式:模拟发送
|
||||
const configManager = new DACPConfigManager()
|
||||
|
||||
// 检查是否有用户配置
|
||||
const hasConfig = await configManager.hasActionConfig('send_email')
|
||||
|
||||
if (!hasConfig) {
|
||||
// 无配置,回退到Demo模式
|
||||
return await executeDemoSendEmail(emailData, context)
|
||||
}
|
||||
|
||||
// 读取配置
|
||||
const config = await configManager.readActionConfig('send_email')
|
||||
|
||||
// 验证配置
|
||||
const validation = configManager.validateEmailConfig(config)
|
||||
if (!validation.valid) {
|
||||
// 配置无效,抛出友好错误
|
||||
const errorMessage = configManager.generateConfigErrorMessage('send_email', validation)
|
||||
throw new Error(errorMessage)
|
||||
}
|
||||
|
||||
try {
|
||||
// 真实邮件发送
|
||||
return await executeRealSendEmail(emailData, config, context)
|
||||
} catch (error) {
|
||||
// 发送失败,提供友好提示
|
||||
console.error('邮件发送失败:', error.message)
|
||||
throw new Error(`\n📧 邮件发送失败\n\n❌ 错误信息: ${error.message}\n\n💡 可能的解决方案:\n • 检查邮箱密码是否正确\n • 确认已启用SMTP服务\n • 验证网络连接状态\n • Gmail用户确保使用应用专用密码\n`)
|
||||
}
|
||||
}
|
||||
|
||||
// Demo模式发送
|
||||
async function executeDemoSendEmail(emailData, context) {
|
||||
console.log('📧 [DACP Demo] Simulating email send:');
|
||||
console.log(` To: ${emailData.to}`);
|
||||
console.log(` Subject: ${emailData.subject}`);
|
||||
@ -133,15 +168,19 @@ async function executeSendEmail(emailData, context) {
|
||||
// 模拟网络延迟
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
|
||||
const configManager = new DACPConfigManager()
|
||||
const configHint = configManager.generateConfigErrorMessage('send_email')
|
||||
|
||||
return {
|
||||
message_id: `msg_${Date.now()}`,
|
||||
status: 'sent',
|
||||
message_id: `demo_msg_${Date.now()}`,
|
||||
status: 'demo_sent',
|
||||
recipient: emailData.to,
|
||||
subject: emailData.subject,
|
||||
body: emailData.body,
|
||||
sent_at: emailData.timestamp,
|
||||
urgency: emailData.urgency,
|
||||
demo_mode: true,
|
||||
config_hint: configHint,
|
||||
execution_metrics: {
|
||||
parsing_time: '10ms',
|
||||
validation_time: '5ms',
|
||||
@ -150,6 +189,61 @@ async function executeSendEmail(emailData, context) {
|
||||
};
|
||||
}
|
||||
|
||||
// 真实邮件发送
|
||||
async function executeRealSendEmail(emailData, config, context) {
|
||||
const startTime = Date.now()
|
||||
|
||||
// 获取提供商配置
|
||||
const configManager = new DACPConfigManager()
|
||||
const providerConfig = configManager.getProviderConfig(config.provider)
|
||||
|
||||
if (!providerConfig) {
|
||||
throw new Error(`不支持的邮件服务提供商: ${config.provider}`)
|
||||
}
|
||||
|
||||
// 创建邮件传输器
|
||||
const transporter = nodemailer.createTransport({
|
||||
host: providerConfig.smtp,
|
||||
port: providerConfig.port,
|
||||
secure: providerConfig.secure,
|
||||
auth: {
|
||||
user: config.smtp.user,
|
||||
pass: config.smtp.password
|
||||
}
|
||||
})
|
||||
|
||||
// 构建邮件选项
|
||||
const mailOptions = {
|
||||
from: `"${config.sender.name}" <${config.sender.email}>`,
|
||||
to: emailData.to,
|
||||
subject: emailData.subject,
|
||||
html: emailData.body.replace(/\n/g, '<br>'),
|
||||
text: emailData.body
|
||||
}
|
||||
|
||||
// 发送邮件
|
||||
const info = await transporter.sendMail(mailOptions)
|
||||
const endTime = Date.now()
|
||||
|
||||
return {
|
||||
message_id: info.messageId,
|
||||
status: 'sent',
|
||||
recipient: emailData.to,
|
||||
subject: emailData.subject,
|
||||
body: emailData.body,
|
||||
sent_at: new Date().toISOString(),
|
||||
urgency: emailData.urgency,
|
||||
demo_mode: false,
|
||||
provider: config.provider,
|
||||
smtp_response: info.response,
|
||||
execution_metrics: {
|
||||
parsing_time: '10ms',
|
||||
validation_time: '5ms',
|
||||
sending_time: `${endTime - startTime}ms`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 导出所有email相关的actions
|
||||
module.exports = {
|
||||
send_email
|
||||
|
||||
@ -9,13 +9,14 @@
|
||||
"test": "jest"
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^4.18.2",
|
||||
"body-parser": "^1.20.2",
|
||||
"cors": "^2.8.5",
|
||||
"joi": "^17.11.0"
|
||||
"express": "^4.18.2",
|
||||
"joi": "^17.11.0",
|
||||
"nodemailer": "^7.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jest": "^29.7.0",
|
||||
"supertest": "^6.3.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
207
src/lib/utils/DACPConfigManager.js
Normal file
207
src/lib/utils/DACPConfigManager.js
Normal file
@ -0,0 +1,207 @@
|
||||
const fs = require('fs-extra')
|
||||
const path = require('path')
|
||||
const os = require('os')
|
||||
|
||||
/**
|
||||
* DACP用户级配置管理器
|
||||
* 管理 ~/.promptx/dacp/ 下的配置文件
|
||||
*/
|
||||
class DACPConfigManager {
|
||||
constructor() {
|
||||
this.userHome = os.homedir()
|
||||
this.dacpConfigDir = path.join(this.userHome, '.promptx', 'dacp')
|
||||
}
|
||||
|
||||
/**
|
||||
* 确保DACP配置目录存在
|
||||
*/
|
||||
async ensureConfigDir() {
|
||||
await fs.ensureDir(this.dacpConfigDir)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定action的配置文件路径
|
||||
* @param {string} action - action名称,如 'send_email'
|
||||
* @returns {string} 配置文件完整路径
|
||||
*/
|
||||
getConfigPath(action) {
|
||||
return path.join(this.dacpConfigDir, `${action}.json`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取action配置
|
||||
* @param {string} action - action名称
|
||||
* @returns {Promise<Object|null>} 配置对象或null
|
||||
*/
|
||||
async readActionConfig(action) {
|
||||
const configPath = this.getConfigPath(action)
|
||||
|
||||
try {
|
||||
if (await fs.pathExists(configPath)) {
|
||||
return await fs.readJson(configPath)
|
||||
}
|
||||
return null
|
||||
} catch (error) {
|
||||
console.warn(`读取DACP配置失败 ${action}:`, error.message)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 写入action配置
|
||||
* @param {string} action - action名称
|
||||
* @param {Object} config - 配置对象
|
||||
*/
|
||||
async writeActionConfig(action, config) {
|
||||
await this.ensureConfigDir()
|
||||
const configPath = this.getConfigPath(action)
|
||||
await fs.writeJson(configPath, config, { spaces: 2 })
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查action配置是否存在
|
||||
* @param {string} action - action名称
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
async hasActionConfig(action) {
|
||||
const configPath = this.getConfigPath(action)
|
||||
return await fs.pathExists(configPath)
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证邮件配置
|
||||
* @param {Object} config - 邮件配置对象
|
||||
* @returns {Object} 验证结果 {valid: boolean, errors: string[]}
|
||||
*/
|
||||
validateEmailConfig(config) {
|
||||
const errors = []
|
||||
|
||||
if (!config) {
|
||||
errors.push('配置对象不能为空')
|
||||
return { valid: false, errors }
|
||||
}
|
||||
|
||||
// 验证provider
|
||||
if (!config.provider) {
|
||||
errors.push('缺少邮件服务提供商(provider)配置')
|
||||
}
|
||||
|
||||
// 验证SMTP配置
|
||||
if (!config.smtp) {
|
||||
errors.push('缺少SMTP配置')
|
||||
} else {
|
||||
if (!config.smtp.user) {
|
||||
errors.push('缺少SMTP用户名(smtp.user)')
|
||||
}
|
||||
if (!config.smtp.password) {
|
||||
errors.push('缺少SMTP密码(smtp.password)')
|
||||
}
|
||||
}
|
||||
|
||||
// 验证发件人配置
|
||||
if (!config.sender) {
|
||||
errors.push('缺少发件人配置(sender)')
|
||||
} else {
|
||||
if (!config.sender.email) {
|
||||
errors.push('缺少发件人邮箱(sender.email)')
|
||||
}
|
||||
if (!config.sender.name) {
|
||||
errors.push('缺少发件人姓名(sender.name)')
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
valid: errors.length === 0,
|
||||
errors
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取邮件服务提供商配置
|
||||
* @param {string} provider - 提供商名称
|
||||
* @returns {Object} 提供商配置
|
||||
*/
|
||||
getProviderConfig(provider) {
|
||||
const providers = {
|
||||
gmail: {
|
||||
smtp: 'smtp.gmail.com',
|
||||
port: 587,
|
||||
secure: false,
|
||||
requireAuth: true
|
||||
},
|
||||
outlook: {
|
||||
smtp: 'smtp-mail.outlook.com',
|
||||
port: 587,
|
||||
secure: false,
|
||||
requireAuth: true
|
||||
},
|
||||
qq: {
|
||||
smtp: 'smtp.qq.com',
|
||||
port: 465,
|
||||
secure: true,
|
||||
requireAuth: true
|
||||
},
|
||||
'163': {
|
||||
smtp: 'smtp.163.com',
|
||||
port: 465,
|
||||
secure: true,
|
||||
requireAuth: true
|
||||
},
|
||||
'126': {
|
||||
smtp: 'smtp.126.com',
|
||||
port: 465,
|
||||
secure: true,
|
||||
requireAuth: true
|
||||
}
|
||||
}
|
||||
|
||||
return providers[provider] || null
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成配置错误提示信息
|
||||
* @param {string} action - action名称
|
||||
* @param {Object} validation - 验证结果
|
||||
* @returns {string} 错误提示信息
|
||||
*/
|
||||
generateConfigErrorMessage(action, validation = null) {
|
||||
const configPath = this.getConfigPath(action)
|
||||
|
||||
let message = `\n📧 DACP邮件服务配置缺失\n\n`
|
||||
|
||||
if (!validation) {
|
||||
// 配置文件不存在
|
||||
message += `❌ 配置文件不存在: ${configPath}\n\n`
|
||||
message += `📝 请创建配置文件,内容如下:\n\n`
|
||||
message += `{\n`
|
||||
message += ` "provider": "gmail",\n`
|
||||
message += ` "smtp": {\n`
|
||||
message += ` "user": "your-email@gmail.com",\n`
|
||||
message += ` "password": "your-app-password"\n`
|
||||
message += ` },\n`
|
||||
message += ` "sender": {\n`
|
||||
message += ` "name": "Your Name",\n`
|
||||
message += ` "email": "your-email@gmail.com"\n`
|
||||
message += ` }\n`
|
||||
message += `}\n\n`
|
||||
message += `💡 支持的邮件服务商: gmail, outlook, qq, 163, 126\n\n`
|
||||
message += `🔐 Gmail用户需要使用应用专用密码:\n`
|
||||
message += ` 1. 进入 Google 账户设置\n`
|
||||
message += ` 2. 启用两步验证\n`
|
||||
message += ` 3. 生成应用专用密码\n`
|
||||
message += ` 4. 使用生成的密码替换上面的 "your-app-password"\n`
|
||||
} else {
|
||||
// 配置不完整
|
||||
message += `❌ 配置文件存在但不完整: ${configPath}\n\n`
|
||||
message += `缺少以下配置项:\n`
|
||||
validation.errors.forEach(error => {
|
||||
message += ` • ${error}\n`
|
||||
})
|
||||
message += `\n请检查并完善配置文件。\n`
|
||||
}
|
||||
|
||||
return message
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = DACPConfigManager
|
||||
@ -4,9 +4,9 @@
|
||||
"metadata": {
|
||||
"version": "2.0.0",
|
||||
"description": "package 级资源注册表",
|
||||
"createdAt": "2025-06-18T09:27:19.817Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.821Z",
|
||||
"resourceCount": 46
|
||||
"createdAt": "2025-06-18T10:00:59.258Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.263Z",
|
||||
"resourceCount": 47
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
@ -17,9 +17,9 @@
|
||||
"description": "专业角色,提供特定领域的专业能力",
|
||||
"reference": "@package://prompt/domain/assistant/assistant.role.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.818Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.818Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.818Z"
|
||||
"createdAt": "2025-06-18T10:00:59.259Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.259Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.259Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -30,9 +30,9 @@
|
||||
"description": "思维模式,指导AI的思考方式",
|
||||
"reference": "@package://prompt/domain/assistant/thought/assistant.thought.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -43,9 +43,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/assistant/execution/assistant.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -56,9 +56,9 @@
|
||||
"description": "专业角色,提供特定领域的专业能力",
|
||||
"reference": "@package://prompt/domain/frontend-developer/frontend-developer.role.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -69,9 +69,9 @@
|
||||
"description": "思维模式,指导AI的思考方式",
|
||||
"reference": "@package://prompt/domain/frontend-developer/thought/frontend-developer.thought.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -82,9 +82,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/java-backend-developer/execution/code-quality.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -95,9 +95,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/frontend-developer/execution/frontend-developer.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -108,9 +108,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/frontend-developer/execution/technical-architecture.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -121,9 +121,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/frontend-developer/execution/user-experience.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -134,9 +134,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/frontend-developer/execution/wechat-miniprogram-development.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -147,9 +147,9 @@
|
||||
"description": "专业角色,提供特定领域的专业能力",
|
||||
"reference": "@package://prompt/domain/java-backend-developer/java-backend-developer.role.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -160,9 +160,9 @@
|
||||
"description": "思维模式,指导AI的思考方式",
|
||||
"reference": "@package://prompt/domain/java-backend-developer/thought/java-backend-developer.thought.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -173,9 +173,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/java-backend-developer/execution/database-design.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -186,9 +186,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/java-backend-developer/execution/java-backend-developer.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -199,9 +199,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/java-backend-developer/execution/spring-ecosystem.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -212,9 +212,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/java-backend-developer/execution/system-architecture.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.819Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.819Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.819Z"
|
||||
"createdAt": "2025-06-18T10:00:59.260Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.260Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.260Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -225,9 +225,9 @@
|
||||
"description": "专业角色,提供特定领域的专业能力",
|
||||
"reference": "@package://prompt/domain/nuwa/nuwa.role.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.261Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.261Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.261Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -238,9 +238,9 @@
|
||||
"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"
|
||||
"createdAt": "2025-06-18T10:00:59.261Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.261Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.261Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -251,9 +251,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/nuwa/execution/dpml-authoring.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.261Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.261Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.261Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -264,9 +264,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/nuwa/execution/role-design-patterns.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.261Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.261Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.261Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -277,9 +277,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/nuwa/execution/role-generation.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.261Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.261Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.261Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -290,9 +290,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/nuwa/execution/visualization-enhancement.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.261Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.261Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.261Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -303,9 +303,9 @@
|
||||
"description": "专业角色,提供特定领域的专业能力",
|
||||
"reference": "@package://prompt/domain/product-manager/product-manager.role.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.261Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.261Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.261Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -316,9 +316,9 @@
|
||||
"description": "思维模式,指导AI的思考方式",
|
||||
"reference": "@package://prompt/domain/product-manager/thought/product-manager.thought.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -329,9 +329,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/product-manager/execution/market-analysis.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -342,9 +342,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/product-manager/execution/product-manager.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -355,9 +355,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/product-manager/execution/user-research.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -368,9 +368,9 @@
|
||||
"description": "专业角色,提供特定领域的专业能力",
|
||||
"reference": "@package://prompt/domain/sean/sean.role.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -381,9 +381,9 @@
|
||||
"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"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -394,9 +394,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/sean/execution/sean-decision-framework.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -407,9 +407,9 @@
|
||||
"description": "专业角色,提供特定领域的专业能力",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/xiaohongshu-marketer.role.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -420,9 +420,9 @@
|
||||
"description": "思维模式,指导AI的思考方式",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/thought/xiaohongshu-marketer.thought.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -433,9 +433,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/brand-marketing.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -446,9 +446,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/community-building.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -459,9 +459,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/content-creation.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -472,9 +472,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/content-optimization.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -485,9 +485,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/data-analytics.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -498,9 +498,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/ecommerce-conversion.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -511,9 +511,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/performance-optimization.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -524,9 +524,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/platform-compliance.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -537,9 +537,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/team-collaboration.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.820Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.820Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.820Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -550,9 +550,9 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/user-operation.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.821Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.821Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.821Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -563,9 +563,22 @@
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/domain/xiaohongshu-marketer/execution/xiaohongshu-marketer.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.821Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.821Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.821Z"
|
||||
"createdAt": "2025-06-18T10:00:59.262Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.262Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.262Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "dacp-email-sending",
|
||||
"source": "package",
|
||||
"protocol": "execution",
|
||||
"name": "Dacp Email Sending 执行模式",
|
||||
"description": "执行模式,定义具体的行为模式",
|
||||
"reference": "@package://prompt/core/dacp-email-sending.execution.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T10:00:59.263Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.263Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.263Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -576,9 +589,9 @@
|
||||
"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"
|
||||
"createdAt": "2025-06-18T10:00:59.263Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.263Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.263Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -589,9 +602,9 @@
|
||||
"description": "思维模式,指导AI的思考方式",
|
||||
"reference": "@package://prompt/core/recall.thought.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.821Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.821Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.821Z"
|
||||
"createdAt": "2025-06-18T10:00:59.263Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.263Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.263Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -602,21 +615,21 @@
|
||||
"description": "思维模式,指导AI的思考方式",
|
||||
"reference": "@package://prompt/core/remember.thought.md",
|
||||
"metadata": {
|
||||
"createdAt": "2025-06-18T09:27:19.821Z",
|
||||
"updatedAt": "2025-06-18T09:27:19.821Z",
|
||||
"scannedAt": "2025-06-18T09:27:19.821Z"
|
||||
"createdAt": "2025-06-18T10:00:59.263Z",
|
||||
"updatedAt": "2025-06-18T10:00:59.263Z",
|
||||
"scannedAt": "2025-06-18T10:00:59.263Z"
|
||||
}
|
||||
}
|
||||
],
|
||||
"stats": {
|
||||
"totalResources": 46,
|
||||
"totalResources": 47,
|
||||
"byProtocol": {
|
||||
"role": 7,
|
||||
"thought": 9,
|
||||
"execution": 30
|
||||
"execution": 31
|
||||
},
|
||||
"bySource": {
|
||||
"package": 46
|
||||
"package": 47
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user