@heyhuynhgiabuu/pi-pretty 0.7.1 → 0.9.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.
@@ -64,6 +64,9 @@ export interface WorkingIndicatorSettings {
64
64
  hint: boolean;
65
65
  /** Tint mid/high tiers (and dim the spinner) with a per-session accent color. */
66
66
  sessionAccent: boolean;
67
+ /** Frame advance interval in ms. Default: WORKING_INTERVAL_MS (33). Higher = fewer
68
+ * full-tree renders per second while the agent works. */
69
+ intervalMs?: number;
67
70
  /** True when the user explicitly configured `mid`/`high` — accent then stays off. */
68
71
  tiersCustomized?: boolean;
69
72
  }
@@ -153,6 +156,9 @@ export function resolveWorkingIndicatorSettings(
153
156
  if (typeof config?.bold === "boolean") settings.bold = config.bold;
154
157
  if (typeof config?.hint === "boolean") settings.hint = config.hint;
155
158
  if (typeof config?.sessionAccent === "boolean") settings.sessionAccent = config.sessionAccent;
159
+ const envInterval = Number.parseInt(env.PRETTY_WORKING_INTERVAL_MS ?? "", 10);
160
+ if (Number.isFinite(envInterval) && envInterval >= 33) settings.intervalMs = envInterval;
161
+ else if (typeof config?.intervalMs === "number" && config.intervalMs >= 33) settings.intervalMs = config.intervalMs;
156
162
  settings.tiersCustomized = typeof config?.mid === "string" || typeof config?.high === "string";
157
163
  return settings;
158
164
  }
@@ -463,6 +469,9 @@ export class WorkingWidget {
463
469
 
464
470
  export interface ThinkingIndicatorSettings {
465
471
  enabled: boolean;
472
+ /** Label refresh interval in ms. Default: WORKING_INTERVAL_MS (33). Higher = fewer
473
+ * full-tree renders per second while thinking — the main FPS lever on long sessions. */
474
+ intervalMs?: number;
466
475
  }
467
476
 
468
477
  export const THINKING_INDICATOR_DEFAULTS: ThinkingIndicatorSettings = { enabled: true };
@@ -479,6 +488,9 @@ export function resolveThinkingIndicatorSettings(
479
488
  const envEnabled = envFlag(env.PRETTY_THINKING_INDICATOR);
480
489
  if (envEnabled !== undefined) settings.enabled = envEnabled;
481
490
  else if (typeof config?.enabled === "boolean") settings.enabled = config.enabled;
491
+ const envInterval = Number.parseInt(env.PRETTY_THINKING_INTERVAL_MS ?? "", 10);
492
+ if (Number.isFinite(envInterval) && envInterval >= 33) settings.intervalMs = envInterval;
493
+ else if (typeof config?.intervalMs === "number" && config.intervalMs >= 33) settings.intervalMs = config.intervalMs;
482
494
  return settings;
483
495
  }
484
496
 
@@ -839,6 +851,7 @@ export async function installWorkingIndicator(
839
851
  ansi,
840
852
  bold: settings.bold,
841
853
  spinnerColor,
854
+ intervalMs: settings.intervalMs,
842
855
  });
843
856
  if (frames.length === 0) return noopController;
844
857