@biffo/cli 0.283.0 → 0.283.1
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/dist/index.js +49 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11235,8 +11235,8 @@ async function runOwnershipCheck(argv) {
|
|
|
11235
11235
|
const { stdout } = await execa12("git", ["diff", "--cached", "--name-status"], { cwd: root });
|
|
11236
11236
|
({ changed: changedFiles, deleted: deletedFiles } = parseNameStatus(stdout));
|
|
11237
11237
|
if (messageFile) {
|
|
11238
|
-
const { readFileSync: readFileSync41, existsSync:
|
|
11239
|
-
if (
|
|
11238
|
+
const { readFileSync: readFileSync41, existsSync: existsSync50 } = await import("fs");
|
|
11239
|
+
if (existsSync50(messageFile)) commitMessage = readFileSync41(messageFile, "utf8");
|
|
11240
11240
|
}
|
|
11241
11241
|
} else {
|
|
11242
11242
|
const base = process.env["GITHUB_BASE_REF"] ?? args[0];
|
|
@@ -11558,7 +11558,7 @@ import { readFileSync as readFileSync34 } from "fs";
|
|
|
11558
11558
|
import { join as join47 } from "path";
|
|
11559
11559
|
|
|
11560
11560
|
// src/lib/terraform-input-guard.ts
|
|
11561
|
-
import { readdirSync as readdirSync20, readFileSync as readFileSync33, statSync as statSync12 } from "fs";
|
|
11561
|
+
import { existsSync as existsSync41, readdirSync as readdirSync20, readFileSync as readFileSync33, statSync as statSync12 } from "fs";
|
|
11562
11562
|
import { join as join46 } from "path";
|
|
11563
11563
|
var GUARDED_SUBCOMMANDS = [
|
|
11564
11564
|
"init",
|
|
@@ -11572,8 +11572,27 @@ var IGNORED_SUBCOMMANDS = ["output", "state", "fmt", "validate", "version", "wor
|
|
|
11572
11572
|
function stripComments2(source) {
|
|
11573
11573
|
return source.split("\n").map((line) => line.replace(/(^|\s)#.*$/, "$1")).join("\n");
|
|
11574
11574
|
}
|
|
11575
|
+
function vendoredPluginServiceDirs(repoRoot) {
|
|
11576
|
+
const servicesDir = join46(repoRoot, "services");
|
|
11577
|
+
const result = /* @__PURE__ */ new Set();
|
|
11578
|
+
let entries;
|
|
11579
|
+
try {
|
|
11580
|
+
entries = readdirSync20(servicesDir);
|
|
11581
|
+
} catch {
|
|
11582
|
+
return result;
|
|
11583
|
+
}
|
|
11584
|
+
for (const entry of entries) {
|
|
11585
|
+
const full = join46(servicesDir, entry);
|
|
11586
|
+
if (!existsSync41(full) || !statSync12(full).isDirectory()) continue;
|
|
11587
|
+
if (existsSync41(join46(full, "biffo.plugin.json"))) {
|
|
11588
|
+
result.add(entry);
|
|
11589
|
+
}
|
|
11590
|
+
}
|
|
11591
|
+
return result;
|
|
11592
|
+
}
|
|
11575
11593
|
function findWorkflowFiles(repoRoot) {
|
|
11576
11594
|
const found = [];
|
|
11595
|
+
const vendoredPluginDirs = vendoredPluginServiceDirs(repoRoot);
|
|
11577
11596
|
const walk2 = (dir, relative10) => {
|
|
11578
11597
|
let entries;
|
|
11579
11598
|
try {
|
|
@@ -11583,6 +11602,9 @@ function findWorkflowFiles(repoRoot) {
|
|
|
11583
11602
|
}
|
|
11584
11603
|
for (const entry of entries) {
|
|
11585
11604
|
if (entry === "node_modules" || entry === ".git" || entry === ".worktrees") continue;
|
|
11605
|
+
if (entry === ".github" && relative10.startsWith("services/") && vendoredPluginDirs.has(relative10.slice("services/".length))) {
|
|
11606
|
+
continue;
|
|
11607
|
+
}
|
|
11586
11608
|
const full = join46(dir, entry);
|
|
11587
11609
|
const rel = relative10 ? `${relative10}/${entry}` : entry;
|
|
11588
11610
|
if (statSync12(full).isDirectory()) {
|
|
@@ -11990,17 +12012,17 @@ async function runPluginAllowlistConventionCheck() {
|
|
|
11990
12012
|
}
|
|
11991
12013
|
|
|
11992
12014
|
// src/scripts/check-plugin-collisions.ts
|
|
11993
|
-
import { existsSync as
|
|
12015
|
+
import { existsSync as existsSync43 } from "fs";
|
|
11994
12016
|
import { join as join51 } from "path";
|
|
11995
12017
|
import { execa as execa17 } from "execa";
|
|
11996
12018
|
|
|
11997
12019
|
// src/lib/plugin-collision-guard.ts
|
|
11998
|
-
import { existsSync as
|
|
12020
|
+
import { existsSync as existsSync42, readdirSync as readdirSync22, statSync as statSync13 } from "fs";
|
|
11999
12021
|
import { join as join50 } from "path";
|
|
12000
12022
|
var PYTEST_SPECIAL = /* @__PURE__ */ new Set(["conftest.py"]);
|
|
12001
12023
|
var IGNORED_DIRS = /* @__PURE__ */ new Set([".venv", "node_modules", "__pycache__", ".git", "dist", "build"]);
|
|
12002
12024
|
function subdirectories(dir) {
|
|
12003
|
-
if (!
|
|
12025
|
+
if (!existsSync42(dir)) return [];
|
|
12004
12026
|
return readdirSync22(dir).filter((entry) => {
|
|
12005
12027
|
if (IGNORED_DIRS.has(entry) || entry.startsWith(".")) return false;
|
|
12006
12028
|
try {
|
|
@@ -12011,12 +12033,12 @@ function subdirectories(dir) {
|
|
|
12011
12033
|
});
|
|
12012
12034
|
}
|
|
12013
12035
|
function regularPackagesOf(pluginDir2) {
|
|
12014
|
-
return subdirectories(pluginDir2).filter((name) =>
|
|
12036
|
+
return subdirectories(pluginDir2).filter((name) => existsSync42(join50(pluginDir2, name, "__init__.py"))).sort();
|
|
12015
12037
|
}
|
|
12016
12038
|
function bareTestModulesOf(pluginDir2) {
|
|
12017
12039
|
const testsDir = join50(pluginDir2, "tests");
|
|
12018
|
-
if (!
|
|
12019
|
-
if (
|
|
12040
|
+
if (!existsSync42(testsDir)) return [];
|
|
12041
|
+
if (existsSync42(join50(testsDir, "__init__.py"))) return [];
|
|
12020
12042
|
return readdirSync22(testsDir).filter((f) => f.endsWith(".py") && !PYTEST_SPECIAL.has(f)).sort();
|
|
12021
12043
|
}
|
|
12022
12044
|
function findCollisions(servicesDir, pluginDirs) {
|
|
@@ -12064,7 +12086,7 @@ function formatCollisions(collisions) {
|
|
|
12064
12086
|
async function runPluginCollisionCheck() {
|
|
12065
12087
|
const root = (await execa17("git", ["rev-parse", "--show-toplevel"])).stdout.trim();
|
|
12066
12088
|
const servicesDir = join51(root, "services");
|
|
12067
|
-
if (!
|
|
12089
|
+
if (!existsSync43(servicesDir)) {
|
|
12068
12090
|
console.log("\u2713 plugin collision guard: no services/ directory \u2014 nothing to compare");
|
|
12069
12091
|
return;
|
|
12070
12092
|
}
|
|
@@ -12084,7 +12106,7 @@ async function runPluginCollisionCheck() {
|
|
|
12084
12106
|
import { execa as execa18 } from "execa";
|
|
12085
12107
|
|
|
12086
12108
|
// src/lib/plugin-terraform-guard.ts
|
|
12087
|
-
import { existsSync as
|
|
12109
|
+
import { existsSync as existsSync44, readFileSync as readFileSync37, readdirSync as readdirSync23 } from "fs";
|
|
12088
12110
|
import { dirname as dirname10, join as join52, relative as relative9, sep as sep3 } from "path";
|
|
12089
12111
|
var SKIP_DIRS3 = /* @__PURE__ */ new Set(["node_modules", ".git", ".worktrees", "dist", ".venv", "__pycache__"]);
|
|
12090
12112
|
var PLUGIN_MANIFEST_FILE2 = "biffo.plugin.json";
|
|
@@ -12127,14 +12149,14 @@ function readSubscriptions(absManifestPath) {
|
|
|
12127
12149
|
}
|
|
12128
12150
|
function checkPluginTerraform(root) {
|
|
12129
12151
|
const violations = [];
|
|
12130
|
-
const coreManifest =
|
|
12152
|
+
const coreManifest = existsSync44(join52(root, CORE_MANIFEST_FILE)) ? readCoreManifest(root) : null;
|
|
12131
12153
|
for (const manifest of findPluginManifests(root)) {
|
|
12132
12154
|
if (coreManifest && !isTemplateOwned(manifest, coreManifest)) continue;
|
|
12133
12155
|
const absManifest = join52(root, manifest);
|
|
12134
12156
|
const subscriptions = readSubscriptions(absManifest);
|
|
12135
12157
|
if (subscriptions === null) continue;
|
|
12136
12158
|
const pluginDir2 = dirname10(absManifest);
|
|
12137
|
-
if (
|
|
12159
|
+
if (existsSync44(join52(pluginDir2, "terraform"))) continue;
|
|
12138
12160
|
const relPluginDir = relative9(root, pluginDir2).split(sep3).join("/");
|
|
12139
12161
|
violations.push({
|
|
12140
12162
|
manifest,
|
|
@@ -12165,12 +12187,12 @@ async function runPluginTerraformCheck() {
|
|
|
12165
12187
|
}
|
|
12166
12188
|
|
|
12167
12189
|
// src/scripts/check-plugin-tool-supply.ts
|
|
12168
|
-
import { existsSync as
|
|
12190
|
+
import { existsSync as existsSync46 } from "fs";
|
|
12169
12191
|
import { join as join54 } from "path";
|
|
12170
12192
|
import { execa as execa19 } from "execa";
|
|
12171
12193
|
|
|
12172
12194
|
// src/lib/plugin-tool-supply-audit.ts
|
|
12173
|
-
import { existsSync as
|
|
12195
|
+
import { existsSync as existsSync45, readFileSync as readFileSync38, readdirSync as readdirSync24, statSync as statSync14 } from "fs";
|
|
12174
12196
|
import { join as join53 } from "path";
|
|
12175
12197
|
|
|
12176
12198
|
// src/lib/openrouter-model-snapshot.ts
|
|
@@ -12904,8 +12926,8 @@ function auditDeclaredModelIds(repoRoot, options = {}) {
|
|
|
12904
12926
|
const now = options.now ?? /* @__PURE__ */ new Date();
|
|
12905
12927
|
const configPath = join53(repoRoot, CONFIG_PY_PATH);
|
|
12906
12928
|
const orchestrationPath = join53(repoRoot, ORCHESTRATION_SCHEMA_PATH);
|
|
12907
|
-
const configMissing = !
|
|
12908
|
-
const orchestrationSchemaMissing = !
|
|
12929
|
+
const configMissing = !existsSync45(configPath);
|
|
12930
|
+
const orchestrationSchemaMissing = !existsSync45(orchestrationPath);
|
|
12909
12931
|
const knownSet = new Set(knownModelIds);
|
|
12910
12932
|
const snapshotEmpty = knownModelIds.length === 0;
|
|
12911
12933
|
const snapshotStale = isSnapshotStale(snapshotFetchedAt, now);
|
|
@@ -13122,7 +13144,7 @@ async function runPluginToolSupplyCheck() {
|
|
|
13122
13144
|
const root = (await execa19("git", ["rev-parse", "--show-toplevel"])).stdout.trim();
|
|
13123
13145
|
let allOk = true;
|
|
13124
13146
|
const pluginsRoot = join54(root, "services", "_plugins");
|
|
13125
|
-
if (!
|
|
13147
|
+
if (!existsSync46(pluginsRoot)) {
|
|
13126
13148
|
console.log("\u2713 plugin tool-supply guard: no services/_plugins/ \u2014 nothing to audit");
|
|
13127
13149
|
} else {
|
|
13128
13150
|
const report = auditPluginToolSupply(pluginsRoot);
|
|
@@ -13153,7 +13175,7 @@ async function runPluginToolSupplyCheck() {
|
|
|
13153
13175
|
}
|
|
13154
13176
|
}
|
|
13155
13177
|
const servicesApiRoot = join54(root, "services", "api");
|
|
13156
|
-
if (!
|
|
13178
|
+
if (!existsSync46(servicesApiRoot)) {
|
|
13157
13179
|
console.log("\u2713 plugin model-id guard: no services/api/ \u2014 nothing to audit");
|
|
13158
13180
|
} else {
|
|
13159
13181
|
const modelReport = auditDeclaredModelIds(root);
|
|
@@ -13330,7 +13352,7 @@ async function runReleaseSubjectCheck(argv) {
|
|
|
13330
13352
|
}
|
|
13331
13353
|
|
|
13332
13354
|
// src/scripts/check-skeleton-drift.ts
|
|
13333
|
-
import { existsSync as
|
|
13355
|
+
import { existsSync as existsSync47, readdirSync as readdirSync26 } from "fs";
|
|
13334
13356
|
import { join as join56 } from "path";
|
|
13335
13357
|
import { execa as execa21 } from "execa";
|
|
13336
13358
|
|
|
@@ -13458,7 +13480,7 @@ function discoverSkeletons(root) {
|
|
|
13458
13480
|
} catch {
|
|
13459
13481
|
return [];
|
|
13460
13482
|
}
|
|
13461
|
-
return entries.filter((name) =>
|
|
13483
|
+
return entries.filter((name) => existsSync47(join56(skeletonsDir, name, ".github", "workflows", "ci.yml"))).sort();
|
|
13462
13484
|
}
|
|
13463
13485
|
async function runSkeletonDriftCheck() {
|
|
13464
13486
|
const root = (await execa21("git", ["rev-parse", "--show-toplevel"])).stdout.trim();
|
|
@@ -13467,7 +13489,7 @@ async function runSkeletonDriftCheck() {
|
|
|
13467
13489
|
for (const name of skeletons) {
|
|
13468
13490
|
const skeletonRoot = join56(root, "_skeletons", name);
|
|
13469
13491
|
filesConsidered += findWorkflowFiles(skeletonRoot).length;
|
|
13470
|
-
if (
|
|
13492
|
+
if (existsSync47(join56(skeletonRoot, "apps", "frontend", "src", "app", "layout.tsx"))) {
|
|
13471
13493
|
filesConsidered += 1;
|
|
13472
13494
|
}
|
|
13473
13495
|
}
|
|
@@ -13619,7 +13641,7 @@ function rawArgsAfter(subcommand) {
|
|
|
13619
13641
|
}
|
|
13620
13642
|
|
|
13621
13643
|
// src/commands/doctor.ts
|
|
13622
|
-
import { existsSync as
|
|
13644
|
+
import { existsSync as existsSync48, readFileSync as readFileSync40 } from "fs";
|
|
13623
13645
|
import { join as join57, resolve as resolve20 } from "path";
|
|
13624
13646
|
import chalk21 from "chalk";
|
|
13625
13647
|
import { Command as Command25 } from "commander";
|
|
@@ -13800,7 +13822,7 @@ async function runDoctor(options, deps = { git: new GitAdapter() }) {
|
|
|
13800
13822
|
}
|
|
13801
13823
|
function readLocalCoreVersion(cwd) {
|
|
13802
13824
|
const path = join57(cwd, INSTANCE_CORE_FILE);
|
|
13803
|
-
if (!
|
|
13825
|
+
if (!existsSync48(path)) return null;
|
|
13804
13826
|
try {
|
|
13805
13827
|
return extractVersionField(readFileSync40(path, "utf8"));
|
|
13806
13828
|
} catch {
|
|
@@ -13823,7 +13845,7 @@ function extractVersionField(contents) {
|
|
|
13823
13845
|
}
|
|
13824
13846
|
function readFossil(cwd) {
|
|
13825
13847
|
const path = join57(cwd, CORE_VERSION_FILE);
|
|
13826
|
-
if (!
|
|
13848
|
+
if (!existsSync48(path)) return null;
|
|
13827
13849
|
try {
|
|
13828
13850
|
const value = readFileSync40(path, "utf8").trim();
|
|
13829
13851
|
return value === "" ? null : value;
|
|
@@ -14274,13 +14296,13 @@ import { fileURLToPath as fileURLToPath6 } from "url";
|
|
|
14274
14296
|
import { Command as Command27 } from "commander";
|
|
14275
14297
|
|
|
14276
14298
|
// src/lib/packaged-scripts.ts
|
|
14277
|
-
import { existsSync as
|
|
14299
|
+
import { existsSync as existsSync49 } from "fs";
|
|
14278
14300
|
import { dirname as dirname11, join as join58 } from "path";
|
|
14279
14301
|
function findPackagedScript(startDir, relativePath) {
|
|
14280
14302
|
let dir = startDir;
|
|
14281
14303
|
for (; ; ) {
|
|
14282
14304
|
const candidate = join58(dir, relativePath);
|
|
14283
|
-
if (
|
|
14305
|
+
if (existsSync49(candidate)) return candidate;
|
|
14284
14306
|
const parent = dirname11(dir);
|
|
14285
14307
|
if (parent === dir) return null;
|
|
14286
14308
|
dir = parent;
|