@chrisdudek/yg 5.0.2 → 5.0.3
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/bin.js +20 -19
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1018,10 +1018,24 @@ async function fetchOllamaModels(endpoint) {
|
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
1020
|
|
|
1021
|
-
// src/
|
|
1021
|
+
// src/utils/binary-check.ts
|
|
1022
1022
|
import { execFile } from "child_process";
|
|
1023
1023
|
import { promisify } from "util";
|
|
1024
1024
|
var execFileAsync = promisify(execFile);
|
|
1025
|
+
async function binaryAvailable(binary) {
|
|
1026
|
+
try {
|
|
1027
|
+
await execFileAsync(binary, ["--version"], {
|
|
1028
|
+
timeout: 1e4,
|
|
1029
|
+
shell: process.platform === "win32"
|
|
1030
|
+
});
|
|
1031
|
+
return true;
|
|
1032
|
+
} catch (err) {
|
|
1033
|
+
debugWrite(`[binary-check] ${binary} --version: ${err.message}`);
|
|
1034
|
+
return false;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
// src/llm/reviewer-test.ts
|
|
1025
1039
|
var CLI_BINARIES = {
|
|
1026
1040
|
"claude-code": "claude",
|
|
1027
1041
|
"codex": "codex",
|
|
@@ -1053,14 +1067,10 @@ async function testCliProvider(provider) {
|
|
|
1053
1067
|
if (!binary) {
|
|
1054
1068
|
return { ok: false, error: `Unsupported CLI provider: ${provider}` };
|
|
1055
1069
|
}
|
|
1056
|
-
|
|
1057
|
-
await execFileAsync("which", [binary], { timeout: 5e3 });
|
|
1070
|
+
if (await binaryAvailable(binary)) {
|
|
1058
1071
|
return { ok: true };
|
|
1059
|
-
} catch (err) {
|
|
1060
|
-
const msg = `'${binary}' not found on PATH`;
|
|
1061
|
-
debugWrite(`[reviewer-test] testCliProvider(${provider}): ${err.message}`);
|
|
1062
|
-
return { ok: false, error: msg };
|
|
1063
1072
|
}
|
|
1073
|
+
return { ok: false, error: `'${binary}' could not be run \u2014 is it installed and on PATH?` };
|
|
1064
1074
|
}
|
|
1065
1075
|
async function testAnthropic(apiKey, model, endpoint) {
|
|
1066
1076
|
const res = await fetch(`${endpoint}/messages`, {
|
|
@@ -13224,10 +13234,7 @@ async function apiFetch(url, init2, providerName, timeoutMs = 6e4) {
|
|
|
13224
13234
|
|
|
13225
13235
|
// src/llm/cli-base.ts
|
|
13226
13236
|
import { spawn } from "child_process";
|
|
13227
|
-
import { execFile as execFile2 } from "child_process";
|
|
13228
13237
|
import { tmpdir } from "os";
|
|
13229
|
-
import { promisify as promisify2 } from "util";
|
|
13230
|
-
var execFileAsync2 = promisify2(execFile2);
|
|
13231
13238
|
function coerceBool(v) {
|
|
13232
13239
|
if (typeof v === "boolean") return v;
|
|
13233
13240
|
if (typeof v === "string") {
|
|
@@ -13326,13 +13333,7 @@ var CliAgentProvider = class {
|
|
|
13326
13333
|
this.timeout = config.timeout ?? 3e5;
|
|
13327
13334
|
}
|
|
13328
13335
|
async isAvailable() {
|
|
13329
|
-
|
|
13330
|
-
await execFileAsync2("which", [this.binary], { timeout: 5e3 });
|
|
13331
|
-
return true;
|
|
13332
|
-
} catch (err) {
|
|
13333
|
-
debugWrite(`[${this.binary}] isAvailable: ${err.message}`);
|
|
13334
|
-
return false;
|
|
13335
|
-
}
|
|
13336
|
+
return binaryAvailable(this.binary);
|
|
13336
13337
|
}
|
|
13337
13338
|
async verifyAspect(prompt) {
|
|
13338
13339
|
const fallback = { satisfied: false, reason: "Reviewer unavailable", errorSource: "provider" };
|
|
@@ -16031,8 +16032,8 @@ import path51 from "path";
|
|
|
16031
16032
|
|
|
16032
16033
|
// src/utils/git-introspect.ts
|
|
16033
16034
|
import { exec } from "child_process";
|
|
16034
|
-
import { promisify as
|
|
16035
|
-
var execp =
|
|
16035
|
+
import { promisify as promisify2 } from "util";
|
|
16036
|
+
var execp = promisify2(exec);
|
|
16036
16037
|
async function isMergeCommit(repoCwd, ref) {
|
|
16037
16038
|
try {
|
|
16038
16039
|
const { stdout } = await execp(`git rev-list --parents -n 1 ${ref}`, { cwd: repoCwd });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrisdudek/yg",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"description": "Architecture rules your AI coding agent can't ignore. It gets the rules for a file before it edits, and every change is checked — by a free local script or an LLM reviewer — before it moves on. Works with Claude Code, Cursor, Copilot, Codex, Cline.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|