From 6dff30da3c7f16c523b106e4faf76e275a051510 Mon Sep 17 00:00:00 2001 From: yi-ge Date: Sun, 22 Feb 2026 23:04:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20agent.json=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20+=20create-agent=20=E6=8A=80=E8=83=BD?= =?UTF-8?q?=E9=80=82=E9=85=8D=E5=8F=8C=E6=A0=87=E8=AF=86=E7=AC=A6=E4=BD=93?= =?UTF-8?q?=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - agent.json: runtime.engine 改为 desirecore-engine,移除废弃的 privacy 和 heartbeat.config_ref 字段 - create-agent SKILL.md: 适配 UUID + slug 双标识符策略,API 响应和回执改用 slug 格式 Co-Authored-By: Claude Opus 4.6 --- agent.json | 9 ++------- skills/create-agent/SKILL.md | 14 ++++++-------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/agent.json b/agent.json index 9f7574d..433c81a 100644 --- a/agent.json +++ b/agent.json @@ -6,15 +6,10 @@ "description": "系统中枢调度器,负责任务分发、Agent 编排与全局状态监控", "author": "DesireCore Team", "runtime": { - "engine": "pi-agent-core" - }, - "privacy": { - "default_scope": "core", - "sharing_requires_explicit_consent": true + "engine": "desirecore-engine" }, "heartbeat": { - "enabled": true, - "config_ref": "heartbeat/HEARTBEAT.md" + "enabled": true }, "default_enabled": { "skills": [ diff --git a/skills/create-agent/SKILL.md b/skills/create-agent/SKILL.md index 915eb19..04fe61b 100644 --- a/skills/create-agent/SKILL.md +++ b/skills/create-agent/SKILL.md @@ -177,19 +177,17 @@ create-agent 是一个**元技能(Meta-Skill)**,赋予 DesireCore 创建 } ``` -**可选**:如需指定 ID,先调用 `GenerateUUID` 工具生成 UUID,再在请求体中附带 `"id": ""`。 +**可选**:如需指定 slug ID,可根据 name 生成合理的 kebab-case slug(如 "法律顾问" → "legal-advisor"),在请求体中附带 `"id": ""`。不指定时系统会自动从 name 生成。 **成功响应** (`201 Created`): ```json { - "id": "a1b2c3d4-...", - "name": "法律顾问小助手", - "created": true + "agentId": "fa-lv-gu-wen-xiao-zhu-shou" } ``` -**验证创建结果**:创建成功后可调用 `GET /api/agents/{id}` 确认。 +**验证创建结果**:创建成功后可调用 `GET /api/agents/{agentId}` 确认(agentId 为 slug)。 ### 阶段 6:回执生成 @@ -199,8 +197,8 @@ create-agent 是一个**元技能(Meta-Skill)**,赋予 DesireCore 创建 ✅ 智能体 "法律顾问小助手" 创建成功 详情: -- Agent ID: a1b2c3d4-... -- 仓库路径: ~/.desirecore/agents/a1b2c3d4-... +- Agent Slug: fa-lv-gu-wen-xiao-zhu-shou +- 仓库路径: ~/.desirecore/agents/fa-lv-gu-wen-xiao-zhu-shou - 已生成文件: agent.json, persona.md, principles.md - AgentFS 规范: v2(扁平结构) @@ -244,7 +242,7 @@ DesireCore 应理解创建后的 Agent 仓库遵循 AgentFS v2 扁平结构: | 错误码 | 场景 | 处理方式 | |--------|------|---------| | 400 | 缺少 name 或 ID 格式无效 | 提示用户检查输入 | -| 409 | Agent ID 已存在 | 建议使用其他名称或重新生成 UUID | +| 409 | Agent ID 已存在 | 建议使用其他名称 | | 500 | 服务器内部错误 | 提示用户稍后再试 | ### 权限要求