prior-cli 1.5.0 → 1.5.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.
Files changed (2) hide show
  1. package/bin/prior.js +17 -31
  2. package/package.json +1 -1
package/bin/prior.js CHANGED
@@ -414,42 +414,28 @@ function dayLabel(dateStr) {
414
414
  }
415
415
 
416
416
  function renderWeatherCard(w) {
417
- const W = 42;
418
- const pad = (str, len) => {
419
- const plain = str.replace(/\x1b\[[0-9;]*m/g, '');
420
- return str + ' '.repeat(Math.max(0, len - plain.length));
421
- };
422
- const line = (content = '') => {
423
- process.stdout.write(c.muted(' │ ') + content + c.muted(' │') + '\n');
424
- };
425
- const rule = ' ├' + '─'.repeat(W) + '┤';
426
- const top = ' ╭' + '─'.repeat(W) + '╮';
427
- const bot = ' ╰' + '─'.repeat(W) + '╯';
428
-
429
- const location = `📍 ${w.city}${w.country ? ', ' + w.country : ''}`;
430
- const icon = weatherIcon(w.code);
431
- const condLine = `${icon} ${w.desc}`;
432
- const tempLine = `🌡 ${w.tempC}°C ${c.dim(`feels like ${w.feelsC}°C`)}`;
433
- const infoLine = `💧 ${w.humidity}% 💨 ${w.windKmph} km/h`;
417
+ // Use left-border-only style — avoids emoji column-width alignment issues
418
+ const L = ' │ ';
419
+ const hr = ' ├─────────────────────────────────────\n';
434
420
 
435
- process.stdout.write(c.muted(top) + '\n');
436
- line(pad(c.bold(location), W));
437
- line();
438
- line(pad(condLine, W));
439
- line(pad(tempLine, W + 9)); // +9 for dim escape codes
440
- line(pad(c.dim(infoLine), W + 9));
421
+ process.stdout.write(c.muted(' ┌─────────────────────────────────────\n'));
422
+ process.stdout.write(c.muted(L) + c.bold(`📍 ${w.city}${w.country ? ', ' + w.country : ''}`) + '\n');
423
+ process.stdout.write(c.muted(L) + '\n');
424
+ process.stdout.write(c.muted(L) + `${weatherIcon(w.code)} ${w.desc}` + '\n');
425
+ process.stdout.write(c.muted(L) + `🌡 ${c.bold(w.tempC + '°C')} ${c.dim('feels like ' + w.feelsC + '°C')}` + '\n');
426
+ process.stdout.write(c.muted(L) + c.dim(`💧 ${w.humidity}% 💨 ${w.windKmph} km/h`) + '\n');
441
427
 
442
428
  if (w.forecast && w.forecast.length) {
443
- process.stdout.write(c.muted(rule) + '\n');
444
- const days = w.forecast.map(f => pad(c.dim(dayLabel(f.date)), 12)).join(' ');
445
- const icons = w.forecast.map(f => pad(weatherIcon(f.code), 12)).join(' ');
446
- const temps = w.forecast.map(f => pad(c.dim(`${f.maxC}° / ${f.minC}°`), 12 + 9)).join(' ');
447
- line(days);
448
- line(icons);
449
- line(temps);
429
+ process.stdout.write(c.muted(hr));
430
+ for (const f of w.forecast) {
431
+ const day = dayLabel(f.date).padEnd(4);
432
+ const icon = weatherIcon(f.code);
433
+ const tmp = `${f.maxC}° / ${f.minC}°`;
434
+ process.stdout.write(c.muted(L) + c.dim(day) + ` ${icon} ` + c.dim(tmp) + '\n');
435
+ }
450
436
  }
451
437
 
452
- process.stdout.write(c.muted(bot) + '\n');
438
+ process.stdout.write(c.muted(' └─────────────────────────────────────\n'));
453
439
  }
454
440
 
455
441
  function renderToolDone(name, summary, preview, weatherData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prior-cli",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Prior Network AI — command-line interface",
5
5
  "bin": {
6
6
  "prior": "bin/prior.js"