Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
feat(skills): let a Chief of Staff switch teammates' skills in one call
AdityaUmale718d02334ef7
diff --git a/packages/phone-protocol/src/skill-request.ts b/packages/phone-protocol/src/skill-request.tsindex 8086c1327e..a0b6808ca3 100644--- a/packages/phone-protocol/src/skill-request.ts+++ b/packages/phone-protocol/src/skill-request.ts@@ -17,6 +17,14 @@ export function skillSwitchVerb(action: SkillSwitchAction): string {return action === "enable" ? "turn on" : action === "disable" ? "turn off" : "delete";}+/** One skill a Chief of Staff turns on or off for a teammate, as part of a change to several at once. */+export interface TeammateSkillChange {+ botId: string;+ botName: string;+ name: string;+ action: "enable" | "disable";+}+/** Kept on the receipt so Undo reverts the library write and the assignments together. */export interface SkillShareRecord {/** deduplicated: identical bytes were already in the library; assigned: it already was a library skill. */@@ -55,6 +63,8 @@ export interface SkillRequestCardData {shareError?: string;/** The change is to a skill on all of the person's bots, not this bot's own. */allBots?: true;+ /** A Chief of Staff's change to its teammates' skills: every one listed is turned on or off together. */+ teammates?: TeammateSkillChange[];}/** The hash a current client may echo after it displayed the completediff --git a/server/drivers/agents-call.test.ts b/server/drivers/agents-call.test.tsindex 3b591f4473..1271911812 100644--- a/server/drivers/agents-call.test.ts+++ b/server/drivers/agents-call.test.ts@@ -222,7 +222,7 @@ describe("skill_manage", () => {const sent: unknown[] = [];const ctx = context({ client: { api: async (path) => { sent.push(path); return {}; }, apiResponse: async () => ({ ok: true, status: 200, body: {} }) } });expect(await callTool("skill_manage", { action: "save" }, ctx)).toEqual({- text: 'skill_manage action must be "create", "update", "import", "enable", "disable" or "delete". It takes action, skill_name, skill_md, references, gist, base_revision, source, all_bots.',+ text: 'skill_manage action must be "create", "update", "import", "enable", "disable", "delete" or "teammates". It takes action, skill_name, skill_md, references, gist, base_revision, source, all_bots, changes.',isError: true,});expect((await callTool("skill_manage", { action: "create", source: "conversation" }, ctx)).text).toContain("---\\nname: file-expense\\ndescription:");diff --git a/server/drivers/agents-call.ts b/server/drivers/agents-call.tsindex 1a534cb286..f7415b9327 100644--- a/server/drivers/agents-call.ts+++ b/server/drivers/agents-call.ts@@ -903,6 +903,8 @@ export async function callTool(called: string, input: Json, context: ToolCallConreturn { text: `Imported skills:\n${live}\n\nStaged (waiting for the user's decision):\n${pending}` };}if (name === "skill_manage") {+ if (args.action === "teammates") return completedProposalResult(await api("/api/internal/skills/stage", { method: "POST", body: JSON.stringify({ fromBotId: BOT_ID, fromThreadId: THREAD_ID, action: "teammates", changes: args.changes }) }), "the change to your teammates' skills")+ ?? { text: "A confirmation card is now visible to the user listing every teammate skill to turn on or off. Nothing changes until they approve it. End this turn and wait for the decision." };if (isSkillSwitchAction(args.action)) {const skillName = typeof args.skill_name === "string" ? args.skill_name.trim() : "";const verb = skillSwitchVerb(args.action);@@ -918,7 +920,7 @@ export async function callTool(called: string, input: Json, context: ToolCallCon};}if (args.action !== "create" && args.action !== "update" && args.action !== "import") {- return { text: `skill_manage action must be "create", "update", "import", "enable", "disable" or "delete". It takes ${argumentNames(fullInputSchema(name))}.`, isError: true };+ return { text: `skill_manage action must be "create", "update", "import", "enable", "disable", "delete" or "teammates". It takes ${argumentNames(fullInputSchema(name))}.`, isError: true };}const skillMd = typeof args.skill_md === "string" ? args.skill_md : "";if (!skillMd.trim() && args.action !== "import") {diff --git a/server/drivers/agents-catalog-goldens/full.tools-list.json b/server/drivers/agents-catalog-goldens/full.tools-list.jsonindex ffbfa524b3..6d1fa781bd 100644--- a/server/drivers/agents-catalog-goldens/full.tools-list.json+++ b/server/drivers/agents-catalog-goldens/full.tools-list.json@@ -2342,7 +2342,7 @@},{"name": "skill_manage",- "description": "Create or update a reusable skill (SKILL.md), import one from GitHub or skills.sh (action import with source; same review as create, brings SKILL.md and references/*.md), or turn one of your own skills on or off, or delete it. Never change a skill unless the person explicitly asked for that named skill. It applies at once, with an Undo where possible: read the result before saying it did. It never raises another bot's execution permissions.",+ "description": "Create or update a reusable skill (SKILL.md), import one from GitHub or skills.sh (action import with source; same review as create, brings SKILL.md and references/*.md), or turn one of your own skills on or off, or delete it. A Chief of Staff may switch teammates' skills in one go (action teammates). Never change a skill unless the person explicitly asked for that named skill. It applies at once, with an Undo where possible: read the result before saying it did. It never raises another bot's execution permissions.","inputSchema": {"type": "object","additionalProperties": false,@@ -2355,7 +2355,8 @@"import","enable","disable",- "delete"+ "delete",+ "teammates"]},"skill_name": {@@ -2403,6 +2404,31 @@"all_bots": {"type": "boolean","description": "create/import: on all the person's bots, if they asked."+ },+ "changes": {+ "type": "array",+ "description": "teammates: all apply or none do.",+ "items": {+ "type": "object",+ "additionalProperties": false,+ "properties": {+ "bot_id": {+ "type": "string",+ "description": "From list_bots."+ },+ "skill_name": {+ "type": "string"+ },+ "on": {+ "type": "boolean"+ }+ },+ "required": [+ "bot_id",+ "skill_name",+ "on"+ ]+ }}},"required": [diff --git a/server/drivers/agents-catalog-goldens/profiles.json b/server/drivers/agents-catalog-goldens/profiles.jsonindex ed1a17675c..309f76782e 100644--- a/server/drivers/agents-catalog-goldens/profiles.json+++ b/server/drivers/agents-catalog-goldens/profiles.json@@ -254,8 +254,8 @@]},"skills": {- "bytes": 65050,- "sha256": "b7dde8a2f6c51570beb8d6319dfd4fd3f4411a549a2295d9e23cf39e31fd913c",+ "bytes": 65438,+ "sha256": "ab5ddc685e0693a85f209d4401ab73b4778686623419f7d453dde294d7410d96","tools": ["tool_result_read","list_room_targets",@@ -318,8 +318,8 @@]},"skills+voice": {- "bytes": 65831,- "sha256": "8ea9f6facb9b272752e2ed88170bf6ef852e4be31200db21648d64a0cebd9a45",+ "bytes": 66219,+ "sha256": "9b8981bf64a0273816adc8e5785015fef5de657f95116e9db4cffdd4ba735c5e","tools": ["tool_result_read","list_room_targets",@@ -383,8 +383,8 @@]},"skills+shared": {- "bytes": 67315,- "sha256": "d461ef0e18f90ead3cbc2ebef8f9b5baa5fb36dba87080db9de9797cb606d4f9",+ "bytes": 67703,+ "sha256": "bdd842340b587ac1ca2a1378d8d60520e135ec4bab3cae9dbd75a09aba3955e2","tools": ["tool_result_read","list_shared_computers",@@ -449,8 +449,8 @@]},"skills+shared+voice": {- "bytes": 68096,- "sha256": "dd8cd734cab34d90db51471e422e007ec991e5e19205a7018ff87637e6b54d21",+ "bytes": 68484,+ "sha256": "7e9487ebec16bafee0fa32cb6304345e2cb7b2db71af2a59e961565db59335ee","tools": ["tool_result_read","list_shared_computers",@@ -976,8 +976,8 @@]},"skills+shared+voice+cloud-home": {- "bytes": 67852,- "sha256": "4677074b46fb14b4c38bbdd320f0328d2b71adf032832ee3bec2ecd1dee45e0a",+ "bytes": 68240,+ "sha256": "893492e845947a6454c5848181bd9348edb5d982437f73570f880da707199f15","tools": ["tool_result_read","list_shared_computers",@@ -1103,8 +1103,8 @@]},"skills+shared+voice+x": {- "bytes": 71935,- "sha256": "188d0c94883239d135e6d3b256e60e0440eba72818203a262d9a857a5d942a32",+ "bytes": 72323,+ "sha256": "38dd2100947cd82b52b1a2a2e212e67db200a08f399af7f7c7c258a9586d8f37","tools": ["tool_result_read","list_shared_computers",@@ -1174,8 +1174,8 @@]},"skills+shared+voice+x+team": {- "bytes": 71935,- "sha256": "188d0c94883239d135e6d3b256e60e0440eba72818203a262d9a857a5d942a32",+ "bytes": 72323,+ "sha256": "38dd2100947cd82b52b1a2a2e212e67db200a08f399af7f7c7c258a9586d8f37","tools": ["tool_result_read","list_shared_computers",@@ -1245,8 +1245,8 @@]},"skills+shared+voice+x+team+images": {- "bytes": 73882,- "sha256": "b74fd64612eedddb67cb1532e88c652b2289e141c0d666474a9c084312fe4f96",+ "bytes": 74270,+ "sha256": "3f2e6434390b1068f685b361b9fed7f136fc03226d8f0ea801fe5ce9a60e83d1","tools": ["tool_result_read","list_shared_computers",@@ -1444,8 +1444,8 @@]},"skills+shared+voice+mausbot": {- "bytes": 68747,- "sha256": "159802e7810ef0f869c073c95d415109a747cbb96cc892672d0e6daeae624fbb",+ "bytes": 69135,+ "sha256": "08b68ebc7ab85cb3b85cb3d2b0374746f033517eb06d2a2483daa410e7b7eb1e","tools": ["tool_result_read","list_shared_computers",@@ -1739,8 +1739,8 @@]},"skills+shared+voice+x+team+images+hosting": {- "bytes": 75806,- "sha256": "cb1179a38ed948224d5c5b6393d51f091c32d3f9362a81a06da9ede620b2abe3",+ "bytes": 76194,+ "sha256": "191b0cf31dbcbe8179189d995c2f0a454ede6aee0c4b4b7619ca146912c06e69","tools": ["tool_result_read","list_shared_computers",@@ -1878,8 +1878,8 @@]},"skills+shared+voice+x+team+board": {- "bytes": 73927,- "sha256": "245eabe4fcb44c0bb0445a036998b3ca0dfa3c20ac7fb459d61d04456489094d",+ "bytes": 74315,+ "sha256": "d830885991a6b75f3ede2c1cf1398e09bc6072a6c5c263dfde7f32a031eab670","tools": ["tool_result_read","list_shared_computers",diff --git a/server/drivers/agents-catalog-wire.test.ts b/server/drivers/agents-catalog-wire.test.tsindex b47faca5a0..726a95fc56 100644--- a/server/drivers/agents-catalog-wire.test.ts+++ b/server/drivers/agents-catalog-wire.test.ts@@ -80,6 +80,7 @@ const PROFILES = profiles();const CHIEF_ONLY_TOOLS = ["create_bot", "list_team_setup", "list_team_library", "propose_team_setup", "propose_bot_deletion", "manage_room", "retry_thread"];const CHIEF_TARGET_TOOLS = ["propose_profile", "propose_model"];const CHIEF_PROFILE_TARGET = " A Chief of Staff may pass for_bot_id (from list_bots) for a requested change to another bot in its section.";+const CHIEF_SKILLS_TARGET = " A Chief of Staff may switch teammates' skills in one go (action teammates).";const TEAMWORK_TOOLS = ["list_room_targets", "coordinate_bots", "assignment_status", "list_bots", "list_rooms", "list_threads", "close_thread", "start_thread", "post_to_room"];const MAUSBOT_TOOLS = ["list_unread_notifications", "mark_notifications_read"];const BOARD_TOOLS = ["board_add", "board_list", "board_update"];@@ -97,10 +98,10 @@ const BUDGET_BASELINE: Record<string, number> = {"voice": 62290,"shared": 63774,"shared+voice": 64555,- "skills": 63830,- "skills+voice": 64611,- "skills+shared": 66095,- "skills+shared+voice": 66876,+ "skills": 65438,+ "skills+voice": 66219,+ "skills+shared": 67703,+ "skills+shared+voice": 68484,"non-chief": 53136,"voice+non-chief": 53917,"shared+non-chief": 55401,@@ -109,19 +110,19 @@ const BUDGET_BASELINE: Record<string, number> = {"skills+voice+non-chief": 56238,"skills+shared+non-chief": 57722,"skills+shared+voice+non-chief": 58503,- "skills+shared+voice+cloud-home": 66632,+ "skills+shared+voice+cloud-home": 68240,"skills+shared+voice+non-chief+cloud-home": 58259,"default+legacy-switches": 61509,"default+mausbot": 62160,- "skills+shared+voice+mausbot": 67527,- "skills+shared+voice+x": 70715,- "skills+shared+voice+x+team": 70715,+ "skills+shared+voice+mausbot": 69135,+ "skills+shared+voice+x": 72323,+ "skills+shared+voice+x+team": 72323,"default+no-computer-pick": 60297,"default+room": 56857,"non-chief+room": 48309,- "skills+shared+voice+x+team+images": 72662,+ "skills+shared+voice+x+team+images": 74270,"default+images": 63456,- "skills+shared+voice+x+team+images+hosting": 74525,+ "skills+shared+voice+x+team+images+hosting": 76194,"default+hosting": 63372,"default+tools-off": 57192,"skills+shared+voice+x+team+board": 73047,@@ -227,7 +228,7 @@ describe("agents proxy tools/list golden", () => {for (const [name, profile] of Object.entries(PROFILES)) {for (const tool of toolsOf(wires[name]!)) {if (profile.env.OMB_CLOUD_HOME === "1" && (tool.name === "select_computer" || OWN_CLOUD_TOOLS.includes(tool.name))) continue;- if (profile.env.OMB_CHIEF_OF_STAFF === "0" && CHIEF_TARGET_TOOLS.includes(tool.name)) continue;+ if (profile.env.OMB_CHIEF_OF_STAFF === "0" && (CHIEF_TARGET_TOOLS.includes(tool.name) || tool.name === "skill_manage")) continue;if (profile.env.OMB_MAUSBOT === "1" && MAUSBOT_TOOLS.includes(tool.name)) continue;if (profile.env.OMB_TEAM_BOARD === "1" && BOARD_TOOLS.includes(tool.name)) continue;expect(JSON.stringify(tool), `${name}: ${tool.name}`).toBe(full.get(tool.name));@@ -366,6 +367,14 @@ describe("agents proxy tools/list golden", () => {expect(browserProfile !== undefined, `${name}: ${chiefTool.name}`).toBe(chiefTool.name === "propose_profile");expected = { ...chiefTool, description: chiefTool.description.replace(CHIEF_PROFILE_TARGET, ""), inputSchema: { ...chiefTool.inputSchema, properties } };}+ if (chiefTool.name === "skill_manage") {+ const { changes, action, ...properties } = chiefTool.inputSchema.properties as Record<string, { enum?: string[] }>;+ expect(changes, `${name}: skill_manage`).toBeDefined();+ expect(action!.enum, `${name}: skill_manage`).toContain("teammates");+ expect(chiefTool.description).toContain(CHIEF_SKILLS_TARGET);+ const ownActions = { ...action, enum: action!.enum!.filter((option) => option !== "teammates") };+ expected = { ...chiefTool, description: chiefTool.description.replace(CHIEF_SKILLS_TARGET, ""), inputSchema: { ...chiefTool.inputSchema, properties: { action: ownActions, ...properties } } };+ }expect(JSON.stringify(tools.get(chiefTool.name)), `${name}: ${chiefTool.name}`).toBe(JSON.stringify(expected));}expect(chiefTools.find((tool) => tool.name === "propose_profile")!.description).toContain(CHIEF_PROFILE_TARGET);diff --git a/server/drivers/agents-catalog.ts b/server/drivers/agents-catalog.tsindex 143141d1e0..c15e9788db 100644--- a/server/drivers/agents-catalog.ts+++ b/server/drivers/agents-catalog.ts@@ -115,6 +115,8 @@ const TRIGGER_FIELDS_SCHEMA = {const MESSAGE_MAX = 12_000;const CHIEF_PROFILE_TARGET = " A Chief of Staff may pass for_bot_id (from list_bots) for a requested change to another bot in its section.";+const CHIEF_SKILL_ACTION = "teammates";+const CHIEF_SKILLS_TARGET = " A Chief of Staff may switch teammates' skills in one go (action teammates).";const APPLIES_AT_ONCE = " It applies at once, with an Undo where possible: read the result before saying it did.";const APPLIES_OUTCOME = APPLIES_AT_ONCE + " It never raises another bot's execution permissions.";@@ -735,12 +737,12 @@ const TOOL_DEFINITIONS = [{name: "skill_manage",description:- "Create or update a reusable skill (SKILL.md), import one from GitHub or skills.sh (action import with source; same review as create, brings SKILL.md and references/*.md), or turn one of your own skills on or off, or delete it. Never change a skill unless the person explicitly asked for that named skill." + APPLIES_OUTCOME,+ "Create or update a reusable skill (SKILL.md), import one from GitHub or skills.sh (action import with source; same review as create, brings SKILL.md and references/*.md), or turn one of your own skills on or off, or delete it." + CHIEF_SKILLS_TARGET + " Never change a skill unless the person explicitly asked for that named skill." + APPLIES_OUTCOME,inputSchema: {type: "object",additionalProperties: false,properties: {- action: { type: "string", enum: ["create", "update", "import", "enable", "disable", "delete"] },+ action: { type: "string", enum: ["create", "update", "import", "enable", "disable", "delete", "teammates"] },skill_name: { type: "string", description: "Every action but create and import: the exact name from skills_list." },skill_md: { type: "string", description: "create or update: the full SKILL.md with its YAML frontmatter." },references: {@@ -761,6 +763,22 @@ const TOOL_DEFINITIONS = [base_revision: { type: "string", description: "To update a skill shared with your team: its revision from skills_list." },source: { type: "string", description: "create or update: the URL, folder or 'conversation' it came from. import: owner/repo, a GitHub link to the skill's folder or SKILL.md, or a skills.sh link." },all_bots: { type: "boolean", description: "create/import: on all the person's bots, if they asked." },+ changes: {+ type: "array",+ minItems: 1,+ maxItems: 40,+ description: "teammates: all apply or none do.",+ items: {+ type: "object",+ additionalProperties: false,+ properties: {+ bot_id: { type: "string", description: "From list_bots." },+ skill_name: { type: "string" },+ on: { type: "boolean" },+ },+ required: ["bot_id", "skill_name", "on"],+ },+ },},required: ["action"],},@@ -880,6 +898,11 @@ function catalogTools(profile: CatalogProfile) {const ROLE_TOOLS = profile.chief? RESEARCH_READY_TOOLS: RESEARCH_READY_TOOLS.filter((tool) => !CHIEF_ONLY_TOOL_NAMES.has(tool.name)).map((tool) => {+ if (tool.name === "skill_manage") {+ const properties = Object.fromEntries(Object.entries(tool.inputSchema.properties).filter(([key]) => key !== "changes")+ .map(([key, value]) => [key, key === "action" && Array.isArray(value.enum) ? { ...value, enum: value.enum.filter((option: string) => option !== CHIEF_SKILL_ACTION) } : value]));+ return { ...tool, description: tool.description.replace(CHIEF_SKILLS_TARGET, ""), inputSchema: { ...tool.inputSchema, properties } };+ }if (!CHIEF_TARGET_TOOL_NAMES.has(tool.name)) return tool;const properties = Object.fromEntries(Object.entries(tool.inputSchema.properties).filter(([key]) => !CHIEF_TARGET_FIELDS.has(key)));return { ...tool, description: tool.description.replace(CHIEF_PROFILE_TARGET, ""), inputSchema: { ...tool.inputSchema, properties } };diff --git a/server/drivers/agents-proxy.test.ts b/server/drivers/agents-proxy.test.tsindex 007e9eac8e..f2bde423be 100644--- a/server/drivers/agents-proxy.test.ts+++ b/server/drivers/agents-proxy.test.ts@@ -2211,7 +2211,7 @@ describe("agents-proxy MCP surface", () => {const manage = list.result.tools.find((t: { name: string }) => t.name === "skill_manage");expect(JSON.stringify(manage.inputSchema)).not.toMatch(/"(oneOf|anyOf|allOf|const|format)":/);expect(manage.inputSchema.required).toEqual(["action"]);- expect(manage.inputSchema.properties.action.enum).toEqual(["create", "update", "import", "enable", "disable", "delete"]);+ expect(manage.inputSchema.properties.action.enum).toEqual(["create", "update", "import", "enable", "disable", "delete", "teammates"]);const listed = await callTool("skills_list", {});expect(listed.result.content[0].text).toContain("file-expense");diff --git a/server/host/skill-switch-host.ts b/server/host/skill-switch-host.tsindex 2b0129ce2e..d48f64071a 100644--- a/server/host/skill-switch-host.ts+++ b/server/host/skill-switch-host.ts@@ -238,5 +238,7 @@ export function createSkillSwitchHost(deps: SkillSwitchHostDeps) {return { claimed: true, state: "undone" };}- return { stage, resolve, undo };+ const turn = (botId: string, name: string, on: boolean, kind: SwitchableSkill["kind"] | undefined) => apply(botId, name, on ? "enable" : "disable", kind);++ return { stage, resolve, undo, switchableSkill, turn };}diff --git a/server/host/teammate-skills-host.test.ts b/server/host/teammate-skills-host.test.tsnew file mode 100644index 0000000000..4a8fcdddaf--- /dev/null+++ b/server/host/teammate-skills-host.test.ts@@ -0,0 +1,204 @@+import { mkdtempSync, readdirSync, rmSync } from "node:fs";+import { tmpdir } from "node:os";+import { join } from "node:path";++import { afterEach, describe, expect, it } from "vitest";++import type { SkillRequestCardData } from "../../shared/skill-request.ts";+import type { OptionCardData } from "../../shared/wire.ts";+import { flushDecisionLog } from "../decision-log.ts";+import type { SwitchableSkill } from "../skill-switch.ts";+import type { BotRecord } from "../store.ts";++import { createTeammateSkillsHost } from "./teammate-skills-host.ts";++const dirs: string[] = [];+afterEach(async () => {+ for (const dir of dirs.splice(0)) {+ await flushDecisionLog(dir);+ rmSync(dir, { recursive: true, force: true });+ }+});++type Skill = { kind: SwitchableSkill["kind"]; enabled: boolean; text: string };++function setup(options: { chief?: boolean; refuse?: string[]; failTurn?: string; room?: boolean } = {}) {+ const dataDir = mkdtempSync(join(tmpdir(), "teammate-skills-host-"));+ dirs.push(dataDir);+ const bots: Record<string, BotRecord> = {+ chief: { id: "chief", name: "Chief", color: "blue", chiefOfStaff: options.chief !== false } as BotRecord,+ writer: { id: "writer", name: "Writer", color: "red" } as BotRecord,+ coder: { id: "coder", name: "Coder", color: "green" } as BotRecord,+ };+ const skills = new Map<string, Skill>([+ ["writer/research", { kind: "own", enabled: false, text: "---\nname: research\n---\n" }],+ ["writer/lint", { kind: "own", enabled: true, text: "---\nname: lint\n---\n" }],+ ["coder/lint", { kind: "own", enabled: true, text: "---\nname: lint\n---\n" }],+ ["coder/pulled", { kind: "imported", enabled: false, text: "---\nname: pulled\n---\n" }],+ ["coder/org", { kind: "fixed", enabled: true, text: "---\nname: org\n---\n" }],+ ]);+ const messages: Array<{ id: string; card: OptionCardData }> = [];+ const turns: string[] = [];+ const host = createTeammateSkillsHost({+ store: {+ bot: (id: string) => bots[id],+ groupByThread: () => (options.room ? ({} as never) : undefined),+ appendMessage: ((_threadId: string, message: { card: OptionCardData }) => { messages.push({ id: `m${messages.length}`, card: message.card }); }) as never,+ patchMessage: ((_threadId: string, id: string, patch: { card: OptionCardData }) => { messages.find((message) => message.id === id)!.card = patch.card; }) as never,+ } as never,+ dataDir,+ persistence: () => ({ ok: true }),+ refusal: (_from, target) => (options.refuse?.includes(target) ? "that bot is not in a department this Chief manages" : null),+ skill: (bot, name) => {+ const skill = skills.get(`${bot.id}/${name}`);+ return skill ? { kind: skill.kind, enabled: skill.enabled, text: skill.text, source: "conversation", description: name } : undefined;+ },+ turn: (botId, name, on) => {+ if (options.failTurn === `${botId}/${name}`) return { error: "disk full" };+ skills.get(`${botId}/${name}`)!.enabled = on;+ turns.push(`${botId}/${name}=${on}`);+ return { name, enabled: on };+ },+ noteSkillChange: () => {},+ });+ const enabled = (key: string) => skills.get(key)!.enabled;+ const card = () => messages.at(-1)!.card;+ const request = () => card().skillRequest as SkillRequestCardData;+ const approve = (behavior: "allow" | "deny" = "allow") =>+ host.resolve({ botId: "chief", threadId: "t1", requestId: request().requestId, behavior, reviewedSha256: request().sha256 }, messages.at(-1)!.id, card(), request());+ const undo = () => host.undo("chief", "t1", { id: messages.at(-1)!.id, card: card() } as never, request());+ const records = () => { try { return readdirSync(join(dataDir, "teammate-skills")); } catch { return []; } };+ const edit = (key: string, text: string) => { skills.get(key)!.text = text; };+ return { bots, host, enabled, card, request, approve, undo, records, turns, edit, messages };+}++const both = { changes: [{ bot_id: "writer", skill_name: "research", on: true }, { bot_id: "coder", skill_name: "lint", on: false }] };++describe("a Chief of Staff changing its teammates' skills", () => {+ it("turns every listed skill on or off at once, with one receipt and one Undo", () => {+ const t = setup();+ expect(t.host.stage(t.bots.chief!, "t1", both, "self")).toMatchObject({ status: 201, body: { state: "applied", changes: 2 } });+ expect(t.enabled("writer/research")).toBe(true);+ expect(t.enabled("coder/lint")).toBe(false);+ expect(t.messages).toHaveLength(1);+ expect(t.card()).toMatchObject({ answered: "allow", autoApplied: true, title: "Skills changed on your team (2)", options: [] });+ expect(t.request().teammates).toEqual([+ { botId: "writer", botName: "Writer", name: "research", action: "enable" },+ { botId: "coder", botName: "Coder", name: "lint", action: "disable" },+ ]);+ expect(t.request().preview).toBe("@Writer: turn on \"research\"\n@Coder: turn off \"lint\"");++ expect(t.undo()).toEqual({ claimed: true, state: "undone" });+ expect(t.enabled("writer/research")).toBe(false);+ expect(t.enabled("coder/lint")).toBe(true);+ expect(t.card().undone).toBe(true);+ });++ it("refuses a bot that is not a Chief of Staff and changes nothing", () => {+ const t = setup({ chief: false });+ expect(t.host.stage(t.bots.chief!, "t1", both, "self")).toMatchObject({ status: 403 });+ expect(t.turns).toEqual([]);+ expect(t.messages).toEqual([]);+ });++ it("changes none when any one change is not allowed, and names every problem", () => {+ const t = setup({ refuse: ["coder"] });+ const result = t.host.stage(t.bots.chief!, "t1", {+ changes: [...both.changes, { bot_id: "writer", skill_name: "missing", on: true }],+ }, "self");+ expect(result.status).toBe(422);+ expect(result.body.error).toMatch(/^Nothing was changed\. /);+ expect(result.body.error).toContain("Coder: that bot is not in a department this Chief manages");+ expect(result.body.error).toContain("Writer:");+ expect(t.turns).toEqual([]);+ expect(t.messages).toEqual([]);+ });++ it("keeps the rules of a bot's own switch: only the person turns on an imported skill, and org skills stay fixed", () => {+ const t = setup();+ const imported = t.host.stage(t.bots.chief!, "t1", { changes: [{ bot_id: "coder", skill_name: "pulled", on: true }] }, "self");+ const fixed = t.host.stage(t.bots.chief!, "t1", { changes: [{ bot_id: "coder", skill_name: "org", on: false }] }, "self");+ expect(imported.status).toBe(422);+ expect(fixed.status).toBe(422);+ expect(t.turns).toEqual([]);+ });++ it("refuses the Chief's own skills, repeated changes and empty lists", () => {+ const t = setup();+ expect(t.host.stage(t.bots.chief!, "t1", { changes: [{ bot_id: "chief", skill_name: "x", on: true }] }, "self").status).toBe(422);+ expect(t.host.stage(t.bots.chief!, "t1", { changes: [both.changes[0], both.changes[0]] }, "self").status).toBe(400);+ expect(t.host.stage(t.bots.chief!, "t1", { changes: [] }, "self").status).toBe(400);+ expect(t.host.stage(t.bots.chief!, "t1", { changes: [{ bot_id: "writer", skill_name: "research" }] }, "self").status).toBe(400);+ expect(t.turns).toEqual([]);+ });++ it("puts back the ones already turned when a later one fails", () => {+ const t = setup({ failTurn: "coder/lint" });+ const result = t.host.stage(t.bots.chief!, "t1", both, "self");+ expect(result).toMatchObject({ status: 422, body: { state: "failed" } });+ expect(result.body.error).toContain("Nothing was changed");+ expect(t.enabled("writer/research")).toBe(false);+ expect(t.enabled("coder/lint")).toBe(true);+ expect(t.messages).toEqual([]);+ });++ it("waits on one card when changes wait for the person, and applies all on approval", () => {+ const t = setup();+ expect(t.host.stage(t.bots.chief!, "t1", both, null)).toMatchObject({ status: 201, body: { state: "pending" } });+ expect(t.card()).toMatchObject({ title: "Change skills on your team (2)?", options: ["Apply", "Deny"] });+ expect(t.turns).toEqual([]);+ expect(t.records()).toHaveLength(1);++ expect(t.approve()).toEqual({ claimed: true, outcome: "allowed-once" });+ expect(t.enabled("writer/research")).toBe(true);+ expect(t.enabled("coder/lint")).toBe(false);+ expect(t.card()).toMatchObject({ answered: "allow", title: "Skills changed on your team (2)" });+ expect(t.records()).toHaveLength(0);+ });++ it("always waits on the card in a room", () => {+ const t = setup({ room: true });+ expect(t.host.stage(t.bots.chief!, "t1", both, "self")).toMatchObject({ status: 201, body: { state: "pending" } });+ expect(t.turns).toEqual([]);+ });++ it("changes nothing on Deny", () => {+ const t = setup();+ t.host.stage(t.bots.chief!, "t1", both, null);+ expect(t.approve("deny")).toEqual({ claimed: true, outcome: "rejected" });+ expect(t.turns).toEqual([]);+ expect(t.records()).toHaveLength(0);+ });++ it("refuses approval, changing none, when any skill changed after the card opened", () => {+ const t = setup();+ t.host.stage(t.bots.chief!, "t1", both, null);+ t.edit("coder/lint", "---\nname: lint\n---\nnew words\n");+ const result = t.approve();+ expect(result).toMatchObject({ claimed: true, status: 422 });+ expect(t.turns).toEqual([]);+ expect(t.card().held).toContain("Nothing was changed");+ });++ it("refuses approval when the Chief no longer manages a teammate on the card", () => {+ const refuse: string[] = [];+ const t = setup({ refuse });+ t.host.stage(t.bots.chief!, "t1", both, null);+ refuse.push("writer");+ expect(t.approve()).toMatchObject({ claimed: true, status: 422 });+ expect(t.turns).toEqual([]);+ });++ it("refuses Undo, changing none, once any listed skill moved on", () => {+ const t = setup();+ t.host.stage(t.bots.chief!, "t1", both, "self");+ t.turns.length = 0;+ const lint = t.host.stage(t.bots.chief!, "t2", { changes: [{ bot_id: "coder", skill_name: "lint", on: true }] }, "self");+ expect(lint.status).toBe(201);+ t.messages.pop();+ t.turns.length = 0;+ expect(t.undo()).toMatchObject({ claimed: true, state: "invalid", stale: true });+ expect(t.turns).toEqual([]);+ expect(t.enabled("writer/research")).toBe(true);+ });+});diff --git a/server/host/teammate-skills-host.ts b/server/host/teammate-skills-host.tsnew file mode 100644index 0000000000..57ceda45bb--- /dev/null+++ b/server/host/teammate-skills-host.ts@@ -0,0 +1,219 @@+// A Chief of Staff turns named skills on or off for several of its teammates in one call. Each change passes the rules a+// bot's own switch does (skill-switch.ts), and they apply together or not at all: where the Chief's own skill changes+// apply directly, with one receipt and one Undo; otherwise on one card, approved only while every skill is still the one+// the card listed.+import { createHash, randomUUID } from "node:crypto";+import { mkdirSync, readFileSync, rmSync } from "node:fs";+import { dirname, join } from "node:path";+import { z } from "zod";++import type { SkillRequestCardData, TeammateSkillChange } from "../../shared/skill-request.ts";+import type { OptionCardData } from "../../shared/wire.ts";+import { writeFileAtomic } from "../atomic.ts";+import { chiefLevel } from "../chief-level.ts";+import { appendDecision } from "../decision-log.ts";+import { UNDO_STALE, type DirectApply } from "../direct-apply.ts";+import { conversationLanguage, serverLine } from "../server-lines.ts";+import { skillSwitchStillMatches, skillSwitchTarget, type SwitchableSkill } from "../skill-switch.ts";+import type { BotRecord, Message, Store } from "../store.ts";++export const TEAMMATE_SKILL_CHANGES_MAX = 40;++export interface TeammateSkillsHostDeps {+ store: Pick<Store, "bot" | "appendMessage" | "patchMessage" | "groupByThread">;+ dataDir: string;+ persistence(botId: string, threadId: string, opensCard: boolean): { ok: true } | { ok: false; status: number; error: string };+ /** Why `fromId` may not change `targetId`'s skills, or null when it may. */+ refusal(fromId: string, targetId: string): string | null;+ skill(bot: BotRecord, name: string): SwitchableSkill | undefined;+ turn(botId: string, name: string, on: boolean, kind: SwitchableSkill["kind"] | undefined): object;+ noteSkillChange(botId: string, threadId: string): void;+}++type Result = { status: number; body: Record<string, unknown> };+type Step = { botId: string; name: string; on: boolean };+type Checked = TeammateSkillChange & { contentSha256: string };++const recordSchema = z.object({+ chiefId: z.string(),+ changes: z.array(z.object({ botId: z.string(), name: z.string(), action: z.enum(["enable", "disable"]), contentSha256: z.string() })),+});+type TeammateSkillsRecord = z.infer<typeof recordSchema>;++const steps = (changes: ReadonlyArray<Pick<TeammateSkillChange, "botId" | "name" | "action">>, back = false): Step[] =>+ changes.map((change) => ({ botId: change.botId, name: change.name, on: (change.action === "enable") !== back }));++export function createTeammateSkillsHost(deps: TeammateSkillsHostDeps) {+ const { store } = deps;+ const recordPath = (requestId: string) => join(deps.dataDir, "teammate-skills", `${requestId}.json`);+ const readRecord = (requestId: string): TeammateSkillsRecord | null => {+ try {+ const parsed = recordSchema.safeParse(JSON.parse(readFileSync(recordPath(requestId), "utf8")));+ return parsed.success ? parsed.data : null;+ } catch { return null; }+ };+ const dropRecord = (requestId: string) => rmSync(recordPath(requestId), { force: true });+ const botName = (id: string) => store.bot(id)?.name ?? id;+ const turnOne = (step: Step) => {+ const bot = store.bot(step.botId);+ return bot ? deps.turn(step.botId, step.name, step.on, deps.skill(bot, step.name)?.kind) : { error: "that bot no longer exists" };+ };++ /** Turns every step, or, when one fails, turns back those already turned so nothing is changed. */+ function turnAll(all: readonly Step[]): { ok: true } | { error: string } {+ const turned: Step[] = [];+ for (const step of all) {+ const result = turnOne(step);+ if ("error" in result) {+ for (const back of turned.reverse()) turnOne({ ...back, on: !back.on });+ return { error: `${botName(step.botId)}, "${step.name}": ${String(result.error)}. Nothing was changed.` };+ }+ turned.push(step);+ }+ return { ok: true };+ }++ /** Every change the call asked for, checked; when any fails, every problem and nothing changed. */+ function checked(from: BotRecord, body: Record<string, unknown>): { changes: Checked[] } | Result {+ const asked = body.changes;+ if (!Array.isArray(asked) || !asked.length) return { status: 400, body: { error: "changes must list at least one { bot_id, skill_name, on }" } };+ if (asked.length > TEAMMATE_SKILL_CHANGES_MAX) return { status: 400, body: { error: `changes can list at most ${TEAMMATE_SKILL_CHANGES_MAX} skills in one call` } };+ const seen = new Set<string>();+ const problems: string[] = [];+ const changes: Checked[] = [];+ for (const [index, item] of asked.entries()) {+ const entry = (item && typeof item === "object" ? item : {}) as Record<string, unknown>;+ const botId = typeof entry.bot_id === "string" ? entry.bot_id.trim() : "";+ const name = typeof entry.skill_name === "string" ? entry.skill_name.trim() : "";+ if (!botId || !name || typeof entry.on !== "boolean") return { status: 400, body: { error: `changes[${index}] needs bot_id, skill_name and on (true or false)` } };+ const key = `${botId}\n${name}`;+ if (seen.has(key)) return { status: 400, body: { error: `changes lists "${name}" for ${botId} more than once` } };+ seen.add(key);+ const target = store.bot(botId);+ if (!target) { problems.push(`${botId}: no such bot; copy its id from list_bots`); continue; }+ if (target.id === from.id) { problems.push(`${target.name}: that is you; turn your own skills on or off with action enable or disable`); continue; }+ const refused = deps.refusal(from.id, target.id);+ if (refused) { problems.push(`${target.name}: ${refused}`); continue; }+ const action = entry.on ? "enable" as const : "disable" as const;+ const switched = skillSwitchTarget(name, action, deps.skill(target, name));+ if ("error" in switched) { problems.push(`${target.name}: ${switched.error}`); continue; }+ changes.push({ botId: target.id, botName: target.name, name, action, contentSha256: switched.contentSha256 });+ }+ if (problems.length) return { status: 422, body: { error: `Nothing was changed. ${problems.join("; ")}` } };+ return { changes };+ }++ function appendCard(args: { requestId: string; from: BotRecord; threadId: string; changes: readonly Checked[]; applied: boolean }): string {+ const language = conversationLanguage(args.threadId);+ const count = args.changes.length;+ const teammates = args.changes.map(({ botId, botName, name, action }) => ({ botId, botName, name, action }));+ const preview = teammates.map((change) =>+ serverLine(language, change.action === "enable" ? "server.teammateSkills.on" : "server.teammateSkills.off", { bot: change.botName, name: change.name })).join("\n");+ const payload: SkillRequestCardData = {+ version: 1, requestId: args.requestId, botId: args.from.id, threadId: args.threadId, stagedId: `teammates-${args.requestId}`,+ action: teammates.every((change) => change.action === "disable") ? "disable" : "enable",+ name: [...new Set(teammates.map((change) => change.name))].join(", "), gist: "",+ preview, sha256: createHash("sha256").update(preview).digest("hex"), warnings: [], createdAt: Date.now(), teammates,+ };+ const title = serverLine(language, "server.teammateSkills.title", { count });+ const done = serverLine(language, "server.teammateSkills.done", { count });+ store.appendMessage(args.threadId, {+ role: "bot", kind: "options", from: { botId: args.from.id, name: args.from.name, color: args.from.color },+ card: {+ title, subtitle: serverLine(language, "server.teammateSkills.body"), options: args.applied ? [] : ["Apply", "Deny"],+ ...(args.applied ? { answered: "allow" as const, autoApplied: true, title: done } : {}),+ requestId: args.requestId, tool: "stage_skill", skillRequest: payload,+ },+ });+ return args.applied ? done : title;+ }++ /** skill_manage action "teammates", from a Chief of Staff. */+ function stage(from: BotRecord, threadId: string, body: Record<string, unknown>, direct: DirectApply | null): Result {+ if (!chiefLevel(from)) return { status: 403, body: { error: "Only a Chief of Staff can change its teammates' skills. Turn your own on or off with action enable or disable." } };+ const asked = checked(from, body);+ if ("status" in asked) return asked;+ // In a room, always the card: words a teammate posted there must not change bots' skills by themselves.+ const applies = store.groupByThread(threadId) ? null : direct;+ const persistence = deps.persistence(from.id, threadId, !applies);+ if (!persistence.ok) return { status: persistence.status, body: { error: persistence.error } };+ const requestId = randomUUID();+ if (applies) {+ const turned = turnAll(steps(asked.changes));+ if ("error" in turned) return { status: 422, body: { state: "failed", error: turned.error } };+ const done = appendCard({ requestId, from, threadId, changes: asked.changes, applied: true });+ appendDecision(deps.dataDir, { threadId, requestId, botId: from.id, botName: from.name, tool: "stage_skill", summary: done, decision: "auto-approved", source: applies });+ deps.noteSkillChange(from.id, threadId);+ return { status: 201, body: { state: "applied", changes: asked.changes.length, summary: `${done}.` } };+ }+ const record: TeammateSkillsRecord = { chiefId: from.id, changes: asked.changes.map(({ botId, name, action, contentSha256 }) => ({ botId, name, action, contentSha256 })) };+ mkdirSync(dirname(recordPath(requestId)), { recursive: true, mode: 0o700 });+ writeFileAtomic(recordPath(requestId), `${JSON.stringify(record)}\n`, { mode: 0o600 });+ let summary: string;+ try {+ summary = appendCard({ requestId, from, threadId, changes: asked.changes, applied: false });+ } catch (error) {+ dropRecord(requestId);+ throw error;+ }+ appendDecision(deps.dataDir, { threadId, requestId, botId: from.id, botName: from.name, tool: "stage_skill", summary, decision: "card-shown", source: "skill" });+ return { status: 201, body: { state: "pending", changes: asked.changes.length, summary } };+ }++ /** The person's answer on the card: approval turns every listed skill, while each is still as the card showed it. */+ function resolve(args: { botId: string; botName?: string; threadId: string; requestId: string; behavior: "allow" | "deny" | "answer"; reviewedSha256?: string },+ messageId: string, card: OptionCardData, request: SkillRequestCardData):+ | { claimed: true; status: number; error: string }+ | { claimed: true; outcome: "allowed-once" | "rejected"; alreadySettled?: true } {+ if (card.answered || card.dismissed) return { claimed: true, outcome: card.answered === "allow" ? "allowed-once" : "rejected", alreadySettled: true };+ const decided = (decision: "user-approved" | "user-denied") => appendDecision(deps.dataDir, { threadId: args.threadId,+ requestId: args.requestId, botId: args.botId, botName: args.botName, tool: card.tool, summary: card.title ?? card.subtitle, decision, source: "user" });+ if (args.behavior !== "allow") {+ store.patchMessage(args.threadId, messageId, { card: { ...card, answered: "deny", dismissed: true, held: undefined } });+ dropRecord(request.requestId);+ decided("user-denied");+ return { claimed: true, outcome: "rejected" };+ }+ if (!request.sha256 || args.reviewedSha256 !== request.sha256) return { claimed: true, status: 409, error: "reviewedSha256 must match the changes shown on the approval card" };+ const record = request.requestId === args.requestId ? readRecord(request.requestId) : null;+ if (!record || record.chiefId !== args.botId) return { claimed: true, status: 422, error: "this approval card no longer matches its changes" };+ const problems = record.changes.flatMap((change) => {+ const target = store.bot(change.botId);+ if (!target) return [`${change.botId}: that bot no longer exists`];+ const refused = deps.refusal(args.botId, target.id);+ const still = refused ? { error: refused } : skillSwitchStillMatches(change.name, change.action, deps.skill(target, change.name), change.contentSha256);+ return "error" in still ? [`${target.name}: ${still.error}`] : [];+ });+ const turned = problems.length ? { error: `Nothing was changed. ${problems.join("; ")}` } : turnAll(steps(record.changes));+ if ("error" in turned) {+ store.patchMessage(args.threadId, messageId, { card: { ...card, held: turned.error } });+ return { claimed: true, status: 422, error: turned.error };+ }+ const done = serverLine(conversationLanguage(args.threadId), "server.teammateSkills.done", { count: record.changes.length });+ store.patchMessage(args.threadId, messageId, { card: { ...card, answered: "allow", held: undefined, title: done } });+ deps.noteSkillChange(args.botId, args.threadId);+ decided("user-approved");+ dropRecord(request.requestId);+ return { claimed: true, outcome: "allowed-once" };+ }++ /** Turns every listed skill back, or none: refuses, changing nothing, once any of them moved on since. */+ function undo(botId: string, threadId: string, message: Message, request: SkillRequestCardData):+ | { claimed: true; state: "undone" }+ | { claimed: true; state: "invalid"; error: string; status: number; stale?: true } {+ const changes = request.teammates ?? [];+ const moved = changes.some((change) => {+ const target = store.bot(change.botId);+ const current = target ? deps.skill(target, change.name) : undefined;+ return !current || current.kind === "fixed" || current.enabled !== (change.action === "enable");+ });+ if (!changes.length || moved) return { claimed: true, state: "invalid", error: UNDO_STALE, status: 409, stale: true };+ const undone = turnAll(steps(changes, true));+ if ("error" in undone) return { claimed: true, state: "invalid", error: undone.error, status: 409 };+ if (message.card) store.patchMessage(threadId, message.id, { card: { ...message.card, undone: true } });+ deps.noteSkillChange(botId, threadId);+ return { claimed: true, state: "undone" };+ }++ return { stage, resolve, undo };+}diff --git a/server/index.ts b/server/index.tsindex ab9743f755..aa2705dcdb 100644--- a/server/index.ts+++ b/server/index.ts@@ -395,7 +395,7 @@ import { pickBotName } from "./names.ts";import { botSkillTemplateSchema, newBotApproval, newBotDefaultsSchema } from "./new-bot-defaults.ts";import { expandLearnTurnText, learnSource } from "./skill-learn.ts";import { connectedAppsForSetup, expandSetupTurnText, setupModeActive, setupSystemPrompt, type SetupConnectedApps } from "./setup-mode.ts"; import { forgetSetupPresser, setupPresser, setupTurnText, takeSetupRequest } from "./setup-request.ts"; import { setupSuggestionsFor } from "./setup-suggestions.ts"; import { createSetupRequestRoutes } from "./routes/setup-request.ts";-import { isSkillSwitchAction, type SkillRequestCardData } from "../shared/skill-request.ts"; import { createSkillSwitchHost } from "./host/skill-switch-host.ts";+import { isSkillSwitchAction, type SkillRequestCardData } from "../shared/skill-request.ts"; import { createSkillSwitchHost } from "./host/skill-switch-host.ts"; import { createTeammateSkillsHost } from "./host/teammate-skills-host.ts";import { checkSoulDrift, readSoulDrift, soulFile, writeSoulMirror } from "./bot-folder.ts";import {botPersona,@@ -9262,7 +9262,7 @@ function undoSkillCard(botId: string, threadId: string, messageId: string): Undoreturn { claimed: true, state: "invalid", error: "Only a change that applied on its own can be undone here.", status: 409 };}if (request.botId !== botId || request.threadId !== threadId) return { claimed: true, state: "invalid", error: "this skill request belongs to a different bot", status: 403 };- const action = request.action; if (request.allBots) return allBotsSkills.undo(botId, threadId, message, request); if (isSkillSwitchAction(action)) return skillSwitch.undo(botId, threadId, message, { ...request, action });+ const action = request.action; if (request.teammates) return teammateSkills.undo(botId, threadId, message, request); if (request.allBots) return allBotsSkills.undo(botId, threadId, message, request); if (isSkillSwitchAction(action)) return skillSwitch.undo(botId, threadId, message, { ...request, action });if (request.shared) return skillsHost.undoReceipt(botId, threadId, message, { ...request, action, shared: request.shared });const undone = undoSkillWrite(botId, { stagedId: request.stagedId, name: request.name, action,...(request.previous ? { previous: { skillMd: request.previous.preview, source: request.previous.source, references: request.previous.references ?? [] } } : {}),@@ -11142,7 +11142,7 @@ function appendSkillRequestCard(args: {};}-const skillSwitch = createSkillSwitchHost({ store, dataDir: DATA_DIR, persistence: skillProposalPersistence, listBotSkills, readBotSkillFile, noteSkillChange: (botId, threadId) => skillReview.noteSkillChange(botId, threadId) }); wireAllBotsSkills({ team: Boolean(CLOUD_TEAM), sharedWithoutTeam: () => !CLOUD_TEAM && sharedMembership(), bot: (id) => store.bot(id), bots: () => store.bots }); const allBotsSkills = createSkillsForAllBotsHost({ store, dataDir: DATA_DIR, persistence: skillProposalPersistence, noteSkillChange: (botId, threadId) => skillReview.noteSkillChange(botId, threadId) });+const skillSwitch = createSkillSwitchHost({ store, dataDir: DATA_DIR, persistence: skillProposalPersistence, listBotSkills, readBotSkillFile, noteSkillChange: (botId, threadId) => skillReview.noteSkillChange(botId, threadId) }); const teammateSkills = createTeammateSkillsHost({ store, dataDir: DATA_DIR, persistence: skillProposalPersistence, refusal: chiefPeerTargetRule("skills"), skill: skillSwitch.switchableSkill, turn: skillSwitch.turn, noteSkillChange: (botId, threadId) => skillReview.noteSkillChange(botId, threadId) }); wireAllBotsSkills({ team: Boolean(CLOUD_TEAM), sharedWithoutTeam: () => !CLOUD_TEAM && sharedMembership(), bot: (id) => store.bot(id), bots: () => store.bots }); const allBotsSkills = createSkillsForAllBotsHost({ store, dataDir: DATA_DIR, persistence: skillProposalPersistence, noteSkillChange: (botId, threadId) => skillReview.noteSkillChange(botId, threadId) });function resolveSkillRequest(args: {botId: string;botName?: string;@@ -11163,7 +11163,7 @@ function resolveSkillRequest(args: {if (request.botId !== args.botId) {return { claimed: true, status: 403, error: "this skill request belongs to a different bot" };}- if (request.allBots) return allBotsSkills.resolve(args, message.id, card, request); if (isSkillSwitchAction(request.action)) return skillSwitch.resolve(args, message.id, card, { ...request, action: request.action });+ if (request.teammates) return teammateSkills.resolve(args, message.id, card, request); if (request.allBots) return allBotsSkills.resolve(args, message.id, card, request); if (isSkillSwitchAction(request.action)) return skillSwitch.resolve(args, message.id, card, { ...request, action: request.action });if (card.answered || card.dismissed) {const cleanup = rejectStagedSkillWrite(args.botId, request.stagedId);if ("applied" in cleanup && cleanup.applied && card.answered !== "allow") {@@ -13402,6 +13402,7 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {if (!connectorThread(from.id, fromThreadId)) {return json(res, 403, { error: "source conversation does not belong to sender" });}+ if (received.action === "teammates") { const staged = teammateSkills.stage(from, fromThreadId, received, appliesDirectly(from.id, fromThreadId)); return json(res, staged.status, staged.body); }const everywhere = await allBotsSkills.stage(from, fromThreadId, received, () => appliesDirectly(from.id, fromThreadId), (asked) => importedSkillRequest(asked, fetch, callSignal, () => skillImportToken(gitAudience(fromThreadId))), () => internalCapabilityIsActive(internalCapability) && skillAuthoringEnabled(cfg), () => (CLOUD_TEAM ? actingPeople.requester(fromThreadId, internalCapability.generation) : null)); if (everywhere) return json(res, everywhere.status, everywhere.body); if (isSkillSwitchAction(received.action)) { const staged = skillSwitch.stage(from, fromThreadId, received.action, received, appliesDirectly(from.id, fromThreadId)); return json(res, staged.status, staged.body); }const body = await importedSkillRequest(received, fetch, callSignal, () => skillImportToken(gitAudience(fromThreadId))); if ("importError" in body) return json(res, 422, { error: body.importError }); if (!internalCapabilityIsActive(internalCapability)) return json(res, 401, { error: TURN_ENDED_REFUSAL }); if (!skillAuthoringEnabled(cfg)) return json(res, 403, { error: "skill authoring is not enabled in Settings" });const direct = appliesDirectly(from.id, fromThreadId);diff --git a/server/teammate-skills.e2e.test.ts b/server/teammate-skills.e2e.test.tsnew file mode 100644index 0000000000..10fab9e0b0--- /dev/null+++ b/server/teammate-skills.e2e.test.ts@@ -0,0 +1,81 @@+// A Chief of Staff turns skills on and off for several teammates in one skill_manage call, through the real server+// and its injected tools; only the provider's planning is scripted. One receipt card lists them all, and one Undo puts+// every one back. A bot that is not a Chief cannot do it.+import { existsSync, readFileSync, writeFileSync } from "node:fs";+import { join } from "node:path";+import { expect, it } from "vitest";+import { launchVerificationServer, runControlOmb } from "../scripts/control-omb.ts";+import { waitForExit } from "./testing/cleanup.ts";++it("turns named skills on and off across a Chief's teammates with one call, and one Undo puts them all back", async () => {+ const fixture = await launchVerificationServer({}, undefined, undefined, undefined, undefined, { scripted: true });+ const { url, dataDir } = fixture.info;+ const planPath = join(dataDir, "room-plan.json");+ const plans: Record<string, { turns: unknown[] }> = {};+ const providerTurns = (): Array<{ botId: string; evidence: Array<{ step?: unknown; response: any }> }> => existsSync(`${planPath}.evidence.jsonl`)+ ? readFileSync(`${planPath}.evidence.jsonl`, "utf8").trim().split("\n").filter(Boolean).map((line) => JSON.parse(line)) : [];+ const api = async (method: string, path: string, body?: unknown) => {+ const response = await fetch(`${url}${path}`, { method, headers: { "content-type": "application/json", origin: url },+ ...(body === undefined ? {} : { body: JSON.stringify(body) }), signal: AbortSignal.timeout(10_000) });+ const result = await response.json() as any;+ expect(response.ok, `${method} ${path}: ${JSON.stringify(result)}`).toBe(true);+ return result;+ };+ const cli = (...args: string[]) => runControlOmb([...args, "--url", url]) as Promise<any>;+ const enabled = async (bot: { id: string }, name: string) =>+ ((await api("GET", `/api/bots/${bot.id}/skills`)).skills as any[]).find((skill) => skill.name === name)?.enabled;+ const run = async (bot: { id: string; activeTaskId: string }, text: string, steps: unknown[]) => {+ const before = providerTurns().length;+ (plans[bot.id] ??= { turns: [] }).turns.push({ steps, reply: `Done: ${text}` });+ writeFileSync(planPath, JSON.stringify(plans));+ await cli("send", "--bot", bot.id, "--task", bot.activeTaskId, "--text", text);+ await expect.poll(() => providerTurns().length, { timeout: 25_000 }).toBe(before + 1);+ expect((await cli("wait", "--bot", bot.id, "--task", bot.activeTaskId, "--timeout", "25")).status).toBe("settled");+ return providerTurns().slice(before)[0]!.evidence.filter((entry) => entry.step).map((entry) => entry.response.result.content[0].text as string);+ };+ const skillMd = (name: string) => `---\nname: ${name}\ndescription: Does ${name} the way this person likes.\n---\n\n# ${name}\n\nFollow the person's steps.\n`;+ try {+ const chief = (await cli("new-bot", "--name", "Clive", "--section", "Operations")).bot;+ await api("PATCH", `/api/bots/${chief.id}`, { chiefOfStaff: true });+ const ada = (await cli("new-bot", "--name", "Ada", "--section", "Operations")).bot;+ const bea = (await cli("new-bot", "--name", "Bea", "--section", "Operations")).bot;+ await api("PATCH", "/api/config", { features: { skillAuthoring: true } });++ await run(ada, "Save my research skill, and keep it off for now.", [+ { tool: "skill_manage", arguments: { action: "create", skill_md: skillMd("research"), source: "conversation" }, expectError: false },+ { tool: "skill_manage", arguments: { action: "disable", skill_name: "research" }, expectError: false },+ ]);+ await run(bea, "Save my lint skill.", [+ { tool: "skill_manage", arguments: { action: "create", skill_md: skillMd("lint"), source: "conversation" }, expectError: false },+ ]);+ expect([await enabled(ada, "research"), await enabled(bea, "lint")]).toEqual([false, true]);++ const [refused] = await run(ada, "Turn off Bea's lint skill.", [+ { tool: "skill_manage", arguments: { action: "teammates", changes: [{ bot_id: bea.id, skill_name: "lint", on: false }] }, expectError: true },+ ]);+ expect(refused).toContain("Only a Chief of Staff");+ expect(await enabled(bea, "lint")).toBe(true);++ const [changed] = await run(chief, "Turn on Ada's research skill and turn off Bea's lint skill.", [+ { tool: "skill_manage", arguments: { action: "teammates", changes: [+ { bot_id: ada.id, skill_name: "research", on: true },+ { bot_id: bea.id, skill_name: "lint", on: false },+ ] }, expectError: false },+ ]);+ expect(changed).not.toContain("confirmation card");+ expect([await enabled(ada, "research"), await enabled(bea, "lint")]).toEqual([true, false]);++ const receipts = ((await api("GET", `/api/threads/${chief.activeTaskId}/messages?limit=50`)).messages as any[]).filter((message) => message.card?.skillRequest);+ expect(receipts).toHaveLength(1);+ const receipt = receipts[0].card;+ expect(receipt).toMatchObject({ autoApplied: true, answered: "allow", skillRequest: { teammates: [+ { botId: ada.id, botName: "Ada", name: "research", action: "enable" },+ { botId: bea.id, botName: "Bea", name: "lint", action: "disable" },+ ] } });++ expect(await api("POST", `/api/threads/${chief.activeTaskId}/undo`, { requestId: receipt.requestId })).toMatchObject({ ok: true, undone: true });+ expect([await enabled(ada, "research"), await enabled(bea, "lint")]).toEqual([false, true]);+ } finally {+ await waitForExit(fixture.child, { signal: "SIGTERM" });+ }+}, 120_000);diff --git a/src/components/ApprovalCard.test.ts b/src/components/ApprovalCard.test.tsindex b60f30e4ad..a87adba2bd 100644--- a/src/components/ApprovalCard.test.ts+++ b/src/components/ApprovalCard.test.ts@@ -723,6 +723,17 @@ describe("ApprovalCard for a change that applied on its own", () => {},}));expect(skill).toContain("Scout added a skill: file-expense");+ const teammates = render(applied({+ tool: "stage_skill",+ skillRequest: {+ version: 1, requestId: "s2", botId: "bot-1", threadId: "thread-1", stagedId: "teammates-s2", action: "enable",+ name: "research, lint", gist: "", warnings: [], createdAt: 1,+ teammates: [{ botId: "b2", botName: "Mira", name: "research", action: "enable" }, { botId: "b3", botName: "Ada", name: "lint", action: "disable" }],+ },+ }));+ expect(teammates).toContain("Scout changed skills on the team: research, lint");+ expect(teammates).not.toContain("turned on a skill");+ expect(teammates).toContain(">Undo<");});it("reads team setup and team memory as one line, with Undo except for a deletion", () => {diff --git a/src/components/ApprovalCard.tsx b/src/components/ApprovalCard.tsxindex 8cf7a1e9cb..a5a6af223d 100644--- a/src/components/ApprovalCard.tsx+++ b/src/components/ApprovalCard.tsx@@ -100,6 +100,7 @@ export function approvalCardOutcome(card: OptionCardData): string | undefined {const routineAction = card.routineRequest?.operation.action;if (routineAction) return t(ROUTINE_SETTLED_LABEL[routineAction]);const skillAction = card.skillRequest?.action;+ if (card.skillRequest?.teammates) return t("approval.status.teammateSkills");if (skillAction) return t(SKILL_SETTLED_LABEL[skillAction]);if (card.profileRequest) return t("approval.status.profileUpdated");if (card.modelRequest) return t("approval.status.modelChanged");@@ -190,7 +191,7 @@ export function appliedChange(card: OptionCardData, name: string): { line: strinconst skill = card.skillRequest;if (skill) {return {- line: t(SKILL_APPLIED_LINE[skill.action], { name, title: skill.allBots ? `${skill.name} · ${t("skills.allBots.tag")}` : skill.name }),+ line: t(skill.teammates ? "approval.applied.skill.teammates" : SKILL_APPLIED_LINE[skill.action], { name, title: skill.allBots ? `${skill.name} · ${t("skills.allBots.tag")}` : skill.name }),canUndo: skill.action === "create" || skill.action === "enable" || skill.action === "disable" || Boolean(skill.previous),};}diff --git a/src/components/SkillRequestPreview.tsx b/src/components/SkillRequestPreview.tsxindex 259d221358..c4decee4bd 100644--- a/src/components/SkillRequestPreview.tsx+++ b/src/components/SkillRequestPreview.tsx@@ -28,7 +28,7 @@ export function SkillRequestPreview({ request }: { request: SkillRequestCardData<div className="mt-3 rounded-lg border border-hairline/40 bg-inset p-3"><div className="flex flex-wrap items-center justify-between gap-2 text-[11px] text-ink-secondary"><span>- {t(REVIEW[request.action][request.references?.length ? 1 : 0])}+ {t(request.teammates ? "skills.request.reviewTeammates" : REVIEW[request.action][request.references?.length ? 1 : 0])}</span><span className="font-mono" title={`sha256 ${reviewedSha256}`}>sha256 {reviewedSha256.slice(0, 8)}diff --git a/src/locales/de.json b/src/locales/de.jsonindex 2026725353..403198ece7 100644--- a/src/locales/de.json+++ b/src/locales/de.json@@ -138,6 +138,11 @@"server.skillSwitch.delete.title": "Skill „{name}“ löschen?","server.skillSwitch.delete.body": "Entfernt diesen Skill mit all seinen Dateien endgültig vom Bot. Seine SKILL.md steht unten, Geheimnisse sind ausgeblendet.","server.skillSwitch.delete.done": "Skill „{name}“ gelöscht",+ "server.teammateSkills.title": "Skills in deinem Team ändern ({count})?",+ "server.teammateSkills.body": "Schaltet jeden Skill unten für das jeweilige Teammitglied ein oder aus, alle auf einmal. Lässt sich einer nicht ändern, ändert sich keiner.",+ "server.teammateSkills.done": "Skills in deinem Team geändert ({count})",+ "server.teammateSkills.on": "@{bot}: „{name}“ einschalten",+ "server.teammateSkills.off": "@{bot}: „{name}“ ausschalten","server.allBotsSkill.create.title": "Skill „{name}“ auf alle deine Bots legen?","server.allBotsSkill.create.done": "Skill „{name}“ ist auf allen deinen Bots","server.allBotsSkill.update.title": "Skill „{name}“ auf allen deinen Bots aktualisieren?",@@ -4555,5 +4560,8 @@"server.github.card.description": "Verbinde GitHub, damit {bot} seine Arbeit in deine Repositorys pushen kann.","server.github.card.connectInApps": "Verbinde GitHub über diese Karte in der App auf deinem Computer oder unter Apps.","githubSignIn.title": "GitHub-Anmeldung",- "githubSignIn.tokenPlaceholder": "github_pat_…"+ "githubSignIn.tokenPlaceholder": "github_pat_…",+ "approval.status.teammateSkills": "Team-Skills geändert",+ "approval.applied.skill.teammates": "{name} hat Skills im Team geändert: {title}",+ "skills.request.reviewTeammates": "Prüfe jede Änderung, bevor du sie anwendest"}diff --git a/src/locales/en.json b/src/locales/en.jsonindex 98b2d9b80f..839efc0144 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -277,6 +277,11 @@"server.skillSwitch.delete.title": "Delete skill \"{name}\"?","server.skillSwitch.delete.body": "Removes this skill and all its files from the bot for good. Its SKILL.md is shown below, with any secrets hidden.","server.skillSwitch.delete.done": "Skill \"{name}\" deleted",+ "server.teammateSkills.title": "Change skills on your team ({count})?",+ "server.teammateSkills.body": "Turns each skill below on or off for that teammate, all at once. If one can't change, none do.",+ "server.teammateSkills.done": "Skills changed on your team ({count})",+ "server.teammateSkills.on": "@{bot}: turn on \"{name}\"",+ "server.teammateSkills.off": "@{bot}: turn off \"{name}\"","server.allBotsSkill.create.title": "Put skill \"{name}\" on all your bots?","server.allBotsSkill.create.done": "Skill \"{name}\" is on all your bots","server.allBotsSkill.update.title": "Update skill \"{name}\" on all your bots?",@@ -1129,6 +1134,7 @@"approval.status.skillTurnedOn": "Skill turned on","approval.status.skillTurnedOff": "Skill turned off","approval.status.skillDeleted": "Skill deleted",+ "approval.status.teammateSkills": "Team skills changed","approval.status.profileUpdated": "Profile updated","approval.status.routineConfirmed": "Routine confirmed","approval.status.skillConfirmed": "Skill confirmed",@@ -1149,6 +1155,7 @@"approval.applied.skill.enable": "{name} turned on a skill: {title}","approval.applied.skill.disable": "{name} turned off a skill: {title}","approval.applied.skill.delete": "{name} deleted a skill: {title}",+ "approval.applied.skill.teammates": "{name} changed skills on the team: {title}","approval.applied.appSetting": "{name} changed {title}","approval.applied.profileOwn": "{name} updated its profile: {title}","approval.applied.profileOther": "{name} updated {target}'s profile: {title}",@@ -9436,6 +9443,7 @@"skills.request.reviewTurnOffRefs": "Review the complete SKILL.md and its reference files before turning it off","skills.request.reviewDelete": "Review the complete SKILL.md before deleting it","skills.request.reviewDeleteRefs": "Review the complete SKILL.md and its reference files before deleting it",+ "skills.request.reviewTeammates": "Review every change before applying it","skills.source": "Source: {source}","skills.sourceUnknown": "Unknown","skills.fullSkill": "Full SKILL.md for {name}",diff --git a/src/locales/it.json b/src/locales/it.jsonindex 07d95ba269..f611f23a8c 100644--- a/src/locales/it.json+++ b/src/locales/it.json@@ -277,6 +277,11 @@"server.skillSwitch.delete.title": "Eliminare abilità \"{name}\"?","server.skillSwitch.delete.body": "Rimuove questa abilità e tutti i suoi file dal bot per sempre. Il suo SKILL.md è mostrato qui sotto, con tutti i segreti nascosti.","server.skillSwitch.delete.done": "Abilità “{name}” eliminata",+ "server.teammateSkills.title": "Cambiare le abilità del tuo team ({count})?",+ "server.teammateSkills.body": "Attiva o disattiva ogni abilità qui sotto per quel compagno di team, tutte insieme. Se una non può cambiare, non cambia nessuna.",+ "server.teammateSkills.done": "Abilità del tuo team cambiate ({count})",+ "server.teammateSkills.on": "@{bot}: attiva \"{name}\"",+ "server.teammateSkills.off": "@{bot}: disattiva \"{name}\"","server.allBotsSkill.create.title": "Mettere l'abilità \"{name}\" su tutti i tuoi bot?","server.allBotsSkill.create.done": "L'abilità \"{name}\" è su tutti i tuoi bot","server.allBotsSkill.update.title": "Aggiornare l'abilità \"{name}\" su tutti i tuoi bot?",@@ -1118,6 +1123,7 @@"approval.status.skillTurnedOn": "Skill attivata","approval.status.skillTurnedOff": "Competenza disattivata","approval.status.skillDeleted": "Tecnica eliminata.",+ "approval.status.teammateSkills": "Abilità del team cambiate","approval.status.profileUpdated": "Profilo aggiornato","approval.status.routineConfirmed": "Routine confermata","approval.status.skillConfirmed": "Abilità confermata",@@ -1138,6 +1144,7 @@"approval.applied.skill.enable": "{name} ha attivato un'abilità: {title}","approval.applied.skill.disable": "{name} ha disattivato una competenza: {title}","approval.applied.skill.delete": "{name} ha eliminato una competenza: {title}",+ "approval.applied.skill.teammates": "{name} ha cambiato le abilità del team: {title}","approval.applied.appSetting": "{name} cambiata {title}","approval.applied.profileOwn": "{name} ha aggiornato il suo profilo: {title}","approval.applied.profileOther": "{name} ha aggiornato il profilo di {target}: {title}",@@ -9303,6 +9310,7 @@"skills.request.reviewTurnOffRefs": "Leggi il SKILL.md completo e i file di riferimento prima di disattivarla","skills.request.reviewDelete": "Leggi il SKILL.md completo prima di eliminarla","skills.request.reviewDeleteRefs": "Leggi il SKILL.md completo e i file di riferimento prima di eliminarla",+ "skills.request.reviewTeammates": "Controlla ogni modifica prima di applicarla","skills.source": "Origine: {source}","skills.sourceUnknown": "Sconosciuta","skills.fullSkill": "SKILL.md completo per {name}",diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex 510042e91e..ab8fcd285f 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -258,6 +258,11 @@"server.skillSwitch.delete.title": "Excluir a habilidade “{name}”?","server.skillSwitch.delete.body": "Remove esta habilidade e todos os arquivos dela do bot de forma definitiva. O SKILL.md aparece abaixo, com os segredos ocultos.","server.skillSwitch.delete.done": "Habilidade “{name}” excluída",+ "server.teammateSkills.title": "Mudar habilidades da sua equipe ({count})?",+ "server.teammateSkills.body": "Liga ou desliga cada habilidade abaixo para esse colega de equipe, todas de uma vez. Se uma não puder mudar, nenhuma muda.",+ "server.teammateSkills.done": "Habilidades da sua equipe alteradas ({count})",+ "server.teammateSkills.on": "@{bot}: ligar “{name}”",+ "server.teammateSkills.off": "@{bot}: desligar “{name}”","server.allBotsSkill.create.title": "Colocar a habilidade “{name}” em todos os seus bots?","server.allBotsSkill.create.done": "A habilidade “{name}” está em todos os seus bots","server.allBotsSkill.update.title": "Atualizar a habilidade “{name}” em todos os seus bots?",@@ -1101,6 +1106,7 @@"approval.status.skillTurnedOn": "Habilidade ligada","approval.status.skillTurnedOff": "Habilidade desligada","approval.status.skillDeleted": "Habilidade excluída",+ "approval.status.teammateSkills": "Habilidades da equipe alteradas","approval.status.profileUpdated": "Perfil atualizado","approval.status.routineConfirmed": "Rotina confirmada","approval.status.skillConfirmed": "Habilidade confirmada",@@ -1121,6 +1127,7 @@"approval.applied.skill.enable": "{name} ligou uma habilidade: {title}","approval.applied.skill.disable": "{name} desligou uma habilidade: {title}","approval.applied.skill.delete": "{name} excluiu uma habilidade: {title}",+ "approval.applied.skill.teammates": "{name} mudou habilidades da equipe: {title}","approval.applied.profileOwn": "{name} atualizou o próprio perfil: {title}","approval.applied.profileOther": "{name} atualizou o perfil de {target}: {title}","approval.applied.modelOwn": "{name} mudou o próprio modelo padrão: {title}",@@ -9381,6 +9388,7 @@"skills.request.reviewTurnOffRefs": "Revise o SKILL.md completo e os arquivos de referência dele antes de desligar a habilidade","skills.request.reviewDelete": "Revise o SKILL.md completo antes de excluir a habilidade","skills.request.reviewDeleteRefs": "Revise o SKILL.md completo e os arquivos de referência dele antes de excluir a habilidade",+ "skills.request.reviewTeammates": "Revise cada mudança antes de aplicar","skills.source": "Origem: {source}","skills.sourceUnknown": "Desconhecida","skills.fullSkill": "SKILL.md completo de {name}",diff --git a/src/locales/source-hashes.json b/src/locales/source-hashes.jsonindex 2a794bae13..f3a7339258 100644--- a/src/locales/source-hashes.json+++ b/src/locales/source-hashes.json@@ -4550,7 +4550,15 @@"room.feed.closedOne": "6792d51731f6be16a6353dbd331b4440bb594d60db6030c155b9f294a4cd3e82","room.feed.closedMany": "1ede71ae8b3ba54d101766e0955aca958b399e0f1ca1531e3753c702c2cc6023","room.thread.backToFeed": "11b2bf44df264af7dbb26dfd164187bd2ce06ba8cf6a756567c49b6ca1604041",- "room.thread.closedBy": "7bf48be497dd9e969da16b8530b7176c21a8738d7653ef965f516da79e51928e"+ "room.thread.closedBy": "7bf48be497dd9e969da16b8530b7176c21a8738d7653ef965f516da79e51928e",+ "server.teammateSkills.title": "80aee94b9f40f525d5de4676927f6ea143dd9d76091069df83be0d73e2951733",+ "server.teammateSkills.body": "81f507037b13cb3be602ffdc3f88a985cb89fd02df63a4a7ed059d5eee802e5c",+ "server.teammateSkills.done": "ef24e04d065b92d8d2d213decc94d4d9f4e1d6235851bdfde5c617458524cbf5",+ "server.teammateSkills.on": "f447b4e3c84611c45abf3ca8d7174dc77514ffea33c7a81e30024483a2ff15eb",+ "server.teammateSkills.off": "78c859c67fae46c022defa20fa5432aa40d72b661bf98a197e439d100c554831",+ "approval.status.teammateSkills": "b830163e051fe1a5a3e4d90cc7ea09da116ea95efa75360c6cf175e25de95aeb",+ "approval.applied.skill.teammates": "a9f337ca8c48f80ae0f963dd024d2b721c2ee9bfa40667f427a15f2c64d3a913",+ "skills.request.reviewTeammates": "5a034d3c78251df4a06bd944b7ed73f154e6af862400ba2cf3e386555092f62d"},"es": {"whop.description": "1a07cf04ef17029448d3781415cbac16d54e66b821907a40d94e0e6349710e70",@@ -40052,7 +40060,15 @@"localApps.install.uninstall": "fe199528850a4e24c14d9ece87a07b40bdcfa5fe504c175c117b997c29259ca6","localApps.install.installed": "f8b32f4e92bd84ce1fcd177bec17d43093de3ee8303bb40c1b9ea521ed6a70f6","localApps.install.failed": "9b0331da691337f15b40d786c9e501c73e2751e11904b083ea961196889b0e2e",- "localApps.install.uninstallFailed": "71fe76dda0814876ed5386f4cd9ea801883d4e430f6cb1c3b58f58136e0e9214"+ "localApps.install.uninstallFailed": "71fe76dda0814876ed5386f4cd9ea801883d4e430f6cb1c3b58f58136e0e9214",+ "server.teammateSkills.title": "80aee94b9f40f525d5de4676927f6ea143dd9d76091069df83be0d73e2951733",+ "server.teammateSkills.body": "81f507037b13cb3be602ffdc3f88a985cb89fd02df63a4a7ed059d5eee802e5c",+ "server.teammateSkills.done": "ef24e04d065b92d8d2d213decc94d4d9f4e1d6235851bdfde5c617458524cbf5",+ "server.teammateSkills.on": "f447b4e3c84611c45abf3ca8d7174dc77514ffea33c7a81e30024483a2ff15eb",+ "server.teammateSkills.off": "78c859c67fae46c022defa20fa5432aa40d72b661bf98a197e439d100c554831",+ "approval.status.teammateSkills": "b830163e051fe1a5a3e4d90cc7ea09da116ea95efa75360c6cf175e25de95aeb",+ "approval.applied.skill.teammates": "a9f337ca8c48f80ae0f963dd024d2b721c2ee9bfa40667f427a15f2c64d3a913",+ "skills.request.reviewTeammates": "5a034d3c78251df4a06bd944b7ed73f154e6af862400ba2cf3e386555092f62d"},"zh": {"pro.fromPrice": "a48a04a457d60b08b54fc83e7a6c4584ffedb1e23621859084900c8521a3af7b",@@ -50527,7 +50543,15 @@"together.notice.background": "060d0df4c05d254b755e1d72633dc83f312cb0016bc847751608863c9b330ef6","rail.together": "63e2f9d95311f58cf165f5f0a29ce9cac35cd36d88c1f393ec15148acae4157a","settings.features.suggestedReplies": "ad9bf4351095386d5bac872bb520ff9168787e3cb055f3b054c8e0b2b5f30120",- "settings.features.suggestedRepliesLine": "e7617f08b418ada91e6ad48ed1e07ce796dc576ce7410af5e85b618cd7fe0816"+ "settings.features.suggestedRepliesLine": "e7617f08b418ada91e6ad48ed1e07ce796dc576ce7410af5e85b618cd7fe0816",+ "server.teammateSkills.title": "80aee94b9f40f525d5de4676927f6ea143dd9d76091069df83be0d73e2951733",+ "server.teammateSkills.body": "81f507037b13cb3be602ffdc3f88a985cb89fd02df63a4a7ed059d5eee802e5c",+ "server.teammateSkills.done": "ef24e04d065b92d8d2d213decc94d4d9f4e1d6235851bdfde5c617458524cbf5",+ "server.teammateSkills.on": "f447b4e3c84611c45abf3ca8d7174dc77514ffea33c7a81e30024483a2ff15eb",+ "server.teammateSkills.off": "78c859c67fae46c022defa20fa5432aa40d72b661bf98a197e439d100c554831",+ "approval.status.teammateSkills": "b830163e051fe1a5a3e4d90cc7ea09da116ea95efa75360c6cf175e25de95aeb",+ "approval.applied.skill.teammates": "a9f337ca8c48f80ae0f963dd024d2b721c2ee9bfa40667f427a15f2c64d3a913",+ "skills.request.reviewTeammates": "5a034d3c78251df4a06bd944b7ed73f154e6af862400ba2cf3e386555092f62d"},"zh-tw": {"whop.description": "1a07cf04ef17029448d3781415cbac16d54e66b821907a40d94e0e6349710e70",@@ -61092,7 +61116,15 @@"together.notice.background": "060d0df4c05d254b755e1d72633dc83f312cb0016bc847751608863c9b330ef6","rail.together": "63e2f9d95311f58cf165f5f0a29ce9cac35cd36d88c1f393ec15148acae4157a","settings.features.suggestedReplies": "ad9bf4351095386d5bac872bb520ff9168787e3cb055f3b054c8e0b2b5f30120",- "settings.features.suggestedRepliesLine": "e7617f08b418ada91e6ad48ed1e07ce796dc576ce7410af5e85b618cd7fe0816"+ "settings.features.suggestedRepliesLine": "e7617f08b418ada91e6ad48ed1e07ce796dc576ce7410af5e85b618cd7fe0816",+ "server.teammateSkills.title": "80aee94b9f40f525d5de4676927f6ea143dd9d76091069df83be0d73e2951733",+ "server.teammateSkills.body": "81f507037b13cb3be602ffdc3f88a985cb89fd02df63a4a7ed059d5eee802e5c",+ "server.teammateSkills.done": "ef24e04d065b92d8d2d213decc94d4d9f4e1d6235851bdfde5c617458524cbf5",+ "server.teammateSkills.on": "f447b4e3c84611c45abf3ca8d7174dc77514ffea33c7a81e30024483a2ff15eb",+ "server.teammateSkills.off": "78c859c67fae46c022defa20fa5432aa40d72b661bf98a197e439d100c554831",+ "approval.status.teammateSkills": "b830163e051fe1a5a3e4d90cc7ea09da116ea95efa75360c6cf175e25de95aeb",+ "approval.applied.skill.teammates": "a9f337ca8c48f80ae0f963dd024d2b721c2ee9bfa40667f427a15f2c64d3a913",+ "skills.request.reviewTeammates": "5a034d3c78251df4a06bd944b7ed73f154e6af862400ba2cf3e386555092f62d"},"uk": {"pro.fromPrice": "a48a04a457d60b08b54fc83e7a6c4584ffedb1e23621859084900c8521a3af7b",@@ -104853,7 +104885,15 @@"together.notice.background": "060d0df4c05d254b755e1d72633dc83f312cb0016bc847751608863c9b330ef6","rail.together": "63e2f9d95311f58cf165f5f0a29ce9cac35cd36d88c1f393ec15148acae4157a","settings.features.suggestedReplies": "ad9bf4351095386d5bac872bb520ff9168787e3cb055f3b054c8e0b2b5f30120",- "settings.features.suggestedRepliesLine": "e7617f08b418ada91e6ad48ed1e07ce796dc576ce7410af5e85b618cd7fe0816"+ "settings.features.suggestedRepliesLine": "e7617f08b418ada91e6ad48ed1e07ce796dc576ce7410af5e85b618cd7fe0816",+ "server.teammateSkills.title": "80aee94b9f40f525d5de4676927f6ea143dd9d76091069df83be0d73e2951733",+ "server.teammateSkills.body": "81f507037b13cb3be602ffdc3f88a985cb89fd02df63a4a7ed059d5eee802e5c",+ "server.teammateSkills.done": "ef24e04d065b92d8d2d213decc94d4d9f4e1d6235851bdfde5c617458524cbf5",+ "server.teammateSkills.on": "f447b4e3c84611c45abf3ca8d7174dc77514ffea33c7a81e30024483a2ff15eb",+ "server.teammateSkills.off": "78c859c67fae46c022defa20fa5432aa40d72b661bf98a197e439d100c554831",+ "approval.status.teammateSkills": "b830163e051fe1a5a3e4d90cc7ea09da116ea95efa75360c6cf175e25de95aeb",+ "approval.applied.skill.teammates": "a9f337ca8c48f80ae0f963dd024d2b721c2ee9bfa40667f427a15f2c64d3a913",+ "skills.request.reviewTeammates": "5a034d3c78251df4a06bd944b7ed73f154e6af862400ba2cf3e386555092f62d"},"ko": {"connectedWorkspaces.localTitle": "7d6deafeab011d734c3fdd1bfd6f69544fbb746a004019269bdb48544b01164b",diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.jsonindex dfeb1e9d53..812d8fa4e3 100644--- a/src/locales/zh-tw.json+++ b/src/locales/zh-tw.json@@ -255,6 +255,11 @@"server.skillSwitch.delete.title": "要刪除技能「{name}」嗎?","server.skillSwitch.delete.body": "從機器人中永久移除這個技能及其所有檔案。下方顯示它的 SKILL.md,並已隱藏所有機密資訊。","server.skillSwitch.delete.done": "已刪除技能「{name}」",+ "server.teammateSkills.title": "要變更團隊成員的技能({count})嗎?",+ "server.teammateSkills.body": "為對應的團隊成員開啟或關閉下面的每個技能,一次全部完成。只要有一個無法變更,就都不變更。",+ "server.teammateSkills.done": "已變更團隊成員的技能({count})",+ "server.teammateSkills.on": "@{bot}:開啟「{name}」",+ "server.teammateSkills.off": "@{bot}:關閉「{name}」","server.allBotsSkill.create.title": "要把技能「{name}」放到你所有的機器人上嗎?","server.allBotsSkill.create.done": "技能「{name}」已在你所有的機器人上","server.allBotsSkill.update.title": "要在你所有的機器人上更新技能「{name}」嗎?",@@ -975,6 +980,7 @@"approval.status.skillTurnedOn": "技能已開啟","approval.status.skillTurnedOff": "技能已關閉","approval.status.skillDeleted": "技能已刪除",+ "approval.status.teammateSkills": "團隊技能已變更","approval.status.profileUpdated": "已更新角色資料","approval.status.routineConfirmed": "已確認例行工作","approval.status.skillConfirmed": "已確認技能",@@ -995,6 +1001,7 @@"approval.applied.skill.enable": "{name} 開啟了一個技能:{title}","approval.applied.skill.disable": "{name} 關閉了一個技能:{title}","approval.applied.skill.delete": "{name} 刪除了一個技能:{title}",+ "approval.applied.skill.teammates": "{name} 變更了團隊的技能:{title}","approval.applied.profileOwn": "{name} 更新了自己的角色資料:{title}","approval.applied.profileOther": "{name} 更新了 {target} 的角色資料:{title}","approval.applied.modelOwn": "{name} 變更了自己的預設模型:{title}",@@ -8346,6 +8353,7 @@"skills.request.reviewTurnOffRefs": "關閉前請檢閱完整的 SKILL.md 及其參考檔案","skills.request.reviewDelete": "刪除前請檢閱完整的 SKILL.md","skills.request.reviewDeleteRefs": "刪除前請檢閱完整的 SKILL.md 及其參考檔案",+ "skills.request.reviewTeammates": "套用前請逐項檢閱每個變更","skills.source": "來源:{source}","skills.sourceUnknown": "未知","skills.fullSkill": "{name} 的完整 SKILL.md",diff --git a/src/locales/zh.json b/src/locales/zh.jsonindex d537380a15..ae35f794d4 100644--- a/src/locales/zh.json+++ b/src/locales/zh.json@@ -35,6 +35,11 @@"server.skillSwitch.delete.title": "删除技能“{name}”?","server.skillSwitch.delete.body": "会把这个技能及其所有文件从机器人中永久移除。下面显示它的 SKILL.md,其中的机密已被隐藏。","server.skillSwitch.delete.done": "技能“{name}”已删除",+ "server.teammateSkills.title": "更改团队成员的技能({count})?",+ "server.teammateSkills.body": "为对应的团队成员开启或关闭下面的每个技能,一次全部完成。只要有一个无法更改,就都不更改。",+ "server.teammateSkills.done": "已更改团队成员的技能({count})",+ "server.teammateSkills.on": "@{bot}:开启“{name}”",+ "server.teammateSkills.off": "@{bot}:关闭“{name}”","server.allBotsSkill.create.title": "要把技能“{name}”放到你的所有机器人上吗?","server.allBotsSkill.create.done": "技能“{name}”已在你的所有机器人上","server.allBotsSkill.update.title": "要在你的所有机器人上更新技能“{name}”吗?",@@ -655,9 +660,11 @@"approval.status.skillTurnedOn": "已开启技能","approval.status.skillTurnedOff": "已关闭技能","approval.status.skillDeleted": "已删除技能",+ "approval.status.teammateSkills": "团队技能已更改","approval.applied.skill.enable": "{name} 开启了一个技能:{title}","approval.applied.skill.disable": "{name} 关闭了一个技能:{title}","approval.applied.skill.delete": "{name} 删除了一个技能:{title}",+ "approval.applied.skill.teammates": "{name} 更改了团队的技能:{title}","cloudAccount.otherEmailOrTeam": "用另一个邮箱买了方案或加入了团队?","cloudAccount.addOtherEmail": "添加那个邮箱","cloudSend.move.doneLeft": "这台电脑上的其他内容都在这里了。这些仍然留在原处:",@@ -9051,6 +9058,7 @@"skills.request.reviewTurnOffRefs": "关闭前请查看完整的 SKILL.md 及其引用文件","skills.request.reviewDelete": "删除前请查看完整的 SKILL.md","skills.request.reviewDeleteRefs": "删除前请查看完整的 SKILL.md 及其引用文件",+ "skills.request.reviewTeammates": "应用前请逐项查看每个更改","skills.source": "来源:{source}","skills.sourceUnknown": "未知","skills.fullSkill": "{name} 的完整 SKILL.md",