prior-cli 1.5.9 → 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 +7 -9
- package/package.json +1 -1
package/bin/prior.js
CHANGED
|
@@ -72,6 +72,7 @@ const THINK_LABELS = [
|
|
|
72
72
|
'prior is on it…',
|
|
73
73
|
'booting up neurons…',
|
|
74
74
|
'asking the BEN group…',
|
|
75
|
+
'euwining…',
|
|
75
76
|
];
|
|
76
77
|
|
|
77
78
|
function spinStart(label = '') {
|
|
@@ -79,18 +80,15 @@ function spinStart(label = '') {
|
|
|
79
80
|
if (!process.stdout.isTTY) return;
|
|
80
81
|
_spinLabel = label;
|
|
81
82
|
_spinStart = Date.now();
|
|
82
|
-
|
|
83
|
+
const startTime = Date.now(); // captured in closure — never reset by label cycling
|
|
83
84
|
_spinTimer = setInterval(() => {
|
|
84
85
|
process.stdout.clearLine(0);
|
|
85
86
|
process.stdout.cursorTo(0);
|
|
86
|
-
const ms = Date.now() -
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
const displayLabel = _spinLabel === 'thinking…' ? THINK_LABELS[labelIdx] : _spinLabel;
|
|
92
|
-
const elapsedStr = ` ${c.dim('(' + fmtElapsed(ms) + ')')}`;
|
|
93
|
-
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) + ')')}`);
|
|
94
92
|
}, 100);
|
|
95
93
|
}
|
|
96
94
|
|