prior-cli 1.5.7 → 1.5.9
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 +32 -2
- package/package.json +1 -1
package/bin/prior.js
CHANGED
|
@@ -51,16 +51,46 @@ function fmtElapsed(ms) {
|
|
|
51
51
|
return `${Math.floor(s / 60)}m ${s % 60}s`;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
const THINK_LABELS = [
|
|
55
|
+
'thinking…',
|
|
56
|
+
'prioring…',
|
|
57
|
+
'processing…',
|
|
58
|
+
'reasoning…',
|
|
59
|
+
'cooking…',
|
|
60
|
+
'figuring it out…',
|
|
61
|
+
'on it…',
|
|
62
|
+
'analyzing…',
|
|
63
|
+
'tapping into prior…',
|
|
64
|
+
'syncing with the network…',
|
|
65
|
+
'loading prior brain…',
|
|
66
|
+
'consulting the feed…',
|
|
67
|
+
'running it through synapse…',
|
|
68
|
+
'give me a sec…',
|
|
69
|
+
'doing the math…',
|
|
70
|
+
'don\'t rush me…',
|
|
71
|
+
'querying the void…',
|
|
72
|
+
'prior is on it…',
|
|
73
|
+
'booting up neurons…',
|
|
74
|
+
'asking the BEN group…',
|
|
75
|
+
];
|
|
76
|
+
|
|
54
77
|
function spinStart(label = '') {
|
|
55
78
|
spinStop();
|
|
56
79
|
if (!process.stdout.isTTY) return;
|
|
57
80
|
_spinLabel = label;
|
|
58
81
|
_spinStart = Date.now();
|
|
82
|
+
let labelIdx = 0;
|
|
59
83
|
_spinTimer = setInterval(() => {
|
|
60
84
|
process.stdout.clearLine(0);
|
|
61
85
|
process.stdout.cursorTo(0);
|
|
62
|
-
const
|
|
63
|
-
|
|
86
|
+
const ms = Date.now() - _spinStart;
|
|
87
|
+
// Cycle through think labels every 4s only when in thinking mode
|
|
88
|
+
if (_spinLabel === 'thinking…') {
|
|
89
|
+
labelIdx = Math.floor(ms / 4000) % THINK_LABELS.length;
|
|
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}`);
|
|
64
94
|
}, 100);
|
|
65
95
|
}
|
|
66
96
|
|