@rely-ai/caliber 1.26.0 → 1.26.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.
Files changed (2) hide show
  1. package/dist/bin.js +34 -70
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -1,8 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
4
  var __esm = (fn, res) => function __init() {
7
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8
6
  };
@@ -10,54 +8,6 @@ var __export = (target, all) => {
10
8
  for (var name in all)
11
9
  __defProp(target, name, { get: all[name], enumerable: true });
12
10
  };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
-
23
- // src/constants.ts
24
- var constants_exports = {};
25
- __export(constants_exports, {
26
- AUTH_DIR: () => AUTH_DIR,
27
- BACKUPS_DIR: () => BACKUPS_DIR,
28
- CALIBER_DIR: () => CALIBER_DIR,
29
- LEARNING_DIR: () => LEARNING_DIR,
30
- LEARNING_FINALIZE_LOG: () => LEARNING_FINALIZE_LOG,
31
- LEARNING_LAST_ERROR_FILE: () => LEARNING_LAST_ERROR_FILE,
32
- LEARNING_MAX_EVENTS: () => LEARNING_MAX_EVENTS,
33
- LEARNING_ROI_FILE: () => LEARNING_ROI_FILE,
34
- LEARNING_SESSION_FILE: () => LEARNING_SESSION_FILE,
35
- LEARNING_STATE_FILE: () => LEARNING_STATE_FILE,
36
- MANIFEST_FILE: () => MANIFEST_FILE,
37
- MIN_SESSIONS_FOR_COMPARISON: () => MIN_SESSIONS_FOR_COMPARISON,
38
- PERSONAL_LEARNINGS_FILE: () => PERSONAL_LEARNINGS_FILE
39
- });
40
- import path2 from "path";
41
- import os from "os";
42
- var AUTH_DIR, CALIBER_DIR, MANIFEST_FILE, BACKUPS_DIR, LEARNING_DIR, LEARNING_SESSION_FILE, LEARNING_STATE_FILE, LEARNING_MAX_EVENTS, LEARNING_ROI_FILE, PERSONAL_LEARNINGS_FILE, LEARNING_FINALIZE_LOG, LEARNING_LAST_ERROR_FILE, MIN_SESSIONS_FOR_COMPARISON;
43
- var init_constants = __esm({
44
- "src/constants.ts"() {
45
- "use strict";
46
- AUTH_DIR = path2.join(os.homedir(), ".caliber");
47
- CALIBER_DIR = ".caliber";
48
- MANIFEST_FILE = path2.join(CALIBER_DIR, "manifest.json");
49
- BACKUPS_DIR = path2.join(CALIBER_DIR, "backups");
50
- LEARNING_DIR = path2.join(CALIBER_DIR, "learning");
51
- LEARNING_SESSION_FILE = "current-session.jsonl";
52
- LEARNING_STATE_FILE = "state.json";
53
- LEARNING_MAX_EVENTS = 500;
54
- LEARNING_ROI_FILE = "roi-stats.json";
55
- PERSONAL_LEARNINGS_FILE = path2.join(AUTH_DIR, "personal-learnings.md");
56
- LEARNING_FINALIZE_LOG = "finalize.log";
57
- LEARNING_LAST_ERROR_FILE = "last-error.json";
58
- MIN_SESSIONS_FOR_COMPARISON = 3;
59
- }
60
- });
61
11
 
62
12
  // src/llm/config.ts
63
13
  var config_exports = {};
@@ -708,9 +658,27 @@ function scan(base, rel, depth, maxDepth, result) {
708
658
  }
709
659
 
710
660
  // src/fingerprint/existing-config.ts
711
- init_constants();
712
661
  import fs2 from "fs";
713
662
  import path3 from "path";
