@neriros/ralphy 2.16.4 → 2.16.5
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/cli/index.js +68 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -35029,8 +35029,8 @@ import { readFileSync as readFileSync2 } from "fs";
|
|
|
35029
35029
|
import { resolve } from "path";
|
|
35030
35030
|
function getVersion() {
|
|
35031
35031
|
try {
|
|
35032
|
-
if ("2.16.
|
|
35033
|
-
return "2.16.
|
|
35032
|
+
if ("2.16.5")
|
|
35033
|
+
return "2.16.5";
|
|
35034
35034
|
} catch {}
|
|
35035
35035
|
const dirsToTry = [];
|
|
35036
35036
|
try {
|
|
@@ -72377,11 +72377,20 @@ var import_react57 = __toESM(require_react(), 1);
|
|
|
72377
72377
|
init_cli();
|
|
72378
72378
|
init_config();
|
|
72379
72379
|
init_wire();
|
|
72380
|
-
var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
|
|
72381
72380
|
import { join as join16, dirname as dirname4 } from "path";
|
|
72382
72381
|
import { pathToFileURL } from "url";
|
|
72383
72382
|
import { homedir as homedir3 } from "os";
|
|
72384
72383
|
import { appendFile, mkdir as mkdir4 } from "fs/promises";
|
|
72384
|
+
|
|
72385
|
+
// packages/core/src/progress.ts
|
|
72386
|
+
function countProgress(content) {
|
|
72387
|
+
const checked = (content.match(/^- \[x\]/gm) ?? []).length;
|
|
72388
|
+
const unchecked = (content.match(/^- \[ \]/gm) ?? []).length;
|
|
72389
|
+
return { checked, unchecked, total: checked + unchecked };
|
|
72390
|
+
}
|
|
72391
|
+
|
|
72392
|
+
// apps/cli/src/components/AgentMode.tsx
|
|
72393
|
+
var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
|
|
72385
72394
|
var lineCounter = 0;
|
|
72386
72395
|
function nextId() {
|
|
72387
72396
|
lineCounter += 1;
|
|
@@ -72408,6 +72417,18 @@ function fmtElapsed(ms) {
|
|
|
72408
72417
|
function trunc(s, max2) {
|
|
72409
72418
|
return s.length > max2 ? s.slice(0, max2 - 1) + "\u2026" : s;
|
|
72410
72419
|
}
|
|
72420
|
+
function calcProgressBar(checked, total, width) {
|
|
72421
|
+
const countStr = `${checked}/${total}`;
|
|
72422
|
+
const inner = width - 2;
|
|
72423
|
+
if (inner < countStr.length + 2)
|
|
72424
|
+
return null;
|
|
72425
|
+
const leftSlot = Math.floor((inner - countStr.length) / 2);
|
|
72426
|
+
const rightSlot = Math.max(0, inner - countStr.length - leftSlot);
|
|
72427
|
+
const filled = total > 0 ? Math.round(checked / total * inner) : 0;
|
|
72428
|
+
const filledLeft = Math.min(filled, leftSlot);
|
|
72429
|
+
const filledRight = Math.max(0, Math.min(filled - leftSlot - countStr.length, rightSlot));
|
|
72430
|
+
return { countStr, filledLeft, leftSlot, filledRight, rightSlot };
|
|
72431
|
+
}
|
|
72411
72432
|
function prLabel(prUrl) {
|
|
72412
72433
|
const m = prUrl.match(/\/pull\/(\d+)/);
|
|
72413
72434
|
return m ? `#${m[1]}` : "PR";
|
|
@@ -72652,6 +72673,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
|
|
|
72652
72673
|
phaseDetail: "",
|
|
72653
72674
|
phaseStartedAt: Date.now(),
|
|
72654
72675
|
currentTask: null,
|
|
72676
|
+
taskProgress: null,
|
|
72655
72677
|
prUrl: null,
|
|
72656
72678
|
currentCmd: null,
|
|
72657
72679
|
tail: []
|
|
@@ -72773,6 +72795,8 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
|
|
|
72773
72795
|
const text = await tasksFile.text();
|
|
72774
72796
|
const match = text.match(/^- \[ \] (.+)$/m);
|
|
72775
72797
|
meta.currentTask = match?.[1]?.trim() ?? null;
|
|
72798
|
+
const { checked, total } = countProgress(text);
|
|
72799
|
+
meta.taskProgress = total > 0 ? { checked, total } : null;
|
|
72776
72800
|
}
|
|
72777
72801
|
} catch (err) {
|
|
72778
72802
|
console.error(`Failed to read tasks.md for worker '${changeName}' (may not exist yet):`, err);
|
|
@@ -73119,6 +73143,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
|
|
|
73119
73143
|
const tail2 = meta?.tail ?? [];
|
|
73120
73144
|
const prUrl = meta?.prUrl ?? null;
|
|
73121
73145
|
const currentTask = meta?.currentTask ?? null;
|
|
73146
|
+
const taskProgress = meta?.taskProgress ?? null;
|
|
73122
73147
|
const pBadge = priorityBadge(w.issue.priority);
|
|
73123
73148
|
const mBadge = modeBadge(w.mode);
|
|
73124
73149
|
const pColor = phaseColor(phase);
|
|
@@ -73322,6 +73347,46 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
|
|
|
73322
73347
|
}, undefined, false, undefined, this)
|
|
73323
73348
|
]
|
|
73324
73349
|
}, undefined, true, undefined, this),
|
|
73350
|
+
taskProgress && (() => {
|
|
73351
|
+
const bar = calcProgressBar(taskProgress.checked, taskProgress.total, termWidth - 4);
|
|
73352
|
+
if (!bar)
|
|
73353
|
+
return null;
|
|
73354
|
+
const { countStr, filledLeft, leftSlot, filledRight, rightSlot } = bar;
|
|
73355
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
73356
|
+
marginTop: 0,
|
|
73357
|
+
children: [
|
|
73358
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
73359
|
+
dimColor: true,
|
|
73360
|
+
children: "["
|
|
73361
|
+
}, undefined, false, undefined, this),
|
|
73362
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
73363
|
+
color: "green",
|
|
73364
|
+
children: "\u2588".repeat(filledLeft)
|
|
73365
|
+
}, undefined, false, undefined, this),
|
|
73366
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
73367
|
+
dimColor: true,
|
|
73368
|
+
children: "\u2591".repeat(leftSlot - filledLeft)
|
|
73369
|
+
}, undefined, false, undefined, this),
|
|
73370
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
73371
|
+
color: "white",
|
|
73372
|
+
bold: true,
|
|
73373
|
+
children: countStr
|
|
73374
|
+
}, undefined, false, undefined, this),
|
|
73375
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
73376
|
+
color: "green",
|
|
73377
|
+
children: "\u2588".repeat(filledRight)
|
|
73378
|
+
}, undefined, false, undefined, this),
|
|
73379
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
73380
|
+
dimColor: true,
|
|
73381
|
+
children: "\u2591".repeat(rightSlot - filledRight)
|
|
73382
|
+
}, undefined, false, undefined, this),
|
|
73383
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
73384
|
+
dimColor: true,
|
|
73385
|
+
children: "]"
|
|
73386
|
+
}, undefined, false, undefined, this)
|
|
73387
|
+
]
|
|
73388
|
+
}, undefined, true, undefined, this);
|
|
73389
|
+
})(),
|
|
73325
73390
|
currentTask && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
73326
73391
|
gap: 1,
|
|
73327
73392
|
marginTop: 0,
|