prior-cli 1.6.0 → 1.6.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.
- package/bin/prior.js +6 -9
- package/package.json +1 -1
package/bin/prior.js
CHANGED
|
@@ -80,18 +80,15 @@ function spinStart(label = '') {
|
|
|
80
80
|
if (!process.stdout.isTTY) return;
|
|
81
81
|
_spinLabel = label;
|
|
82
82
|
_spinStart = Date.now();
|
|
83
|
-
|
|
83
|
+
const startTime = Date.now(); // captured in closure — never reset by label cycling
|
|
84
84
|
_spinTimer = setInterval(() => {
|
|
85
85
|
process.stdout.clearLine(0);
|
|
86
86
|
process.stdout.cursorTo(0);
|
|
87
|
-
const ms = Date.now() -
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
const displayLabel = _spinLabel === 'thinking…' ? THINK_LABELS[labelIdx] : _spinLabel;
|
|
93
|
-
const elapsedStr = ` ${c.dim('(' + fmtElapsed(ms) + ')')}`;
|
|
94
|
-
process.stdout.write(` ${c.brand(SPIN_FRAMES[_spinIdx++ % 4])} ${c.dim(displayLabel)}${elapsedStr}`);
|
|
87
|
+
const ms = Date.now() - startTime;
|
|
88
|
+
const displayLabel = _spinLabel === 'thinking…'
|
|
89
|
+
? THINK_LABELS[Math.floor(ms / 4000) % THINK_LABELS.length]
|
|
90
|
+
: _spinLabel;
|
|
91
|
+
process.stdout.write(` ${c.brand(SPIN_FRAMES[_spinIdx++ % 4])} ${c.dim(displayLabel)} ${c.dim('(' + fmtElapsed(ms) + ')')}`);
|
|
95
92
|
}, 100);
|
|
96
93
|
}
|
|
97
94
|
|