2b8f83d2dd
The plugin stops shipping its workflow layer: - skills/ship-feature and skills/ship-feature-lane, the 18 stage/ship slash commands (plugin.json keeps agenthub-doctor/update/open), and all four agents/ (qc-local, senior-gate-reviewer, backend-reviewer, frontend-reviewer). - CLI `agenthub skills install`, `agenthub lanes agents install`, `agenthub ship-full|ship-quick`; routes POST /api/skills/install and POST /api/lanes/:id/agents/install; the Settings button, the lane Tools menu item and the Add-lane setup step that called them. - The Superpowers auto-install: server/lib/skill-plugins.js, the bootstrap's autoInstallSkillPlugins / skillPluginsSettled gate and the doctor row. Pipelines are kept but dormant: server/data/pipelines/ is deleted, so no template ships. `default` resolves to EMPTY_PIPELINE (no nodes, progress 0), createLane still accepts it, POST /api/lanes/:id/stage answers 400 ENOPIPELINE, and the Workspace hides the stage timer, pickers, PipelineMap and strip stage chip for a lane with no nodes. A template dropped into DASHBOARD_PIPELINES_DIR turns it all back on. The server suite loads its templates from server/__tests__/fixtures/pipelines/. Docs: CLAUDE.md (marker, retired rules), README(.vi), INSTALL, ARCHITECTURE, docs/LANES|PLUGINS|CLI|API, agenthub-introduction.html.
43 lines
1.4 KiB
JavaScript
43 lines
1.4 KiB
JavaScript
/**
|
|
* @file Cleans up what older builds wrote into a lane: `removeStageDoc` takes
|
|
* AgentHub's stage block back out of a codex lane's AGENTS.md. Plain file I/O.
|
|
* @author Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
|
|
*/
|
|
|
|
const fs = require("node:fs");
|
|
const path = require("node:path");
|
|
|
|
// The block older builds wrote into a codex lane's AGENTS.md. Codex lanes no
|
|
// longer carry a pipeline, so `removeStageDoc` takes it back out.
|
|
const STAGE_BLOCK_START = "<!-- agenthub:stage:start -->";
|
|
const STAGE_BLOCK_END = "<!-- agenthub:stage:end -->";
|
|
|
|
/**
|
|
* Remove AgentHub's stage block from `<cwd>/AGENTS.md`, leaving every other
|
|
* line as it was. A file left with nothing else in it was AgentHub's own
|
|
* creation, so it is deleted. Never throws.
|
|
*
|
|
* @returns {boolean} whether the file changed
|
|
*/
|
|
function removeStageDoc(cwd) {
|
|
const file = path.join(cwd, "AGENTS.md");
|
|
try {
|
|
const doc = fs.readFileSync(file, "utf8");
|
|
const start = doc.indexOf(STAGE_BLOCK_START);
|
|
const end = doc.indexOf(STAGE_BLOCK_END, start);
|
|
if (start === -1 || end === -1) return false;
|
|
const rest = (
|
|
doc.slice(0, start).trimEnd() +
|
|
"\n\n" +
|
|
doc.slice(end + STAGE_BLOCK_END.length).trimStart()
|
|
).trim();
|
|
if (rest) fs.writeFileSync(file, `${rest}\n`);
|
|
else fs.rmSync(file);
|
|
return true;
|
|
} catch {
|
|
return false; // no file, or unreadable — nothing of ours to take out
|
|
}
|
|
}
|
|
|
|
module.exports = { removeStageDoc };
|