@cbartens/bkit 5.0.3 → 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 +4 -2
- 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/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/templates/.github/workflows/bkit-ci.yml +24 -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 +20 -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/render/hosts.js +149 -1
- package/dist/render/models.js +9 -0
- package/package.json +5 -3
package/.bkit/core/engine/cli.ts
CHANGED
|
@@ -20,7 +20,8 @@ import { runInstall } from "./commands/install/install.js";
|
|
|
20
20
|
import { OPTIN_MODULES } from "./install/manifest.js";
|
|
21
21
|
import { OPENCODE_PROVIDERS } from "./shared/egress.js";
|
|
22
22
|
|
|
23
|
-
export type ModuleFlag =
|
|
23
|
+
export type ModuleFlag =
|
|
24
|
+
"core" | "claude" | "cursor" | "opencode" | "codex" | "antigravity" | "cloud";
|
|
24
25
|
|
|
25
26
|
/** Cloud-agent variant chosen via `--auto=<variant>`. */
|
|
26
27
|
export const CLOUD_VARIANTS = ["claude", "cursor", "opencode"] as const;
|
|
@@ -169,7 +170,7 @@ export interface UpgradeFlags {
|
|
|
169
170
|
// generic check only ever validates claude/cursor/codex. `full`, `core` and `cloud`
|
|
170
171
|
// are NOT accepted as bare flags: use `--auto=<claude|cursor>`; core is implicit.
|
|
171
172
|
// There is no dependency-updater flag. Copy an example; CI warns when none is present.
|
|
172
|
-
const MODULE_FLAGS = new Set<ModuleFlag>(["claude", "cursor", "opencode", "codex"]);
|
|
173
|
+
const MODULE_FLAGS = new Set<ModuleFlag>(["claude", "cursor", "opencode", "codex", "antigravity"]);
|
|
173
174
|
|
|
174
175
|
// ALL_MODULES — every non-opt-in module, core first. Used to expand a bare/full
|
|
175
176
|
// uninstall (which additionally pulls in the opt-in add-ons below for zero footprint).
|
|
@@ -411,6 +412,12 @@ export function parseArgs(argv: string[]): ParsedArgs {
|
|
|
411
412
|
);
|
|
412
413
|
process.exit(1);
|
|
413
414
|
}
|
|
415
|
+
if (flag.startsWith("antigravity=")) {
|
|
416
|
+
console.error(
|
|
417
|
+
`[bkit] --antigravity takes no value (got ${JSON.stringify("--" + flag)}). Antigravity runs on one gateway (google), so the flag is bare: --antigravity. Only --opencode is provider-pluggable.`,
|
|
418
|
+
);
|
|
419
|
+
process.exit(1);
|
|
420
|
+
}
|
|
414
421
|
if (flag.startsWith("opencode=")) {
|
|
415
422
|
const rawValue = flag.slice("opencode=".length);
|
|
416
423
|
if (!rawValue) {
|
|
@@ -612,12 +619,12 @@ Usage:
|
|
|
612
619
|
|
|
613
620
|
Core (implicit — no flag; installed/upgraded on every install):
|
|
614
621
|
AGENTS.md (cross-host dispatch router), .agents/rules.md + .agents/context.md +
|
|
615
|
-
.agents/docs.md + .agents/skills.md managed blocks, .gitignore +
|
|
616
|
-
blocks, docs/, .bkit/*.md, .bkit/version, the template copies in
|
|
617
|
-
the bkit:gate:* / bkit:deps:* package.json scripts every workflow
|
|
618
|
-
missing, never overwritten, left by uninstall). The tool scripts those
|
|
619
|
-
(typecheck, lint, format:check, lint:prose, slop:delta) and their devDeps are
|
|
620
|
-
to add: see .bkit/templates.md.
|
|
622
|
+
.agents/docs.md + .agents/shortcuts.md + .agents/skills.md managed blocks, .gitignore +
|
|
623
|
+
.gitattributes managed blocks, docs/, .bkit/*.md, .bkit/version, the template copies in
|
|
624
|
+
.bkit/templates/, and the bkit:gate:* / bkit:deps:* package.json scripts every workflow
|
|
625
|
+
runs (added when missing, never overwritten, left by uninstall). The tool scripts those
|
|
626
|
+
gates chain (typecheck, lint, format:check, lint:prose, slop:delta) and their devDeps are
|
|
627
|
+
yours to add: see .bkit/templates.md.
|
|
621
628
|
|
|
622
629
|
Module flags (composable; symmetric install ↔ uninstall):
|
|
623
630
|
--claude .claude/agents/ + .claude/commands/ (byte-identical mirror) + CLAUDE.md
|
|
@@ -639,6 +646,13 @@ Module flags (composable; symmetric install ↔ uninstall):
|
|
|
639
646
|
+ .codex/hooks.json + .codex/hooks/bkit-gateguard.cjs, plus the workflow skills
|
|
640
647
|
(.agents/skills/bkit-*/). Codex loads project-local hooks ONLY once the
|
|
641
648
|
.codex/ layer is trusted — until then GateGuard is installed and never fires.
|
|
649
|
+
--antigravity Google Antigravity IDE host. BARE flag — takes no value: Antigravity runs
|
|
650
|
+
on one gateway (google). Installs as a workspace PLUGIN at
|
|
651
|
+
.agents/plugins/bkit/ — plugin.json + skills/bkit-*/SKILL.md (workflow
|
|
652
|
+
skills) + agents/bkit-*.md (subagent prompts) + hooks.json + hooks/*.cjs,
|
|
653
|
+
keeping .agents/ root Codex's. Plus root GEMINI.md. There is no native
|
|
654
|
+
subagent tool: the orchestrator loads each prompt with view_file and runs
|
|
655
|
+
it in-session.
|
|
642
656
|
|
|
643
657
|
Dependency updaters (copy an example and own it):
|
|
644
658
|
.bkit/templates/.github/renovate.json5
|
|
@@ -682,6 +696,8 @@ Uninstall flags:
|
|
|
682
696
|
Examples:
|
|
683
697
|
bkit install --claude .claude/** + CLAUDE.md + core.
|
|
684
698
|
bkit install --claude --cursor Both hosts + core.
|
|
699
|
+
bkit install --codex Codex CLI host (agents + workflow skills + hooks).
|
|
700
|
+
bkit install --antigravity Google Antigravity host (workspace plugin under .agents/plugins/bkit/ + GEMINI.md).
|
|
685
701
|
bkit install --opencode=opencode-zen opencode host (Zen built-in gateway, additive).
|
|
686
702
|
bkit install --opencode=opencode-go opencode host (Go built-in gateway, additive).
|
|
687
703
|
bkit install --opencode=openrouter add openrouter alongside an opencode gateway.
|
|
@@ -736,7 +752,7 @@ export function validateModuleFlagsForVerb(
|
|
|
736
752
|
if (verb === "install" && moduleFlags.size === 0) {
|
|
737
753
|
return (
|
|
738
754
|
"[bkit] `bkit install` requires at least one module flag. Name what to install: " +
|
|
739
|
-
"--claude, --cursor, --codex, --opencode=<provider> (plus opt-in " +
|
|
755
|
+
"--claude, --cursor, --codex, --antigravity, --opencode=<provider> (plus opt-in " +
|
|
740
756
|
"--auto=<claude|cursor>). Run `bkit help` for usage."
|
|
741
757
|
);
|
|
742
758
|
}
|
|
@@ -30,6 +30,8 @@ export function detectInstalledModules(cwd: string): Set<ModuleFlag> {
|
|
|
30
30
|
if (fs.existsSync(path.join(cwd, ".cursor", "agents"))) mods.add("cursor");
|
|
31
31
|
if (fs.existsSync(path.join(cwd, ".opencode", "agents"))) mods.add("opencode");
|
|
32
32
|
if (fs.existsSync(path.join(cwd, ".codex", "agents"))) mods.add("codex");
|
|
33
|
+
if (fs.existsSync(path.join(cwd, ".agents", "plugins", "bkit", "plugin.json")))
|
|
34
|
+
mods.add("antigravity");
|
|
33
35
|
return mods;
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -97,6 +97,11 @@ export function runStatus(cwd: string, logPrefix: string): void {
|
|
|
97
97
|
const codexDir = path.join(cwd, ".codex");
|
|
98
98
|
const codexPresent = fs.existsSync(codexDir);
|
|
99
99
|
|
|
100
|
+
// --- antigravity host ---
|
|
101
|
+
const antigravityPresent = fs.existsSync(
|
|
102
|
+
path.join(cwd, ".agents", "plugins", "bkit", "plugin.json"),
|
|
103
|
+
);
|
|
104
|
+
|
|
100
105
|
const opencodeStatus = opencodePresent
|
|
101
106
|
? `INSTALLED (${providerLabel}: ${opencodeProviderDisplay} / model: ${opencodeModel})`
|
|
102
107
|
: "absent (run: bkit install --opencode=<provider>)";
|
|
@@ -104,6 +109,9 @@ export function runStatus(cwd: string, logPrefix: string): void {
|
|
|
104
109
|
console.log(
|
|
105
110
|
`${logPrefix} codex: ${codexPresent ? "INSTALLED (provider: openai)" : "absent (run: bkit install --codex)"}`,
|
|
106
111
|
);
|
|
112
|
+
console.log(
|
|
113
|
+
`${logPrefix} antigravity: ${antigravityPresent ? "INSTALLED (provider: google)" : "absent (run: bkit install --antigravity)"}`,
|
|
114
|
+
);
|
|
107
115
|
|
|
108
116
|
// --- summary ---
|
|
109
117
|
const installedHosts = [
|
|
@@ -111,6 +119,7 @@ export function runStatus(cwd: string, logPrefix: string): void {
|
|
|
111
119
|
cursorPresent ? "cursor" : null,
|
|
112
120
|
opencodePresent ? "opencode" : null,
|
|
113
121
|
codexPresent ? "codex" : null,
|
|
122
|
+
antigravityPresent ? "antigravity" : null,
|
|
114
123
|
].filter(Boolean);
|
|
115
124
|
console.log(
|
|
116
125
|
`${logPrefix} Installed hosts: ${installedHosts.length > 0 ? installedHosts.join(", ") : "none"}`,
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
parseModelLookup,
|
|
32
32
|
applyModelOverrides,
|
|
33
33
|
buildOpencodeModelLookup,
|
|
34
|
+
buildAntigravityModelLookup,
|
|
34
35
|
parseEffortMap,
|
|
35
36
|
} from "../../render/models.js";
|
|
36
37
|
import { getBkitDocsRoot } from "../../shared/package-roots.js";
|
|
@@ -116,6 +117,7 @@ export function modulesToCliFlags(
|
|
|
116
117
|
if (mods.has("cursor")) out.push("--cursor");
|
|
117
118
|
if (mods.has("opencode")) out.push(`--opencode=${opencodeProvider ?? "<provider>"}`);
|
|
118
119
|
if (mods.has("codex")) out.push("--codex");
|
|
120
|
+
if (mods.has("antigravity")) out.push("--antigravity");
|
|
119
121
|
if (mods.has("cloud")) out.push(`--auto=${cloudVariant ?? "<variant>"}`);
|
|
120
122
|
return out.join(" ");
|
|
121
123
|
}
|
|
@@ -300,6 +302,7 @@ export async function runInstall(
|
|
|
300
302
|
let modelLookup: Map<string, string> = new Map();
|
|
301
303
|
let opencodeModelLookup: Map<string, string> = new Map();
|
|
302
304
|
let codexModelLookup: Map<string, string> = new Map();
|
|
305
|
+
let antigravityModelLookup: Map<string, string> = new Map();
|
|
303
306
|
let effortMap: EffortMap = new Map();
|
|
304
307
|
const promptsMdPath = path.join(getBkitDocsRoot(), "prompts.md");
|
|
305
308
|
const consumerPromptsMdPath = path.join(process.cwd(), ".bkit", "prompts.md");
|
|
@@ -333,6 +336,15 @@ export async function runInstall(
|
|
|
333
336
|
}
|
|
334
337
|
applyModelOverrides(codexModelLookup, "openai", consumerPromptsMdPath);
|
|
335
338
|
}
|
|
339
|
+
if (effectiveModules.has("antigravity")) {
|
|
340
|
+
// Antigravity is nullary — one gateway (`google`), so there is nothing to detect.
|
|
341
|
+
try {
|
|
342
|
+
antigravityModelLookup = buildAntigravityModelLookup(promptsMdPath);
|
|
343
|
+
} catch {
|
|
344
|
+
// Not fatal — antigravity module will fail per-file if a model is missing
|
|
345
|
+
}
|
|
346
|
+
applyModelOverrides(antigravityModelLookup, "google", consumerPromptsMdPath);
|
|
347
|
+
}
|
|
336
348
|
effortMap = parseEffortMap(promptsMdPath);
|
|
337
349
|
}
|
|
338
350
|
|
|
@@ -426,6 +438,7 @@ export async function runInstall(
|
|
|
426
438
|
modelLookup,
|
|
427
439
|
opencodeModelLookup,
|
|
428
440
|
codexModelLookup,
|
|
441
|
+
antigravityModelLookup,
|
|
429
442
|
effortMap,
|
|
430
443
|
opencodeProvider: renderOpencodeProvider,
|
|
431
444
|
advisories,
|
|
@@ -436,6 +449,13 @@ export async function runInstall(
|
|
|
436
449
|
cloudVariant,
|
|
437
450
|
// Stamped into every rendered agent + command as the managed-version marker.
|
|
438
451
|
version: getInstallingVersion(),
|
|
452
|
+
// Full host set for this run: dispatched ∪ already-on-disk. Read by the Antigravity
|
|
453
|
+
// module to warn when Codex is also installed (both hosts' `bkit-*` workflow skills
|
|
454
|
+
// then surface in Antigravity's skill selector).
|
|
455
|
+
installedModules: new Set<ModuleFlag>([
|
|
456
|
+
...effectiveModules,
|
|
457
|
+
...detectInstalledModules(process.cwd()),
|
|
458
|
+
]),
|
|
439
459
|
};
|
|
440
460
|
|
|
441
461
|
// --- Phase 2: Install (current behaviour — dispatch modules) ---
|
|
@@ -248,6 +248,7 @@ const CORE_TEMPLATE_DOCTRINE: ManifestEntry[] = [
|
|
|
248
248
|
{ path: ".agents/context.md", format: "markered-text", module: "core" },
|
|
249
249
|
{ path: ".agents/docs.md", format: "markered-text", module: "core" },
|
|
250
250
|
{ path: ".agents/rules.md", format: "markered-text", module: "core" },
|
|
251
|
+
{ path: ".agents/shortcuts.md", format: "markered-text", module: "core" },
|
|
251
252
|
{ path: ".agents/skills.md", format: "markered-text", module: "core" },
|
|
252
253
|
];
|
|
253
254
|
|
|
@@ -283,7 +284,7 @@ export function buildDecisionTable(
|
|
|
283
284
|
modules instanceof Set
|
|
284
285
|
? ([...modules].filter((m) =>
|
|
285
286
|
// Includes the opt-in add-ons (cloud) a Set caller passes.
|
|
286
|
-
["core", "claude", "cursor", "opencode", "codex", "cloud"].includes(m),
|
|
287
|
+
["core", "claude", "cursor", "opencode", "codex", "antigravity", "cloud"].includes(m),
|
|
287
288
|
) as ModuleName[])
|
|
288
289
|
: (modules as ModuleName[]);
|
|
289
290
|
|
|
@@ -501,7 +502,7 @@ export async function runUninstall(
|
|
|
501
502
|
modules instanceof Set
|
|
502
503
|
? ([...modules].filter((m) =>
|
|
503
504
|
// Includes the opt-in add-ons (cloud) a Set caller passes.
|
|
504
|
-
["core", "claude", "cursor", "opencode", "codex", "cloud"].includes(m),
|
|
505
|
+
["core", "claude", "cursor", "opencode", "codex", "antigravity", "cloud"].includes(m),
|
|
505
506
|
) as ModuleName[])
|
|
506
507
|
: (modules as ModuleName[]);
|
|
507
508
|
|
|
@@ -715,6 +716,9 @@ export async function runUninstall(
|
|
|
715
716
|
// separately below: `.agents/skills/` is SHARED with third-party skills installed via
|
|
716
717
|
// skills.sh, so the directory itself must never be removed wholesale.
|
|
717
718
|
...(moduleList.includes("codex") ? [".codex/agents"] : []),
|
|
719
|
+
// antigravity plugin subagent mirrors (`.agents/plugins/bkit/agents/bkit-*.md`). The
|
|
720
|
+
// plugin's workflow skills (`.agents/plugins/bkit/skills/bkit-*`) are swept below.
|
|
721
|
+
...(moduleList.includes("antigravity") ? [".agents/plugins/bkit/agents"] : []),
|
|
718
722
|
];
|
|
719
723
|
for (const dir of mirrorDirs) {
|
|
720
724
|
const absDir = path.join(ctx.cwd, dir);
|
|
@@ -733,24 +737,31 @@ export async function runUninstall(
|
|
|
733
737
|
}
|
|
734
738
|
}
|
|
735
739
|
|
|
736
|
-
// Workflow skills
|
|
737
|
-
// skills.sh, so only the bkit-prefixed DIRECTORIES are removed — never the
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
740
|
+
// Workflow skills. Codex's live at `.agents/skills/` (SHARED with third-party skills
|
|
741
|
+
// installed via skills.sh, so only the bkit-prefixed DIRECTORIES are removed — never the
|
|
742
|
+
// parent); Antigravity's live in its plugin at `.agents/plugins/bkit/skills/`. Sweep each
|
|
743
|
+
// host's set independently.
|
|
744
|
+
const skillDirs = [
|
|
745
|
+
...(moduleList.includes("codex") ? [path.join(".agents", "skills")] : []),
|
|
746
|
+
...(moduleList.includes("antigravity")
|
|
747
|
+
? [path.join(".agents", "plugins", "bkit", "skills")]
|
|
748
|
+
: []),
|
|
749
|
+
];
|
|
750
|
+
for (const skillsDir of skillDirs) {
|
|
751
|
+
const absDir = path.join(ctx.cwd, skillsDir);
|
|
752
|
+
if (!fs.existsSync(absDir)) continue;
|
|
753
|
+
try {
|
|
754
|
+
for (const d of fs.readdirSync(absDir)) {
|
|
755
|
+
if (!d.startsWith("bkit-")) continue;
|
|
756
|
+
const abs = path.join(absDir, d);
|
|
757
|
+
if (!fs.statSync(abs).isDirectory()) continue;
|
|
758
|
+
fs.rmSync(abs, { recursive: true, force: true });
|
|
759
|
+
result.deleted.push(path.join(skillsDir, d));
|
|
760
|
+
console.log(`${ctx.logPrefix} delete mirror: ${path.join(skillsDir, d)}`);
|
|
753
761
|
}
|
|
762
|
+
} catch (err) {
|
|
763
|
+
const msg = (err as Error).message;
|
|
764
|
+
console.error(`${ctx.logPrefix} error cleaning up ${skillsDir}: ${msg}`);
|
|
754
765
|
}
|
|
755
766
|
}
|
|
756
767
|
}
|
|
@@ -77,6 +77,7 @@ import {
|
|
|
77
77
|
parseModelLookup,
|
|
78
78
|
applyModelOverrides,
|
|
79
79
|
buildOpencodeModelLookup,
|
|
80
|
+
buildAntigravityModelLookup,
|
|
80
81
|
parseEffortMap,
|
|
81
82
|
} from "../../render/models.js";
|
|
82
83
|
|
|
@@ -478,8 +479,8 @@ export function updateCanonicalHashesAfterUpgrade(
|
|
|
478
479
|
|
|
479
480
|
const fresh: Record<string, string> = {};
|
|
480
481
|
for (const relPath of seedablePaths) {
|
|
481
|
-
// Exclude .agents/ internal files (docs.md, friction.md, rules.md,
|
|
482
|
-
// .env.example etc.) from canonicalHashes — they are not consumer-facing files
|
|
482
|
+
// Exclude .agents/ internal files (docs.md, friction.md, rules.md, shortcuts.md,
|
|
483
|
+
// skills.md, .env.example etc.) from canonicalHashes — they are not consumer-facing files
|
|
483
484
|
// whose hashes bkit uses for drift detection. Mirrors the same filter applied
|
|
484
485
|
// in the install path (install/modules/index.ts postDispatch). Template copies carry no
|
|
485
486
|
// hash there either.
|
|
@@ -538,6 +539,8 @@ export function detectInstalledHostModules(cwd: string): Set<ModuleFlag> {
|
|
|
538
539
|
if (fs.existsSync(path.join(cwd, ".cursor", "agents"))) mods.add("cursor");
|
|
539
540
|
if (fs.existsSync(path.join(cwd, ".opencode", "agents"))) mods.add("opencode");
|
|
540
541
|
if (fs.existsSync(path.join(cwd, ".codex", "agents"))) mods.add("codex");
|
|
542
|
+
if (fs.existsSync(path.join(cwd, ".agents", "plugins", "bkit", "plugin.json")))
|
|
543
|
+
mods.add("antigravity");
|
|
541
544
|
return mods;
|
|
542
545
|
}
|
|
543
546
|
|
|
@@ -855,6 +858,7 @@ export async function runUpgradeCommand(upgradeFlags: UpgradeFlags): Promise<voi
|
|
|
855
858
|
let renderModelLookup: Map<string, string> = new Map();
|
|
856
859
|
let renderOpencodeModelLookup: Map<string, string> = new Map();
|
|
857
860
|
let renderCodexModelLookup: Map<string, string> = new Map();
|
|
861
|
+
let renderAntigravityModelLookup: Map<string, string> = new Map();
|
|
858
862
|
let renderEffortMap: EffortMap = new Map();
|
|
859
863
|
const pkgPromptsMd = path.join(getBkitDocsRoot(), "prompts.md");
|
|
860
864
|
const consumerPromptsMd = path.join(process.cwd(), ".bkit", "prompts.md");
|
|
@@ -882,6 +886,14 @@ export async function runUpgradeCommand(upgradeFlags: UpgradeFlags): Promise<voi
|
|
|
882
886
|
}
|
|
883
887
|
applyModelOverrides(renderCodexModelLookup, "openai", consumerPromptsMd);
|
|
884
888
|
}
|
|
889
|
+
if (renderModules.has("antigravity")) {
|
|
890
|
+
try {
|
|
891
|
+
renderAntigravityModelLookup = buildAntigravityModelLookup(pkgPromptsMd);
|
|
892
|
+
} catch {
|
|
893
|
+
// Not fatal — the antigravity module fails per-file if a model is missing
|
|
894
|
+
}
|
|
895
|
+
applyModelOverrides(renderAntigravityModelLookup, "google", consumerPromptsMd);
|
|
896
|
+
}
|
|
885
897
|
renderEffortMap = parseEffortMap(pkgPromptsMd);
|
|
886
898
|
}
|
|
887
899
|
const renderWs: WriteSet = { writes: [] };
|
|
@@ -891,6 +903,7 @@ export async function runUpgradeCommand(upgradeFlags: UpgradeFlags): Promise<voi
|
|
|
891
903
|
modelLookup: renderModelLookup,
|
|
892
904
|
opencodeModelLookup: renderOpencodeModelLookup,
|
|
893
905
|
codexModelLookup: renderCodexModelLookup,
|
|
906
|
+
antigravityModelLookup: renderAntigravityModelLookup,
|
|
894
907
|
effortMap: renderEffortMap,
|
|
895
908
|
opencodeProvider: renderProvider,
|
|
896
909
|
advisories: [],
|
|
@@ -902,6 +915,8 @@ export async function runUpgradeCommand(upgradeFlags: UpgradeFlags): Promise<voi
|
|
|
902
915
|
// Re-stamp every rendered agent + command at the version we are upgrading TO,
|
|
903
916
|
// so a clean upgrade refreshes the managed-version marker and `bkit check` stays green.
|
|
904
917
|
version: getInstallingVersion(),
|
|
918
|
+
// The detected host set — read by the Antigravity module for the Codex-overlap advisory.
|
|
919
|
+
installedModules: renderModules,
|
|
905
920
|
};
|
|
906
921
|
const rendered = renderManagedOutputs(renderModules, renderCtx);
|
|
907
922
|
|
|
@@ -56,6 +56,14 @@ export type Probe =
|
|
|
56
56
|
| { kind: "unavailable"; message: string }
|
|
57
57
|
| { kind: "failed"; message: string };
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* The `owner/repo` a PR URL points at, or undefined when it is not a recognizable
|
|
61
|
+
* GitHub PR URL. Lets a caller compare the repo a PR resolved in against `--repo`.
|
|
62
|
+
*/
|
|
63
|
+
export function prRepoSlug(url: string | null | undefined): string | undefined {
|
|
64
|
+
return /^https?:\/\/[^/]+\/([^/]+\/[^/]+)\/pull\//.exec(url ?? "")?.[1];
|
|
65
|
+
}
|
|
66
|
+
|
|
59
67
|
function ghFailure(res: GhResult, what: string): Probe {
|
|
60
68
|
const detail = res.stderr.split("\n").at(-1) || `exit ${String(res.status)}`;
|
|
61
69
|
return ghUnavailable(res)
|
|
@@ -70,10 +78,19 @@ function ghFailure(res: GhResult, what: string): Probe {
|
|
|
70
78
|
*/
|
|
71
79
|
export function probePr(
|
|
72
80
|
cwd: string,
|
|
73
|
-
opts: {
|
|
81
|
+
opts: {
|
|
82
|
+
head?: string;
|
|
83
|
+
base?: string;
|
|
84
|
+
state: "open" | "all";
|
|
85
|
+
number?: string;
|
|
86
|
+
/** Honour `--repo`: resolve the PR in this owner/repo, not the checkout's remote. */
|
|
87
|
+
repo?: string;
|
|
88
|
+
},
|
|
74
89
|
): Probe {
|
|
75
90
|
if (opts.number !== undefined) {
|
|
76
|
-
const
|
|
91
|
+
const args = ["pr", "view", opts.number, "--json", `${PR_FIELDS},mergeable`];
|
|
92
|
+
if (opts.repo !== undefined) args.push("--repo", opts.repo);
|
|
93
|
+
const res = runGh(cwd, args);
|
|
77
94
|
if (!res.ok) return ghFailure(res, `gh pr view ${opts.number}`);
|
|
78
95
|
const parsed = parseJson(res.stdout);
|
|
79
96
|
if (!parsed.ok) return { kind: "failed", message: "gh pr view printed no JSON" };
|
|
@@ -81,6 +98,7 @@ export function probePr(
|
|
|
81
98
|
}
|
|
82
99
|
const args = ["pr", "list", "--head", opts.head!, "--state", opts.state, "--json", PR_FIELDS];
|
|
83
100
|
if (opts.base !== undefined) args.push("--base", opts.base);
|
|
101
|
+
if (opts.repo !== undefined) args.push("--repo", opts.repo);
|
|
84
102
|
const res = runGh(cwd, args);
|
|
85
103
|
if (!res.ok) return ghFailure(res, `gh pr list --head ${opts.head!}`);
|
|
86
104
|
const parsed = parseJson(res.stdout);
|
|
@@ -45,7 +45,7 @@ import { TIMEOUTS } from "../../shared/timeouts.js";
|
|
|
45
45
|
import { FID_PATTERNS, fromBranch, fromMarker, issueIdOf, readIssueTracker } from "./fids.js";
|
|
46
46
|
import { AUTO_LABEL, AUTO_ROUTE_SUFFIX } from "./issues.js";
|
|
47
47
|
import { checkOnlyBookkeeping } from "./ledgers.js";
|
|
48
|
-
import { closeTransportRow, crossCheckFile, probePr } from "./prs.js";
|
|
48
|
+
import { closeTransportRow, crossCheckFile, prRepoSlug, probePr, type PrInfo } from "./prs.js";
|
|
49
49
|
import { resolveOwnerRepo, splitSlug } from "./repo.js";
|
|
50
50
|
import { extraField, str } from "./status.js";
|
|
51
51
|
import { writeStepRow } from "./steps.js";
|
|
@@ -1357,6 +1357,27 @@ function auditRow(file: string, type: string, fields: Record<string, unknown>):
|
|
|
1357
1357
|
);
|
|
1358
1358
|
}
|
|
1359
1359
|
|
|
1360
|
+
/**
|
|
1361
|
+
* Log where a `--pr` resolved so a `--repo` naming a repo other than the checkout
|
|
1362
|
+
* is visible; the PR URL names the repo `gh` actually read from.
|
|
1363
|
+
*/
|
|
1364
|
+
function logResolvedPrRepo(
|
|
1365
|
+
repoFlag: string | undefined,
|
|
1366
|
+
prNumber: string,
|
|
1367
|
+
pr: PrInfo | undefined,
|
|
1368
|
+
log: (m: string) => void,
|
|
1369
|
+
): void {
|
|
1370
|
+
if (repoFlag === undefined) return;
|
|
1371
|
+
const resolved = prRepoSlug(pr?.url);
|
|
1372
|
+
if (resolved === undefined) {
|
|
1373
|
+
log(`PR ${prNumber}: could not read the resolved repo from its URL (--repo ${repoFlag})`);
|
|
1374
|
+
} else if (resolved !== repoFlag) {
|
|
1375
|
+
log(`PR ${prNumber} resolved in ${resolved} — --repo names ${repoFlag}`);
|
|
1376
|
+
} else {
|
|
1377
|
+
log(`PR ${prNumber} resolved in ${repoFlag}`);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1360
1381
|
function runGate(ctx: RunContext): number {
|
|
1361
1382
|
const f = ctx.flags;
|
|
1362
1383
|
const given = [f.head, f.pr, f.squashOf].filter((v) => v !== undefined).length;
|
|
@@ -1374,12 +1395,13 @@ function runGate(ctx: RunContext): number {
|
|
|
1374
1395
|
if (prNumber !== undefined) {
|
|
1375
1396
|
if (!/^[1-9][0-9]*$/.test(prNumber))
|
|
1376
1397
|
throw new CommandError(EXIT.USAGE, "--pr / --squash-of take a PR number");
|
|
1377
|
-
pr = probePr(ctx.cwd, { number: prNumber, state: "open" });
|
|
1398
|
+
pr = probePr(ctx.cwd, { number: prNumber, state: "open", repo: str(f.repo) });
|
|
1378
1399
|
if (pr.kind === "unavailable") {
|
|
1379
1400
|
ctx.log(pr.message);
|
|
1380
1401
|
return EXIT.USE_MCP;
|
|
1381
1402
|
}
|
|
1382
1403
|
const info = pr.kind === "ok" ? pr.pr : undefined;
|
|
1404
|
+
logResolvedPrRepo(str(f.repo), prNumber, info, ctx.log);
|
|
1383
1405
|
head = (f.squashOf !== undefined ? info?.mergeCommit?.oid : info?.headRefOid) ?? "";
|
|
1384
1406
|
if (head === "") {
|
|
1385
1407
|
ctx.log(
|
|
@@ -1515,11 +1537,12 @@ async function runRevalidate(ctx: RunContext): Promise<number> {
|
|
|
1515
1537
|
throw new CommandError(EXIT.USAGE, "--reason must be head-move or gate-refusal");
|
|
1516
1538
|
const status = path.resolve(ctx.cwd, String(f.file));
|
|
1517
1539
|
runGit(ctx.cwd, ["fetch", "origin", branch]);
|
|
1518
|
-
const pr = probePr(ctx.cwd, { number: String(f.pr), state: "open" });
|
|
1540
|
+
const pr = probePr(ctx.cwd, { number: String(f.pr), state: "open", repo: str(f.repo) });
|
|
1519
1541
|
if (pr.kind === "unavailable") {
|
|
1520
1542
|
ctx.log(pr.message);
|
|
1521
1543
|
return EXIT.USE_MCP;
|
|
1522
1544
|
}
|
|
1545
|
+
logResolvedPrRepo(str(f.repo), String(f.pr), pr.kind === "ok" ? pr.pr : undefined, ctx.log);
|
|
1523
1546
|
const current = pr.kind === "ok" ? (pr.pr?.headRefOid ?? "") : "";
|
|
1524
1547
|
if (current === "") {
|
|
1525
1548
|
ctx.log("cannot read the PR head — query failed (403 = PAT scope)");
|
|
@@ -12,7 +12,7 @@ import type { ModuleFlag } from "../cli.js";
|
|
|
12
12
|
* (`--auto=`, `--opencode=`). A bare/full `uninstall` DOES remove them (zero footprint).
|
|
13
13
|
* Dependency-updater files are not modules — bkit never writes or removes them.
|
|
14
14
|
*/
|
|
15
|
-
export const OPTIN_MODULES = new Set<ModuleFlag>(["cloud", "opencode", "codex"]);
|
|
15
|
+
export const OPTIN_MODULES = new Set<ModuleFlag>(["cloud", "opencode", "codex", "antigravity"]);
|
|
16
16
|
|
|
17
17
|
// ---------------------------------------------------------------------------
|
|
18
18
|
// Types
|
|
@@ -44,7 +44,8 @@ export interface ManifestEntry {
|
|
|
44
44
|
generated?: boolean;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
export type ModuleName =
|
|
47
|
+
export type ModuleName =
|
|
48
|
+
"core" | "claude" | "cursor" | "opencode" | "codex" | "antigravity" | "cloud";
|
|
48
49
|
|
|
49
50
|
// ---------------------------------------------------------------------------
|
|
50
51
|
// Issue tracker
|
|
@@ -387,6 +388,40 @@ export const CODEX_MANIFEST: ManifestEntry[] = [
|
|
|
387
388
|
// managed dynamically — the set follows the bkit-prefix prompt/workflow files at install.
|
|
388
389
|
];
|
|
389
390
|
|
|
391
|
+
// --antigravity: Google Antigravity IDE host. Installs as a workspace PLUGIN at
|
|
392
|
+
// `.agents/plugins/bkit/` (Antigravity's own packaging surface), so `.agents/` root stays
|
|
393
|
+
// the dedicated Codex install. Root `GEMINI.md` is the redirect mirror of `CLAUDE.md`
|
|
394
|
+
// (Antigravity loads `GEMINI.md` as a workspace rule file).
|
|
395
|
+
export const ANTIGRAVITY_MANIFEST: ManifestEntry[] = [
|
|
396
|
+
// plugin.json — the required plugin manifest. Tier-2 json (deep-contained): bkit owns
|
|
397
|
+
// the schema/name/description keys (the schema is `additionalProperties: false`).
|
|
398
|
+
{ path: ".agents/plugins/bkit/plugin.json", format: "json", module: "antigravity" },
|
|
399
|
+
// hooks.json — Tier-2 json (deep-contained): bkit owns the PreToolUse GateGuard and
|
|
400
|
+
// guardrails entries, consumers may add their own event groups alongside them.
|
|
401
|
+
{ path: ".agents/plugins/bkit/hooks.json", format: "json", module: "antigravity" },
|
|
402
|
+
// bkit-gateguard.cjs — Tier-2 markered-text, twin of the Claude/Codex hook (same
|
|
403
|
+
// stdin/stdout contract); differs in the tool names (`write_to_file` /
|
|
404
|
+
// `replace_file_content`) and the payload path field.
|
|
405
|
+
{
|
|
406
|
+
path: ".agents/plugins/bkit/hooks/bkit-gateguard.cjs",
|
|
407
|
+
format: "markered-text",
|
|
408
|
+
module: "antigravity",
|
|
409
|
+
},
|
|
410
|
+
// bkit-guardrails.cjs — Tier-2 markered-text, twin of the Cursor/Codex hook. Registered
|
|
411
|
+
// on matcher `run_command`, Antigravity's shell tool name.
|
|
412
|
+
{
|
|
413
|
+
path: ".agents/plugins/bkit/hooks/bkit-guardrails.cjs",
|
|
414
|
+
format: "markered-text",
|
|
415
|
+
module: "antigravity",
|
|
416
|
+
},
|
|
417
|
+
// Root GEMINI.md — Antigravity workspace-rule redirect to .agents/rules.md, owned by the
|
|
418
|
+
// antigravity module: `uninstall --antigravity` removes it; other installs leave it.
|
|
419
|
+
{ path: "GEMINI.md", format: "markered-text", module: "antigravity" },
|
|
420
|
+
// Subagent prompts (.agents/plugins/bkit/agents/bkit-*.md) and workflow skills
|
|
421
|
+
// (.agents/plugins/bkit/skills/bkit-*/) are managed dynamically — the set follows the
|
|
422
|
+
// bkit-prefix prompt/workflow files at install.
|
|
423
|
+
];
|
|
424
|
+
|
|
390
425
|
// Cloud agent integration is opt-in — NOT in a default install, so a default install
|
|
391
426
|
// ships ZERO cloud footprint. Every variant writes no files: the cloud workflow
|
|
392
427
|
// (bkit-cloud.yml), bkit-cloud-bootstrap.sh and the Cursor Background Agent files
|
|
@@ -418,6 +453,7 @@ const MODULE_MANIFESTS: Record<ModuleName, ManifestEntry[]> = {
|
|
|
418
453
|
cursor: CURSOR_MANIFEST,
|
|
419
454
|
opencode: OPENCODE_MANIFEST,
|
|
420
455
|
codex: CODEX_MANIFEST,
|
|
456
|
+
antigravity: ANTIGRAVITY_MANIFEST,
|
|
421
457
|
cloud: CLOUD_MANIFEST,
|
|
422
458
|
};
|
|
423
459
|
|