@rely-ai/caliber 1.22.1 → 1.23.0-dev.1773792440
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 +102 -43
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -7050,9 +7050,17 @@ var ParallelTaskDisplay = class {
|
|
|
7050
7050
|
cachedCardLines = null;
|
|
7051
7051
|
cachedCardIndex = -1;
|
|
7052
7052
|
cachedCardCols = -1;
|
|
7053
|
+
cachedConnectors = null;
|
|
7053
7054
|
add(name, options) {
|
|
7054
7055
|
const index = this.tasks.length;
|
|
7055
|
-
this.tasks.push({
|
|
7056
|
+
this.tasks.push({
|
|
7057
|
+
name,
|
|
7058
|
+
status: "pending",
|
|
7059
|
+
message: "",
|
|
7060
|
+
depth: options?.depth ?? 0,
|
|
7061
|
+
pipelineLabel: options?.pipelineLabel,
|
|
7062
|
+
pipelineRow: options?.pipelineRow ?? 0
|
|
7063
|
+
});
|
|
7056
7064
|
return index;
|
|
7057
7065
|
}
|
|
7058
7066
|
start() {
|
|
@@ -7159,42 +7167,84 @@ var ParallelTaskDisplay = class {
|
|
|
7159
7167
|
const boundary = lastSpace > max * 0.5 ? lastSpace : max - 1;
|
|
7160
7168
|
return text.slice(0, boundary) + "\u2026";
|
|
7161
7169
|
}
|
|
7162
|
-
|
|
7163
|
-
const cols = process.stdout.columns || 80;
|
|
7164
|
-
const elapsed = task.startTime ? this.formatTime((task.endTime ?? Date.now()) - task.startTime) : "";
|
|
7165
|
-
const timeStr = elapsed ? ` ${chalk10.dim(elapsed)}` : "";
|
|
7166
|
-
const timePlain = elapsed ? ` ${elapsed}` : "";
|
|
7167
|
-
let icon;
|
|
7168
|
-
let nameStyle;
|
|
7169
|
-
let msgStyle;
|
|
7170
|
+
statusIcon(task) {
|
|
7170
7171
|
switch (task.status) {
|
|
7171
7172
|
case "pending":
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
icon = chalk10.cyan(SPINNER_FRAMES[this.spinnerFrame]);
|
|
7178
|
-
nameStyle = chalk10.white;
|
|
7179
|
-
msgStyle = chalk10.dim;
|
|
7180
|
-
break;
|
|
7173
|
+
return { char: "\u25CB", styled: chalk10.dim("\u25CB") };
|
|
7174
|
+
case "running": {
|
|
7175
|
+
const frame = SPINNER_FRAMES[this.spinnerFrame];
|
|
7176
|
+
return { char: frame, styled: chalk10.cyan(frame) };
|
|
7177
|
+
}
|
|
7181
7178
|
case "done":
|
|
7182
|
-
|
|
7183
|
-
nameStyle = chalk10.white;
|
|
7184
|
-
msgStyle = chalk10.dim;
|
|
7185
|
-
break;
|
|
7179
|
+
return { char: "\u2713", styled: chalk10.green("\u2713") };
|
|
7186
7180
|
case "failed":
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
const
|
|
7193
|
-
|
|
7194
|
-
const
|
|
7181
|
+
return { char: "\u2717", styled: chalk10.red("\u2717") };
|
|
7182
|
+
}
|
|
7183
|
+
}
|
|
7184
|
+
renderPipelineHeader() {
|
|
7185
|
+
const mainTasks = this.tasks.filter((t) => t.pipelineLabel && t.pipelineRow === 0);
|
|
7186
|
+
const branchTasks = this.tasks.filter((t) => t.pipelineLabel && t.pipelineRow === 1);
|
|
7187
|
+
if (mainTasks.length === 0) return [];
|
|
7188
|
+
const arrow = " \u2192 ";
|
|
7189
|
+
const styledArrow = chalk10.dim(arrow);
|
|
7190
|
+
const renderNode = (t) => {
|
|
7191
|
+
const { char, styled: icon } = this.statusIcon(t);
|
|
7192
|
+
const label = t.pipelineLabel;
|
|
7193
|
+
const styledLabel = t.status === "pending" ? chalk10.dim(label) : label;
|
|
7194
|
+
return {
|
|
7195
|
+
plain: `[${char} ${label}]`,
|
|
7196
|
+
styled: chalk10.dim("[") + icon + " " + styledLabel + chalk10.dim("]")
|
|
7197
|
+
};
|
|
7198
|
+
};
|
|
7199
|
+
const mainNodes = mainTasks.map(renderNode);
|
|
7200
|
+
const mainLine = PREFIX + mainNodes.map((n) => n.styled).join(styledArrow);
|
|
7201
|
+
const lines = [mainLine];
|
|
7202
|
+
if (branchTasks.length > 0) {
|
|
7203
|
+
const firstNodePlainWidth = mainNodes[0].plain.length;
|
|
7204
|
+
const indent = " ".repeat(PREFIX.length + firstNodePlainWidth + arrow.length);
|
|
7205
|
+
const branchNodes = branchTasks.map(renderNode);
|
|
7206
|
+
const branchLine = indent + chalk10.dim("\u2198 ") + branchNodes.map((n) => n.styled).join(styledArrow) + chalk10.dim(" \u2197");
|
|
7207
|
+
lines.push(branchLine);
|
|
7208
|
+
}
|
|
7209
|
+
return lines;
|
|
7210
|
+
}
|
|
7211
|
+
hasSiblingAfter(startIdx, depth) {
|
|
7212
|
+
for (let i = startIdx; i < this.tasks.length; i++) {
|
|
7213
|
+
if (this.tasks[i].depth < depth) return false;
|
|
7214
|
+
if (this.tasks[i].depth === depth) return true;
|
|
7215
|
+
}
|
|
7216
|
+
return false;
|
|
7217
|
+
}
|
|
7218
|
+
getTreeConnector(index) {
|
|
7219
|
+
const task = this.tasks[index];
|
|
7220
|
+
if (task.depth === 0) return "";
|
|
7221
|
+
if (task.depth === 1) {
|
|
7222
|
+
return this.hasSiblingAfter(index + 1, 1) ? "\u251C\u2500 " : "\u2514\u2500 ";
|
|
7223
|
+
}
|
|
7224
|
+
if (task.depth === 2) {
|
|
7225
|
+
const pipe = this.hasSiblingAfter(index + 1, 1) ? "\u2502" : " ";
|
|
7226
|
+
return `${pipe} \u2514\u2500 `;
|
|
7227
|
+
}
|
|
7228
|
+
return " ".repeat(task.depth);
|
|
7229
|
+
}
|
|
7230
|
+
renderLine(task, index) {
|
|
7231
|
+
const cols = process.stdout.columns || 80;
|
|
7232
|
+
const elapsed = task.startTime ? this.formatTime((task.endTime ?? Date.now()) - task.startTime) : "";
|
|
7233
|
+
const timeStr = elapsed ? ` ${chalk10.dim(elapsed)}` : "";
|
|
7234
|
+
const timePlain = elapsed ? ` ${elapsed}` : "";
|
|
7235
|
+
const { styled: icon } = this.statusIcon(task);
|
|
7236
|
+
const nameStyle = task.status === "pending" ? chalk10.dim : chalk10.white;
|
|
7237
|
+
const msgStyle = task.status === "failed" ? chalk10.red : chalk10.dim;
|
|
7238
|
+
if (!this.cachedConnectors) {
|
|
7239
|
+
this.cachedConnectors = this.tasks.map((_, i) => this.getTreeConnector(i));
|
|
7240
|
+
}
|
|
7241
|
+
const connector = this.cachedConnectors[index];
|
|
7242
|
+
const connectorStyled = connector ? chalk10.dim(connector) : "";
|
|
7243
|
+
const paddedName = task.name.padEnd(Math.max(0, NAME_COL_WIDTH - connector.length));
|
|
7244
|
+
const usedByFixed = PREFIX.length + connector.length + 2 + NAME_COL_WIDTH + timePlain.length;
|
|
7195
7245
|
const msgMax = Math.max(cols - usedByFixed - 2, 10);
|
|
7196
7246
|
const msg = task.message ? this.smartTruncate(task.message, msgMax) : "";
|
|
7197
|
-
return `${PREFIX}${
|
|
7247
|
+
return `${PREFIX}${connectorStyled}${icon} ${nameStyle(paddedName)}${msg ? msgStyle(msg) : ""}${timeStr}`;
|
|
7198
7248
|
}
|
|
7199
7249
|
draw(initial) {
|
|
7200
7250
|
const { stdout } = process;
|
|
@@ -7202,7 +7252,15 @@ var ParallelTaskDisplay = class {
|
|
|
7202
7252
|
stdout.write(`\x1B[${this.lineCount}A`);
|
|
7203
7253
|
}
|
|
7204
7254
|
stdout.write("\x1B[0J");
|
|
7205
|
-
const
|
|
7255
|
+
const pipelineHeader = this.renderPipelineHeader();
|
|
7256
|
+
const taskLines = this.tasks.map((t, i) => this.renderLine(t, i));
|
|
7257
|
+
const lines = [];
|
|
7258
|
+
if (pipelineHeader.length > 0) {
|
|
7259
|
+
lines.push(...pipelineHeader);
|
|
7260
|
+
const cols = stdout.columns || 80;
|
|
7261
|
+
lines.push(PREFIX + chalk10.dim("\u2500".repeat(Math.min(cols - PREFIX.length * 2, 55))));
|
|
7262
|
+
}
|
|
7263
|
+
lines.push(...taskLines);
|
|
7206
7264
|
if (this.waitingEnabled && this.waitingCards.length > 0 && stdout.isTTY) {
|
|
7207
7265
|
const cols = stdout.columns || 80;
|
|
7208
7266
|
if (this.currentCard !== this.cachedCardIndex || cols !== this.cachedCardCols || !this.cachedCardLines) {
|
|
@@ -7353,11 +7411,11 @@ async function initCommand(options) {
|
|
|
7353
7411
|
let skillSearchResult = { results: [], contentMap: /* @__PURE__ */ new Map() };
|
|
7354
7412
|
let fingerprint;
|
|
7355
7413
|
const display = new ParallelTaskDisplay();
|
|
7356
|
-
const TASK_STACK = display.add("Detecting project stack");
|
|
7357
|
-
const TASK_CONFIG = display.add("Generating configs");
|
|
7358
|
-
const TASK_SKILLS_GEN = display.add("Generating skills", { depth:
|
|
7359
|
-
const TASK_SKILLS_SEARCH = wantsSkills ? display.add("Searching community skills") : -1;
|
|
7360
|
-
const TASK_SCORE_REFINE = display.add("Validating & refining setup");
|
|
7414
|
+
const TASK_STACK = display.add("Detecting project stack", { pipelineLabel: "Scan" });
|
|
7415
|
+
const TASK_CONFIG = display.add("Generating configs", { depth: 1, pipelineLabel: "Generate" });
|
|
7416
|
+
const TASK_SKILLS_GEN = display.add("Generating skills", { depth: 2, pipelineLabel: "Skills" });
|
|
7417
|
+
const TASK_SKILLS_SEARCH = wantsSkills ? display.add("Searching community skills", { depth: 1, pipelineLabel: "Search", pipelineRow: 1 }) : -1;
|
|
7418
|
+
const TASK_SCORE_REFINE = display.add("Validating & refining setup", { pipelineLabel: "Validate" });
|
|
7361
7419
|
display.start();
|
|
7362
7420
|
display.enableWaitingContent();
|
|
7363
7421
|
try {
|
|
@@ -7385,7 +7443,8 @@ async function initCommand(options) {
|
|
|
7385
7443
|
}
|
|
7386
7444
|
display.update(TASK_CONFIG, "running");
|
|
7387
7445
|
const generatePromise = (async () => {
|
|
7388
|
-
|
|
7446
|
+
let localBaseline = baselineScore;
|
|
7447
|
+
const failingForDismissal = localBaseline.checks.filter((c) => !c.passed && c.maxPoints > 0);
|
|
7389
7448
|
if (failingForDismissal.length > 0) {
|
|
7390
7449
|
display.update(TASK_CONFIG, "running", "Evaluating baseline checks...");
|
|
7391
7450
|
try {
|
|
@@ -7395,7 +7454,7 @@ async function initCommand(options) {
|
|
|
7395
7454
|
const existingIds = new Set(existing.map((d) => d.id));
|
|
7396
7455
|
const merged = [...existing, ...newDismissals.filter((d) => !existingIds.has(d.id))];
|
|
7397
7456
|
writeDismissedChecks(merged);
|
|
7398
|
-
|
|
7457
|
+
localBaseline = computeLocalScore(process.cwd(), targetAgent);
|
|
7399
7458
|
}
|
|
7400
7459
|
} catch {
|
|
7401
7460
|
display.update(TASK_CONFIG, "running", "Skipped dismissal evaluation");
|
|
@@ -7404,11 +7463,11 @@ async function initCommand(options) {
|
|
|
7404
7463
|
let failingChecks;
|
|
7405
7464
|
let passingChecks;
|
|
7406
7465
|
let currentScore;
|
|
7407
|
-
if (hasExistingConfig &&
|
|
7408
|
-
const currentLlmFixable =
|
|
7466
|
+
if (hasExistingConfig && localBaseline.score >= 95 && !options.force) {
|
|
7467
|
+
const currentLlmFixable = localBaseline.checks.filter((c) => !c.passed && c.maxPoints > 0 && !NON_LLM_CHECKS.has(c.id));
|
|
7409
7468
|
failingChecks = currentLlmFixable.map((c) => ({ name: c.name, suggestion: c.suggestion, fix: c.fix }));
|
|
7410
|
-
passingChecks =
|
|
7411
|
-
currentScore =
|
|
7469
|
+
passingChecks = localBaseline.checks.filter((c) => c.passed).map((c) => ({ name: c.name }));
|
|
7470
|
+
currentScore = localBaseline.score;
|
|
7412
7471
|
}
|
|
7413
7472
|
if (report) {
|
|
7414
7473
|
const fullPrompt = buildGeneratePrompt(fingerprint, targetAgent, fingerprint.description, failingChecks, currentScore, passingChecks);
|
package/package.json
CHANGED