663
+
664
+ // src/constants.ts
665
+ import path2 from "path";
666
+ import os from "os";
667
+ var AUTH_DIR = path2.join(os.homedir(), ".caliber");
668
+ var CALIBER_DIR = ".caliber";
669
+ var MANIFEST_FILE = path2.join(CALIBER_DIR, "manifest.json");
670
+ var BACKUPS_DIR = path2.join(CALIBER_DIR, "backups");
671
+ var LEARNING_DIR = path2.join(CALIBER_DIR, "learning");
672
+ var LEARNING_SESSION_FILE = "current-session.jsonl";
673
+ var LEARNING_STATE_FILE = "state.json";
674
+ var LEARNING_MAX_EVENTS = 500;
675
+ var LEARNING_ROI_FILE = "roi-stats.json";
676
+ var PERSONAL_LEARNINGS_FILE = path2.join(AUTH_DIR, "personal-learnings.md");
677
+ var LEARNING_FINALIZE_LOG = "finalize.log";
678
+ var LEARNING_LAST_ERROR_FILE = "last-error.json";
679
+ var MIN_SESSIONS_FOR_COMPARISON = 3;
680
+
681
+ // src/fingerprint/existing-config.ts
714
682
  function readExistingConfigs(dir) {
715
683
  const configs = {};
716
684
  const readmeMdPath = path3.join(dir, "README.md");
@@ -4225,7 +4193,6 @@ function writeGithubCopilotConfig(config) {
4225
4193
  }
4226
4194
 
4227
4195
  // src/writers/backup.ts
4228
- init_constants();
4229
4196
  import fs13 from "fs";
4230
4197
  import path13 from "path";
4231
4198
  function createBackup(files) {
@@ -4401,7 +4368,6 @@ function ensureBuiltinSkills() {
4401
4368
  }
4402
4369
 
4403
4370
  // src/writers/manifest.ts
4404
- init_constants();
4405
4371
  import fs15 from "fs";
4406
4372
  import crypto2 from "crypto";
4407
4373
  function readManifest() {
@@ -4488,9 +4454,8 @@ function undoSetup() {
4488
4454
  }
4489
4455
  }
4490
4456
  }
4491
- const { MANIFEST_FILE: MANIFEST_FILE2 } = (init_constants(), __toCommonJS(constants_exports));
4492
- if (fs16.existsSync(MANIFEST_FILE2)) {
4493
- fs16.unlinkSync(MANIFEST_FILE2);
4457
+ if (fs16.existsSync(MANIFEST_FILE)) {
4458
+ fs16.unlinkSync(MANIFEST_FILE);
4494
4459
  }
4495
4460
  return { restored, removed };
4496
4461
  }
@@ -4501,7 +4466,7 @@ function getFilesToWrite(setup) {
4501
4466
  if (setup.claude.mcpServers) files.push(".mcp.json");
4502
4467
  if (setup.claude.skills) {
4503
4468
  for (const s of setup.claude.skills) {
4504
- files.push(`.claude/skills/${s.name.replace(/[^a-z0-9-]/gi, "-").toLowerCase()}.md`);
4469
+ files.push(`.claude/skills/${s.name.replace(/[^a-z0-9-]/gi, "-").toLowerCase()}/SKILL.md`);
4505
4470
  }
4506
4471
  }
4507
4472
  }
@@ -4542,7 +4507,6 @@ function ensureGitignore() {
4542
4507
  }
4543
4508
 
4544
4509
  // src/writers/staging.ts
4545
- init_constants();
4546
4510
  import fs17 from "fs";
4547
4511
  import path15 from "path";
4548
4512
  var STAGED_DIR = path15.join(CALIBER_DIR, "staged");
@@ -4814,7 +4778,6 @@ function removeLearningHooks() {
4814
4778
  }
4815
4779
 
4816
4780
  // src/lib/state.ts
4817
- init_constants();
4818
4781
  import fs21 from "fs";
4819
4782
  import path17 from "path";
4820
4783
  import { execSync as execSync7 } from "child_process";
@@ -5899,7 +5862,6 @@ function checkSources(dir) {
5899
5862
  }
5900
5863
 
5901
5864
  // src/scoring/dismissed.ts
5902
- init_constants();
5903
5865
  import fs22 from "fs";
5904
5866
  import path18 from "path";
5905
5867
  var DISMISSED_FILE = path18.join(CALIBER_DIR, "dismissed-checks.json");
@@ -6206,7 +6168,8 @@ function scanLocalState(dir) {
6206
6168
  });
6207
6169
  }
6208
6170
  }
6209
- } catch {
6171
+ } catch (error) {
6172
+ warnScanSkip(".mcp.json", error);
6210
6173
  }
6211
6174
  }
6212
6175
  const agentsMdPath = path19.join(dir, "AGENTS.md");
