@cbartens/bkit 5.0.2 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.bkit/README.md +4 -4
- package/.bkit/core/.agents/docs.md +1 -0
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-gateguard.cjs +104 -0
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +119 -0
- package/.bkit/core/.agents/rules.md +2 -2
- package/.bkit/core/.agents/shortcuts.md +73 -0
- package/.bkit/core/.agents/skills.md +5 -3
- package/.bkit/core/.bkit/README.md +3 -3
- package/.bkit/core/.bkit/comparison.md +2 -2
- package/.bkit/core/.bkit/install.md +5 -3
- package/.bkit/core/.bkit/prompts.md +69 -68
- package/.bkit/core/.bkit/providers.md +28 -10
- package/.bkit/core/.bkit/templates.md +5 -3
- package/.bkit/core/.bkit/workflows.md +6 -6
- package/.bkit/core/AGENTS.md +11 -0
- package/.bkit/core/engine/checks/after/managed.ts +4 -1
- package/.bkit/core/engine/cli.ts +25 -9
- package/.bkit/core/engine/commands/install/check.ts +2 -0
- package/.bkit/core/engine/commands/install/doctor.ts +9 -0
- package/.bkit/core/engine/commands/install/install.ts +20 -0
- package/.bkit/core/engine/commands/install/uninstall.ts +30 -19
- package/.bkit/core/engine/commands/install/upgrade.ts +17 -2
- package/.bkit/core/engine/commands/workflow/prs.ts +20 -2
- package/.bkit/core/engine/commands/workflow/runs.ts +26 -3
- package/.bkit/core/engine/install/manifest.ts +38 -2
- package/.bkit/core/engine/install/modules/antigravity.ts +265 -0
- package/.bkit/core/engine/install/modules/codex.ts +3 -0
- package/.bkit/core/engine/install/modules/core.ts +7 -1
- package/.bkit/core/engine/install/modules/index.ts +33 -6
- package/.bkit/core/engine/install/template-copies.ts +19 -1
- package/.bkit/core/engine/render/hosts.ts +174 -1
- package/.bkit/core/engine/render/models.ts +10 -0
- package/.bkit/core/prompts/bkit-audit-generate.md +1 -1
- package/.bkit/core/prompts/bkit-build-challenge-1.md +1 -1
- package/.bkit/core/prompts/bkit-build-challenge-2.md +1 -1
- package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +1 -1
- package/.bkit/core/prompts/bkit-build-challenge-remediate.md +1 -1
- package/.bkit/core/prompts/bkit-build-challenge-tests.md +1 -1
- package/.bkit/core/prompts/bkit-build-install-skills.md +6 -5
- package/.bkit/core/prompts/bkit-build-plan-current.md +1 -1
- package/.bkit/core/prompts/bkit-build-plan-execute.md +1 -1
- package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +1 -1
- package/.bkit/core/prompts/bkit-build-plan-verify.md +1 -1
- package/.bkit/core/prompts/bkit-build-summary.md +1 -1
- package/.bkit/core/prompts/bkit-debug-abort-handover.md +1 -1
- package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +1 -1
- package/.bkit/core/prompts/bkit-debug-failure-remediate.md +1 -1
- package/.bkit/core/prompts/bkit-debug-failure-soak.md +1 -1
- package/.bkit/core/prompts/bkit-debug-summary.md +1 -1
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +1 -1
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +1 -1
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +1 -1
- package/.bkit/core/prompts/bkit-design-generate.md +1 -1
- package/.bkit/core/prompts/bkit-design-organise.md +1 -1
- package/.bkit/core/prompts/bkit-design-review-1.md +1 -1
- package/.bkit/core/prompts/bkit-design-review-2.md +1 -1
- package/.bkit/core/prompts/bkit-design-spike.md +1 -1
- package/.bkit/core/prompts/bkit-design-summary.md +1 -1
- package/.bkit/core/prompts/bkit-design-update.md +1 -1
- package/.bkit/core/prompts/bkit-plan-complexity-check.md +1 -1
- package/.bkit/core/prompts/bkit-plan-complexity-split.md +1 -1
- package/.bkit/core/prompts/bkit-plan-generate.md +1 -1
- package/.bkit/core/prompts/bkit-plan-review-1.md +1 -1
- package/.bkit/core/prompts/bkit-plan-review-2.md +1 -1
- package/.bkit/core/prompts/bkit-plan-review-3.md +1 -1
- package/.bkit/core/prompts/bkit-plan-scope-check-1.md +1 -1
- package/.bkit/core/prompts/bkit-plan-scope-check-2.md +1 -1
- package/.bkit/core/prompts/bkit-plan-summary.md +1 -1
- package/.bkit/core/prompts/bkit-plan-update.md +1 -1
- package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +1 -1
- package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +1 -1
- package/.bkit/core/prompts/bkit-ship-summary.md +1 -1
- package/.bkit/core/prompts/bkit-ship-update-docs.md +1 -1
- package/.bkit/core/prompts/bkit-utility-compress-markdown.md +1 -1
- package/.bkit/core/prompts/bkit-utility-update-decisions.md +1 -1
- package/.bkit/core/prompts/bkit-utility-update-deferrals.md +1 -1
- package/.bkit/core/prompts/bkit-utility-update-documentation.md +1 -1
- package/.bkit/core/prompts/bkit-utility-update-failures.md +1 -1
- package/.bkit/core/prompts/bkit-utility-update-knowledge.md +1 -1
- package/.bkit/core/prompts/bkit-utility-update-roadmap.md +3 -3
- package/.bkit/core/workflows/bkit-auto.md +1 -1
- package/.bkit/core/workflows/bkit-build.md +3 -1
- package/.bkit/core/workflows/bkit-debug.md +3 -1
- package/.bkit/core/workflows/bkit-design.md +3 -1
- package/.bkit/core/workflows/bkit-plan.md +3 -1
- package/.bkit/core/workflows/bkit-ship.md +3 -1
- package/.bkit/shared/.agents/plugins/bkit/hooks.json +26 -0
- package/.bkit/shared/.agents/plugins/bkit/plugin.json +5 -0
- package/.bkit/shared/GEMINI.md +11 -0
- package/.bkit/shared/docs/security.md +3 -3
- package/.bkit/shared/docs/setup.md +11 -0
- package/.bkit/templates/.github/workflows/bkit-ci.yml +37 -0
- package/.bkit/templates/.prettierignore +3 -0
- package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +2 -2
- package/.bkit/templates/slop-scan.config.json +3 -1
- package/CHANGELOG.md +34 -0
- package/README.md +9 -8
- package/dist/checks/after/managed.js +1 -0
- package/dist/cli.js +21 -8
- package/dist/commands/install/check.js +2 -0
- package/dist/commands/install/doctor.js +4 -0
- package/dist/commands/install/install.js +22 -1
- package/dist/commands/install/uninstall.js +34 -22
- package/dist/commands/install/upgrade.js +18 -3
- package/dist/commands/workflow/prs.js +13 -1
- package/dist/commands/workflow/runs.js +23 -3
- package/dist/install/manifest.js +35 -1
- package/dist/install/modules/antigravity.js +224 -0
- package/dist/install/modules/codex.js +3 -0
- package/dist/install/modules/core.js +7 -1
- package/dist/install/modules/index.js +17 -6
- package/dist/install/template-copies.js +16 -1
- package/dist/render/hosts.js +149 -1
- package/dist/render/models.js +9 -0
- package/package.json +5 -3
|
@@ -166,6 +166,7 @@ const CORE_TEMPLATE_DOCTRINE = [
|
|
|
166
166
|
{ path: ".agents/context.md", format: "markered-text", module: "core" },
|
|
167
167
|
{ path: ".agents/docs.md", format: "markered-text", module: "core" },
|
|
168
168
|
{ path: ".agents/rules.md", format: "markered-text", module: "core" },
|
|
169
|
+
{ path: ".agents/shortcuts.md", format: "markered-text", module: "core" },
|
|
169
170
|
{ path: ".agents/skills.md", format: "markered-text", module: "core" },
|
|
170
171
|
];
|
|
171
172
|
/**
|
|
@@ -195,7 +196,7 @@ export function buildDecisionTable(modules, ctx) {
|
|
|
195
196
|
const moduleList = modules instanceof Set
|
|
196
197
|
? [...modules].filter((m) =>
|
|
197
198
|
// Includes the opt-in add-ons (cloud) a Set caller passes.
|
|
198
|
-
["core", "claude", "cursor", "opencode", "codex", "cloud"].includes(m))
|
|
199
|
+
["core", "claude", "cursor", "opencode", "codex", "antigravity", "cloud"].includes(m))
|
|
199
200
|
: modules;
|
|
200
201
|
const entries = [
|
|
201
202
|
...getInstallManifest(moduleList),
|
|
@@ -389,7 +390,7 @@ export async function runUninstall(modules, ctx) {
|
|
|
389
390
|
const moduleList = modules instanceof Set
|
|
390
391
|
? [...modules].filter((m) =>
|
|
391
392
|
// Includes the opt-in add-ons (cloud) a Set caller passes.
|
|
392
|
-
["core", "claude", "cursor", "opencode", "codex", "cloud"].includes(m))
|
|
393
|
+
["core", "claude", "cursor", "opencode", "codex", "antigravity", "cloud"].includes(m))
|
|
393
394
|
: modules;
|
|
394
395
|
// Nuke confirmation
|
|
395
396
|
if (ctx.nuke && !ctx.yes && !ctx.dryRun) {
|
|
@@ -583,6 +584,9 @@ export async function runUninstall(modules, ctx) {
|
|
|
583
584
|
// separately below: `.agents/skills/` is SHARED with third-party skills installed via
|
|
584
585
|
// skills.sh, so the directory itself must never be removed wholesale.
|
|
585
586
|
...(moduleList.includes("codex") ? [".codex/agents"] : []),
|
|
587
|
+
// antigravity plugin subagent mirrors (`.agents/plugins/bkit/agents/bkit-*.md`). The
|
|
588
|
+
// plugin's workflow skills (`.agents/plugins/bkit/skills/bkit-*`) are swept below.
|
|
589
|
+
...(moduleList.includes("antigravity") ? [".agents/plugins/bkit/agents"] : []),
|
|
586
590
|
];
|
|
587
591
|
for (const dir of mirrorDirs) {
|
|
588
592
|
const absDir = path.join(ctx.cwd, dir);
|
|
@@ -603,28 +607,36 @@ export async function runUninstall(modules, ctx) {
|
|
|
603
607
|
console.error(`${ctx.logPrefix} error cleaning up ${dir}: ${err.message}`);
|
|
604
608
|
}
|
|
605
609
|
}
|
|
606
|
-
// Workflow skills
|
|
607
|
-
// skills.sh, so only the bkit-prefixed DIRECTORIES are removed — never the
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
const
|
|
625
|
-
|
|
610
|
+
// Workflow skills. Codex's live at `.agents/skills/` (SHARED with third-party skills
|
|
611
|
+
// installed via skills.sh, so only the bkit-prefixed DIRECTORIES are removed — never the
|
|
612
|
+
// parent); Antigravity's live in its plugin at `.agents/plugins/bkit/skills/`. Sweep each
|
|
613
|
+
// host's set independently.
|
|
614
|
+
const skillDirs = [
|
|
615
|
+
...(moduleList.includes("codex") ? [path.join(".agents", "skills")] : []),
|
|
616
|
+
...(moduleList.includes("antigravity")
|
|
617
|
+
? [path.join(".agents", "plugins", "bkit", "skills")]
|
|
618
|
+
: []),
|
|
619
|
+
];
|
|
620
|
+
for (const skillsDir of skillDirs) {
|
|
621
|
+
const absDir = path.join(ctx.cwd, skillsDir);
|
|
622
|
+
if (!fs.existsSync(absDir))
|
|
623
|
+
continue;
|
|
624
|
+
try {
|
|
625
|
+
for (const d of fs.readdirSync(absDir)) {
|
|
626
|
+
if (!d.startsWith("bkit-"))
|
|
627
|
+
continue;
|
|
628
|
+
const abs = path.join(absDir, d);
|
|
629
|
+
if (!fs.statSync(abs).isDirectory())
|
|
630
|
+
continue;
|
|
631
|
+
fs.rmSync(abs, { recursive: true, force: true });
|
|
632
|
+
result.deleted.push(path.join(skillsDir, d));
|
|
633
|
+
console.log(`${ctx.logPrefix} delete mirror: ${path.join(skillsDir, d)}`);
|
|
626
634
|
}
|
|
627
635
|
}
|
|
636
|
+
catch (err) {
|
|
637
|
+
const msg = err.message;
|
|
638
|
+
console.error(`${ctx.logPrefix} error cleaning up ${skillsDir}: ${msg}`);
|
|
639
|
+
}
|
|
628
640
|
}
|
|
629
641
|
}
|
|
630
642
|
// Remove the generated `.claude/bkit-cloud.md` (untracked, gitignored — holds resolved
|
|
@@ -38,7 +38,7 @@ import { formatPayloadLinkChanges, syncPayloadLinks } from "../../install/payloa
|
|
|
38
38
|
import { renderOpencodeJson, reconcileOpencodeJson } from "../../install/modules/opencode.js";
|
|
39
39
|
import { renderManagedOutputs } from "../../install/modules/index.js";
|
|
40
40
|
import { reconcileMcpJson, enrichClaudeSettingsAllows } from "../../install/modules/claude.js";
|
|
41
|
-
import { parseModelLookup, applyModelOverrides, buildOpencodeModelLookup, parseEffortMap, } from "../../render/models.js";
|
|
41
|
+
import { parseModelLookup, applyModelOverrides, buildOpencodeModelLookup, buildAntigravityModelLookup, parseEffortMap, } from "../../render/models.js";
|
|
42
42
|
/** Zero-value token map — markered-text templates managed on upgrade are token-free. */
|
|
43
43
|
const EMPTY_TOKENS = {
|
|
44
44
|
DEFAULT_BRANCH: "",
|
|
@@ -293,8 +293,8 @@ export function updateCanonicalHashesAfterUpgrade(result, options) {
|
|
|
293
293
|
const seedablePaths = new Set([...result.updated, ...result.skippedSeedable]);
|
|
294
294
|
const fresh = {};
|
|
295
295
|
for (const relPath of seedablePaths) {
|
|
296
|
-
// Exclude .agents/ internal files (docs.md, friction.md, rules.md,
|
|
297
|
-
// .env.example etc.) from canonicalHashes — they are not consumer-facing files
|
|
296
|
+
// Exclude .agents/ internal files (docs.md, friction.md, rules.md, shortcuts.md,
|
|
297
|
+
// skills.md, .env.example etc.) from canonicalHashes — they are not consumer-facing files
|
|
298
298
|
// whose hashes bkit uses for drift detection. Mirrors the same filter applied
|
|
299
299
|
// in the install path (install/modules/index.ts postDispatch). Template copies carry no
|
|
300
300
|
// hash there either.
|
|
@@ -347,6 +347,8 @@ export function detectInstalledHostModules(cwd) {
|
|
|
347
347
|
mods.add("opencode");
|
|
348
348
|
if (fs.existsSync(path.join(cwd, ".codex", "agents")))
|
|
349
349
|
mods.add("codex");
|
|
350
|
+
if (fs.existsSync(path.join(cwd, ".agents", "plugins", "bkit", "plugin.json")))
|
|
351
|
+
mods.add("antigravity");
|
|
350
352
|
return mods;
|
|
351
353
|
}
|
|
352
354
|
/**
|
|
@@ -633,6 +635,7 @@ export async function runUpgradeCommand(upgradeFlags) {
|
|
|
633
635
|
let renderModelLookup = new Map();
|
|
634
636
|
let renderOpencodeModelLookup = new Map();
|
|
635
637
|
let renderCodexModelLookup = new Map();
|
|
638
|
+
let renderAntigravityModelLookup = new Map();
|
|
636
639
|
let renderEffortMap = new Map();
|
|
637
640
|
const pkgPromptsMd = path.join(getBkitDocsRoot(), "prompts.md");
|
|
638
641
|
const consumerPromptsMd = path.join(process.cwd(), ".bkit", "prompts.md");
|
|
@@ -663,6 +666,15 @@ export async function runUpgradeCommand(upgradeFlags) {
|
|
|
663
666
|
}
|
|
664
667
|
applyModelOverrides(renderCodexModelLookup, "openai", consumerPromptsMd);
|
|
665
668
|
}
|
|
669
|
+
if (renderModules.has("antigravity")) {
|
|
670
|
+
try {
|
|
671
|
+
renderAntigravityModelLookup = buildAntigravityModelLookup(pkgPromptsMd);
|
|
672
|
+
}
|
|
673
|
+
catch {
|
|
674
|
+
// Not fatal — the antigravity module fails per-file if a model is missing
|
|
675
|
+
}
|
|
676
|
+
applyModelOverrides(renderAntigravityModelLookup, "google", consumerPromptsMd);
|
|
677
|
+
}
|
|
666
678
|
renderEffortMap = parseEffortMap(pkgPromptsMd);
|
|
667
679
|
}
|
|
668
680
|
const renderWs = { writes: [] };
|
|
@@ -672,6 +684,7 @@ export async function runUpgradeCommand(upgradeFlags) {
|
|
|
672
684
|
modelLookup: renderModelLookup,
|
|
673
685
|
opencodeModelLookup: renderOpencodeModelLookup,
|
|
674
686
|
codexModelLookup: renderCodexModelLookup,
|
|
687
|
+
antigravityModelLookup: renderAntigravityModelLookup,
|
|
675
688
|
effortMap: renderEffortMap,
|
|
676
689
|
opencodeProvider: renderProvider,
|
|
677
690
|
advisories: [],
|
|
@@ -683,6 +696,8 @@ export async function runUpgradeCommand(upgradeFlags) {
|
|
|
683
696
|
// Re-stamp every rendered agent + command at the version we are upgrading TO,
|
|
684
697
|
// so a clean upgrade refreshes the managed-version marker and `bkit check` stays green.
|
|
685
698
|
version: getInstallingVersion(),
|
|
699
|
+
// The detected host set — read by the Antigravity module for the Codex-overlap advisory.
|
|
700
|
+
installedModules: renderModules,
|
|
686
701
|
};
|
|
687
702
|
const rendered = renderManagedOutputs(renderModules, renderCtx);
|
|
688
703
|
// MCP config: bkit's tracker entry only (reconcileMcpJson), for the hosts the consumer
|
|
@@ -17,6 +17,13 @@ import { EXIT_NO_STATUS, FILE_FLAG, readStatusRows, statusFile, str } from "./st
|
|
|
17
17
|
// gh
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
const PR_FIELDS = "number,url,state,baseRefName,headRefName,headRefOid,title,mergeCommit";
|
|
20
|
+
/**
|
|
21
|
+
* The `owner/repo` a PR URL points at, or undefined when it is not a recognizable
|
|
22
|
+
* GitHub PR URL. Lets a caller compare the repo a PR resolved in against `--repo`.
|
|
23
|
+
*/
|
|
24
|
+
export function prRepoSlug(url) {
|
|
25
|
+
return /^https?:\/\/[^/]+\/([^/]+\/[^/]+)\/pull\//.exec(url ?? "")?.[1];
|
|
26
|
+
}
|
|
20
27
|
function ghFailure(res, what) {
|
|
21
28
|
const detail = res.stderr.split("\n").at(-1) || `exit ${String(res.status)}`;
|
|
22
29
|
return ghUnavailable(res)
|
|
@@ -30,7 +37,10 @@ function ghFailure(res, what) {
|
|
|
30
37
|
*/
|
|
31
38
|
export function probePr(cwd, opts) {
|
|
32
39
|
if (opts.number !== undefined) {
|
|
33
|
-
const
|
|
40
|
+
const args = ["pr", "view", opts.number, "--json", `${PR_FIELDS},mergeable`];
|
|
41
|
+
if (opts.repo !== undefined)
|
|
42
|
+
args.push("--repo", opts.repo);
|
|
43
|
+
const res = runGh(cwd, args);
|
|
34
44
|
if (!res.ok)
|
|
35
45
|
return ghFailure(res, `gh pr view ${opts.number}`);
|
|
36
46
|
const parsed = parseJson(res.stdout);
|
|
@@ -41,6 +51,8 @@ export function probePr(cwd, opts) {
|
|
|
41
51
|
const args = ["pr", "list", "--head", opts.head, "--state", opts.state, "--json", PR_FIELDS];
|
|
42
52
|
if (opts.base !== undefined)
|
|
43
53
|
args.push("--base", opts.base);
|
|
54
|
+
if (opts.repo !== undefined)
|
|
55
|
+
args.push("--repo", opts.repo);
|
|
44
56
|
const res = runGh(cwd, args);
|
|
45
57
|
if (!res.ok)
|
|
46
58
|
return ghFailure(res, `gh pr list --head ${opts.head}`);
|
|
@@ -28,7 +28,7 @@ import { TIMEOUTS } from "../../shared/timeouts.js";
|
|
|
28
28
|
import { FID_PATTERNS, fromBranch, fromMarker, issueIdOf, readIssueTracker } from "./fids.js";
|
|
29
29
|
import { AUTO_LABEL, AUTO_ROUTE_SUFFIX } from "./issues.js";
|
|
30
30
|
import { checkOnlyBookkeeping } from "./ledgers.js";
|
|
31
|
-
import { closeTransportRow, crossCheckFile, probePr } from "./prs.js";
|
|
31
|
+
import { closeTransportRow, crossCheckFile, prRepoSlug, probePr } from "./prs.js";
|
|
32
32
|
import { resolveOwnerRepo, splitSlug } from "./repo.js";
|
|
33
33
|
import { extraField, str } from "./status.js";
|
|
34
34
|
import { writeStepRow } from "./steps.js";
|
|
@@ -977,6 +977,24 @@ function auditRow(file, type, fields) {
|
|
|
977
977
|
throw new CommandError(EXIT.USAGE, `${file} does not exist`);
|
|
978
978
|
fs.appendFileSync(file, `${JSON.stringify({ type, workflow: "ship", at: statusTimestamp(), ...fields })}\n`);
|
|
979
979
|
}
|
|
980
|
+
/**
|
|
981
|
+
* Log where a `--pr` resolved so a `--repo` naming a repo other than the checkout
|
|
982
|
+
* is visible; the PR URL names the repo `gh` actually read from.
|
|
983
|
+
*/
|
|
984
|
+
function logResolvedPrRepo(repoFlag, prNumber, pr, log) {
|
|
985
|
+
if (repoFlag === undefined)
|
|
986
|
+
return;
|
|
987
|
+
const resolved = prRepoSlug(pr?.url);
|
|
988
|
+
if (resolved === undefined) {
|
|
989
|
+
log(`PR ${prNumber}: could not read the resolved repo from its URL (--repo ${repoFlag})`);
|
|
990
|
+
}
|
|
991
|
+
else if (resolved !== repoFlag) {
|
|
992
|
+
log(`PR ${prNumber} resolved in ${resolved} — --repo names ${repoFlag}`);
|
|
993
|
+
}
|
|
994
|
+
else {
|
|
995
|
+
log(`PR ${prNumber} resolved in ${repoFlag}`);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
980
998
|
function runGate(ctx) {
|
|
981
999
|
const f = ctx.flags;
|
|
982
1000
|
const given = [f.head, f.pr, f.squashOf].filter((v) => v !== undefined).length;
|
|
@@ -993,12 +1011,13 @@ function runGate(ctx) {
|
|
|
993
1011
|
if (prNumber !== undefined) {
|
|
994
1012
|
if (!/^[1-9][0-9]*$/.test(prNumber))
|
|
995
1013
|
throw new CommandError(EXIT.USAGE, "--pr / --squash-of take a PR number");
|
|
996
|
-
pr = probePr(ctx.cwd, { number: prNumber, state: "open" });
|
|
1014
|
+
pr = probePr(ctx.cwd, { number: prNumber, state: "open", repo: str(f.repo) });
|
|
997
1015
|
if (pr.kind === "unavailable") {
|
|
998
1016
|
ctx.log(pr.message);
|
|
999
1017
|
return EXIT.USE_MCP;
|
|
1000
1018
|
}
|
|
1001
1019
|
const info = pr.kind === "ok" ? pr.pr : undefined;
|
|
1020
|
+
logResolvedPrRepo(str(f.repo), prNumber, info, ctx.log);
|
|
1002
1021
|
head = (f.squashOf !== undefined ? info?.mergeCommit?.oid : info?.headRefOid) ?? "";
|
|
1003
1022
|
if (head === "") {
|
|
1004
1023
|
ctx.log(`cannot read the ${f.squashOf !== undefined ? "squash commit" : "head"} of PR ${prNumber}`);
|
|
@@ -1122,11 +1141,12 @@ async function runRevalidate(ctx) {
|
|
|
1122
1141
|
throw new CommandError(EXIT.USAGE, "--reason must be head-move or gate-refusal");
|
|
1123
1142
|
const status = path.resolve(ctx.cwd, String(f.file));
|
|
1124
1143
|
runGit(ctx.cwd, ["fetch", "origin", branch]);
|
|
1125
|
-
const pr = probePr(ctx.cwd, { number: String(f.pr), state: "open" });
|
|
1144
|
+
const pr = probePr(ctx.cwd, { number: String(f.pr), state: "open", repo: str(f.repo) });
|
|
1126
1145
|
if (pr.kind === "unavailable") {
|
|
1127
1146
|
ctx.log(pr.message);
|
|
1128
1147
|
return EXIT.USE_MCP;
|
|
1129
1148
|
}
|
|
1149
|
+
logResolvedPrRepo(str(f.repo), String(f.pr), pr.kind === "ok" ? pr.pr : undefined, ctx.log);
|
|
1130
1150
|
const current = pr.kind === "ok" ? (pr.pr?.headRefOid ?? "") : "";
|
|
1131
1151
|
if (current === "") {
|
|
1132
1152
|
ctx.log("cannot read the PR head — query failed (403 = PAT scope)");
|
package/dist/install/manifest.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* (`--auto=`, `--opencode=`). A bare/full `uninstall` DOES remove them (zero footprint).
|
|
10
10
|
* Dependency-updater files are not modules — bkit never writes or removes them.
|
|
11
11
|
*/
|
|
12
|
-
export const OPTIN_MODULES = new Set(["cloud", "opencode", "codex"]);
|
|
12
|
+
export const OPTIN_MODULES = new Set(["cloud", "opencode", "codex", "antigravity"]);
|
|
13
13
|
// ---------------------------------------------------------------------------
|
|
14
14
|
// Issue tracker
|
|
15
15
|
// ---------------------------------------------------------------------------
|
|
@@ -325,6 +325,39 @@ export const CODEX_MANIFEST = [
|
|
|
325
325
|
// Agent mirrors (.codex/agents/*.toml) and workflow skills (.agents/skills/bkit-*/) are
|
|
326
326
|
// managed dynamically — the set follows the bkit-prefix prompt/workflow files at install.
|
|
327
327
|
];
|
|
328
|
+
// --antigravity: Google Antigravity IDE host. Installs as a workspace PLUGIN at
|
|
329
|
+
// `.agents/plugins/bkit/` (Antigravity's own packaging surface), so `.agents/` root stays
|
|
330
|
+
// the dedicated Codex install. Root `GEMINI.md` is the redirect mirror of `CLAUDE.md`
|
|
331
|
+
// (Antigravity loads `GEMINI.md` as a workspace rule file).
|
|
332
|
+
export const ANTIGRAVITY_MANIFEST = [
|
|
333
|
+
// plugin.json — the required plugin manifest. Tier-2 json (deep-contained): bkit owns
|
|
334
|
+
// the schema/name/description keys (the schema is `additionalProperties: false`).
|
|
335
|
+
{ path: ".agents/plugins/bkit/plugin.json", format: "json", module: "antigravity" },
|
|
336
|
+
// hooks.json — Tier-2 json (deep-contained): bkit owns the PreToolUse GateGuard and
|
|
337
|
+
// guardrails entries, consumers may add their own event groups alongside them.
|
|
338
|
+
{ path: ".agents/plugins/bkit/hooks.json", format: "json", module: "antigravity" },
|
|
339
|
+
// bkit-gateguard.cjs — Tier-2 markered-text, twin of the Claude/Codex hook (same
|
|
340
|
+
// stdin/stdout contract); differs in the tool names (`write_to_file` /
|
|
341
|
+
// `replace_file_content`) and the payload path field.
|
|
342
|
+
{
|
|
343
|
+
path: ".agents/plugins/bkit/hooks/bkit-gateguard.cjs",
|
|
344
|
+
format: "markered-text",
|
|
345
|
+
module: "antigravity",
|
|
346
|
+
},
|
|
347
|
+
// bkit-guardrails.cjs — Tier-2 markered-text, twin of the Cursor/Codex hook. Registered
|
|
348
|
+
// on matcher `run_command`, Antigravity's shell tool name.
|
|
349
|
+
{
|
|
350
|
+
path: ".agents/plugins/bkit/hooks/bkit-guardrails.cjs",
|
|
351
|
+
format: "markered-text",
|
|
352
|
+
module: "antigravity",
|
|
353
|
+
},
|
|
354
|
+
// Root GEMINI.md — Antigravity workspace-rule redirect to .agents/rules.md, owned by the
|
|
355
|
+
// antigravity module: `uninstall --antigravity` removes it; other installs leave it.
|
|
356
|
+
{ path: "GEMINI.md", format: "markered-text", module: "antigravity" },
|
|
357
|
+
// Subagent prompts (.agents/plugins/bkit/agents/bkit-*.md) and workflow skills
|
|
358
|
+
// (.agents/plugins/bkit/skills/bkit-*/) are managed dynamically — the set follows the
|
|
359
|
+
// bkit-prefix prompt/workflow files at install.
|
|
360
|
+
];
|
|
328
361
|
// Cloud agent integration is opt-in — NOT in a default install, so a default install
|
|
329
362
|
// ships ZERO cloud footprint. Every variant writes no files: the cloud workflow
|
|
330
363
|
// (bkit-cloud.yml), bkit-cloud-bootstrap.sh and the Cursor Background Agent files
|
|
@@ -351,6 +384,7 @@ const MODULE_MANIFESTS = {
|
|
|
351
384
|
cursor: CURSOR_MANIFEST,
|
|
352
385
|
opencode: OPENCODE_MANIFEST,
|
|
353
386
|
codex: CODEX_MANIFEST,
|
|
387
|
+
antigravity: ANTIGRAVITY_MANIFEST,
|
|
354
388
|
cloud: CLOUD_MANIFEST,
|
|
355
389
|
};
|
|
356
390
|
// ---------------------------------------------------------------------------
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
// install/modules/antigravity.ts — the Google Antigravity host module. The whole host
|
|
2
|
+
// installs into a workspace PLUGIN at `.agents/plugins/bkit/`, so `.agents/` root stays
|
|
3
|
+
// the dedicated Codex install.
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
|
+
import * as path from "node:path";
|
|
6
|
+
import { writeTier2, writeTier2JsonContained, ensureDir } from "../write.js";
|
|
7
|
+
import { stampManagedVersion } from "../version-file.js";
|
|
8
|
+
import { ANTIGRAVITY_AGENTS_DIR, applyAntigravityPrompt, applyAntigravitySkill, } from "../../render/hosts.js";
|
|
9
|
+
import { getCoreRoot, getSharedRoot, getWorkflowsRoot, getPromptsRoot, } from "../../shared/package-roots.js";
|
|
10
|
+
import { DEFAULT_ISSUE_TRACKER } from "../manifest.js";
|
|
11
|
+
import { substituteWorkflow } from "../../render/trackers.js";
|
|
12
|
+
import { BKIT_PREFIX, installFile, listMdFiles, readInstallingVersion, trackMirrorWrite, } from "./core.js";
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// runAntigravityModule — Google Antigravity IDE host (opt-in via --antigravity)
|
|
15
|
+
//
|
|
16
|
+
// Nullary flag, like --codex: Antigravity runs on one pinned gateway (`google`).
|
|
17
|
+
//
|
|
18
|
+
// The host installs as a workspace PLUGIN (`.agents/plugins/bkit/`) — Antigravity's own
|
|
19
|
+
// packaging surface (antigravity.google/docs/plugins). The plugin activates per project:
|
|
20
|
+
// .agents/plugins/bkit/plugin.json — plugin manifest (required)
|
|
21
|
+
// .agents/plugins/bkit/skills/bkit-<wf>/SKILL.md — workflow entry points (skills)
|
|
22
|
+
// .agents/plugins/bkit/agents/<name>.md — subagent prompt definitions
|
|
23
|
+
// .agents/plugins/bkit/hooks.json + hooks/ — GateGuard registration (PreToolUse)
|
|
24
|
+
//
|
|
25
|
+
// `.agents/` ROOT stays the dedicated Codex install: Codex workflow skills live at
|
|
26
|
+
// `.agents/skills/bkit-<wf>/SKILL.md` and this module never writes there.
|
|
27
|
+
//
|
|
28
|
+
// There is no native subagent tool on Antigravity: the orchestrator loads a prompt with
|
|
29
|
+
// `view_file` and executes its step contract in-session, which is why the workflow skills
|
|
30
|
+
// respell `**Subagent:** @name` to the plugin's `agents/<name>.md` path.
|
|
31
|
+
//
|
|
32
|
+
// `.agents/plugins/` may hold consumer plugins, so every sweep here is scoped to the
|
|
33
|
+
// `bkit` plugin directory (and, within it, to `bkit-` prefixed entries).
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
/** The bkit Antigravity workspace plugin root. */
|
|
36
|
+
export const ANTIGRAVITY_PLUGIN_DIR = ".agents/plugins/bkit";
|
|
37
|
+
/** Workflow skills, one directory per workflow, each holding SKILL.md. */
|
|
38
|
+
export const ANTIGRAVITY_SKILLS_DIR = ".agents/plugins/bkit/skills";
|
|
39
|
+
/** Subagent prompt definitions. Sourced from the renderer's shared constant. */
|
|
40
|
+
export { ANTIGRAVITY_AGENTS_DIR };
|
|
41
|
+
/** Hook scripts referenced by the plugin's hooks.json. */
|
|
42
|
+
export const ANTIGRAVITY_HOOKS_DIR = ".agents/plugins/bkit/hooks";
|
|
43
|
+
/**
|
|
44
|
+
* Convert a workflow orchestrator into an Antigravity SKILL.md. Tracker-conditional
|
|
45
|
+
* blocks are resolved first, exactly as for the other hosts' command mirrors.
|
|
46
|
+
*/
|
|
47
|
+
export function applyAntigravityWorkflowSkill(content, skillName, issueTracker) {
|
|
48
|
+
return applyAntigravitySkill(substituteWorkflow(content, issueTracker).output, skillName);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Render the plugin's subagent prompts and workflow skills. Extracted so `bkit upgrade`
|
|
52
|
+
* re-renders them identically — bkit-owned output, force-overwritten.
|
|
53
|
+
*/
|
|
54
|
+
export function renderAntigravityAgentsSkills(ctx) {
|
|
55
|
+
const { dryRun, effortMap, logPrefix } = ctx;
|
|
56
|
+
const tag = dryRun ? "[dry-run] " : "";
|
|
57
|
+
const issueTracker = ctx.issueTracker ?? DEFAULT_ISSUE_TRACKER;
|
|
58
|
+
const version = ctx.version ?? readInstallingVersion();
|
|
59
|
+
const written = [];
|
|
60
|
+
const modelLookup = ctx.antigravityModelLookup;
|
|
61
|
+
if (!modelLookup) {
|
|
62
|
+
throw new Error("renderAntigravityAgentsSkills: ctx.antigravityModelLookup is required");
|
|
63
|
+
}
|
|
64
|
+
// --- Prompts: markdown+frontmatter -> .agents/plugins/bkit/agents/<name>.md ---
|
|
65
|
+
{
|
|
66
|
+
const src = getPromptsRoot();
|
|
67
|
+
const dest = ANTIGRAVITY_AGENTS_DIR;
|
|
68
|
+
if (!dryRun)
|
|
69
|
+
ensureDir(dest);
|
|
70
|
+
const files = listMdFiles(src, BKIT_PREFIX);
|
|
71
|
+
const sourceSet = new Set(files);
|
|
72
|
+
for (const f of files) {
|
|
73
|
+
const transform = (c) => stampManagedVersion(applyAntigravityPrompt(substituteWorkflow(c, issueTracker).output, modelLookup, effortMap), version);
|
|
74
|
+
if (installFile(path.join(src, f), path.join(dest, f), transform, dryRun)) {
|
|
75
|
+
const rel = path.join(dest, f);
|
|
76
|
+
console.log(`${logPrefix} ${tag}write: ${rel}`);
|
|
77
|
+
trackMirrorWrite(ctx, rel, written);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Orphan sweep is bkit-prefix scoped — the plugin's agents/ is bkit-owned.
|
|
81
|
+
if (fs.existsSync(dest)) {
|
|
82
|
+
for (const f of fs.readdirSync(dest)) {
|
|
83
|
+
if (!f.startsWith(BKIT_PREFIX))
|
|
84
|
+
continue;
|
|
85
|
+
if (sourceSet.has(f))
|
|
86
|
+
continue;
|
|
87
|
+
const rel = path.join(dest, f);
|
|
88
|
+
if (!dryRun)
|
|
89
|
+
fs.rmSync(rel, { force: true });
|
|
90
|
+
console.log(`${logPrefix} ${tag}delete orphan: ${rel}`);
|
|
91
|
+
trackMirrorWrite(ctx, rel, written);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// --- Workflow skills: one directory per workflow, each holding SKILL.md ---
|
|
96
|
+
{
|
|
97
|
+
const src = getWorkflowsRoot();
|
|
98
|
+
const files = listMdFiles(src, BKIT_PREFIX);
|
|
99
|
+
const sourceStems = new Set(files.map((f) => f.replace(/\.md$/, "")));
|
|
100
|
+
if (!dryRun && files.length > 0)
|
|
101
|
+
ensureDir(ANTIGRAVITY_SKILLS_DIR);
|
|
102
|
+
for (const f of files) {
|
|
103
|
+
const stem = f.replace(/\.md$/, "");
|
|
104
|
+
const dest = path.join(ANTIGRAVITY_SKILLS_DIR, stem, "SKILL.md");
|
|
105
|
+
if (!dryRun)
|
|
106
|
+
ensureDir(path.dirname(dest));
|
|
107
|
+
const transform = (c) => stampManagedVersion(applyAntigravityWorkflowSkill(c, stem, issueTracker), version);
|
|
108
|
+
if (installFile(path.join(src, f), dest, transform, dryRun)) {
|
|
109
|
+
console.log(`${logPrefix} ${tag}write: ${dest}`);
|
|
110
|
+
trackMirrorWrite(ctx, dest, written);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Prefix-scoped sweep inside the bkit plugin's skills/.
|
|
114
|
+
if (fs.existsSync(ANTIGRAVITY_SKILLS_DIR)) {
|
|
115
|
+
for (const d of fs.readdirSync(ANTIGRAVITY_SKILLS_DIR)) {
|
|
116
|
+
if (!d.startsWith(BKIT_PREFIX))
|
|
117
|
+
continue;
|
|
118
|
+
if (sourceStems.has(d))
|
|
119
|
+
continue;
|
|
120
|
+
const rel = path.join(ANTIGRAVITY_SKILLS_DIR, d);
|
|
121
|
+
if (!dryRun)
|
|
122
|
+
fs.rmSync(rel, { recursive: true, force: true });
|
|
123
|
+
console.log(`${logPrefix} ${tag}delete orphan: ${rel}`);
|
|
124
|
+
trackMirrorWrite(ctx, rel, written);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return written;
|
|
129
|
+
}
|
|
130
|
+
export function runAntigravityModule(ctx) {
|
|
131
|
+
const { dryRun, advisories, ws, logPrefix } = ctx;
|
|
132
|
+
const tag = dryRun ? "[dry-run] " : "";
|
|
133
|
+
renderAntigravityAgentsSkills(ctx);
|
|
134
|
+
const pluginShared = path.join(getSharedRoot(), ".agents", "plugins", "bkit");
|
|
135
|
+
const pluginHooksSrc = path.join(getCoreRoot(), ".agents", "plugins", "bkit", "hooks");
|
|
136
|
+
// --- plugin.json — Tier-2 json (deep-contained), the required plugin manifest ---
|
|
137
|
+
{
|
|
138
|
+
const jsonSrc = path.join(pluginShared, "plugin.json");
|
|
139
|
+
const jsonDst = path.join(ANTIGRAVITY_PLUGIN_DIR, "plugin.json");
|
|
140
|
+
if (fs.existsSync(jsonSrc)) {
|
|
141
|
+
if (!dryRun)
|
|
142
|
+
ensureDir(path.dirname(jsonDst));
|
|
143
|
+
const prevLen = ws.writes.length;
|
|
144
|
+
writeTier2JsonContained(jsonSrc, jsonDst, dryRun, ws);
|
|
145
|
+
if (ws.writes.length > prevLen)
|
|
146
|
+
console.log(`${logPrefix} ${tag}antigravity: ${jsonDst}`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// Root GEMINI.md — Antigravity workspace-rule redirect to .agents/rules.md. A ROOT file
|
|
150
|
+
// (not under .agents/), so the plugin walk does not cover it. Tier-2 markered-text
|
|
151
|
+
// (writeTier2 html-comment), exact twin of the claude module's CLAUDE.md.
|
|
152
|
+
{
|
|
153
|
+
const src = path.join(getSharedRoot(), "GEMINI.md");
|
|
154
|
+
const dst = "GEMINI.md";
|
|
155
|
+
if (fs.existsSync(src)) {
|
|
156
|
+
const prevLen = ws.writes.length;
|
|
157
|
+
writeTier2(src, dst, ctx.tokens, "html-comment", dryRun, ws);
|
|
158
|
+
if (ws.writes.length > prevLen)
|
|
159
|
+
console.log(`${logPrefix} ${tag}antigravity: ${dst}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// --- plugin hooks.json — Tier-2 deep-contained (consumers may add their own groups) ---
|
|
163
|
+
{
|
|
164
|
+
const jsonSrc = path.join(pluginShared, "hooks.json");
|
|
165
|
+
const jsonDst = path.join(ANTIGRAVITY_PLUGIN_DIR, "hooks.json");
|
|
166
|
+
if (fs.existsSync(jsonSrc)) {
|
|
167
|
+
if (!dryRun)
|
|
168
|
+
ensureDir(path.dirname(jsonDst));
|
|
169
|
+
const prevLen = ws.writes.length;
|
|
170
|
+
writeTier2JsonContained(jsonSrc, jsonDst, dryRun, ws);
|
|
171
|
+
if (ws.writes.length > prevLen)
|
|
172
|
+
console.log(`${logPrefix} ${tag}antigravity: ${jsonDst}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// --- bkit-gateguard.cjs — Tier-2 markered-text, twin of the Claude/Codex hook ---
|
|
176
|
+
{
|
|
177
|
+
const hookSrc = path.join(pluginHooksSrc, "bkit-gateguard.cjs");
|
|
178
|
+
const hookDst = path.join(ANTIGRAVITY_HOOKS_DIR, "bkit-gateguard.cjs");
|
|
179
|
+
if (fs.existsSync(hookSrc)) {
|
|
180
|
+
if (!dryRun)
|
|
181
|
+
ensureDir(path.dirname(hookDst));
|
|
182
|
+
const prevLen = ws.writes.length;
|
|
183
|
+
writeTier2(hookSrc, hookDst, ctx.tokens, "slash-comment", dryRun, ws);
|
|
184
|
+
if (ws.writes.length > prevLen)
|
|
185
|
+
console.log(`${logPrefix} ${tag}antigravity: ${hookDst}`);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// --- bkit-guardrails.cjs — Tier-2 markered-text, twin of the Cursor/Codex hook ---
|
|
189
|
+
// Registered on matcher `run_command` in hooks.json above. Same decision engine as the
|
|
190
|
+
// other hosts; the deny tier blocks for real.
|
|
191
|
+
{
|
|
192
|
+
const railSrc = path.join(pluginHooksSrc, "bkit-guardrails.cjs");
|
|
193
|
+
const railDst = path.join(ANTIGRAVITY_HOOKS_DIR, "bkit-guardrails.cjs");
|
|
194
|
+
if (fs.existsSync(railSrc)) {
|
|
195
|
+
if (!dryRun)
|
|
196
|
+
ensureDir(path.dirname(railDst));
|
|
197
|
+
const prevLen = ws.writes.length;
|
|
198
|
+
writeTier2(railSrc, railDst, ctx.tokens, "slash-comment", dryRun, ws);
|
|
199
|
+
if (ws.writes.length > prevLen)
|
|
200
|
+
console.log(`${logPrefix} ${tag}antigravity: ${railDst}`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
advisories.push({
|
|
204
|
+
id: "antigravity-setup",
|
|
205
|
+
severity: "advisory",
|
|
206
|
+
detect: "antigravity host installed as a workspace plugin (.agents/plugins/bkit/: plugin.json + skills/bkit-* + agents/ + hooks.json).",
|
|
207
|
+
action: "Three things that differ from the other hosts:\n" +
|
|
208
|
+
"1. Workflows are SKILLS here, not slash commands: Antigravity discovers them under `.agents/plugins/bkit/skills/bkit-<wf>/SKILL.md` (the plugin activates per project — no toggle).\n" +
|
|
209
|
+
"2. There is no native subagent tool. The orchestrator loads each subagent prompt from `.agents/plugins/bkit/agents/` with `view_file` and executes it in-session; isolated runs use `run_command` (`agy`).\n" +
|
|
210
|
+
"3. GateGuard and guardrails are wired from `.agents/plugins/bkit/hooks.json` (PreToolUse on `write_to_file` / `replace_file_content` / `run_command`). See .bkit/providers.md.",
|
|
211
|
+
});
|
|
212
|
+
// Both hosts installed: Antigravity's skill selector lists TWO sets of bkit-* skills.
|
|
213
|
+
// Codex does not merge same-named skills; Antigravity lists both. Warn which to pick.
|
|
214
|
+
const codexPresent = ctx.installedModules?.has("codex") ??
|
|
215
|
+
fs.existsSync(path.join(process.cwd(), ".codex", "agents"));
|
|
216
|
+
if (codexPresent) {
|
|
217
|
+
advisories.push({
|
|
218
|
+
id: "antigravity-codex-skill-overlap",
|
|
219
|
+
severity: "advisory",
|
|
220
|
+
detect: "Codex and Antigravity are both installed — Antigravity's skill selector now lists BOTH the Codex workflow skills (`.agents/skills/bkit-<wf>/SKILL.md`) and the Antigravity plugin skills (`.agents/plugins/bkit/skills/bkit-<wf>/SKILL.md`).",
|
|
221
|
+
action: "In Antigravity, invoke the WORKFLOW skills from the plugin under `.agents/plugins/bkit/skills/bkit-<wf>/SKILL.md` — they carry Antigravity's tool vocabulary (`view_file`, plugin subagent paths). The `.agents/skills/bkit-*` copies are Codex's install and name Claude/Codex tools Antigravity does not have. If you only use one host, the other's skills are harmless but may appear in the picker.",
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
@@ -98,6 +98,9 @@ export function renderCodexAgentsSkills(ctx) {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
// --- Workflow skills: one directory per workflow, each holding SKILL.md ---
|
|
101
|
+
// `.agents/skills/` is Codex's. The Antigravity host installs its own workflow skills
|
|
102
|
+
// into a workspace plugin (`.agents/plugins/bkit/skills/`) instead, so this directory
|
|
103
|
+
// has a single writer and the two hosts never fight over one file.
|
|
101
104
|
{
|
|
102
105
|
const src = getWorkflowsRoot();
|
|
103
106
|
const files = listMdFiles(src, BKIT_PREFIX);
|
|
@@ -70,7 +70,13 @@ export function removeOrphans(destDir, sourceFiles, dryRun, prefix) {
|
|
|
70
70
|
return removed;
|
|
71
71
|
}
|
|
72
72
|
/** The markered-text `.agents/*.md` blocks core owns. */
|
|
73
|
-
const CORE_AGENT_FILES = [
|
|
73
|
+
const CORE_AGENT_FILES = [
|
|
74
|
+
"context.md",
|
|
75
|
+
"docs.md",
|
|
76
|
+
"rules.md",
|
|
77
|
+
"shortcuts.md",
|
|
78
|
+
"skills.md",
|
|
79
|
+
];
|
|
74
80
|
// The two shared-root files core writes: stored in `shared/`, owned by the core
|
|
75
81
|
// manifest, written as html-comment managed blocks.
|
|
76
82
|
const CORE_SHARED_FILES = [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Each module function receives { dryRun, tokens, modelLookup, advisories, ws, … } (ModuleContext)
|
|
3
3
|
// and emits writes into the shared WriteSet.
|
|
4
4
|
//
|
|
5
|
-
// Dispatch order: core → claude → cursor → opencode → codex → cloud
|
|
5
|
+
// Dispatch order: core → claude → cursor → opencode → codex → antigravity → cloud
|
|
6
6
|
// .bkit/version is written LAST — in postDispatch after ALL modules complete (MED-4).
|
|
7
7
|
import * as fs from "node:fs";
|
|
8
8
|
import * as path from "node:path";
|
|
@@ -13,6 +13,7 @@ import { renderClaudeAgentsCommands, runClaudeModule } from "./claude.js";
|
|
|
13
13
|
import { renderCursorAgentsCommands, runCursorModule } from "./cursor.js";
|
|
14
14
|
import { renderOpencodeAgentsCommands, runOpencodeModule } from "./opencode.js";
|
|
15
15
|
import { CODEX_SKILLS_DIR, renderCodexAgentsSkills, runCodexModule } from "./codex.js";
|
|
16
|
+
import { ANTIGRAVITY_SKILLS_DIR, renderAntigravityAgentsSkills, runAntigravityModule, } from "./antigravity.js";
|
|
16
17
|
import { runCloudModule } from "./cloud.js";
|
|
17
18
|
// ---------------------------------------------------------------------------
|
|
18
19
|
// renderManagedOutputs — re-render the bkit-managed OUTPUT files that the
|
|
@@ -52,6 +53,8 @@ export function renderManagedOutputs(modules, ctx) {
|
|
|
52
53
|
written.push(...renderOpencodeAgentsCommands(ctx));
|
|
53
54
|
if (modules.has("codex"))
|
|
54
55
|
written.push(...renderCodexAgentsSkills(ctx));
|
|
56
|
+
if (modules.has("antigravity"))
|
|
57
|
+
written.push(...renderAntigravityAgentsSkills(ctx));
|
|
55
58
|
return written;
|
|
56
59
|
}
|
|
57
60
|
/** Rendered mirror dirs: every `bkit-*` file of the given extension in each is bkit's. */
|
|
@@ -63,6 +66,7 @@ const RENDERED_MIRRORS = [
|
|
|
63
66
|
[".opencode/agents", ".md"],
|
|
64
67
|
[".opencode/commands", ".md"],
|
|
65
68
|
[".codex/agents", ".toml"],
|
|
69
|
+
[".agents/plugins/bkit/agents", ".md"],
|
|
66
70
|
];
|
|
67
71
|
/**
|
|
68
72
|
* Every file bkit writes into `cwd` that carries the managed-version marker: the core
|
|
@@ -98,13 +102,18 @@ export function listStampedFiles(cwd) {
|
|
|
98
102
|
add(path.join(dir, f), "whole");
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
105
|
+
// Codex renders workflow skills into `.agents/skills/bkit-*/SKILL.md`; Antigravity renders
|
|
106
|
+
// its own into the plugin `.agents/plugins/bkit/skills/bkit-*/SKILL.md`. Both stamp a
|
|
107
|
+
// managed-version marker; collect each for the stale detector.
|
|
108
|
+
for (const dir of [CODEX_SKILLS_DIR, ANTIGRAVITY_SKILLS_DIR]) {
|
|
109
|
+
const abs = path.join(cwd, dir);
|
|
110
|
+
if (!fs.existsSync(abs))
|
|
111
|
+
continue;
|
|
112
|
+
for (const d of fs.readdirSync(abs)) {
|
|
104
113
|
if (!d.startsWith(BKIT_PREFIX))
|
|
105
114
|
continue;
|
|
106
|
-
if (fs.existsSync(path.join(
|
|
107
|
-
add(path.join(
|
|
115
|
+
if (fs.existsSync(path.join(abs, d, "SKILL.md"))) {
|
|
116
|
+
add(path.join(dir, d, "SKILL.md"), "whole");
|
|
108
117
|
}
|
|
109
118
|
}
|
|
110
119
|
}
|
|
@@ -119,6 +128,7 @@ export const MODULE_REGISTRY = {
|
|
|
119
128
|
cursor: runCursorModule,
|
|
120
129
|
opencode: runOpencodeModule,
|
|
121
130
|
codex: runCodexModule,
|
|
131
|
+
antigravity: runAntigravityModule,
|
|
122
132
|
cloud: runCloudModule,
|
|
123
133
|
// "full" is never directly in the registry — resolveModules expands it to all modules
|
|
124
134
|
};
|
|
@@ -129,6 +139,7 @@ export const MODULE_DISPATCH_ORDER = [
|
|
|
129
139
|
"cursor",
|
|
130
140
|
"opencode",
|
|
131
141
|
"codex",
|
|
142
|
+
"antigravity",
|
|
132
143
|
"cloud",
|
|
133
144
|
];
|
|
134
145
|
/**
|