dikt 1.3.0 → 1.4.0

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/cli.mjs +13 -4
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -49,7 +49,7 @@ function formatFileSize(bytes) {
49
49
 
50
50
  // ── Constants ─────────────────────────────────────────────────────────────────
51
51
 
52
- const VERSION = '1.3.0';
52
+ const VERSION = '1.4.0';
53
53
  const CONFIG_BASE = process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config');
54
54
  const CONFIG_DIR = path.join(CONFIG_BASE, 'dikt');
55
55
  const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
@@ -458,13 +458,22 @@ function renderKeybar() {
458
458
  return ` ${DIM}[SPACE]${RESET} Record ${copyKey}${autoCopyKey}${histKey}${retryKey}`.trimEnd();
459
459
  }
460
460
 
461
+ function formatDuration(seconds) {
462
+ if (seconds < 60) return `${seconds.toFixed(1)}s`;
463
+ const m = Math.floor(seconds / 60);
464
+ const s = (seconds % 60).toFixed(1).padStart(4, '0');
465
+ if (m < 60) return `${m}m ${s}s`;
466
+ const h = Math.floor(m / 60);
467
+ const rm = String(m % 60).padStart(2, '0');
468
+ return `${h}h ${rm}m ${s}s`;
469
+ }
470
+
461
471
  function renderStatus() {
462
472
  switch (state.mode) {
463
473
  case 'idle':
464
474
  return ` ${GREY}● Idle${RESET}`;
465
475
  case 'recording': {
466
- const secs = state.duration.toFixed(1);
467
- return ` ${RED}${BOLD}● Recording${RESET} ${RED}${secs}s${RESET}`;
476
+ return ` ${RED}${BOLD}● Recording${RESET} ${RED}${formatDuration(state.duration)}${RESET}`;
468
477
  }
469
478
  case 'transcribing': {
470
479
  const sp = SPINNER[state.spinnerFrame % SPINNER.length];
@@ -558,7 +567,7 @@ function renderMeta() {
558
567
  const cost = (state.duration / 60 * COST_PER_MIN).toFixed(4);
559
568
  const latencyStr = state.latency ? `${(state.latency / 1000).toFixed(1)}s` : '—';
560
569
  const histLabel = state.historyIndex >= 0 ? ` · history ${state.historyIndex + 1}/${state.history.length}` : '';
561
- return ` ${DIM}${state.wordCount} words · ${state.duration.toFixed(1)}s · latency ${latencyStr} · $${cost}${histLabel}${RESET}`;
570
+ return ` ${DIM}${state.wordCount} words · ${formatDuration(state.duration)} · latency ${latencyStr} · $${cost}${histLabel}${RESET}`;
562
571
  }
563
572
 
564
573
  function renderHelp() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dikt",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Voice dictation for the terminal.",
5
5
  "type": "module",
6
6
  "bin": {