feat(lanes): add ccam lanes mcp sync CLI (F1)

This commit is contained in:
2026-08-05 15:34:15 +07:00
parent 8471b3a757
commit 60fb7cbaeb
+26
View File
@@ -2174,6 +2174,24 @@ async function cmdLanesAgentsInstall(args) {
console.log(`${c.green("✔")} installed: ${result.installed.join(", ")}`); console.log(`${c.green("✔")} installed: ${result.installed.join(", ")}`);
} }
/** `ccam lanes mcp sync [<id>] [--cwd path]` — relocate the source repo's
* already-configured MCP servers into <lane>/.mcp.json and seed Chromium
* profiles. Never run automatically; a session calls it explicitly. */
async function cmdLanesMcpSync(args) {
const resolved = await resolveLaneArg(args);
if (!resolved) return;
const result = await post(`/api/lanes/${resolved.laneId}/mcp/sync`, {}, { allowError: true });
if (result.status) {
console.error(`✖ mcp sync → ${result.data?.error?.message || result.status}`);
process.exitCode = 1;
return;
}
console.log(`${c.green("✔")} synced: ${result.servers.join(", ")}`);
if (result.profilesSeeded.length) {
console.log(` seeded profiles: ${result.profilesSeeded.join(", ")}`);
}
}
async function cmdFeatureShow(args) { async function cmdFeatureShow(args) {
const slug = args.find((arg) => !arg.startsWith("--")); const slug = args.find((arg) => !arg.startsWith("--"));
if (!slug) { if (!slug) {
@@ -2365,6 +2383,11 @@ const COMMAND_GROUPS = [
"[<id>]", "[<id>]",
"Write the ship-feature-lane agent templates (qc-local, senior-gate-reviewer) into <lane>/.claude/agents/, git-excluded", "Write the ship-feature-lane agent templates (qc-local, senior-gate-reviewer) into <lane>/.claude/agents/, git-excluded",
], ],
[
"lanes mcp sync",
"[<id>]",
"Relocate the source repo's MCP servers into <lane>/.mcp.json and seed Chromium profiles",
],
[ [
"lock status|acquire|release", "lock status|acquire|release",
"[<name>] [--holder X] [--timeout N]", "[<name>] [--holder X] [--timeout N]",
@@ -3186,6 +3209,9 @@ async function runCommand(argv) {
if (rest[0] === "agents" && rest[1] === "install") { if (rest[0] === "agents" && rest[1] === "install") {
return cmdLanesAgentsInstall(rest.slice(2)); return cmdLanesAgentsInstall(rest.slice(2));
} }
if (rest[0] === "mcp" && rest[1] === "sync") {
return cmdLanesMcpSync(rest.slice(2));
}
return cmdLanes(); return cmdLanes();
case "lock": { case "lock": {
const sub = rest[0]; const sub = rest[0];