@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.
- package/CHANGELOG.md +30 -1
- package/README.md +5 -2
- package/dist/claude-style.d.ts +4 -0
- package/dist/claude-style.d.ts.map +1 -1
- package/dist/claude-style.js +140 -10
- package/dist/claude-style.js.map +1 -1
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -1
- package/dist/fff.d.ts.map +1 -1
- package/dist/fff.js +6 -1
- package/dist/fff.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +9 -7
- package/dist/render.js.map +1 -1
- package/dist/user-rail.d.ts +15 -0
- package/dist/user-rail.d.ts.map +1 -0
- package/dist/user-rail.js +61 -0
- package/dist/user-rail.js.map +1 -0
- package/dist/working-indicator.d.ts +6 -0
- package/dist/working-indicator.d.ts.map +1 -1
- package/dist/working-indicator.js +11 -0
- package/dist/working-indicator.js.map +1 -1
- package/package.json +4 -4
- package/src/claude-style.ts +178 -9
- package/src/config.ts +13 -0
- package/src/fff.ts +7 -3
- package/src/index.ts +9 -1
- package/src/render.ts +9 -7
- package/src/user-rail.ts +80 -0
- package/src/working-indicator.ts +13 -0
package/src/working-indicator.ts
CHANGED
|
@@ -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
|
|