From d461378b32b75647c24af542c24d9818490cce87 Mon Sep 17 00:00:00 2001 From: Yige Date: Thu, 29 Oct 2026 12:01:30 +0800 Subject: [PATCH] feat(manage-teams): restore archived teams (1.5.0) (#234) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 团队解散后只能看到归档目录,缺少列出与恢复归档的入口。技能补充 list_archived / restore 两个动作、按 archiveId 恢复、原 ID 被占用或原组长 缺失时的处理,以及对恢复回执(规则核准待审阅、工作目录回退、缺失成员、 警告)的逐项转达;技能增版为 1.5.0,最低客户端 10.0.192,旧客户端不应加载 新增动作。 Documents the new list_archived and restore actions of ManageTeam: finding archives, restoring by archiveId, passing a new name when the original team ID is taken or a supervisor when the original one no longer exists, and relaying every item of the restore receipt (pending rule approval, workdir fallback, missing members, warnings). Bumps the Skill to 1.5.0 with a 10.0.192 client floor so older tool ABIs cannot load the new actions. Validation: i18n/schema/catalog checks passed with 103 pre-existing governance/provenance warnings (identical to origin/main); reviewed human translations and refreshed their source hash. New content uses generic roles and examples. No customer, tenant, credential or runtime fixture data is introduced. Related: desirecore/desirecore#5046. Client implementation: https://github.com/desirecore/desirecore/pull/5425. Do not infer release availability from this Skill PR. The authorized alternative pre-publication check passed: full working tree including hidden files, changed paths, branch and commit metadata, and this commit text were scanned for credential shapes and manually reviewed for customer-neutral content. No private token list was supplied or recorded. --- skills/manage-teams/SKILL.md | 22 +++++++++++++------- skills/manage-teams/SKILL.zh-CN.md | 12 +++++++++-- skills/manage-teams/catalog-metadata.v1.json | 6 +++--- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/skills/manage-teams/SKILL.md b/skills/manage-teams/SKILL.md index 072906d..d4d92ee 100644 --- a/skills/manage-teams/SKILL.md +++ b/skills/manage-teams/SKILL.md @@ -2,7 +2,7 @@ license: "MIT" name: manage-teams description: 创建和管理 Agent 团队,组织多 Agent 协作。Use when 需要多个 Agent 持续协作、建立组织架构,或发布、安装和同步团队仓库时。 -version: 1.4.0 +version: 1.5.0 type: procedural risk_level: medium status: enabled @@ -13,7 +13,7 @@ tags: - organization metadata: author: desirecore - updated_at: '2026-10-06' + updated_at: '2026-10-28' i18n: default_locale: en-US source_locale: zh-CN @@ -26,7 +26,7 @@ metadata: description: >- 创建和管理 Agent 团队,组织多 Agent 协作。Use when 需要多个 Agent 持续协作、建立组织架构,或发布、安装和同步团队仓库时。 body: ./SKILL.zh-CN.md - source_hash: sha256:778c6fb42f550a02 + source_hash: sha256:1695a3d0b629eed5 translated_by: human en-US: name: Team Management @@ -34,7 +34,7 @@ metadata: description: >- Create and govern Agent teams. Use when multiple Agents need sustained collaboration, an organizational hierarchy, or a team repository must be published, installed, or synchronized. body: ./SKILL.md - source_hash: sha256:778c6fb42f550a02 + source_hash: sha256:1695a3d0b629eed5 translated_by: human market: icon: >- @@ -55,7 +55,7 @@ market: fill-opacity="0.7"/> category: productivity - required_client_version: 10.0.178 + required_client_version: 10.0.192 --- # manage-teams Skill @@ -85,6 +85,7 @@ A team defines organization, shared directories, and governance. Actual work is ### 1. Inspect Before Mutating - If `teamId` is unknown, call `ManageTeam(action="list")` first. +- A disbanded team is not returned by `list`; inspect team archives with `ManageTeam(action="list_archived")`. - Before modifying, disbanding, or synchronizing a team, call `ManageTeam(action="get", teamId=...)` and verify its name, type, supervisor, members, local repository directory, and remote state. - Never guess a path under `~/.desirecore`; use only the absolute repository path returned by `get`. - `list` can filter by `parentTeamId`. With `tree=true`, `teamId` selects the subtree root and `parentTeamId` is ignored. @@ -104,7 +105,9 @@ A team defines organization, shared directories, and governance. Actual work is | `set_member_source` | Declare where a member Agent comes from | `teamId`, `agentId`, `memberSource`; `git` needs `url` (https, will be cloned) and `ref` (defaults to `main`), `registry` needs `id`+`version`, `core`/`local` need nothing else | | `update` | Partially update team configuration | `teamId`; supports `name/type/isolation/parentTeamId/description/avatar/avatarImage` | | `promote` | Promote an ephemeral team to persistent | `teamId`; one-way and never implicit | -| `disband` | Disband a team | `teamId`; enters approval; preserves a full archive, requiring workdir binding and content review on restore | +| `disband` | Disband a team | `teamId`; enters approval; preserves a full archive that `restore` can bring back | +| `list_archived` | List team archives | no parameters; read-only; returns `archiveId`, the original team ID, archive time and reason, whether the supervisor still exists, missing members, and whether the original ID is taken | +| `restore` | Restore a team from an archive | `archiveId`; `name` is required when the original ID is taken (restores under a new ID), `supervisor` when the original supervisor no longer exists; same tier as `create`, no approval | | `fork_team` | Install a team from a remote repository | `url`; `name?`, `installMembers?`; enters approval | | `push` | Push a local team to its connected remote | `teamId`; enters approval | | `pull` | Pull and validate a team from its connected remote | `teamId`; enters approval | @@ -187,7 +190,10 @@ For an image avatar, use `avatarImage.source` with `dc-media://`, a bar - Disband an ephemeral team after its project is complete so the organization does not accumulate stale teams. - Use `promote` only for an explicit long-term collaboration requirement; promotion is one-way. -- `disband` archives the complete team directory and ends its local workdir binding, even without Git initialization. Archive failure preserves the original data and reports failure. The action enters approval; the caller's approval mode determines whether a human card appears. To restore, first check that the team ID is free, then bind the workdir and approve its content again. +- `disband` archives the complete team directory and ends its local workdir binding, even without Git initialization. Archive failure preserves the original data and reports failure. The action enters approval; the caller's approval mode determines whether a human card appears. Bring it back later with `restore`. +- To restore, call `list_archived`, then `restore` with the returned `archiveId`. When the original ID is taken, pass `name`: the team is restored under a new ID and never overwrites the existing team. When the original supervisor no longer exists, pass `supervisor` (an existing local Agent other than `desirecore`). +- Relay every item of the restore receipt: a pending rule approval must be confirmed by the user in team settings; tell the user when the shared workdir fell back to the default or is unbound; missing local members can be installed with `install_members` or removed with `remove_members`; explain each warning. Success only means the team is back in the active directory, not that it is ready to work. +- Restoring never recreates deleted Agents and never treats rules as approved: the archived approval record is reinstated by content digest, so changed content is still blocked. ### 6. Team Repository and Remote Synchronization @@ -233,4 +239,6 @@ Report the team name and ID, type, supervisor and members, workdir mode, organiz - `Supervisor already leads another team`: run `set_supervisor` on the existing team before retrying. - `Remote not configured`: use `add_remote` to configure the destination, or use client team settings; do not guess a hidden API. - Local content changed or conflicts exist: obtain the directory with `get`, inspect Git state, preserve user changes, and only then decide whether to commit, pull, or retry. +- `Original team ID is taken`: retry `restore` with a new `name`. +- `Original supervisor no longer exists`: retry `restore` with `supervisor` set to an existing local Agent. - If this Skill is missing or disabled, the minimal operation may still be executed from the `ManageTeam` action/parameter Schema and tool error messages. Never bypass the tool by editing AgentFS directly. diff --git a/skills/manage-teams/SKILL.zh-CN.md b/skills/manage-teams/SKILL.zh-CN.md index e393f0e..a04859d 100644 --- a/skills/manage-teams/SKILL.zh-CN.md +++ b/skills/manage-teams/SKILL.zh-CN.md @@ -27,6 +27,7 @@ ### 1. 先查再改 - 不知道 `teamId` 时先执行 `ManageTeam(action="list")`。 +- 已解散的团队不在 `list` 里,用 `ManageTeam(action="list_archived")` 查看团队归档。 - 修改、解散或远程同步前执行 `ManageTeam(action="get", teamId=...)`,核对名称、类型、组长、成员、本地仓库目录和远程状态。 - 不要猜测 `~/.desirecore` 下的路径;本地仓库绝对路径只使用 `get` 返回值。 - `list` 可传 `parentTeamId` 过滤;`tree=true` 返回组织树,此时 `teamId` 表示子树根,`parentTeamId` 不生效。 @@ -46,7 +47,9 @@ | `set_member_source` | 声明成员 Agent 的来源 | `teamId`、`agentId`、`memberSource`;`git` 必填 `url`(https,将被 clone)与 `ref`(默认 `main`),`registry` 必填 `id`+`version`,`core`/`local` 无附加字段 | | `update` | 部分更新团队配置 | `teamId`;可更新 `name/type/isolation/parentTeamId/description/avatar/avatarImage` | | `promote` | 临时团队升级为持久团队 | `teamId`;单向操作,不得隐式执行 | -| `disband` | 解散团队 | `teamId`;提交审批;完整归档,恢复需重新绑定目录和核准内容 | +| `disband` | 解散团队 | `teamId`;提交审批;完整归档,之后可用 `restore` 恢复 | +| `list_archived` | 列出团队归档 | 无参数;只读,返回 `archiveId`、原团队 ID、归档时间与原因、组长是否存在、缺失成员、原 ID 是否被占用 | +| `restore` | 从归档恢复团队 | `archiveId`;原 ID 被占用时必填 `name`(以新 ID 恢复),原组长已不存在时必填 `supervisor`;与 `create` 同档,不进入审批 | | `fork_team` | 从远程仓库安装团队 | `url`;`name?`、`installMembers?`;进入审批闸门 | | `push` | 把本地团队仓库推送到已连接的远程 | `teamId`;进入审批闸门 | | `pull` | 从已连接的远程拉取并校验团队 | `teamId`;进入审批闸门 | @@ -129,7 +132,10 @@ - 临时团队完成一次项目后应解散,避免组织结构长期堆积。 - 只有明确存在长期协作需求时才 `promote`;这是单向升级。 -- `disband` 完整归档团队目录并结束本机工作目录绑定;不依赖 Git 初始化。归档失败保留原数据并报告失败。该动作提交审批,是否显示真人卡片由调用方的审批模式决定。恢复时先确认 teamId 未被占用,再绑定工作目录、重新核准内容。 +- `disband` 完整归档团队目录并结束本机工作目录绑定;不依赖 Git 初始化。归档失败保留原数据并报告失败。该动作提交审批,是否显示真人卡片由调用方的审批模式决定。之后可用 `restore` 恢复。 +- 恢复:先 `list_archived`,按返回的 `archiveId` 调 `restore`。原 ID 已被占用时提供 `name`,团队以新 ID 恢复,不会覆盖现有团队;原组长已不存在时提供 `supervisor`(本机存在的 Agent,不能是 `desirecore`)。 +- 逐项转达恢复回执:规则核准待审阅时须由用户本人在团队设置中确认;共享工作目录改绑默认目录或未绑定时告知用户;本机已不存在的成员可用 `install_members` 补装或 `remove_members` 移除;警告逐条说明。恢复成功只表示团队回到活动目录,不代表团队已可正常工作。 +- 恢复不会重建已删除的 Agent,也不会把规则当作已核准:归档时的核准记录按内容摘要装回,内容被改过时照常拦下。 ### 6. 团队仓库与远程同步 @@ -175,4 +181,6 @@ - `组长已管理其他团队`:先为原团队执行 `set_supervisor`,再重试。 - `未配置远程`:调用 `add_remote` 配置目标,或使用客户端团队设置;不要猜测隐藏 API。 - `本地内容已变化/存在冲突`:先用 `get` 获取目录并检查 Git 状态,保留用户改动后再决定提交、拉取或重试。 +- `原团队 ID 已被占用`:用 `name` 提供新名称后重试 `restore`。 +- `原组长已不存在`:用 `supervisor` 指定本机存在的 Agent 后重试 `restore`。 - Skill 缺失或禁用时,仍可根据 `ManageTeam` 的 action、参数 Schema 和错误提示执行最小操作,不要因此绕过工具直接修改 AgentFS。 diff --git a/skills/manage-teams/catalog-metadata.v1.json b/skills/manage-teams/catalog-metadata.v1.json index dc2097d..4e01b28 100644 --- a/skills/manage-teams/catalog-metadata.v1.json +++ b/skills/manage-teams/catalog-metadata.v1.json @@ -28,13 +28,13 @@ }, "release": { "state": "known", - "version": "1.4.0", + "version": "1.5.0", "versionScheme": "semver" }, "timestamps": { "catalogUpdatedAt": { "state": "known", - "value": "2026-10-06T13:00:00Z", + "value": "2026-10-28T00:00:00Z", "precision": "second" }, "releasePublishedAt": { @@ -65,7 +65,7 @@ "platforms": { "state": "unknown" }, - "requiredClientVersion": "10.0.178" + "requiredClientVersion": "10.0.192" }, "spec": { "kind": "skill",