prior-cli 1.7.2 → 1.7.4
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 +42 -5
- package/package.json +1 -1
package/bin/prior.js
CHANGED
|
@@ -844,7 +844,7 @@ async function startChat(opts = {}) {
|
|
|
844
844
|
console.log(c.ok(' ◉') + c.muted(' Agent mode ') + c.dim('· file web shell image prior-network'));
|
|
845
845
|
|
|
846
846
|
console.log(DIVIDER);
|
|
847
|
-
console.log(c.muted(' /help /clear /compact /timer /save /load /saves /delete /exit'));
|
|
847
|
+
console.log(c.muted(' /help /clear /update /compact /timer /save /load /saves /delete /exit'));
|
|
848
848
|
console.log(DIVIDER);
|
|
849
849
|
console.log('');
|
|
850
850
|
|
|
@@ -861,6 +861,7 @@ async function startChat(opts = {}) {
|
|
|
861
861
|
readline.emitKeypressEvents(process.stdin, rl);
|
|
862
862
|
|
|
863
863
|
const SLASH_CMDS = [
|
|
864
|
+
{ cmd: '/update', desc: 'Check for updates and install if available' },
|
|
864
865
|
{ cmd: '/compact', desc: 'Compact conversation to save context' },
|
|
865
866
|
{ cmd: '/timer', desc: 'Set a countdown timer e.g. /timer 30s' },
|
|
866
867
|
{ cmd: '/saves', desc: 'List all saved conversations' },
|
|
@@ -869,8 +870,8 @@ async function startChat(opts = {}) {
|
|
|
869
870
|
{ cmd: '/delete', desc: 'Delete a saved conversation' },
|
|
870
871
|
{ cmd: '/help', desc: 'Show help' },
|
|
871
872
|
{ cmd: '/clear', desc: 'Clear screen' },
|
|
872
|
-
{ cmd: '/censored', desc: 'Load
|
|
873
|
-
{ cmd: '/uncensored', desc: 'Load
|
|
873
|
+
{ cmd: '/censored', desc: 'Load Prior Standard model' },
|
|
874
|
+
{ cmd: '/uncensored', desc: 'Load Prior Uncensored model' },
|
|
874
875
|
{ cmd: '/usage', desc: 'Token usage today' },
|
|
875
876
|
{ cmd: '/learn', desc: 'Learn this directory → prior.md' },
|
|
876
877
|
{ cmd: '/login', desc: 'Sign in' },
|
|
@@ -1403,6 +1404,41 @@ Keep it under 350 words. Write prior.md now.`;
|
|
|
1403
1404
|
return loop();
|
|
1404
1405
|
}
|
|
1405
1406
|
|
|
1407
|
+
case '/update': {
|
|
1408
|
+
console.log('');
|
|
1409
|
+
process.stdout.write(c.dim(' Checking for updates…'));
|
|
1410
|
+
const _fetch = require('node-fetch');
|
|
1411
|
+
let _latest;
|
|
1412
|
+
try {
|
|
1413
|
+
const _res = await _fetch('https://registry.npmjs.org/prior-cli/latest', { timeout: 8000 });
|
|
1414
|
+
if (!_res.ok) throw new Error(`HTTP ${_res.status}`);
|
|
1415
|
+
_latest = (await _res.json()).version;
|
|
1416
|
+
} catch (err) {
|
|
1417
|
+
process.stdout.clearLine(0); process.stdout.cursorTo(0);
|
|
1418
|
+
console.log(c.err(` ✗ Could not reach npm registry: ${err.message}\n`));
|
|
1419
|
+
return loop();
|
|
1420
|
+
}
|
|
1421
|
+
process.stdout.clearLine(0); process.stdout.cursorTo(0);
|
|
1422
|
+
if (_latest === version) {
|
|
1423
|
+
console.log(c.ok(' ✓ Already up to date ') + c.muted(`v${version}\n`));
|
|
1424
|
+
return loop();
|
|
1425
|
+
}
|
|
1426
|
+
console.log(` ${c.muted('Current :')} ${c.white(`v${version}`)}`);
|
|
1427
|
+
console.log(` ${c.muted('Latest :')} ${c.bold(`v${_latest}`)}`);
|
|
1428
|
+
console.log('');
|
|
1429
|
+
process.stdout.write(c.dim(' Installing update…'));
|
|
1430
|
+
try {
|
|
1431
|
+
require('child_process').execSync('npm install -g prior-cli@latest', { stdio: 'ignore' });
|
|
1432
|
+
process.stdout.clearLine(0); process.stdout.cursorTo(0);
|
|
1433
|
+
console.log(c.ok(` ✓ Updated to v${_latest} `) + c.muted('restart prior to apply\n'));
|
|
1434
|
+
} catch (err) {
|
|
1435
|
+
process.stdout.clearLine(0); process.stdout.cursorTo(0);
|
|
1436
|
+
console.log(c.err(` ✗ Install failed: ${err.message}`));
|
|
1437
|
+
console.log(c.muted(' Try manually: npm install -g prior-cli@latest\n'));
|
|
1438
|
+
}
|
|
1439
|
+
return loop();
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1406
1442
|
case '/compact': {
|
|
1407
1443
|
if (chatHistory.length === 0) {
|
|
1408
1444
|
console.log(c.muted(' Nothing to compact yet.\n'));
|
|
@@ -1548,6 +1584,7 @@ Be concise but thorough — this summary replaces the full history to save conte
|
|
|
1548
1584
|
case '/help':
|
|
1549
1585
|
console.log('');
|
|
1550
1586
|
console.log(c.bold(' Commands'));
|
|
1587
|
+
console.log(c.muted(' /update ') + 'Check for updates and install if available');
|
|
1551
1588
|
console.log(c.muted(' /compact ') + 'Compact conversation to save context');
|
|
1552
1589
|
console.log(c.muted(' /timer <duration> ') + 'Countdown timer e.g. /timer 30s, /timer 5m');
|
|
1553
1590
|
console.log(c.muted(' /saves ') + 'List all saved conversations');
|
|
@@ -1555,8 +1592,8 @@ Be concise but thorough — this summary replaces the full history to save conte
|
|
|
1555
1592
|
console.log(c.muted(' /load [name|number] ') + 'Load a saved conversation (picker if no arg)');
|
|
1556
1593
|
console.log(c.muted(' /delete [name|number]') + 'Delete a saved conversation');
|
|
1557
1594
|
console.log(c.muted(' /clear ') + 'Clear screen');
|
|
1558
|
-
console.log(c.muted(' /censored ') + 'Load
|
|
1559
|
-
console.log(c.muted(' /uncensored ') + 'Load
|
|
1595
|
+
console.log(c.muted(' /censored ') + 'Load Prior Standard model');
|
|
1596
|
+
console.log(c.muted(' /uncensored ') + 'Load Prior Uncensored model');
|
|
1560
1597
|
console.log(c.muted(' /usage ') + 'Token usage for today');
|
|
1561
1598
|
console.log(c.muted(' /learn ') + 'Scan directory and write prior.md context file');
|
|
1562
1599
|
console.log(c.muted(' /login ') + 'Sign in to a different account');
|