feat: 更新智能体归档与恢复技能至2.7.0 / Update Agent archive and restore skill (#291)

## 中文

`delete-agent` 2.6.0 仍把删除描述为不可恢复,并要求选择 `deleteRuns`,与当前客户端的归档行为冲突。更新至
2.7.0,说明可恢复归档、`list_archived` / `restore`、ID 冲突与团队/调度回执;永久删除继续由用户在界面完成。

最低客户端版本提高到已正式发布的 10.0.204,同步中英文技能、目录元数据及 CHANGELOG。通过正式 Windows x64 包的真实
ToolExecutor 验证列表与原 ID 恢复,文件及会话历史前后一致;权限与审批模式未更改。该运行只覆盖这次正向场景。

验证:完整目录与 i18n 校验通过(0 错误,104 条现有警告);该技能中英翻译新鲜度通过;公开信息扫描与 diff 检查通过。客户端
seed 将在市场合入后的独立 PR 更新。

## English

`delete-agent` 2.6.0 describes deletion as irreversible and asks for
`deleteRuns`, conflicting with current archive behavior. Version 2.7.0
documents recoverable archiving, `list_archived` / `restore`, ID
conflicts, and team/schedule receipts. Permanent deletion remains a user
action in the interface.

Require released DesireCore 10.0.204 and synchronize both languages,
catalog metadata, and the changelog. The formal Windows x64 package
executed listing and original-ID restoration through its real
ToolExecutor; files and conversation history matched afterward, with
permission and approval settings unchanged. This runtime evidence covers
that positive scenario.

Validation: complete catalog and i18n checks passed (0 errors, 104
existing warnings), as did this skill's translation freshness,
public-information scan, and diff checks. A separate client PR will
update the seed after the marketplace change merges.
This commit is contained in:
yige authored and GitHub committed 2026-11-17 17:08:41 +08:00
1 parent 8c059453e4
commit 7a4c0144d1
4 files changed
+77 -88

No files matched your search

+9
View File
@@ -1,5 +1,14 @@
# Changelog # Changelog
## [2.7.0] - 2026-11-17
- 删除改为可恢复的本机归档;不再询问或传递 deleteRuns:true。
- 增加 list_archived / restore、name 冲突和 restoreLedTeams 用法,按真实回执交接团队、调度与历史归属。
- 最低客户端版本为已正式发布并验证归档工具动作的 DesireCore 10.0.204;技能启用,永久删除仍仅由用户在界面完成。
- Archive deletion locally and retain history; remove the obsolete deleteRuns:true flow.
- Add list_archived / restore, name conflicts, and restoreLedTeams; report actual team, schedule, and history receipts.
- Require released DesireCore 10.0.204 and enable the skill; permanent deletion remains a user-only interface action.
## [2.5.2] - 2026-07-19 ## [2.5.2] - 2026-07-19
- 复盘补回改写压缩时误删的实质信息:create 的 AgentFS v2/git 版本管理定位、基础创建(name+description 自动填充 persona L0)、需求收集引导问题示例;update/delete/discover 的使用场景与版本管理定位。功能对齐原始意图,仍保留结构性压缩。 - 复盘补回改写压缩时误删的实质信息:create 的 AgentFS v2/git 版本管理定位、基础创建(name+description 自动填充 persona L0)、需求收集引导问题示例;update/delete/discover 的使用场景与版本管理定位。功能对齐原始意图,仍保留结构性压缩。
+42 -49
View File
@@ -1,10 +1,12 @@
--- ---
license: "MIT" license: MIT
name: delete-agent name: delete-agent
description: 安全删除指定的智能体及其关联数据。删除前会验证智能体状态,支持可选地删除所有会话历史。Use when 用户需要删除不再使用的智能体。 description: Archive unused Agents, list local archives and restore them through
version: 2.6.0 ManageAgent. Only the user can permanently delete an Agent through the
interface.
version: 2.7.0
type: meta type: meta
risk_level: high risk_level: medium
status: enabled status: enabled
disable-model-invocation: true disable-model-invocation: true
tags: tags:
@@ -13,7 +15,7 @@ tags:
- meta - meta
metadata: metadata:
author: desirecore author: desirecore
updated_at: '2026-08-25' updated_at: '2026-11-17'
i18n: i18n:
default_locale: en-US default_locale: en-US
source_locale: zh-CN source_locale: zh-CN
@@ -21,23 +23,27 @@ metadata:
- zh-CN - zh-CN
- en-US - en-US
zh-CN: zh-CN:
name: 删除智能体 name: 删除与恢复智能体
short_desc: 安全删除智能体及其关联数据,支持多重确认与可选历史清理 short_desc: 归档或恢复智能体,保留历史并报告团队和调度事项
description: 安全删除指定的智能体及其关联数据。删除前会验证智能体状态,支持可选地删除所有会话历史。Use when 用户需要删除不再使用的智能体。 description: 通过 ManageAgent 归档不再使用的智能体、查询本机归档与恢复;永久删除仅由用户在界面完成。
body: ./SKILL.zh-CN.md body: ./SKILL.zh-CN.md
source_hash: sha256:b401869e91222236 source_hash: sha256:4f5aae9c80b22ee9
translated_by: human translated_by: ai:gpt-6
translated_at: '2026-11-16'
en-US: en-US:
name: Delete Agent name: Archive and Restore Agents
short_desc: Safely delete an Agent and its associated data, with multi-step confirmation and optional history cleanup short_desc: Archive or restore Agents, keep history, and report team and
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. schedule follow-up
description: Archive unused Agents, list local archives and restore them through
ManageAgent. Only the user can permanently delete an Agent through the
interface.
body: ./SKILL.md body: ./SKILL.md
source_hash: sha256:b401869e91222236 source_hash: sha256:4f5aae9c80b22ee9
translated_by: human translated_by: ai:gpt-6
translated_at: '2026-11-16'
market: market:
icon: >- icon: <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 0 24 24" fill="none"><defs><linearGradient id="da2-a" x1="2" y1="7" x2="16"
24 24" fill="none"><defs><linearGradient id="da2-a" x1="2" y1="7" x2="16"
y2="21" gradientUnits="userSpaceOnUse"><stop stop-color="#FF9500"/><stop y2="21" gradientUnits="userSpaceOnUse"><stop stop-color="#FF9500"/><stop
offset="1" stop-color="#FF3B30"/></linearGradient></defs><circle cx="9" offset="1" stop-color="#FF3B30"/></linearGradient></defs><circle cx="9"
cy="7" r="4" fill="url(#da2-a)" fill-opacity="0.15" stroke="url(#da2-a)" cy="7" r="4" fill="url(#da2-a)" fill-opacity="0.15" stroke="url(#da2-a)"
@@ -52,56 +58,43 @@ market:
verified: true verified: true
compatible_agents: [] compatible_agents: []
channel: latest channel: latest
required_client_version: 10.0.90 required_client_version: 10.0.204
--- ---
# delete-agent skill # delete-agent Skill
## L0: One-Sentence Summary ## L0: One-Sentence Summary
Safely delete a specified Agent and its associated data (filesystem, in-memory state, optional conversation history). Archive unused Agents or restore them from local archives, preserve conversation history, and report team and schedule follow-up from actual receipts.
## L1: Overview ## L1: Overview
Meta-skill: list candidates → confirm intent (irreversible) → ask whether to delete history → execute via `ManageAgent(action='delete')`. Use it to clean up Agents that are no longer used, test/experimental, or need storage reclaimed. Its value is what the tool can't give: candidate filtering with status guidance, and intent confirmation before deletion. The tool guarantees the multi-way refusals (core agent / self / active state) and team cascading. Use this for deleting an Agent, recovering an accidental deletion, or inspecting local archives. Use `ManageAgent`, without local HTTP calls or manually moving archive directories. Deletion archives the Agent: it can be recovered locally, does not expire automatically, and is excluded from subsequent backups and migration packages. Only the user can permanently delete it through Settings → Data & Privacy → Archive.
## L2: Detailed Spec ## L2: Detailed Specification
Flow: list deletable Agents → confirm intent and target → ask whether to delete history → execute → receipt. ### Archive an Agent
### Stage 1: List Candidates When the target is unspecified, list candidates with `ManageAgent(action='list')`; use `get` for details. Verify the name and ID, explaining that history is retained and teams it leads are archived too. Do not reconfirm a clearly authorized target; clarify ambiguous targets first. The tool protects built-in Agents, the caller itself, and active Agents. Stop an active target through the interface or wait until it is idle.
When the user hasn't named a specific Agent, fetch the list with `ManageAgent(action='list')` and group by status: `offline` / `error` are safe to delete; `online` / `busy` / `recovery` are marked "stop first" (the tool will refuse them) and excluded from the rest of the flow. For details, use `ManageAgent(action='get', id)`. E.g.: Call `ManageAgent(action='delete', id='example-agent')`. Do not ask whether to delete history or pass `deleteRuns=true`: the new tool rejects it. Approval follows the caller's approval mode; do not promise a dialog. Report the actual archive identifier, team and worktree dispositions, and warnings. Unbinding preserves worktrees and branches. Retain `archiveId` for recovery when needed; do not claim archiving reclaims all disk space.
``` ### List Archives and Restore
Deletable: Legal Advisor (legal-assistant, offline), Test Bot (test-bot, offline)
Stop first: Data Analyst (data-analyst, online)
```
### Stage 2: Confirm Intent Use `ManageAgent(action='list_archived')` to inspect local archives. This is read-only and does not roll forward or repair incomplete transactions. Explain the actual `phase`, `restorable`, and `originalIdOccupied` values. Query again when an identifier is missing or an archive has disappeared; never invent an `archiveId`.
Confirm the target Agent (name/ID) with the user, **explicitly state it is irreversible** (config, skills, tools will be permanently deleted), show basic info, and wait for confirmation. For a restorable entry, call `ManageAgent(action='restore', archiveId='identifier from the list')`. If the original ID is occupied, obtain the user's choice of a new name and pass `name`; never overwrite an existing Agent. When the original ID is free, providing `name` renames without forcing an ID change. `restoreLedTeams` defaults to `true`; pass `false` if the user wants its led teams to remain archived.
### Stage 3: Ask About Deletion Options An occupied original ID means restoration under a new ID: conversation history remains under the original ID, schedules are not restored, and absolute-path environments in private skills may need preparation again. Explain these consequences before execution. Restoration has the same approval tier as creation, with no additional confirmation. The owner still validates identity and permissions; do not supply a fabricated `userId` or impersonate the official Renderer.
Ask whether to also delete all of the Agent's conversation history: yes → `deleteRuns=true`; no → `deleteRuns=false` (default, omittable, keeps history). ### Complete the Handoff from the Receipt
### Stage 4: Execute Deletion `agentId` identifies the actual restored Agent. `idChanged` and `runsAttached` describe identity and history attachment. Report `teams.restored`, `teams.pending`, `teams.memberOf`, and `warnings`. Led teams not restored together need handling in the archive page's Teams segment; former memberships are not reinstated.
Before the call, reconfirm the target and the `deleteRuns` choice. The tool submits deletion to the current approval chain; whether an additional dialog appears depends on the caller's approval mode. Do not promise that a dialog will appear unless an approval event is actually shown. Execute: Schedules do not enable automatically. `schedules.reenablable` can be enabled through the existing update entry; `recreateRequired` must be recreated, with scripts uploaded again; `dropped` lists definitions not restored under a new ID. Old instance authorization does not revive. MCP OAuth, App links, and worktree bindings are not reinstated. Agent restoration does not establish that all teams, schedules, or authorizations have been restored.
``` ### Failures and Permanent Deletion
ManageAgent(action='delete', id='legal-assistant', deleteRuns=true)
```
After confirmation the deletion completes, including team cascading: a team whose supervisor is the target is disbanded; membership is removed where the target is a member. Preserve returned error codes, states, and warnings. `AGENT_RESTORE_ID_OCCUPIED` requires `name` or another query to inspect concurrent occupation. Do not bypass `AGENT_RESTORE_USER_MISMATCH` by claiming another identity. Follow the actual failure for incomplete, corrupt, or cleanup-pending archives; do not remove containers yourself. Verify unknown results through the list before retrying a restore or creating another Agent.
### Stage 5: Receipt If the user explicitly requests permanent deletion or history removal, guide them to the interface to review credential files and history scope and complete confirmation. Do not attempt `purge`, directory deletion through Bash, or Renderer-protected HTTP endpoints. Existing backup copies are unaffected by permanent deletion. Whether marketplace uninstall is recoverable depends on the actual client capability; this Skill does not promise later implementation stages.
From the tool's return (cleaned paths, deleted run count, memory-cleanup details), produce a user-friendly report (no internal paths), e.g. "✅ Deleted XXX; cleaned filesystem / scheduler / subscriptions / MCP / N conversation records / team cascade".
### Deletion Scope and Boundaries
- **Always deleted**: AgentFS directory (config/persona/rules/skills/tools/memory), user preference data, in-memory state (scheduler/queue/message subscriptions/MCP connections), registry entry. **Optionally deleted** (`deleteRuns=true`): conversation history and topic index. **Team cascade** (automatic): supervisor → disband team, member → remove. **Kept**: other Agents, user config, global settings, market cache.
- Explain tool refusals to the user with a next step: the core agent (desirecore / core / bound UUID) cannot be deleted; the caller can't delete itself; active state (online/busy/recovery) needs stopping in the UI first or waiting until idle; a non-existent ID means the Agent is already gone or the ID is wrong.
- Always done via `ManageAgent` (`action='list' | 'get' | 'delete'`). Deletion is high risk: complete this skill's explicit intent confirmation first, then follow the approval result returned by the tool.
+15 -28
View File
@@ -4,49 +4,36 @@
## L0:一句话摘要 ## L0:一句话摘要
安全删除指定的智能体及其关联数据(文件系统、内存状态、可选会话历史)。 归档不再使用的智能体,或从本机归档恢复;保留会话历史,按真实回执报告团队与调度事项。
## L1:概述 ## L1:概述
元技能:列出候选 → 确认意图(不可恢复)→ 询问是否删历史 → `ManageAgent(action='delete')` 执行。用于清理不再使用、测试性/实验性、或需释放存储的智能体。价值在工具给不了的部分:候选筛选与状态引导、删除前的意图确认。工具层多重拒绝(核心体 / 自身 / 活跃态)与团队级联由工具保证。 用户可以删除、找回误删智能体,或查看本机归档。通过 `ManageAgent` 完成,不直接调用本机 HTTP,不手工移动归档目录。删除即归档:本机可恢复,不自动过期,不进入之后的备份或迁移包。永久删除只能由用户在「设置 → 数据与隐私 → 归档」完成。
## L2:详细规范 ## L2:详细规范
流程:列出可选智能体 → 确认意图与目标 → 询问是否删历史 → 执行删除 → 回执。 ### 归档智能体
### 阶段 1:列出候选 用户未明确目标时,用 `ManageAgent(action='list')` 列出候选,需要详情时用 `get`。核对名称与 ID,并说明会话历史保留、领导的团队一并归档。用户已明确授权的目标不重复询问;目标含糊时先澄清。工具保留内置智能体、自删及活跃状态保护;活跃目标需先在界面停止或等待空闲。
用户未指定具体智能体时,`ManageAgent(action='list')` 取列表,按状态分组展示:`offline` / `error` 可安全删除;`online` / `busy` / `recovery` 标注"需先停止"(会被工具拒绝),不进入后续流程。需详情用 `ManageAgent(action='get', id)`。例如: 调用 `ManageAgent(action='delete', id='example-agent')`。不要询问是否同时删除历史,不传 `deleteRuns=true`,新工具会拒绝它。工具按调用方审批模式裁决,不承诺一定弹卡。成功后只根据真实回执报告归档标识、团队和 worktree 处置及警告;解除绑定会保留工作树与分支。保存 `archiveId` 供需要时恢复,不把归档说成释放全部磁盘。
``` ### 查看归档与恢复
可删除:法律顾问助手 (legal-assistant, offline)、测试机器人 (test-bot, offline)
需先停止:数据分析师 (data-analyst, online)
```
### 阶段 2:确认意图 用 `ManageAgent(action='list_archived')` 查本机归档。该动作只读,不前滚或修复未完成事务;按 `phase`、`restorable` 和 `originalIdOccupied` 说明当前状态。缺少目标标识或归档已消失时重新查询,不猜 `archiveId`。
向用户确认目标智能体(名称/ID),**明确告知不可恢复**(配置、技能、工具将永久删除),展示基本信息,等用户确认。 对可恢复项调用 `ManageAgent(action='restore', archiveId='列表返回的标识')`。原 ID 被占用时先取得用户选择的新名称,再传 `name`;不得覆盖已有智能体。原 ID 空闲时,提供 `name` 只改名,不强制换 ID。`restoreLedTeams` 默认 `true`,用户要求团队继续留在归档时传 `false`。
### 阶段 3:询问删除选项 原 ID 冲突会导致新 ID:会话历史留在原 ID 下,调度不恢复;私有技能里的绝对路径环境可能要重新准备。执行前说明这些影响。恢复与创建同档,无额外确认;既有身份与权限仍由 owner 校验,不自报 `userId` 或冒充官方 Renderer。
问是否同时删除该智能体的全部会话历史:是 → `deleteRuns=true`;否 → `deleteRuns=false`(默认、可省略,保留历史)。 ### 按回执完成交接
### 阶段 4:执行删除 `agentId` 是实际恢复对象;`idChanged`、`runsAttached` 说明身份与历史归属。逐项报告 `teams.restored`、`teams.pending`、`teams.memberOf` 与 `warnings`。未一并恢复的领导团队需在归档页团队分段处理,原成员资格不还原。
调用前再次确认目标和 `deleteRuns` 选择。工具会把删除提交到当前审批链;是否出现额外弹窗取决于调用方的审批模式,不要在没有看到审批事件时声称“一定会弹窗”。执行: 调度不会自动启用:`schedules.reenablable` 可经原入口重新启用,`recreateRequired` 需重新创建(脚本需重新上传),`dropped` 表示新 ID 恢复时未带回的定义。旧实例授权不复活;MCP OAuth、App 链接与 worktree 绑定不还原。不要因 Agent 已恢复而宣称所有团队、调度或授权已恢复。
``` ### 失败和永久删除
ManageAgent(action='delete', id='legal-assistant', deleteRuns=true)
```
确认后完成删除,含团队级联:目标是组长的团队自动解散,是成员的自动移除。 保留工具返回的错误码、状态和警告。`AGENT_RESTORE_ID_OCCUPIED` 需要 `name` 或重新查询并发占用事实;`AGENT_RESTORE_USER_MISMATCH` 不可通过自报身份绕过;未完成、损坏或占位待收尾的归档按当前失败说明交接,不私自清理容器。未知结果先用列表核实,不重复创建或恢复。
### 阶段 5:回执 用户明确要求永久删除或删除历史时,引导到界面,由用户查看凭据文件与历史范围并完成确认;不尝试 `purge`、Bash 删除目录或受 Renderer 保护的 HTTP 端点。此前已有备份副本不受永久删除影响。市场卸载是否可恢复按实际客户端能力判断,不用本技能承诺尚未交付的后续分期。
据工具返回(已清理路径、删除会话数、内存清理详情)生成用户友好报告(不暴露内部路径),例如「✅ 已删除 XXX;清理了文件系统 / 调度 / 订阅 / MCP / N 条会话历史 / 团队级联」。
### 删除范围与边界
- **始终删**:AgentFS 目录(配置/人格/规则/技能/工具/记忆)、用户偏好数据、内存状态(调度器/队列/消息订阅/MCP 连接)、注册表条目。**可选删**(`deleteRuns=true`):会话历史与话题索引。**团队级联**(自动):组长 → 解散团队、成员 → 移除。**保留不删**:其他智能体、用户配置、全局设置、市场缓存。
- 工具拒绝场景据此向用户解释并给下一步:核心智能体(desirecore / core / 绑定 UUID)不可删;不能删调用方自身;活跃态(online/busy/recovery)需先在 UI 停止或等其空闲;ID 不存在则智能体已删或 ID 有误。
- 一律经 `ManageAgent`(`action='list' | 'get' | 'delete'`)完成;delete 为高风险操作,必须先完成本技能的明确意图确认,并遵循工具返回的审批结果。
+11 -11
View File
@@ -9,14 +9,14 @@
"defaultLocale": "en-US", "defaultLocale": "en-US",
"i18n": { "i18n": {
"zh-CN": { "zh-CN": {
"name": "删除智能体", "name": "删除与恢复智能体",
"summary": "安全删除智能体及其关联数据,支持多重确认与可选历史清理", "summary": "归档或恢复智能体,保留历史并报告团队和调度事项",
"description": "安全删除指定的智能体及其关联数据。删除前会验证智能体状态,支持可选地删除所有会话历史。Use when 用户需要删除不再使用的智能体。" "description": "通过 ManageAgent 归档不再使用的智能体、查询本机归档与恢复;永久删除仅由用户在界面完成。"
}, },
"en-US": { "en-US": {
"name": "Delete Agent", "name": "Archive and Restore Agents",
"summary": "Safely delete an Agent and its associated data, with multi-step confirmation and optional history cleanup", "summary": "Archive or restore Agents, keep history, and report team and schedule follow-up",
"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." "description": "Archive unused Agents, list local archives and restore them through ManageAgent. Only the user can permanently delete an Agent through the interface."
} }
}, },
"category": "productivity", "category": "productivity",
@@ -28,14 +28,14 @@
}, },
"release": { "release": {
"state": "known", "state": "known",
"version": "2.6.0", "version": "2.7.0",
"versionScheme": "semver" "versionScheme": "semver"
}, },
"timestamps": { "timestamps": {
"catalogUpdatedAt": { "catalogUpdatedAt": {
"state": "known", "state": "known",
"value": "2026-08-25T08:13:09Z", "value": "2026-11-17",
"precision": "second" "precision": "day"
}, },
"releasePublishedAt": { "releasePublishedAt": {
"state": "unknown" "state": "unknown"
@@ -65,10 +65,10 @@
"platforms": { "platforms": {
"state": "unknown" "state": "unknown"
}, },
"requiredClientVersion": "10.0.90" "requiredClientVersion": "10.0.204"
}, },
"spec": { "spec": {
"kind": "skill", "kind": "skill",
"riskLevel": "high" "riskLevel": "medium"
} }
} }