From 22b128f1858ef98d062c1d41d76d7000492e52b2 Mon Sep 17 00:00:00 2001 From: Yige Date: Tue, 25 Aug 2026 16:13:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(skills):=20=E7=8B=AC=E7=AB=8B=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E6=99=BA=E8=83=BD=E4=BD=93=E7=94=9F=E5=91=BD=E5=91=A8?= =?UTF-8?q?=E6=9C=9F=E6=93=8D=E4=BD=9C=E8=AF=B4=E6=98=8E=20(#90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 中文 ### 变更 - 新增 `clone-agent` 内置 Skill,覆盖私有数据复制和团队分发边界 - 将 Smart routing、reasoning、头像和确认流程迁入 action-specific Skills - 修正 `update-agent` 与当前 ManageAgent 白名单的漂移 - 保持所有市场 Skill 按需加载,并加入 builtin 清单 ### 验证 - `uv run --quiet scripts/i18n/test_validate_i18n.py` - `uv run --quiet scripts/i18n/validate-i18n.py` - `uv run --quiet scripts/i18n/translate.py --check` - 公共信息边界检查通过 ## English ### Changes - Add the built-in `clone-agent` Skill for private-data copy and team-distribution boundaries - Move Smart routing, reasoning, avatar, and confirmation workflows into action-specific Skills - Align `update-agent` with the current ManageAgent configuration whitelist - Keep every marketplace Skill on-demand and add the new Skill to the built-in manifest ### Verification - `uv run --quiet scripts/i18n/test_validate_i18n.py` - `uv run --quiet scripts/i18n/validate-i18n.py` - `uv run --quiet scripts/i18n/translate.py --check` - Public information boundary review passed --- builtin-skills.json | 1 + manifest.json | 4 +- skills/clone-agent/SKILL.md | 128 +++++++++++++++++++++++++++ skills/clone-agent/SKILL.zh-CN.md | 80 +++++++++++++++++ skills/create-agent/SKILL.md | 55 ++++++++++-- skills/create-agent/SKILL.zh-CN.md | 44 ++++++++- skills/delete-agent/SKILL.md | 15 ++-- skills/delete-agent/SKILL.zh-CN.md | 4 +- skills/discover-agent/SKILL.md | 13 ++- skills/discover-agent/SKILL.zh-CN.md | 2 +- skills/update-agent/SKILL.md | 24 +++-- skills/update-agent/SKILL.zh-CN.md | 13 ++- 12 files changed, 343 insertions(+), 40 deletions(-) create mode 100644 skills/clone-agent/SKILL.md create mode 100644 skills/clone-agent/SKILL.zh-CN.md diff --git a/builtin-skills.json b/builtin-skills.json index 9ca2170..8c89341 100644 --- a/builtin-skills.json +++ b/builtin-skills.json @@ -1,5 +1,6 @@ { "skills": [ + "clone-agent", "code-intelligence", "configuring-compute", "create-agent", diff --git a/manifest.json b/manifest.json index b2ca9e9..5296f52 100644 --- a/manifest.json +++ b/manifest.json @@ -27,8 +27,8 @@ }, "stats": { "totalAgents": 1, - "totalSkills": 61, - "lastUpdated": "2026-08-23" + "totalSkills": 62, + "lastUpdated": "2026-08-25" }, "features": [ "curated-index", diff --git a/skills/clone-agent/SKILL.md b/skills/clone-agent/SKILL.md new file mode 100644 index 0000000..ba22c19 --- /dev/null +++ b/skills/clone-agent/SKILL.md @@ -0,0 +1,128 @@ +--- +name: clone-agent +description: >- + 完整克隆现有智能体为独立本地副本,并安全处理私有记忆、偏好、关系与团队分发影响。Use when 用户要求复制、克隆或基于现有 Agent 创建独立变体。 +version: 1.0.0 +type: meta +risk_level: medium +status: enabled +disable-model-invocation: true +tags: + - agent + - clone + - meta +metadata: + author: desirecore + updated_at: '2026-08-25' + i18n: + default_locale: en-US + source_locale: zh-CN + locales: + - zh-CN + - en-US + zh-CN: + name: 克隆智能体 + short_desc: 完整复制现有智能体为独立本地副本,可选继承用户私有数据 + description: >- + 完整克隆现有智能体为独立本地副本,并安全处理私有记忆、偏好、关系与团队分发影响。Use when 用户要求复制、克隆或基于现有 Agent 创建独立变体。 + body: ./SKILL.zh-CN.md + source_hash: sha256:d97c5736c37e1bcf + translated_by: human + en-US: + name: Clone Agent + short_desc: Clone an existing Agent into an independent local copy with optional private user data + description: >- + Clone an existing Agent into an independent local copy while safely handling private memory, preferences, relationships, and team distribution impact. Use when the user asks to copy, clone, or create an independent variant from an existing Agent. + body: ./SKILL.md + source_hash: sha256:d97c5736c37e1bcf + translated_by: human +market: + icon: >- + + category: productivity + maintainer: + name: DesireCore Official + verified: true + compatible_agents: [] + channel: latest + required_client_version: 10.0.96 +--- + +# clone-agent Skill + +## L0: One-Sentence Summary + +Clone an existing Agent into an independent local copy while explicitly handling private user data and team distribution impact. + +## L1: Overview + +Use this skill when the user wants to copy an Agent or create an independent variant that keeps the source Agent's persona, principles, skills, and configuration. The clone receives a new ID and UUID. It is not an empty-template create operation and never creates a fork in GitHub, Gitee, or another code hosting account. + +## L2: Detailed Specification + +Flow: decide whether cloning is appropriate → inspect the source Agent → confirm the clone name and private-data choices → call ManageAgent → report the clone's local and distribution properties. + +### 1. Choose Clone or Create + +- Use `clone` when the user wants to retain an existing Agent's persona, rules, skills, and configuration in an independent copy or variant. +- Use `create-agent` when the user wants a new Agent in a similar domain but with independently designed behavior. +- Do not recreate an Agent merely to make it “similar”; `create` produces a fresh template and does not inherit the source capability package. + +### 2. Confirm the Source + +If the user did not provide an exact ID, call `ManageAgent(action='list')`; use `ManageAgent(action='get', id)` when name, status, or description needs verification. + +The tool rejects these cases and they must not be bypassed: + +- The core `desirecore` Agent cannot be cloned. +- An Agent whose routing was fixed by the human model selector cannot be cloned autonomously; ask the user to use the UI. +- The source Agent does not exist. + +### 3. Name and Private User Data + +- `name` is optional; the default is “Source Name (Copy)”. +- Private user data is not copied by default. Pass `copyUserData` only when the user explicitly asks the clone to inherit memory, preferences, or relationship state. +- `copyUserData.memory` copies private memory between the user and the source Agent. +- `copyUserData.preferences` copies user preferences for the source Agent. +- `copyUserData.relationship` copies the user-Agent relationship profile. + +Before enabling any of these fields, explain the exact scope and obtain confirmation. Do not interpret “full clone” as consent to copy private user data. + +### 4. Execute + +Basic call: + +```json +{ + "action": "clone", + "id": "source-agent-id", + "name": "New Copy Name" +} +``` + +When private-data copying was explicitly confirmed: + +```json +{ + "action": "clone", + "id": "source-agent-id", + "name": "New Copy Name", + "copyUserData": { + "memory": true, + "preferences": false, + "relationship": false + } +} +``` + +ManageAgent performs a local-only copy, applies both caller and source Provider ceilings, registers the new Agent, and compensates by removing an incomplete clone if registration fails. Never use a git hosting fork, local HTTP API, or direct AgentFS directory copy instead. + +### 5. Receipt and Team Impact + +After success, report: + +- The new Agent ID and that it is ready for Delegate / ManageTeam. +- Which private-data categories were actually copied; missing source categories are skipped, so trust the tool receipt rather than the request. +- The clone has `local` origin. Adding it to a team makes that team `distributable=false`. If the team must later be published or forked by others, use an Agent published to a remote repository instead. + +On failure, follow the tool's exact result. If compensation cleanup also failed, preserve the evidence and clearly request human governance rather than retrying blindly. diff --git a/skills/clone-agent/SKILL.zh-CN.md b/skills/clone-agent/SKILL.zh-CN.md new file mode 100644 index 0000000..dff85a6 --- /dev/null +++ b/skills/clone-agent/SKILL.zh-CN.md @@ -0,0 +1,80 @@ + + +# clone-agent 技能 + +## L0:一句话摘要 + +把一个现有智能体完整克隆为独立的本地副本,并明确处理私有数据与团队分发影响。 + +## L1:概述 + +当用户需要“复制一个相同能力的 Agent”“基于现有 Agent 做独立变体”时使用本技能。克隆会保留源 Agent 的 persona、principles、技能与配置,但生成新的 ID 和 UUID;它不是重新创建空模板,也不会在 GitHub、Gitee 等代码托管平台创建 fork。 + +## L2:详细规范 + +流程:确认 clone 是否合适 → 检查源 Agent → 确认副本名称与私有数据选项 → 调用 ManageAgent → 报告副本性质与后续影响。 + +### 1. 判断 clone 还是 create + +- 用户要保留现有 Agent 的人格、规则、技能和配置,只做独立副本或后续变体:用 `clone`。 +- 用户只想创建同领域但设定不同的新 Agent:加载 `create-agent`,用 `create`。 +- 不要为了“像某个 Agent”而重新 create;create 只生成新模板,不会继承源 Agent 的能力包。 + +### 2. 确认源 Agent + +用户未给准确 ID 时先调用 `ManageAgent(action='list')`;必要时用 `ManageAgent(action='get', id)` 核对名称、状态和描述。 + +以下情况工具会拒绝,直接解释原因,不要绕过: + +- 核心智能体 `desirecore` 不可克隆。 +- 由人类固定为 fixed 模型路由的 Agent 不允许模型自主克隆,应请用户使用界面完成。 +- 源 Agent 不存在。 + +### 3. 副本名称与私有数据 + +- `name` 可选;不传时默认为“源名称 (副本)”。 +- 默认不复制用户私有数据。只有用户明确要求副本继承记忆、偏好或关系时才传 `copyUserData`。 +- `copyUserData.memory`:复制用户与源 Agent 的私有记忆。 +- `copyUserData.preferences`:复制用户对源 Agent 的偏好配置。 +- `copyUserData.relationship`:复制用户与源 Agent 的关系档案。 + +启用任一私有数据复制前,向用户说明复制范围并确认;不要根据“完整克隆”自行推断用户同意复制私有数据。 + +### 4. 执行克隆 + +基础调用: + +```json +{ + "action": "clone", + "id": "source-agent-id", + "name": "新副本名称" +} +``` + +明确复制私有数据时: + +```json +{ + "action": "clone", + "id": "source-agent-id", + "name": "新副本名称", + "copyUserData": { + "memory": true, + "preferences": false, + "relationship": false + } +} +``` + +ManageAgent 会执行纯本地复制、应用调用方与源 Agent 的 Provider ceiling、注册新 Agent,并在注册失败时清理不完整副本。不要自行调用 git fork、HTTP API 或直接复制 AgentFS 目录。 + +### 5. 回执与团队影响 + +成功后向用户说明: + +- 新 Agent 的 ID,以及它已经可以用于 Delegate / ManageTeam。 +- 实际复制了哪些私有数据;源没有的数据会被跳过,以工具回执为准。 +- 副本属于 `local` 来源。把它加入团队会使团队 `distributable=false`;如果团队未来需要发布或供他人 fork,应改用已发布到远程仓库的 Agent。 + +克隆失败时只按工具返回的原因处理。若工具报告补偿清理失败,保留现场并明确提示需要人工治理,不要再次盲目克隆。 diff --git a/skills/create-agent/SKILL.md b/skills/create-agent/SKILL.md index 72f639f..498c61e 100644 --- a/skills/create-agent/SKILL.md +++ b/skills/create-agent/SKILL.md @@ -2,7 +2,7 @@ name: create-agent description: >- 通过多轮对话收集需求,调用 ManageAgent 内置工具创建新的 AgentFS v2 智能体,支持自定义 persona 和 principles。Use when 用户要求创建新智能体、培养某领域助手、或快速基于模板生成可治理 Agent。 -version: 2.5.4 +version: 2.6.0 type: meta risk_level: low status: enabled @@ -13,7 +13,7 @@ tags: - meta metadata: author: desirecore - updated_at: '2026-07-19' + updated_at: '2026-08-25' i18n: default_locale: en-US source_locale: zh-CN @@ -26,7 +26,7 @@ metadata: description: >- 通过多轮对话收集需求,调用 ManageAgent 内置工具创建新的 AgentFS v2 智能体,支持自定义 persona 和 principles。Use when 用户要求创建新智能体、培养某领域助手、或快速基于模板生成可治理 Agent。 body: ./SKILL.zh-CN.md - source_hash: sha256:52972ee5408bc49f + source_hash: sha256:14e8755703784086 translated_by: human en-US: name: Create Agent @@ -34,9 +34,8 @@ metadata: description: >- Collect requirements through multi-turn conversation and call the ManageAgent builtin tool to create a new AgentFS v2 Agent, with customizable persona and principles. Use when the user asks to create a new Agent, raise a domain assistant, or quickly produce a governable Agent from a template. body: ./SKILL.md - source_hash: sha256:52972ee5408bc49f - translated_by: ai:claude-fable-5 - translated_at: '2026-07-19' + source_hash: sha256:14e8755703784086 + translated_by: human market: icon: >- " } +``` + +`source` may be a media ID from the current turn or a PNG/JPEG/WebP file inside the working directory. URLs and base64 are rejected. The service crops to 512×512 WebP and removes EXIF automatically. Avatar failure does not roll back an otherwise successful Agent creation; retry only the avatar operation according to the receipt. + ### Stage 6: Receipt Present in a user-friendly way (no internal paths / technical details): confirm success and suggest next steps — start chatting, add skills, adjust persona or rules. diff --git a/skills/create-agent/SKILL.zh-CN.md b/skills/create-agent/SKILL.zh-CN.md index fb1912c..ca32251 100644 --- a/skills/create-agent/SKILL.zh-CN.md +++ b/skills/create-agent/SKILL.zh-CN.md @@ -67,9 +67,51 @@ ManageAgent({ - 最简创建只需 `{ "action": "create", "name": "我的助手" }`(其余全自动生成)。 - 基础创建 `{ "action": "create", "name": "法律顾问", "description": "专注合同审查" }`——只给 name + description,description 会自动填充 persona 的 L0。 -- 可选 `id`(kebab-case slug;`core` / `desirecore` 为核心保留标识不可用,含 name 自动生成命中的情况)、`config.llm`(仅 llm 增量;mcp_servers 等敏感字段会被拒,需创建后经界面调整)。 +- 可选 `id`(kebab-case slug;`core` / `desirecore` 为核心保留标识不可用,含 name 自动生成命中的情况)、`config`、`smartRouting` 与 `avatarImage`。详细契约见下方;`mcp_servers`、`tool_permissions` 等敏感字段会被拒,需创建后经界面调整。 - 创建后智能体立即在线可用,返回 ID 可直接用于 ManageTeam / Delegate。若工具报错(已存在 / 命中保留标识 / config 非白名单字段等),向用户说明原因并按提示调整后重试。 +#### 创建参数说明 + +**智能路由**:新建 Agent 默认使用 Smart 旗舰量级。需要按职责控制量级时传 `smartRouting`: + +```json +{ + "tier": "balanced", + "requiredCapabilities": ["vision", "tool_use"], + "reasoning": "high" +} +``` + +- `tier` 可选 `lightweight`、`balanced`、`flagship`;`reasoning` 可选 `auto`、`off`、`minimal`、`low`、`medium`、`high`、`xhigh`、`max`。 +- `tier` 未传时默认 `flagship`;只表达任务量级和能力需求,不绑定具体 Provider 或模型。 +- 固定模型、Provider、Smart/fixed 模式由人类模型选择器管理,不能通过 ManageAgent 修改。 +- 用户说“最深/最高/拉满”通常对应 `xhigh`;只有用户明确点名 `max` 且模型支持时才使用 `max`。 + +**配置增量**:`config` 只支持 `llm` 与声明头像 `avatar`。创建时通常无需传;确需调整默认推理行为时可用: + +```json +{ + "llm": { + "reasoning": "high", + "maxRetryDelayMs": 30000 + }, + "avatar": { + "char": "法", + "color": "purple" + } +} +``` + +`config.llm` 当前只开放 `reasoning`、`thinkingBudgets`、`maxRetryDelayMs`。不要传 `model`、`provider`、`providerId` 或 `routingMode`。 + +**图片头像**:使用独立的 `avatarImage`,不要把图片写进 `config`: + +```json +{ "source": "dc-media://" } +``` + +`source` 可以是本轮媒体 ID 或工作目录内的 PNG/JPEG/WebP 文件;不接受 URL 或 base64。服务端会自动裁成 512×512 WebP 并移除 EXIF。头像失败不会回滚已经成功创建的 Agent,需根据工具回执单独重试头像设置。 + ### 阶段 6:回执 以用户友好方式呈现(不暴露内部路径/技术细节):告知创建成功,并提示下一步——直接对话、添加技能、调整人格或规则。 diff --git a/skills/delete-agent/SKILL.md b/skills/delete-agent/SKILL.md index 4e8bce6..a8eddaf 100644 --- a/skills/delete-agent/SKILL.md +++ b/skills/delete-agent/SKILL.md @@ -1,7 +1,7 @@ --- name: delete-agent description: 安全删除指定的智能体及其关联数据。删除前会验证智能体状态,支持可选地删除所有会话历史。Use when 用户需要删除不再使用的智能体。 -version: 2.5.2 +version: 2.6.0 type: meta risk_level: high status: enabled @@ -12,7 +12,7 @@ tags: - meta metadata: author: desirecore - updated_at: '2026-07-19' + updated_at: '2026-08-25' i18n: default_locale: en-US source_locale: zh-CN @@ -24,16 +24,15 @@ metadata: short_desc: 安全删除智能体及其关联数据,支持多重确认与可选历史清理 description: 安全删除指定的智能体及其关联数据。删除前会验证智能体状态,支持可选地删除所有会话历史。Use when 用户需要删除不再使用的智能体。 body: ./SKILL.zh-CN.md - source_hash: sha256:d5eb268aa5209e88 + source_hash: sha256:b401869e91222236 translated_by: human en-US: name: Delete Agent short_desc: Safely delete an Agent and its associated data, with multi-step confirmation and optional history cleanup description: Safely delete a specified Agent and its associated data. Verifies the Agent's state before deletion and optionally removes all session history. Use when the user needs to delete an Agent that is no longer in use. body: ./SKILL.md - source_hash: sha256:d5eb268aa5209e88 - translated_by: ai:claude-fable-5 - translated_at: '2026-07-19' + source_hash: sha256:b401869e91222236 + translated_by: human market: icon: >- - Recommend the best-matching Agent based on the user’s needs, show a candidate list, and guide selection. Use when the user describes a need but is unsure which Agent to ask for help, or wants to browse available Agents. body: ./SKILL.md - source_hash: sha256:bf81bef8caa89cc5 - translated_by: ai:claude-fable-5 - translated_at: '2026-07-19' + source_hash: sha256:302e6a516b1415e0 + translated_by: human market: icon: >- - 安全更新现有智能体的配置、人格、原则、技能与记忆,输出可审阅 diff 并在确认后应用与提交。Use when 用户要求修改 Agent 行为、安装/卸载技能、调整配置、回滚变更或修订规则。 -version: 3.1.3 +version: 3.2.0 type: meta risk_level: low status: enabled @@ -14,7 +14,7 @@ tags: - meta metadata: author: desirecore - updated_at: '2026-07-19' + updated_at: '2026-08-25' i18n: default_locale: en-US source_locale: zh-CN @@ -27,7 +27,7 @@ metadata: description: >- 安全更新现有智能体的配置、人格、原则、技能与记忆,输出可审阅 diff 并在确认后应用与提交。Use when 用户要求修改 Agent 行为、安装/卸载技能、调整配置、回滚变更或修订规则。 body: ./SKILL.zh-CN.md - source_hash: sha256:d33f63306685168e + source_hash: sha256:6ba1c3ba7a6dd36e translated_by: human en-US: name: Update Agent @@ -35,9 +35,8 @@ metadata: description: >- Safely update an existing Agent's config, persona, principles, skills, and memory, producing reviewable diffs that are applied and committed only after confirmation. Use when the user asks to modify Agent behavior, install/uninstall skills, adjust config, roll back changes, or revise rules. body: ./SKILL.md - source_hash: sha256:d33f63306685168e - translated_by: ai:claude-fable-5 - translated_at: '2026-07-19' + source_hash: sha256:6ba1c3ba7a6dd36e + translated_by: human market: icon: >- " }) ``` **Merge semantics**: structured persona/principles are **field-level merges** (omitted fields keep their original values — passing only `L1.personality` won't clear L0/role); a markdown string is a **full replacement** (whole-file rewrite); `config.llm` is a **shallow-merge delta**. The merged result is validated against the whole schema; invalid config never lands. @@ -137,7 +140,10 @@ Key points: - **Read before write**: first `ManageAgent(action='get', id)` to fetch current values, for diff generation and field-name checking. Structured field names are fixed: persona's `L1.role` / `personality` (string array) / `communication_style`; principles' `L1.must_do` / `must_not` (string arrays) / `priority`; plus top-level `L0` / `L2`. - **Confirmation and boundaries**: updating self skips the extra confirmation; updating another agent triggers user confirmation (on top of this skill's diff confirmation); the core agent (`desirecore` / `core`) is refused. -- **config whitelist**: `config` accepts only `llm`; `mcp_servers` / `tool_permissions` / `version` / `id` etc. are rejected with the field named — such runtime config does not go through ManageAgent; tell the user it currently needs the corresponding mechanism. +- **config whitelist**: `config` accepts only `llm` and `avatar`. `config.llm` currently exposes `reasoning`, `thinkingBudgets`, and `maxRetryDelayMs`; `config.avatar` exposes only `char` and `color`. `mcp_servers`, `tool_permissions`, `version`, `id`, and other fields are rejected with the field named. +- **model governance**: concrete `model`, `provider`, `providerId`, and Smart/fixed selection are governed only by the human model selector and cannot be changed through ManageAgent. Adjust Smart workload, required capabilities, and reasoning intent through `smartRouting`. +- **reasoning levels**: natural-language requests such as “deepest/highest/max it out” normally map to `xhigh`; use `max` only when explicitly requested and supported. `auto` is an explicit value; use `config.llm.reasoning=null` when the user wants to restore the global default. +- **avatars**: character/color settings use `config.avatar`; image avatars use `avatarImage.source`, accepting a current-turn media ID or a PNG/JPEG/WebP file inside the working directory. URLs and base64 are rejected. `avatarImage.remove=true` removes the image and falls back to the declarative avatar. - **Partial write failure**: the tool reports exactly which fields landed / which failed; retry only the failed fields, don't resend everything. - **Rename in one call**: to change the display name, call `ManageAgent(action='update', id, name='Y')` directly (writes agent.json and refreshes the list); if the persona doc title should match, append a persona update in the same turn. **Never claim a rename happened without actually calling ManageAgent.** diff --git a/skills/update-agent/SKILL.zh-CN.md b/skills/update-agent/SKILL.zh-CN.md index 6d75959..b6445e7 100644 --- a/skills/update-agent/SKILL.zh-CN.md +++ b/skills/update-agent/SKILL.zh-CN.md @@ -20,7 +20,9 @@ | --- | --- | --- | | 改名(显示名称) | `ManageAgent(update, name=...)` | agent.json(中) | | 改简介 | `ManageAgent(update, description=...)` | agent.json(低) | -| LLM 配置(模型/温度) | `ManageAgent(update, config={llm:{...}})` | agent.json(中) | +| 默认推理与重试配置 | `ManageAgent(update, config={llm:{...}})` | agent.json(中) | +| 声明头像 | `ManageAgent(update, config={avatar:{...}})` | agent.json(低) | +| 图片头像 | `ManageAgent(update, avatarImage={...})` | avatar(中) | | 性格/风格 | `ManageAgent(update, persona=... 或 markdown)` | persona.md(中) | | 行为规则 | `ManageAgent(update, principles=... 或 markdown)` | principles.md(高) | | 安装/卸载技能 | Read/Write | `skills/`(低/中) | @@ -62,12 +64,14 @@ **路径 A · 结构化字段 → ManageAgent(强制;禁止直接 Write `agent.json` / `persona.md` / `principles.md`)** -字段与约束:`name`(1–50 字符)、`description`(≤200)、`config.llm`(增量浅合并,**config 仅允许 llm**)、`persona` / `principles`(结构化对象 `{L0, L1:{...}, L2}` 或 markdown 字符串)。调用: +字段与约束:`name`(1–50 字符)、`description`(≤200)、`config.llm` / `config.avatar`(增量浅合并)、`avatarImage`、`smartRouting`、`persona` / `principles`(结构化对象 `{L0, L1:{...}, L2}` 或 markdown 字符串)。调用: ``` ManageAgent(action='update', id='', name='新名称') ManageAgent(action='update', id='', persona={ L1: { personality: ["专业","严谨"] } }) ManageAgent(action='update', id='', principles='…完整 markdown…') +ManageAgent(action='update', id='', config={ llm: { reasoning: "high" } }) +ManageAgent(action='update', id='', avatarImage={ source: "dc-media://" }) ``` **合并语义**:结构化 persona/principles 为**字段级合并**(省略字段保留原值,如只传 `L1.personality` 不会清掉 L0/role);markdown 字符串为**整体替换**(整篇重写);`config.llm` 为**增量浅合并**。合并结果整体过 schema 校验,非法配置不落盘。 @@ -76,7 +80,10 @@ ManageAgent(action='update', id='', principles='…完整 markdown…' - **改前先读**:先 `ManageAgent(action='get', id)` 取现值,用于生成 diff、校对字段名。结构化字段名固定:persona 的 `L1.role` / `personality`(字符串数组)/ `communication_style`,principles 的 `L1.must_do` / `must_not`(字符串数组)/ `priority`,加顶层 `L0` / `L2`。 - **确认与边界**:更新自身免二次确认;更新其他智能体触发用户确认(与本技能 diff 确认叠加);核心智能体(`desirecore` / `core`)拒绝更新。 -- **config 白名单**:`config` 仅接受 `llm`;`mcp_servers` / `tool_permissions` / `version` / `id` 等会被拒并指明字段名——这类运行时配置不走 ManageAgent,向用户说明暂需经对应机制处理。 +- **config 白名单**:`config` 只接受 `llm` 与 `avatar`。`config.llm` 当前开放 `reasoning`、`thinkingBudgets`、`maxRetryDelayMs`;`config.avatar` 只开放 `char` 与 `color`。`mcp_servers` / `tool_permissions` / `version` / `id` 等会被拒并指明字段名。 +- **模型治理**:具体 `model`、`provider`、`providerId` 与 Smart/fixed 模式只由人类模型选择器管理,不能通过 ManageAgent 修改。Smart Agent 的量级、能力与推理意图用 `smartRouting` 更新。 +- **推理档位**:用户说“最深/最高/拉满”通常对应 `xhigh`;只有明确点名 `max` 且模型支持时才用 `max`。`auto` 是显式值;用户要求恢复全局默认时传 `config.llm.reasoning=null` 清除字段。 +- **头像**:字符与色系走 `config.avatar`;图片走 `avatarImage.source`,接受本轮媒体 ID 或工作目录内 PNG/JPEG/WebP,不接受 URL/base64。`avatarImage.remove=true` 删除图片头像并回落到字符头像。 - **部分写入失败**:工具精确报告已生效/失败字段,仅重试失败字段,不整体重发。 - **改名一次调用完成**:用户要改显示名称时直接 `ManageAgent(action='update', id, name='Y')`(写 agent.json 并刷新列表),如需人格文档标题同步可同轮追加 persona 更新。**绝不在未实际调用 ManageAgent 时声称已改名。**