feat(lanes): add ccam lanes integration CLI + route (F3a)
This commit is contained in:
+27
@@ -2192,6 +2192,25 @@ async function cmdLanesMcpSync(args) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** `ccam lanes integration <name> [<id>]` — check whether a named
|
||||||
|
* integration (tracker, dev_qc, ci_wait) is turned on for this lane, per
|
||||||
|
* its .ccam/profile/integrations.env. Exit 0 = on, 1 = off. */
|
||||||
|
async function cmdLanesIntegration(args) {
|
||||||
|
const name = args.find((arg) => !arg.startsWith("--"));
|
||||||
|
if (!name) {
|
||||||
|
console.error("usage: ccam lanes integration <name> [<id>]");
|
||||||
|
process.exitCode = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const resolved = await resolveLaneArg(args.filter((a) => a !== name));
|
||||||
|
if (!resolved) return;
|
||||||
|
const { enabled } = await get(
|
||||||
|
`/api/lanes/${resolved.laneId}/integrations/${encodeURIComponent(name)}`
|
||||||
|
);
|
||||||
|
console.log(enabled ? "on" : "off");
|
||||||
|
process.exitCode = enabled ? 0 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
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) {
|
||||||
@@ -2388,6 +2407,11 @@ const COMMAND_GROUPS = [
|
|||||||
"[<id>]",
|
"[<id>]",
|
||||||
"Relocate the source repo's MCP servers into <lane>/.mcp.json and seed Chromium profiles",
|
"Relocate the source repo's MCP servers into <lane>/.mcp.json and seed Chromium profiles",
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
"lanes integration",
|
||||||
|
"<name> [<id>]",
|
||||||
|
"Check whether a named integration (tracker, dev_qc, ci_wait) is on for this lane — exit 0/1",
|
||||||
|
],
|
||||||
[
|
[
|
||||||
"lock status|acquire|release",
|
"lock status|acquire|release",
|
||||||
"[<name>] [--holder X] [--timeout N]",
|
"[<name>] [--holder X] [--timeout N]",
|
||||||
@@ -3212,6 +3236,9 @@ async function runCommand(argv) {
|
|||||||
if (rest[0] === "mcp" && rest[1] === "sync") {
|
if (rest[0] === "mcp" && rest[1] === "sync") {
|
||||||
return cmdLanesMcpSync(rest.slice(2));
|
return cmdLanesMcpSync(rest.slice(2));
|
||||||
}
|
}
|
||||||
|
if (rest[0] === "integration") {
|
||||||
|
return cmdLanesIntegration(rest.slice(1));
|
||||||
|
}
|
||||||
return cmdLanes();
|
return cmdLanes();
|
||||||
case "lock": {
|
case "lock": {
|
||||||
const sub = rest[0];
|
const sub = rest[0];
|
||||||
|
|||||||
+13
-1
@@ -35,7 +35,7 @@ const { withLaneLock } = require("../lib/lane-lock");
|
|||||||
const { checkSync, mergeSync, continueSync } = require("../lib/lane-sync");
|
const { checkSync, mergeSync, continueSync } = require("../lib/lane-sync");
|
||||||
const { installAgents } = require("../lib/lane-agents");
|
const { installAgents } = require("../lib/lane-agents");
|
||||||
const { syncMcp } = require("../lib/lane-mcp");
|
const { syncMcp } = require("../lib/lane-mcp");
|
||||||
const { HOOKS, runHook, resolveProfile } = require("../lib/lane-profile");
|
const { HOOKS, runHook, resolveProfile, isIntegrationEnabled } = require("../lib/lane-profile");
|
||||||
const { slotDirs } = require("../lib/lane-slots");
|
const { slotDirs } = require("../lib/lane-slots");
|
||||||
const {
|
const {
|
||||||
upLane,
|
upLane,
|
||||||
@@ -371,6 +371,18 @@ router.post("/:id/mcp/sync", sameOriginGuard, async (req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether a named integration (tracker, dev_qc, ci_wait, ...) is turned on
|
||||||
|
* for this lane — reads .ccam/profile/integrations.env. Read-only, no
|
||||||
|
* sameOriginGuard needed (same reasoning GET /:id/git already documents:
|
||||||
|
* that guard exists for destructive actions).
|
||||||
|
*/
|
||||||
|
router.get("/:id/integrations/:name", (req, res) => {
|
||||||
|
const lane = lanesLib.getLane(req.params.id);
|
||||||
|
if (!lane) return res.status(404).json({ error: { code: "ENOLANE", message: "lane not found" } });
|
||||||
|
res.json({ enabled: isIntegrationEnabled(lane, req.params.name) });
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A lane's working-copy facts: branch, short HEAD, that commit's subject, and
|
* A lane's working-copy facts: branch, short HEAD, that commit's subject, and
|
||||||
* the uncommitted counts. Read-only, so no same-origin guard — that guard
|
* the uncommitted counts. Read-only, so no same-origin guard — that guard
|
||||||
|
|||||||
Reference in New Issue
Block a user