@rely-ai/caliber 1.44.1 → 1.44.2
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 +112 -50
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -180,7 +180,7 @@ __export(resolve_caliber_exports, {
|
|
|
180
180
|
resolveCaliber: () => resolveCaliber
|
|
181
181
|
});
|
|
182
182
|
import fs6 from "fs";
|
|
183
|
-
import { execSync as
|
|
183
|
+
import { execSync as execSync5 } from "child_process";
|
|
184
184
|
function resolveCaliber() {
|
|
185
185
|
if (_resolved) return _resolved;
|
|
186
186
|
const whichCmd = process.platform === "win32" ? "where caliber" : "which caliber";
|
|
@@ -188,7 +188,7 @@ function resolveCaliber() {
|
|
|
188
188
|
const isNpx = process.argv[1]?.includes("_npx") || process.env.npm_execpath?.includes("npx");
|
|
189
189
|
if (isNpx) {
|
|
190
190
|
try {
|
|
191
|
-
const out =
|
|
191
|
+
const out = execSync5(whichCmd, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
192
192
|
const caliberPath = out.split("\n")[0].trim();
|
|
193
193
|
if (caliberPath) {
|
|
194
194
|
_resolved = caliberPath;
|
|
@@ -197,7 +197,7 @@ function resolveCaliber() {
|
|
|
197
197
|
} catch {
|
|
198
198
|
}
|
|
199
199
|
try {
|
|
200
|
-
const out =
|
|
200
|
+
const out = execSync5(whichNpxCmd, {
|
|
201
201
|
encoding: "utf-8",
|
|
202
202
|
stdio: ["pipe", "pipe", "pipe"]
|
|
203
203
|
}).trim();
|
|
@@ -212,7 +212,7 @@ function resolveCaliber() {
|
|
|
212
212
|
return _resolved;
|
|
213
213
|
}
|
|
214
214
|
try {
|
|
215
|
-
const out =
|
|
215
|
+
const out = execSync5(whichCmd, {
|
|
216
216
|
encoding: "utf-8",
|
|
217
217
|
stdio: ["pipe", "pipe", "pipe"]
|
|
218
218
|
}).trim();
|
|
@@ -897,7 +897,7 @@ var init_builtin_skills = __esm({
|
|
|
897
897
|
});
|
|
898
898
|
|
|
899
899
|
// src/utils/editor.ts
|
|
900
|
-
import { execSync as
|
|
900
|
+
import { execSync as execSync15, spawn as spawn3 } from "child_process";
|
|
901
901
|
import fs29 from "fs";
|
|
902
902
|
import path25 from "path";
|
|
903
903
|
import os6 from "os";
|
|
@@ -910,7 +910,7 @@ function getEmptyFilePath(proposedPath) {
|
|
|
910
910
|
function commandExists(cmd) {
|
|
911
911
|
try {
|
|
912
912
|
const check = process.platform === "win32" ? `where ${cmd}` : `which ${cmd}`;
|
|
913
|
-
|
|
913
|
+
execSync15(check, { stdio: "ignore" });
|
|
914
914
|
return true;
|
|
915
915
|
} catch {
|
|
916
916
|
return false;
|
|
@@ -1274,6 +1274,7 @@ function isGitRepo() {
|
|
|
1274
1274
|
// src/fingerprint/file-tree.ts
|
|
1275
1275
|
import fs from "fs";
|
|
1276
1276
|
import path from "path";
|
|
1277
|
+
import { execSync as execSync2 } from "child_process";
|
|
1277
1278
|
var IGNORE_DIRS = /* @__PURE__ */ new Set([
|
|
1278
1279
|
"node_modules",
|
|
1279
1280
|
".git",
|
|
@@ -1290,8 +1291,59 @@ var IGNORE_DIRS = /* @__PURE__ */ new Set([
|
|
|
1290
1291
|
"target"
|
|
1291
1292
|
]);
|
|
1292
1293
|
function getFileTree(dir, maxDepth = 3) {
|
|
1294
|
+
const gitFiles = getGitTrackedFiles(dir);
|
|
1295
|
+
const entries = gitFiles ? buildTreeFromGitFiles(dir, gitFiles, maxDepth) : scanEntries(dir, maxDepth);
|
|
1296
|
+
return sortAndFormat(entries);
|
|
1297
|
+
}
|
|
1298
|
+
function getGitTrackedFiles(dir) {
|
|
1299
|
+
try {
|
|
1300
|
+
const output = execSync2("git ls-files --cached --others --exclude-standard", {
|
|
1301
|
+
cwd: dir,
|
|
1302
|
+
encoding: "utf-8",
|
|
1303
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
1304
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
1305
|
+
});
|
|
1306
|
+
return output.trim().split("\n").filter(Boolean);
|
|
1307
|
+
} catch {
|
|
1308
|
+
return null;
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
function buildTreeFromGitFiles(dir, files, maxDepth) {
|
|
1312
|
+
const result = [];
|
|
1313
|
+
const seenDirs = /* @__PURE__ */ new Set();
|
|
1314
|
+
for (const relFile of files) {
|
|
1315
|
+
const parts = relFile.split("/");
|
|
1316
|
+
if (parts.length - 1 > maxDepth) continue;
|
|
1317
|
+
const absPath = path.join(dir, relFile);
|
|
1318
|
+
let mtime = 0;
|
|
1319
|
+
try {
|
|
1320
|
+
mtime = fs.statSync(absPath).mtimeMs;
|
|
1321
|
+
} catch {
|
|
1322
|
+
continue;
|
|
1323
|
+
}
|
|
1324
|
+
result.push({ relPath: relFile, isDir: false, mtime });
|
|
1325
|
+
for (let i = 1; i < parts.length; i++) {
|
|
1326
|
+
const dirRel = parts.slice(0, i).join("/") + "/";
|
|
1327
|
+
if (seenDirs.has(dirRel)) continue;
|
|
1328
|
+
seenDirs.add(dirRel);
|
|
1329
|
+
const depth = i;
|
|
1330
|
+
if (depth > maxDepth) break;
|
|
1331
|
+
let dirMtime = 0;
|
|
1332
|
+
try {
|
|
1333
|
+
dirMtime = fs.statSync(path.join(dir, dirRel)).mtimeMs;
|
|
1334
|
+
} catch {
|
|
1335
|
+
}
|
|
1336
|
+
result.push({ relPath: dirRel, isDir: true, mtime: dirMtime });
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
return result;
|
|
1340
|
+
}
|
|
1341
|
+
function scanEntries(dir, maxDepth) {
|
|
1293
1342
|
const entries = [];
|
|
1294
1343
|
scan(dir, "", 0, maxDepth, entries);
|
|
1344
|
+
return entries;
|
|
1345
|
+
}
|
|
1346
|
+
function sortAndFormat(entries) {
|
|
1295
1347
|
const dirs = [];
|
|
1296
1348
|
const files = [];
|
|
1297
1349
|
for (const e of entries) {
|
|
@@ -1354,7 +1406,7 @@ import path3 from "path";
|
|
|
1354
1406
|
// src/constants.ts
|
|
1355
1407
|
import path2 from "path";
|
|
1356
1408
|
import os from "os";
|
|
1357
|
-
import { execSync as
|
|
1409
|
+
import { execSync as execSync3 } from "child_process";
|
|
1358
1410
|
var AUTH_DIR = path2.join(os.homedir(), ".caliber");
|
|
1359
1411
|
var CALIBER_DIR = ".caliber";
|
|
1360
1412
|
var MANIFEST_FILE = path2.join(CALIBER_DIR, "manifest.json");
|
|
@@ -1363,7 +1415,7 @@ var _learningDirCache = null;
|
|
|
1363
1415
|
function getLearningDir() {
|
|
1364
1416
|
if (_learningDirCache) return _learningDirCache;
|
|
1365
1417
|
try {
|
|
1366
|
-
const gitCommonDir =
|
|
1418
|
+
const gitCommonDir = execSync3("git rev-parse --git-common-dir", {
|
|
1367
1419
|
encoding: "utf-8",
|
|
1368
1420
|
stdio: ["pipe", "pipe", "pipe"]
|
|
1369
1421
|
}).trim();
|
|
@@ -1543,7 +1595,7 @@ function readExistingConfigs(dir) {
|
|
|
1543
1595
|
// src/fingerprint/code-analysis.ts
|
|
1544
1596
|
import fs3 from "fs";
|
|
1545
1597
|
import path5 from "path";
|
|
1546
|
-
import { execSync as
|
|
1598
|
+
import { execSync as execSync4 } from "child_process";
|
|
1547
1599
|
|
|
1548
1600
|
// src/lib/sanitize.ts
|
|
1549
1601
|
import path4 from "path";
|
|
@@ -1962,7 +2014,7 @@ function buildImportCounts(files) {
|
|
|
1962
2014
|
function getGitFrequency(dir) {
|
|
1963
2015
|
const freq = /* @__PURE__ */ new Map();
|
|
1964
2016
|
try {
|
|
1965
|
-
const output =
|
|
2017
|
+
const output = execSync4(
|
|
1966
2018
|
'git log --since="6 months ago" --format="" --name-only --diff-filter=ACMR 2>/dev/null | head -10000',
|
|
1967
2019
|
{ cwd: dir, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 5e3 }
|
|
1968
2020
|
);
|
|
@@ -2371,7 +2423,7 @@ var OpenAICompatProvider = class {
|
|
|
2371
2423
|
async call(options) {
|
|
2372
2424
|
const response = await this.client.chat.completions.create({
|
|
2373
2425
|
model: options.model || this.defaultModel,
|
|
2374
|
-
|
|
2426
|
+
max_completion_tokens: options.maxTokens || 4096,
|
|
2375
2427
|
...this.temperature !== void 0 && { temperature: this.temperature },
|
|
2376
2428
|
messages: [
|
|
2377
2429
|
{ role: "system", content: options.system },
|
|
@@ -2406,7 +2458,7 @@ var OpenAICompatProvider = class {
|
|
|
2406
2458
|
messages.push({ role: "user", content: options.prompt });
|
|
2407
2459
|
const stream = await this.client.chat.completions.create({
|
|
2408
2460
|
model: options.model || this.defaultModel,
|
|
2409
|
-
|
|
2461
|
+
max_completion_tokens: options.maxTokens || 10240,
|
|
2410
2462
|
...this.temperature !== void 0 && { temperature: this.temperature },
|
|
2411
2463
|
messages,
|
|
2412
2464
|
stream: true
|
|
@@ -2457,7 +2509,7 @@ var MiniMaxProvider = class extends OpenAICompatProvider {
|
|
|
2457
2509
|
};
|
|
2458
2510
|
|
|
2459
2511
|
// src/llm/cursor-acp.ts
|
|
2460
|
-
import { spawn, execSync as
|
|
2512
|
+
import { spawn, execSync as execSync6, execFileSync } from "child_process";
|
|
2461
2513
|
import os3 from "os";
|
|
2462
2514
|
|
|
2463
2515
|
// src/llm/seat-based-errors.ts
|
|
@@ -2535,7 +2587,7 @@ function resolveAgentBin() {
|
|
|
2535
2587
|
if (_agentBin !== null) return _agentBin;
|
|
2536
2588
|
try {
|
|
2537
2589
|
const whichCmd = IS_WINDOWS ? "where agent" : "which agent";
|
|
2538
|
-
const out =
|
|
2590
|
+
const out = execSync6(whichCmd, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
2539
2591
|
const p = out.split("\n")[0].trim();
|
|
2540
2592
|
if (p) {
|
|
2541
2593
|
_agentBin = p;
|
|
@@ -2826,7 +2878,7 @@ var CursorAcpProvider = class {
|
|
|
2826
2878
|
function isCursorAgentAvailable() {
|
|
2827
2879
|
if (resolveAgentBin() !== "agent") return true;
|
|
2828
2880
|
try {
|
|
2829
|
-
|
|
2881
|
+
execSync6(IS_WINDOWS ? "where agent" : "which agent", { stdio: "ignore" });
|
|
2830
2882
|
return true;
|
|
2831
2883
|
} catch {
|
|
2832
2884
|
return false;
|
|
@@ -2847,7 +2899,7 @@ function isCursorLoggedIn() {
|
|
|
2847
2899
|
|
|
2848
2900
|
// src/llm/claude-cli.ts
|
|
2849
2901
|
import fs7 from "fs";
|
|
2850
|
-
import { spawn as spawn2, execSync as
|
|
2902
|
+
import { spawn as spawn2, execSync as execSync7, execFileSync as execFileSync2 } from "child_process";
|
|
2851
2903
|
var DEFAULT_TIMEOUT_MS2 = 10 * 60 * 1e3;
|
|
2852
2904
|
var IS_WINDOWS2 = process.platform === "win32";
|
|
2853
2905
|
function candidateClaudePaths() {
|
|
@@ -2867,7 +2919,7 @@ function resolveClaudeBin() {
|
|
|
2867
2919
|
if (_claudeBin !== null) return _claudeBin;
|
|
2868
2920
|
try {
|
|
2869
2921
|
const whichCmd = IS_WINDOWS2 ? "where claude" : "which claude";
|
|
2870
|
-
const out =
|
|
2922
|
+
const out = execSync7(whichCmd, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
2871
2923
|
const p = out.split("\n")[0].trim();
|
|
2872
2924
|
if (p) {
|
|
2873
2925
|
_claudeBin = p;
|
|
@@ -2886,10 +2938,18 @@ function resolveClaudeBin() {
|
|
|
2886
2938
|
_claudeBin = "claude";
|
|
2887
2939
|
return _claudeBin;
|
|
2888
2940
|
}
|
|
2941
|
+
function cleanClaudeEnv() {
|
|
2942
|
+
const env = { ...process.env };
|
|
2943
|
+
for (const key of Object.keys(env)) {
|
|
2944
|
+
if (key === "CLAUDE_CODE_SIMPLE" || key === "CLAUDECODE" || key.startsWith("CLAUDE_CODE_")) {
|
|
2945
|
+
delete env[key];
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2948
|
+
return env;
|
|
2949
|
+
}
|
|
2889
2950
|
function spawnClaude(args) {
|
|
2890
2951
|
const bin = resolveClaudeBin();
|
|
2891
|
-
const
|
|
2892
|
-
const env = parentEnv;
|
|
2952
|
+
const env = cleanClaudeEnv();
|
|
2893
2953
|
return IS_WINDOWS2 ? spawn2([bin, ...args].join(" "), {
|
|
2894
2954
|
cwd: process.cwd(),
|
|
2895
2955
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -3043,7 +3103,7 @@ var ClaudeCliProvider = class {
|
|
|
3043
3103
|
function isClaudeCliAvailable() {
|
|
3044
3104
|
if (resolveClaudeBin() !== "claude") return true;
|
|
3045
3105
|
try {
|
|
3046
|
-
|
|
3106
|
+
execSync7(IS_WINDOWS2 ? "where claude" : "which claude", { stdio: "ignore" });
|
|
3047
3107
|
return true;
|
|
3048
3108
|
} catch {
|
|
3049
3109
|
return false;
|
|
@@ -3056,7 +3116,8 @@ function isClaudeCliLoggedIn() {
|
|
|
3056
3116
|
const result = execFileSync2(resolveClaudeBin(), ["auth", "status"], {
|
|
3057
3117
|
input: "",
|
|
3058
3118
|
stdio: ["pipe", "pipe", "pipe"],
|
|
3059
|
-
timeout: 5e3
|
|
3119
|
+
timeout: 5e3,
|
|
3120
|
+
env: cleanClaudeEnv()
|
|
3060
3121
|
});
|
|
3061
3122
|
const output = result.toString().trim();
|
|
3062
3123
|
try {
|
|
@@ -3884,7 +3945,7 @@ init_config();
|
|
|
3884
3945
|
import fs8 from "fs";
|
|
3885
3946
|
import path7 from "path";
|
|
3886
3947
|
import crypto from "crypto";
|
|
3887
|
-
import { execSync as
|
|
3948
|
+
import { execSync as execSync8 } from "child_process";
|
|
3888
3949
|
var CACHE_VERSION = 1;
|
|
3889
3950
|
var CACHE_DIR = ".caliber/cache";
|
|
3890
3951
|
var CACHE_FILE = "fingerprint.json";
|
|
@@ -3893,7 +3954,7 @@ function getCachePath(dir) {
|
|
|
3893
3954
|
}
|
|
3894
3955
|
function getGitHead(dir) {
|
|
3895
3956
|
try {
|
|
3896
|
-
return
|
|
3957
|
+
return execSync8("git rev-parse HEAD", {
|
|
3897
3958
|
cwd: dir,
|
|
3898
3959
|
encoding: "utf-8",
|
|
3899
3960
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -3905,7 +3966,7 @@ function getGitHead(dir) {
|
|
|
3905
3966
|
}
|
|
3906
3967
|
function getDirtySignature(dir) {
|
|
3907
3968
|
try {
|
|
3908
|
-
const output =
|
|
3969
|
+
const output = execSync8("git diff --name-only HEAD", {
|
|
3909
3970
|
cwd: dir,
|
|
3910
3971
|
encoding: "utf-8",
|
|
3911
3972
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -4248,7 +4309,7 @@ function getCursorConfigDir() {
|
|
|
4248
4309
|
init_resolve_caliber();
|
|
4249
4310
|
import fs11 from "fs";
|
|
4250
4311
|
import path10 from "path";
|
|
4251
|
-
import { execSync as
|
|
4312
|
+
import { execSync as execSync9 } from "child_process";
|
|
4252
4313
|
var SETTINGS_PATH = path10.join(".claude", "settings.json");
|
|
4253
4314
|
var REFRESH_TAIL = "refresh --quiet";
|
|
4254
4315
|
var HOOK_DESCRIPTION = "Caliber: auto-refreshing docs based on code changes";
|
|
@@ -4453,7 +4514,7 @@ ${PRECOMMIT_END}`;
|
|
|
4453
4514
|
}
|
|
4454
4515
|
function getGitHooksDir() {
|
|
4455
4516
|
try {
|
|
4456
|
-
const gitDir =
|
|
4517
|
+
const gitDir = execSync9("git rev-parse --git-dir", {
|
|
4457
4518
|
encoding: "utf-8",
|
|
4458
4519
|
stdio: ["pipe", "pipe", "pipe"]
|
|
4459
4520
|
}).trim();
|
|
@@ -5217,9 +5278,10 @@ async function generateSetup(fingerprint, targetAgent, prompt, callbacks, failin
|
|
|
5217
5278
|
({ platform, topic }) => generateSkill(skillContext, topic, fastModel).then((skill) => ({ platform, skill }))
|
|
5218
5279
|
)
|
|
5219
5280
|
);
|
|
5220
|
-
const { failed: failedCount } = mergeSkillResults(skillResults, setup);
|
|
5281
|
+
const { succeeded, failed: failedCount } = mergeSkillResults(skillResults, setup);
|
|
5221
5282
|
if (failedCount > 0 && callbacks) {
|
|
5222
|
-
|
|
5283
|
+
const msg = succeeded === 0 ? `${failedCount} skill${failedCount === 1 ? "" : "s"} failed to generate \u2014 config saved without skills` : `Warning: ${failedCount} of ${failedCount + succeeded} skill${failedCount === 1 ? "" : "s"} failed to generate`;
|
|
5284
|
+
callbacks.onStatus(msg);
|
|
5223
5285
|
}
|
|
5224
5286
|
return coreResult;
|
|
5225
5287
|
}
|
|
@@ -6560,7 +6622,7 @@ init_resolve_caliber();
|
|
|
6560
6622
|
// src/lib/state.ts
|
|
6561
6623
|
import fs25 from "fs";
|
|
6562
6624
|
import path21 from "path";
|
|
6563
|
-
import { execSync as
|
|
6625
|
+
import { execSync as execSync10 } from "child_process";
|
|
6564
6626
|
var STATE_FILE = path21.join(CALIBER_DIR, ".caliber-state.json");
|
|
6565
6627
|
function normalizeTargetAgent(value) {
|
|
6566
6628
|
if (Array.isArray(value)) return value;
|
|
@@ -6588,7 +6650,7 @@ function writeState(state) {
|
|
|
6588
6650
|
}
|
|
6589
6651
|
function getCurrentHeadSha() {
|
|
6590
6652
|
try {
|
|
6591
|
-
return
|
|
6653
|
+
return execSync10("git rev-parse HEAD", {
|
|
6592
6654
|
encoding: "utf-8",
|
|
6593
6655
|
stdio: ["pipe", "pipe", "pipe"]
|
|
6594
6656
|
}).trim();
|
|
@@ -7274,7 +7336,7 @@ function checkGrounding(dir) {
|
|
|
7274
7336
|
|
|
7275
7337
|
// src/scoring/checks/accuracy.ts
|
|
7276
7338
|
import { existsSync as existsSync4, statSync } from "fs";
|
|
7277
|
-
import { execSync as
|
|
7339
|
+
import { execSync as execSync11 } from "child_process";
|
|
7278
7340
|
import { join as join5 } from "path";
|
|
7279
7341
|
init_resolve_caliber();
|
|
7280
7342
|
function validateReferences(dir) {
|
|
@@ -7284,13 +7346,13 @@ function validateReferences(dir) {
|
|
|
7284
7346
|
}
|
|
7285
7347
|
function detectGitDrift(dir) {
|
|
7286
7348
|
try {
|
|
7287
|
-
|
|
7349
|
+
execSync11("git rev-parse --git-dir", { cwd: dir, stdio: ["pipe", "pipe", "pipe"] });
|
|
7288
7350
|
} catch {
|
|
7289
7351
|
return { commitsSinceConfigUpdate: 0, lastConfigCommit: null, isGitRepo: false };
|
|
7290
7352
|
}
|
|
7291
7353
|
const configFiles = ["CLAUDE.md", "AGENTS.md", ".cursorrules", ".cursor/rules"];
|
|
7292
7354
|
try {
|
|
7293
|
-
const headTimestamp =
|
|
7355
|
+
const headTimestamp = execSync11(
|
|
7294
7356
|
"git log -1 --format=%ct HEAD",
|
|
7295
7357
|
{ cwd: dir, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
7296
7358
|
).trim();
|
|
@@ -7311,7 +7373,7 @@ function detectGitDrift(dir) {
|
|
|
7311
7373
|
let latestConfigCommitHash = null;
|
|
7312
7374
|
for (const file of configFiles) {
|
|
7313
7375
|
try {
|
|
7314
|
-
const hash =
|
|
7376
|
+
const hash = execSync11(
|
|
7315
7377
|
`git log -1 --format=%H -- "${file}"`,
|
|
7316
7378
|
{ cwd: dir, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
7317
7379
|
).trim();
|
|
@@ -7320,7 +7382,7 @@ function detectGitDrift(dir) {
|
|
|
7320
7382
|
latestConfigCommitHash = hash;
|
|
7321
7383
|
} else {
|
|
7322
7384
|
try {
|
|
7323
|
-
|
|
7385
|
+
execSync11(
|
|
7324
7386
|
`git merge-base --is-ancestor ${latestConfigCommitHash} ${hash}`,
|
|
7325
7387
|
{ cwd: dir, stdio: ["pipe", "pipe", "pipe"] }
|
|
7326
7388
|
);
|
|
@@ -7335,12 +7397,12 @@ function detectGitDrift(dir) {
|
|
|
7335
7397
|
return { commitsSinceConfigUpdate: 0, lastConfigCommit: null, isGitRepo: true };
|
|
7336
7398
|
}
|
|
7337
7399
|
try {
|
|
7338
|
-
const countStr =
|
|
7400
|
+
const countStr = execSync11(
|
|
7339
7401
|
`git rev-list --count ${latestConfigCommitHash}..HEAD`,
|
|
7340
7402
|
{ cwd: dir, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
7341
7403
|
).trim();
|
|
7342
7404
|
const commitsSince = parseInt(countStr, 10) || 0;
|
|
7343
|
-
const lastDate =
|
|
7405
|
+
const lastDate = execSync11(
|
|
7344
7406
|
`git log -1 --format=%ci ${latestConfigCommitHash}`,
|
|
7345
7407
|
{ cwd: dir, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
7346
7408
|
).trim();
|
|
@@ -7413,12 +7475,12 @@ function checkAccuracy(dir) {
|
|
|
7413
7475
|
// src/scoring/checks/freshness.ts
|
|
7414
7476
|
init_resolve_caliber();
|
|
7415
7477
|
import { existsSync as existsSync5, statSync as statSync2 } from "fs";
|
|
7416
|
-
import { execSync as
|
|
7478
|
+
import { execSync as execSync12 } from "child_process";
|
|
7417
7479
|
import { join as join6 } from "path";
|
|
7418
7480
|
function getCommitsSinceConfigUpdate(dir) {
|
|
7419
7481
|
const configFiles = ["CLAUDE.md", "AGENTS.md", ".cursorrules"];
|
|
7420
7482
|
try {
|
|
7421
|
-
const headTimestamp =
|
|
7483
|
+
const headTimestamp = execSync12(
|
|
7422
7484
|
"git log -1 --format=%ct HEAD",
|
|
7423
7485
|
{ cwd: dir, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
7424
7486
|
).trim();
|
|
@@ -7438,12 +7500,12 @@ function getCommitsSinceConfigUpdate(dir) {
|
|
|
7438
7500
|
}
|
|
7439
7501
|
for (const file of configFiles) {
|
|
7440
7502
|
try {
|
|
7441
|
-
const hash =
|
|
7503
|
+
const hash = execSync12(
|
|
7442
7504
|
`git log -1 --format=%H -- "${file}"`,
|
|
7443
7505
|
{ cwd: dir, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
7444
7506
|
).trim();
|
|
7445
7507
|
if (hash) {
|
|
7446
|
-
const countStr =
|
|
7508
|
+
const countStr = execSync12(
|
|
7447
7509
|
`git rev-list --count ${hash}..HEAD`,
|
|
7448
7510
|
{ cwd: dir, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
7449
7511
|
).trim();
|
|
@@ -7561,7 +7623,7 @@ function checkFreshness(dir) {
|
|
|
7561
7623
|
|
|
7562
7624
|
// src/scoring/checks/bonus.ts
|
|
7563
7625
|
import { existsSync as existsSync6, readdirSync as readdirSync3 } from "fs";
|
|
7564
|
-
import { execSync as
|
|
7626
|
+
import { execSync as execSync13 } from "child_process";
|
|
7565
7627
|
import { join as join7 } from "path";
|
|
7566
7628
|
init_resolve_caliber();
|
|
7567
7629
|
init_pre_commit_block();
|
|
@@ -7580,7 +7642,7 @@ function configContentSuggestsPinnedModel(lower) {
|
|
|
7580
7642
|
// src/scoring/checks/bonus.ts
|
|
7581
7643
|
function hasPreCommitHook(dir) {
|
|
7582
7644
|
try {
|
|
7583
|
-
const gitDir =
|
|
7645
|
+
const gitDir = execSync13("git rev-parse --git-dir", {
|
|
7584
7646
|
cwd: dir,
|
|
7585
7647
|
encoding: "utf-8",
|
|
7586
7648
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -8050,7 +8112,7 @@ import fs27 from "fs";
|
|
|
8050
8112
|
import path23 from "path";
|
|
8051
8113
|
import os5 from "os";
|
|
8052
8114
|
import crypto4 from "crypto";
|
|
8053
|
-
import { execSync as
|
|
8115
|
+
import { execSync as execSync14 } from "child_process";
|
|
8054
8116
|
var CONFIG_DIR2 = path23.join(os5.homedir(), ".caliber");
|
|
8055
8117
|
var CONFIG_FILE2 = path23.join(CONFIG_DIR2, "config.json");
|
|
8056
8118
|
var runtimeDisabled = false;
|
|
@@ -8102,7 +8164,7 @@ var PERSONAL_DOMAINS = /* @__PURE__ */ new Set([
|
|
|
8102
8164
|
]);
|
|
8103
8165
|
function getGitEmail() {
|
|
8104
8166
|
try {
|
|
8105
|
-
const email =
|
|
8167
|
+
const email = execSync14("git config user.email", { encoding: "utf-8" }).trim();
|
|
8106
8168
|
return email || void 0;
|
|
8107
8169
|
} catch {
|
|
8108
8170
|
return void 0;
|
|
@@ -8121,7 +8183,7 @@ function getGitEmailInfo() {
|
|
|
8121
8183
|
}
|
|
8122
8184
|
function getRepoHash() {
|
|
8123
8185
|
try {
|
|
8124
|
-
const remote =
|
|
8186
|
+
const remote = execSync14("git remote get-url origin || git rev-parse --show-toplevel", {
|
|
8125
8187
|
encoding: "utf-8",
|
|
8126
8188
|
stdio: ["pipe", "pipe", "pipe"]
|
|
8127
8189
|
}).trim();
|
|
@@ -11736,7 +11798,7 @@ import ora6 from "ora";
|
|
|
11736
11798
|
import pLimit from "p-limit";
|
|
11737
11799
|
|
|
11738
11800
|
// src/lib/git-diff.ts
|
|
11739
|
-
import { execSync as
|
|
11801
|
+
import { execSync as execSync16 } from "child_process";
|
|
11740
11802
|
var MAX_DIFF_BYTES = 1e5;
|
|
11741
11803
|
var DOC_PATTERNS = [
|
|
11742
11804
|
"CLAUDE.md",
|
|
@@ -11762,7 +11824,7 @@ function excludeArgs() {
|
|
|
11762
11824
|
}
|
|
11763
11825
|
function safeExec(cmd) {
|
|
11764
11826
|
try {
|
|
11765
|
-
return
|
|
11827
|
+
return execSync16(cmd, {
|
|
11766
11828
|
encoding: "utf-8",
|
|
11767
11829
|
stdio: ["pipe", "pipe", "pipe"],
|
|
11768
11830
|
maxBuffer: 10 * 1024 * 1024
|
|
@@ -14736,7 +14798,7 @@ learn.command("add <content>").description("Add a learning directly (used by age
|
|
|
14736
14798
|
import fs53 from "fs";
|
|
14737
14799
|
import path43 from "path";
|
|
14738
14800
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
14739
|
-
import { execSync as
|
|
14801
|
+
import { execSync as execSync17, execFileSync as execFileSync5 } from "child_process";
|
|
14740
14802
|
import chalk29 from "chalk";
|
|
14741
14803
|
import ora8 from "ora";
|
|
14742
14804
|
import confirm4 from "@inquirer/confirm";
|
|
@@ -14764,7 +14826,7 @@ function isNewer(registry, current) {
|
|
|
14764
14826
|
}
|
|
14765
14827
|
function getInstalledVersion() {
|
|
14766
14828
|
try {
|
|
14767
|
-
const globalRoot =
|
|
14829
|
+
const globalRoot = execSync17("npm root -g", {
|
|
14768
14830
|
encoding: "utf-8",
|
|
14769
14831
|
stdio: ["pipe", "pipe", "pipe"]
|
|
14770
14832
|
}).trim();
|
package/package.json
CHANGED