@@ -6234,7 +6197,8 @@ function scanLocalState(dir) {
6234
6197
  });
6235
6198
  }
6236
6199
  }
6237
- } catch {
6200
+ } catch (error) {
6201
+ warnScanSkip(".agents/skills", error);
6238
6202
  }
6239
6203
  }
6240
6204
  const cursorrulesPath = path19.join(dir, ".cursorrules");
@@ -6275,7 +6239,8 @@ function scanLocalState(dir) {
6275
6239
  });
6276
6240
  }
6277
6241
  }
6278
- } catch {
6242
+ } catch (error) {
6243
+ warnScanSkip(".cursor/skills", error);
6279
6244
  }
6280
6245
  }
6281
6246
  const cursorMcpPath = path19.join(dir, ".cursor", "mcp.json");
@@ -6293,7 +6258,8 @@ function scanLocalState(dir) {
6293
6258
  });
6294
6259
  }
6295
6260
  }
6296
- } catch {
6261
+ } catch (error) {
6262
+ warnScanSkip(".cursor/mcp.json", error);
6297
6263
  }
6298
6264
  }
6299
6265
  return items;
@@ -6305,6 +6271,10 @@ function hashFile(filePath) {
6305
6271
  function hashJson(obj) {
6306
6272
  return crypto3.createHash("sha256").update(JSON.stringify(obj)).digest("hex");
6307
6273
  }
6274
+ function warnScanSkip(target, error) {
6275
+ const message = error instanceof Error ? error.message : String(error);
6276
+ console.warn(`Warning: ${target} scan skipped (${message})`);
6277
+ }
6308
6278
 
6309
6279
  // src/commands/recommend.ts
6310
6280
  init_config();
@@ -9658,7 +9628,6 @@ function isSimilarLearning(a, b) {
9658
9628
  }
9659
9629
 
9660
9630
  // src/learner/writer.ts
9661
- init_constants();
9662
9631
  var LEARNINGS_FILE = "CALIBER_LEARNINGS.md";
9663
9632
  var LEARNINGS_HEADER = `# Caliber Learnings
9664
9633
 
@@ -10354,7 +10323,6 @@ function readStdin() {
10354
10323
  }
10355
10324
 
10356
10325
  // src/learner/storage.ts
10357
- init_constants();
10358
10326
  import fs40 from "fs";
10359
10327
  import path31 from "path";
10360
10328
  var MAX_RESPONSE_LENGTH = 2e3;
@@ -10529,7 +10497,6 @@ function sanitizeSecrets(text) {
10529
10497
  }
10530
10498
 
10531
10499
  // src/lib/notifications.ts
10532
- init_constants();
10533
10500
  import fs41 from "fs";
10534
10501
  import path32 from "path";
10535
10502
  import chalk22 from "chalk";
@@ -10698,7 +10665,6 @@ function calculateSessionWaste(events) {
10698
10665
  init_config();
10699
10666
 
10700
10667
  // src/learner/roi.ts
10701
- init_constants();
10702
10668
  import fs42 from "fs";
10703
10669
  import path33 from "path";
10704
10670
  var DEFAULT_TOTALS = {
@@ -10935,7 +10901,6 @@ function findStaleLearnings(stats, minSessions = DEFAULT_MIN_SESSIONS) {
10935
10901
  }
10936
10902
 
10937
10903
  // src/commands/learn.ts
10938
- init_constants();
10939
10904
  var MIN_EVENTS_FOR_ANALYSIS = 25;
10940
10905
  var MIN_EVENTS_AUTO = 10;
10941
10906
  var AUTO_SETTLE_MS = 200;
@@ -11428,7 +11393,6 @@ async function learnAddCommand(content, options) {
11428
11393
 
11429
11394
  // src/commands/insights.ts
11430
11395
  import chalk24 from "chalk";
11431
- init_constants();
11432
11396
  var MIN_SESSIONS_FULL = 20;
11433
11397
  function buildInsightsData(stats) {
11434
11398
  const t = stats.totals;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rely-ai/caliber",
3
- "version": "1.26.0",
3
+ "version": "1.26.1",
4
4
  "description": "Analyze your codebase and generate optimized AI agent configs (CLAUDE.md, .cursorrules, skills) — no API key needed",
5
5
  "type": "module",
6
6
  "bin": {