repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

pi(ext): remove animations and tps extensions

c3727038c6c79df49e30476ff15b5e26ef0330ad

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (44)

pi/agent/extensions/animations/animations/blackhole.ts

Deleted
deleted file mode 100644
1 -import { rgb, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const blackHole: AnimationFn = (f, w, _phase, colors) => {
7 - const W = Math.min(w, 25);
8 - const center = Math.floor(W / 2);
9 - const accent = colors?.thinkingXhigh ?? [90, 0, 180];
10 - const error = colors?.thinkingHigh ?? [140, 50, 180];
11 - const dimC = colors?.dim ?? [10, 5, 15];
12 -
13 - const [accentR, accentG, accentB] = readableScale(...accent, 1.3);
14 - const [errorR, errorG, errorB] = readableScale(...error, 1.2);
15 - const [dimR, dimG, dimB] = readableScale(...dimC, 1.0);
16 -
17 - let line = "";
18 - for (let i = 0; i < W; i++) {
19 - const dist = Math.abs(i - center);
20 - const spiral = Math.sin(dist * 0.5 - f * 0.3) * 0.5 + 0.5;
21 - if (dist < 2) {
22 - const pulse = Math.sin(f * 0.2) * 0.3 + 0.7;
23 - const [pr, pg, pb] = readableScale(accentR, 0, accentB * 2, pulse);
24 - line += rgb(pr, pg, pb) + "○";
25 - } else if (dist < 4) {
26 - const phase = (f * 0.2 + dist * 0.3) % 1;
27 - if (phase > 0.3 && phase < 0.7) {
28 - const hue = (dist * 30 + f * 10) % 360;
29 - const [hr, hg, hb] = readableScale(
30 - accentR * 0.5 + Math.sin(hue * 0.1) * accentR * 0.5,
31 - accentG + Math.cos(hue * 0.1) * 50,
32 - Math.min(255, accentB + Math.sin(hue * 0.2) * 55),
33 - 1.1
34 - );
35 - line += rgb(Math.round(hr), Math.round(hg), Math.round(hb)) + "◎";
36 - } else {
37 - const [dr, dg, db] = readableScale(dimR * 3, dimG * 2, dimB * 3, 1.0);
38 - line += rgb(dr, dg, db) + "·";
39 - }
40 - } else {
41 - const pull = Math.max(0, 1 - dist / (W / 2));
42 - if (pull > 0.3 && spiral > 0.5) {
43 - const [ar, ag, ab] = readableScale(accentR, accentG, accentB, pull);
44 - line += rgb(ar, ag, ab) + "·";
45 - }
46 - else { line += rgb(dimR, dimG, dimB) + " "; }
47 - }
48 - }
49 - return line + reset;
50 -};
52 -export const def: AnimationDef = { name: "blackhole", fn: blackHole, category: "thinking", description: "◎ Black hole accretion", lines: 1 };

pi/agent/extensions/animations/animations/brainstorm.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const weatherPhases = [
7 - { icon: "\ue30d", label: "calm" },
8 - { icon: "\ue302", label: "thinking." },
9 - { icon: "\ue318", label: "thinking.." },
10 - { icon: "\ue31d", label: "EUREKA!" },
11 - { icon: "\ue30b", label: "insight!" },
12 - { icon: "\ue302", label: "processing" },
13 -];
15 -const brainstorm: AnimationFn = (f, _w, _phase, colors) => {
16 - const pd = 35, pos = f % (weatherPhases.length * pd), pi = Math.floor(pos / pd), p = weatherPhases[pi];
17 - const accent = colors?.thinkingHigh ?? [220, 180, 50];
18 - const warning = colors?.thinkingXhigh ?? [220, 220, 80];
19 - const mutedC = colors?.syntaxComment ?? [140, 140, 170];
20 -
21 - const phaseColors = [
22 - readableScale(...accent, 1.1),
23 - readableScale(...mutedC, 0.9),
24 - readableScale(...mutedC, 0.9),
25 - readableScale(...warning, 1.2),
26 - readableScale(...accent, 1.0),
27 - readableScale(...mutedC, 0.9),
28 - ];
29 - const pc = phaseColors[pi];
30 - const glow = Math.sin(f * 0.15) * 0.15;
31 - const [r, g, b] = readableScale(pc[0], pc[1], pc[2], 1 + glow);
32 -
33 - const dimC = colors?.dim ?? [80, 80, 70];
34 - const [dimR, dimG, dimB] = readableScale(...dimC, 0.5);
35 -
36 - let sparks = "";
37 - for (let i = 0; i < 15; i++) {
38 - if (Math.random() < 0.15) {
39 - const intensity = 0.3 + Math.random() * 0.5;
40 - const [sr, sg, sb] = readableScale(accent[0], accent[1], accent[2], intensity);
41 - sparks += rgb(sr, sg, sb) + (Math.random() < 0.3 ? "⚡" : "✦");
42 - } else sparks += " ";
43 - }
44 - return rgb(r, g, b) + bold + p.icon + " " + p.label + nobold + " " + sparks + reset;
45 -};
47 -export const def: AnimationDef = { name: "brainstorm", fn: brainstorm, category: "thinking", description: "Weather icon storm", lines: 1 };

pi/agent/extensions/animations/animations/commits.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const commitGraph: AnimationFn = (f, w, _phase, colors) => {
7 - const W = w;
8 - const error = colors?.syntaxKeyword ?? [220, 60, 80];
9 - const warning = colors?.syntaxString ?? [220, 160, 70];
10 - const success = colors?.syntaxType ?? [70, 220, 80];
11 - const accent = colors?.syntaxVariable ?? [70, 180, 220];
12 - const toolTitle = colors?.syntaxComment ?? [160, 70, 220];
13 -
14 - const colors_arr = [
15 - readableScale(...error, 1.2),
16 - readableScale(...warning, 1.2),
17 - readableScale(...success, 1.2),
18 - readableScale(...accent, 1.2),
19 - readableScale(...toolTitle, 1.2),
20 - ];
21 -
22 - const dimC = colors?.dim ?? [35, 35, 45];
23 - const [dimR, dimG, dimB] = readableScale(...dimC, 0.7);
24 -
25 - let line = "";
26 - for (let i = 0; i < W; i++) {
27 - const ci = Math.floor((f * 0.15 + i * 0.3) % colors_arr.length);
28 - const [r, g, b] = colors_arr[ci];
29 - const hasDot = (i + Math.floor(f * 0.5)) % 4 === 0;
30 - const hasBranch = i % 7 === 3;
31 - if (hasDot) { line += bold + rgb(r, g, b) + "●" + nobold; }
32 - else if (hasBranch) { line += rgb(r, g, b) + "│"; }
33 - else { line += rgb(dimR, dimG, dimB) + "─"; }
34 - }
35 - return line + reset;
36 -};
38 -export const def: AnimationDef = { name: "commits", fn: commitGraph, category: "both", description: "● Git commit graph", lines: 1 };

pi/agent/extensions/animations/animations/crush.ts

Deleted
deleted file mode 100644
1 -import { rgb, reset, ellipsis } from "../utils";
2 -import { PHASE_LABELS } from "../types";
3 -import type { AnimationFn, AnimationDef } from "../types";
4 -import type { ThemeColors } from "../theme-colors";
5 -import { readableScale } from "../theme-colors";
7 -const scrambleChars = "0123456789abcdefABCDEF~!@#$£€%^&*()+=_";
8 -const scrambleBirths = Array.from({ length: 15 }, () => Math.random() * 20);
9 -const scrambleRamp: number[][] = [];
10 -for (let i = 0; i < 24; i++) {
11 - const t = i / 24,
12 - a = t * Math.PI * 2;
13 - scrambleRamp.push([
14 - Math.round(Math.sin(a) * 127 + 128),
15 - Math.round(Math.sin(a + 2.094) * 80 + 80),
16 - Math.round(Math.sin(a + 4.189) * 127 + 128),
17 - ]);
18 -}
20 -const crushScramble: AnimationFn = (f, w, phase, colors) => {
21 - const label = PHASE_LABELS[phase || "thinking"];
22 - const labelPad = label.length + 4;
23 - const sw = Math.max(w - labelPad, 15);
24 - const init = f > 20;
25 - const labelColor = colors?.text ?? [200, 200, 200];
26 - let line = "";
27 - for (let i = 0; i < sw; i++) {
28 - const ci = (i + (init ? f : 0)) % scrambleRamp.length,
29 - [r, g, b] = scrambleRamp[ci];
30 - line +=
31 - rgb(r, g, b) +
32 - (!init && f < scrambleBirths[i % scrambleBirths.length]
33 - ? "."
34 - : scrambleChars[Math.floor(Math.random() * scrambleChars.length)]);
35 - }
36 - line += " " + rgb(labelColor[0], labelColor[1], labelColor[2]) + label;
37 - if (init) line += rgb(labelColor[0], labelColor[1], labelColor[2]) + ellipsis(f);
38 - return line + reset;
39 -};
41 -export const def: AnimationDef = { name: "crush", fn: crushScramble, category: "both", description: "Crush-style scrambler", lines: 1 };

pi/agent/extensions/animations/animations/cylon.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset, PI_GRAD, lerpGrad } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const cylonEye: AnimationFn = (f, w, _phase, colors) => {
7 - const W = w;
9 - const sweepFrames = 55;
10 - const fullCycle = sweepFrames * 2;
11 - const cf = f % fullCycle;
13 - function ease(t: number): number {
14 - return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
15 - }
17 - const t =
18 - cf < sweepFrames
19 - ? ease(cf / sweepFrames)
20 - : 1 - ease((cf - sweepFrames) / sweepFrames);
21 - const center = t * (W - 1);
23 - const goingRight = cf < sweepFrames;
25 - // Use theme accent color for the eye, or fall back to amber
26 - const accent = colors?.accent ?? [255, 140, 50];
27 - const eyePulse = Math.sin(f * 0.2) * 0.3 + 0.7;
28 - const eyeR = Math.round(accent[0] * eyePulse);
29 - const eyeG = Math.round(accent[1] * eyePulse);
30 - const eyeB = Math.round(accent[2] * eyePulse);
32 - // Trail colors derived from accent
33 - const tailSpread = 12;
34 - const leadSpread = 5;
36 - // Background color from theme dim
37 - const bgDim = colors?.dim ?? [18, 6, 6];
39 - let line = "";
40 - for (let x = 0; x < W; x++) {
41 - const dist = x - center;
43 - if (Math.abs(dist) < 0.5) {
44 - line += bold + rgb(eyeR, eyeG, eyeB) + "●" + nobold;
45 - } else {
46 - const rawDist = goingRight ? dist : -dist;
47 - const behindDist = Math.max(0, -rawDist);
48 - const aheadDist = Math.max(0, rawDist);
49 - const normDist = behindDist / tailSpread + aheadDist / leadSpread;
51 - const b = Math.max(0, 1 - normDist);
53 - if (b > 0.7) {
54 - const [tr, tg, tb] = readableScale(accent[0], accent[1], accent[2], b);
55 - line += bold + rgb(tr, tg, tb) + "─" + nobold;
56 - } else if (b > 0.4) {
57 - const [tr, tg, tb] = readableScale(accent[0], accent[1], accent[2], b * 0.7);
58 - line += rgb(tr, tg, tb) + "─";
59 - } else if (b > 0.1) {
60 - const [tr, tg, tb] = readableScale(accent[0], accent[1], accent[2], b * 0.4);
61 - line += rgb(tr, tg, tb) + "╌";
62 - } else {
63 - line += rgb(bgDim[0], bgDim[1], bgDim[2]) + "╌";
64 - }
65 - }
66 - }
67 - return line + reset;
68 -};
70 -export const def: AnimationDef = { name: "cylon", fn: cylonEye, category: "both", description: "● Cylon eye scanner", lines: 1 };

pi/agent/extensions/animations/animations/data-burst.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const dataBurst: AnimationFn = (f, w, _phase, colors) => {
7 - const W = w;
8 - // Theme-aware colors with readableScale
9 - const accent = colors?.syntaxVariable ?? [0, 200, 220];
10 - const error = colors?.syntaxKeyword ?? [200, 50, 220];
11 - const textC = colors?.syntaxType ?? [160, 160, 220];
12 - const success = colors?.thinkingXhigh ?? [50, 180, 220];
13 - const warning = colors?.syntaxString ?? [220, 60, 180];
14 -
15 - const glyphs = ["◉", "●", "○", "◎"];
16 -
17 - // Scale and prepare colors
18 - const colors_arr = [
19 - readableScale(...accent, 1.3),
20 - readableScale(...error, 1.3),
21 - readableScale(...textC, 1.2),
22 - readableScale(...success, 1.2),
23 - readableScale(...warning, 1.2),
24 - ];
25 -
26 - let line = "";
27 - for (let i = 0; i < W; i++) {
28 - const phase = (i / W + f * 0.05) % 1;
29 - const ci = Math.floor(phase * colors_arr.length) % colors_arr.length;
30 - const gi = Math.floor(phase * glyphs.length) % glyphs.length;
31 - const bright = Math.sin(phase * Math.PI * 2 + f * 0.1) * 0.3 + 0.7;
32 - const [r, g, b] = colors_arr[ci];
33 - if (phase > 0.3 && phase < 0.7) {
34 - line += bold + rgb(r, g, b) + glyphs[gi] + nobold;
35 - }
36 - else {
37 - const [dr, dg, db] = readableScale(r, g, b, bright * 0.35);
38 - line += rgb(dr, dg, db) + "·";
39 - }
40 - }
41 - return line + reset;
42 -};
44 -export const def: AnimationDef = { name: "data-burst", fn: dataBurst, category: "both", description: "◉ Streaming data packets", lines: 1 };

pi/agent/extensions/animations/animations/dev-constellation.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, dim, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const devNodes = [
7 - { ch: "\ue796" },
8 - { ch: "\ue718" },
9 - { ch: "\ue73c" },
10 - { ch: "\ue7a8" },
11 - { ch: "\uf13b" },
12 - { ch: "\ue61e" },
13 -];
15 -const devConstellation: AnimationFn = (f, _w, _phase, colors) => {
16 - const accent = colors?.thinkingLow ?? [50, 130, 220];
17 - const success = colors?.thinkingMedium ?? [70, 180, 100];
18 - const warning = colors?.thinkingHigh ?? [220, 180, 50];
19 - const error = colors?.thinkingXhigh ?? [180, 90, 220];
20 - const toolTitle = colors?.syntaxKeyword ?? [90, 180, 220];
21 - const textC = colors?.syntaxVariable ?? [220, 90, 90];
22 -
23 - // Scale colors for visibility
24 - const scaledColors = [
25 - readableScale(...accent, 1.2),
26 - readableScale(...success, 1.2),
27 - readableScale(...warning, 1.2),
28 - readableScale(...error, 1.2),
29 - readableScale(...toolTitle, 1.2),
30 - readableScale(...textC, 1.2),
31 - ];
33 - const gap = 5, totalW = devNodes.length * (gap + 1) - 1, pp = (f * 0.4) % totalW;
34 - const dimC = colors?.dim ?? [35, 35, 50];
35 - const borderC = colors?.borderMuted ?? [120, 120, 180];
36 -
37 - // Active line color - use accent, scaled up
38 - const [activeR, activeG, activeB] = readableScale(accent[0], accent[1], accent[2], 1.6);
40 - let line = "";
41 - for (let i = 0; i < devNodes.length; i++) {
42 - const np = i * (gap + 1), dist = Math.abs(pp - np);
43 - const c = scaledColors[i];
44 - line += (dist < 1.5 ? bold : dim) + rgb(c[0], c[1], c[2]) + devNodes[i].ch + nobold;
45 - if (i < devNodes.length - 1) {
46 - for (let g = 0; g < gap; g++) {
47 - const cp = np + 1 + g, cd = Math.abs(pp - cp);
48 - line += cd < 1
49 - ? bold + rgb(activeR, activeG, activeB) + "━"
50 - : cd < 2.5
51 - ? rgb(borderC[0], borderC[1], borderC[2]) + "─"
52 - : rgb(dimC[0], dimC[1], dimC[2]) + "·";
53 - }
54 - }
55 - }
56 - return line + reset;
57 -};
59 -export const def: AnimationDef = { name: "dev-constellation", fn: devConstellation, category: "thinking", description: "Dev icons with pulses", lines: 1 };

pi/agent/extensions/animations/animations/electric.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const electricCrackle: AnimationFn = (f, w, _phase, colors) => {
7 - const W = w;
8 - // Use accent (adapts to theme) instead of hardcoded purple
9 - const accent = colors?.thinkingXhigh ?? [120, 80, 255];
10 - const [accentR, accentG, accentB] = readableScale(accent[0], accent[1], accent[2], 1.2);
11 - const dimC = colors?.dim ?? [30, 30, 50];
12 -
13 - // Lightning bolt color - bright yellow/white using accent
14 - const [boltR, boltG, boltB] = readableScale(accentR, accentG, accentB, 1.5);
16 - const pos = (f * 0.4) % W;
17 - const buf: string[] = [];
19 - for (let i = 0; i < W; i++) {
20 - const dist = Math.abs(i - pos);
21 - if (dist < 1) {
22 - // Lightning bolt - bright accent
23 - buf.push(bold + rgb(boltR, boltG, boltB) + "⚡" + nobold);
24 - } else if (dist < 2) {
25 - const pulse = Math.sin(f * 0.5 + i * 0.3) > 0;
26 - buf.push(pulse ? rgb(accentR, accentG, accentB) + "·" : " ");
27 - } else if (dist < 4 && Math.random() < 0.15) {
28 - buf.push(rgb(accentR, accentG, accentB) + "·");
29 - } else {
30 - buf.push(rgb(dimC[0], dimC[1], dimC[2]) + " ");
31 - }
32 - }
33 - return buf.join("") + reset;
34 -};
36 -export const def: AnimationDef = { name: "electric", fn: electricCrackle, category: "both", description: "⚡ Lightning crackle", lines: 1 };

pi/agent/extensions/animations/animations/fire.ts

Deleted
deleted file mode 100644
1 -import { rgb, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const fireChars = " .:-=+*#%@█";
7 -let fireBuf: Float64Array[] = [];
8 -let fireLastW = 0;
10 -const fire: AnimationFn = (f, w, _phase, colors) => {
11 - const W = w;
12 - if (W !== fireLastW) {
13 - fireBuf = Array.from({ length: 4 }, () => new Float64Array(W));
14 - fireLastW = W;
15 - }
16 - // Palette: black → dark red → orange → yellow → white, derived from theme warning/error
17 - const error = colors?.syntaxString ?? [220, 0, 0];
18 - const warning = colors?.mdHeading ?? [220, 180, 50];
19 -
20 - const firePalette = [
21 - [0, 0, 0],
22 - readableScale(...error, 0.25),
23 - readableScale(...error, 0.5),
24 - readableScale(...error, 0.8),
25 - readableScale(...warning, 0.8),
26 - readableScale(...warning, 1.0),
27 - readableScale(...warning, 1.2),
28 - ];
29 -
30 - for (let x = 0; x < W; x++) {
31 - fireBuf[3][x] = Math.random() > 0.35 ? 1 : Math.random() * 0.5;
32 - }
33 - for (let y = 0; y < 3; y++) {
34 - for (let x = 0; x < W; x++) {
35 - fireBuf[y][x] = (fireBuf[y + 1][(x - 1 + W) % W] + fireBuf[y + 1][x] + fireBuf[y + 1][(x + 1) % W]) / 3.1;
36 - }
37 - }
38 - let line = "";
39 - for (let x = 0; x < W; x++) {
40 - const v = Math.min(1, Math.max(0, fireBuf[0][x]));
41 - const pi = Math.floor(v * (firePalette.length - 1));
42 - const ci = Math.floor(v * (fireChars.length - 1));
43 - const [r, g, b] = firePalette[pi];
44 - line += rgb(r, g, b) + fireChars[ci];
45 - }
46 - return line + reset;
47 -};
49 -export const def: AnimationDef = { name: "fire", fn: fire, category: "working", description: "Demoscene fire", lines: 1 };

pi/agent/extensions/animations/animations/glitch-text.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import { PHASE_LABELS } from "../types";
3 -import type { AnimationFn, AnimationDef } from "../types";
4 -import type { ThemeColors } from "../theme-colors";
5 -import { readableScale } from "../theme-colors";
7 -const glitchText: AnimationFn = (f, _w, phase, colors) => {
8 - const text = PHASE_LABELS[phase || "thinking"];
9 - const glyphs = "█▓▒░╳╱╲¥£€$#@!?&%~*";
10 - const accent = colors?.accent ?? [0, 200, 180];
11 - const error = colors?.error ?? [220, 50, 100];
12 - const textC = colors?.text ?? [80, 180, 220];
13 - const warning = colors?.warning ?? [220, 200, 80];
14 -
15 - // Scale colors for visibility on light backgrounds
16 - const [accentR, accentG, accentB] = readableScale(accent[0], accent[1], accent[2], 1.3);
17 - const [errorR, errorG, errorB] = readableScale(error[0], error[1], error[2], 1.3);
18 - const [textR, textG, textB] = readableScale(textC[0], textC[1], textC[2], 1.0);
19 - const [warningR, warningG, warningB] = readableScale(warning[0], warning[1], warning[2], 1.2);
21 - const colors_arr = [
22 - rgb(accentR, accentG, accentB),
23 - rgb(errorR, errorG, errorB),
24 - rgb(textR, textG, textB),
25 - rgb(warningR, warningG, warningB),
26 - ];
27 -
28 - // Main text color - use accent for visibility
29 - const mainColor = rgb(accentR, accentG, accentB);
30 -
31 - let line = "";
32 - for (let i = 0; i < text.length; i++) {
33 - if (Math.random() < 0.12) {
34 - line += colors_arr[Math.floor(Math.random() * colors_arr.length)] +
35 - glyphs[Math.floor(Math.random() * glyphs.length)];
36 - } else if (Math.random() < 0.06) {
37 - line += colors_arr[Math.floor(Math.random() * colors_arr.length)] +
38 - (text[Math.min(Math.max(i + (Math.random() < 0.5 ? -1 : 1), 0), text.length - 1)] || " ");
39 - } else line += bold + mainColor + text[i] + nobold;
40 - }
41 - const jitter = Math.random() < 0.1 ? " ".repeat(Math.floor(Math.random() * 3)) : "";
42 - return jitter + line + reset;
43 -};
45 -export const def: AnimationDef = { name: "glitch-text", fn: glitchText, category: "both", description: "Cyberpunk glitch effect", lines: 1 };

pi/agent/extensions/animations/animations/heartbeat.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const heartbeat: AnimationFn = (f, w, _phase, colors) => {
7 - const W = Math.min(w, 25);
8 - const heart = "♥";
9 - const beats = [0, 0, 0, 1, 2, 3, 2, 1];
10 - const bi = Math.floor(f * 0.5) % beats.length;
11 - const intensity = beats[bi];
12 - const padding = Math.floor((W - 5) / 2);
13 - const spaces = " ".repeat(padding);
14 - const pulse = intensity > 0 ? bold : "";
15 -
16 - const error = colors?.thinkingXhigh ?? [220, 50, 140];
17 - const [r, g, b] = readableScale(
18 - error[0],
19 - error[1] + intensity * 25,
20 - error[2] - intensity * 15,
21 - 1.1
22 - );
23 -
24 - return spaces + pulse + rgb(r, g, b) + heart + " " + heart + " " + heart + nobold + spaces + reset;
25 -};
27 -export const def: AnimationDef = { name: "heartbeat", fn: heartbeat, category: "both", description: "♥ Classic heartbeat pulse", lines: 1 };

pi/agent/extensions/animations/animations/hexdump.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const memoryHex: AnimationFn = (f, w, _phase, colors) => {
7 - const W = w;
8 - const hexChars = "0123456789ABCDEF";
9 - const success = colors?.syntaxComment ?? [50, 220, 100];
10 - const accent = colors?.syntaxKeyword ?? [0, 180, 140];
11 - const toolTitle = colors?.syntaxType ?? [90, 220, 140];
12 -
13 - const colors_arr = [
14 - readableScale(...success, 1.1),
15 - readableScale(...accent, 1.1),
16 - readableScale(...toolTitle, 1.1),
17 - ];
18 -
19 - const seed = Math.floor(f * 0.1);
20 - let line = "";
21 - for (let i = 0; i < W; i += 4) {
22 - const offset = (seed + i) % 256;
23 - const byte1 = hexChars[(offset >> 4) & 0xf];
24 - const byte2 = hexChars[offset & 0xf];
25 - const ci = Math.floor((f * 0.1 + i * 0.1) % colors_arr.length);
26 - const [r, g, b] = colors_arr[ci];
27 - const isHighlight = (i + Math.floor(f)) % 12 === 0;
28 - if (isHighlight) {
29 - const [br, bg, bb] = readableScale(r, g, b, 1.2);
30 - line += bold + rgb(br, bg, bb) + byte1 + byte2 + nobold;
31 - }
32 - else {
33 - const [dr, dg, db] = readableScale(r, g, b, 0.5);
34 - line += rgb(dr, dg, db) + byte1 + byte2;
35 - }
36 - if (i + 2 < W) line += " ";
37 - }
38 - return line + reset;
39 -};
41 -export const def: AnimationDef = { name: "hexdump", fn: memoryHex, category: "working", description: "CAFE Hex memory dump", lines: 1 };

pi/agent/extensions/animations/animations/horn.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const hornBeam: AnimationFn = (f, w, _phase, colors) => {
7 - const W = Math.min(w, 30);
8 - const center = Math.floor(W / 2);
9 -
10 - // Theme-aware colors
11 - const textC = colors?.text ?? [200, 200, 220];
12 - const [textR, textG, textB] = readableScale(textC[0], textC[1], textC[2], 1.2);
13 -
14 - const accent = colors?.thinkingHigh ?? [220, 180, 80];
15 - const success = colors?.thinkingXhigh ?? [80, 180, 220];
16 - const warning = colors?.mdHeading ?? [220, 80, 180];
17 -
18 - // Rainbow using theme colors
19 - const rainbow = [
20 - readableScale(...accent, 1.2),
21 - readableScale(...warning, 1.2),
22 - readableScale(...success, 1.2),
23 - readableScale(...accent, 1.0),
24 - readableScale(...success, 1.0),
25 - ];
26 -
27 - const dimC = colors?.dim ?? [30, 20, 40];
28 - const [dimR, dimG, dimB] = readableScale(dimC[0], dimC[1], dimC[2], 1.0);
29 -
30 - let line = "";
31 - for (let i = 0; i < W; i++) {
32 - const dist = Math.abs(i - center);
33 - const beam = Math.sin(f * 0.2) * 0.3 + 0.7;
34 - if (dist < 1) {
35 - line += bold + rgb(textR, textG, textB) + "│" + nobold;
36 - }
37 - else if (dist < 3) {
38 - const ci = Math.floor((dist * 2 + f * 0.5) % rainbow.length);
39 - const [r, g, b] = rainbow[ci];
40 - line += rgb(Math.round(r * beam), Math.round(g * beam), Math.round(b * beam)) + "│";
41 - } else if (dist < 5 && Math.random() < 0.2) {
42 - const ci = Math.floor((f * 0.3 + dist) % rainbow.length);
43 - const [r, g, b] = rainbow[ci];
44 - line += rgb(r, g, b) + "✦";
45 - } else {
46 - line += rgb(dimR, dimG, dimB) + " ";
47 - }
48 - }
49 - return line + reset;
50 -};
52 -export const def: AnimationDef = { name: "horn", fn: hornBeam, category: "thinking", description: "│ Unicorn horn beam", lines: 1 };

pi/agent/extensions/animations/animations/icon-morph.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const morphIcons = [
7 - { ch: "\uf0eb" },
8 - { ch: "\uf013" },
9 - { ch: "\uf0e7" },
10 - { ch: "\uf135" },
11 - { ch: "\uf005" },
12 - { ch: "\uf06d" },
13 - { ch: "\uf0ac" },
14 - { ch: "\uf004" },
15 -];
16 -const trans = "░▒▓█▓▒░";
18 -const iconMorphing: AnimationFn = (f, _w, _phase, colors) => {
19 - const accent = colors?.thinkingMedium ?? [220, 200, 50];
20 - const warning = colors?.mdHeading ?? [220, 140, 50];
21 - const error = colors?.syntaxString ?? [220, 90, 90];
22 - const success = colors?.thinkingHigh ?? [90, 220, 180];
23 - const toolTitle = colors?.syntaxKeyword ?? [90, 180, 220];
24 -
25 - const iconColors = [
26 - readableScale(...accent, 1.1),
27 - readableScale(...toolTitle, 1.1),
28 - readableScale(...warning, 1.1),
29 - readableScale(...error, 1.1),
30 - readableScale(...accent, 1.1),
31 - readableScale(...warning, 1.1),
32 - readableScale(...toolTitle, 1.1),
33 - readableScale(...error, 1.1),
34 - ];
36 - const cd = 25, pos = f % (morphIcons.length * cd);
37 - const ci = Math.floor(pos / cd), ni = (ci + 1) % morphIcons.length, p = (pos % cd) / cd;
38 - const cur = iconColors[ci], nxt = iconColors[ni];
39 - const [r, g, b] = readableScale(
40 - Math.round(cur[0] + (nxt[0] - cur[0]) * p),
41 - Math.round(cur[1] + (nxt[1] - cur[1]) * p),
42 - Math.round(cur[2] + (nxt[2] - cur[2]) * p),
43 - 1.1
44 - );
45 - const display = p < 0.3 ? morphIcons[ci].ch : p < 0.7 ? trans[Math.min(Math.floor((p - 0.3) / 0.4 * trans.length), trans.length - 1)] : morphIcons[ni].ch;
47 - const dimC = colors?.dim ?? [80, 80, 70];
48 - let trail = "";
49 - for (let i = 0; i < 20; i++) {
50 - const sp = Math.random() < 0.25 ? (Math.random() < 0.5 ? "✦" : "·") : " ";
51 - const [dr, dg, db] = readableScale(...dimC, 0.4 + Math.random() * 0.4);
52 - trail += rgb(dr, dg, db) + sp;
53 - }
54 - return rgb(r, g, b) + display + " " + trail + reset;
55 -};
57 -export const def: AnimationDef = { name: "icon-morph", fn: iconMorphing, category: "both", description: "Morphing nerd font icons", lines: 1 };

pi/agent/extensions/animations/animations/kitt.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -// Knight Rider KITT scanner
7 -// Red bouncing bar with trailing glow — keeps original timing/easing
9 -const kittScanner: AnimationFn = (f, w, _phase, colors) => {
10 - const W = w;
12 - // Red from theme error color
13 - const red = colors?.error ?? [200, 50, 50];
15 - // Dim background from theme
16 - const bgDim = colors?.dim ?? [18, 6, 6];
18 - // ── Timing (DO NOT CHANGE) ──
19 - const sweepFrames = 65;
20 - const dwellFrames = 30;
21 - const fullCycle = sweepFrames * 2 + dwellFrames;
22 - const cf = f % fullCycle;
24 - function bounceEase(t: number): number {
25 - if (t < 0.5) {
26 - return 2 * t * t * t * t;
27 - }
28 - return 1 - Math.pow(-2 * t + 2, 4) / 2;
29 - }
31 - let t: number;
32 - let isDwelling = false;
34 - if (cf < sweepFrames) {
35 - t = bounceEase(cf / sweepFrames);
36 - } else if (cf < sweepFrames * 2) {
37 - t = 1 - bounceEase((cf - sweepFrames) / sweepFrames);
38 - } else {
39 - isDwelling = true;
40 - t = cf < sweepFrames + dwellFrames / 2 ? 1 : 0;
41 - }
43 - const center = t * (W - 1);
44 - const dwellPulse = isDwelling ? Math.sin(f * 0.15) * 0.15 + 0.85 : 1.0;
46 - // ── Render ──
47 - const tailSpread = 14;
48 - const leadSpread = 4;
50 - let line = "";
51 - for (let x = 0; x < W; x++) {
52 - const dist = Math.abs(x - center);
54 - // Gaussian-like falloff
55 - const brightness = Math.max(0, Math.exp(-(dist * dist) / (2 * 3.5))) * dwellPulse;
57 - if (brightness < 0.05) {
58 - line += rgb(bgDim[0], bgDim[1], bgDim[2]) + "╌";
59 - } else if (brightness > 0.7) {
60 - const pulse = Math.sin(f * 0.1) * 0.1 + 0.9;
61 - const [cr, cg, cb] = readableScale(red[0], red[1], red[2], brightness * pulse);
62 - line += bold + rgb(cr, cg, cb) + "━" + nobold;
63 - } else {
64 - const [cr, cg, cb] = readableScale(red[0], red[1], red[2], brightness * 0.8);
65 - line += rgb(cr, cg, cb) + "─";
66 - }
67 - }
68 - return line + reset;
69 -};
71 -export const def: AnimationDef = { name: "kitt", fn: kittScanner, category: "both", description: "━ Knight Rider scanner", lines: 1 };

pi/agent/extensions/animations/animations/laser-grid.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const laserGrid: AnimationFn = (f, w, _phase, colors) => {
7 - const W = w;
8 - const lines = 5;
9 - const rows = 3;
10 - const perspective = Math.sin(f * 0.1) * 0.2 + 0.8;
11 - const accent = colors?.thinkingHigh ?? [220, 0, 180];
12 - const error = colors?.thinkingXhigh ?? [220, 0, 220];
13 - const dimC = colors?.dim ?? [15, 5, 20];
14 - const borderC = colors?.borderMuted ?? [50, 20, 70];
15 -
16 - const [accentR, accentG, accentB] = readableScale(...accent, 1.3);
17 - const [errorR, errorG, errorB] = readableScale(...error, 1.2);
18 - const [borderR, borderG, borderB] = readableScale(...borderC, 0.8);
19 - const [dimR, dimG, dimB] = readableScale(...dimC, 1.0);
20 -
21 - let line = "";
22 - for (let i = 0; i < W; i++) {
23 - const row = Math.floor((i / W) * rows);
24 - const pulse = (f * 0.2 + i * 0.1 + row) % 1;
25 - const glow = pulse > 0.4 && pulse < 0.6;
26 - const y = row / rows;
27 - const inGrid = i % Math.ceil(W / lines) < 1;
28 - if (inGrid && glow) { line += bold + rgb(accentR, accentG, accentB) + "║" + nobold; }
29 - else if (inGrid) { line += rgb(borderR, borderG, borderB) + "│"; }
30 - else if (Math.abs(pulse - 0.5) < 0.1) { line += rgb(errorR, errorG, errorB) + "·"; }
31 - else { line += rgb(dimR, dimG, dimB) + " "; }
32 - }
33 - return line + reset;
34 -};
36 -export const def: AnimationDef = { name: "laser-grid", fn: laserGrid, category: "working", description: "║ Laser grid perspective", lines: 1 };

pi/agent/extensions/animations/animations/magic.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const magicGlow: AnimationFn = (f, w, _phase, colors) => {
7 - const W = Math.min(w, 28);
8 - const glyphs = ["◈", "◇", "◈", "◆"];
9 - const pulse = Math.sin(f * 0.15) * 0.5 + 0.5;
10 - const glowSize = Math.floor(pulse * 3);
11 - const accent = colors?.thinkingHigh ?? [220, 90, 180];
12 - const borderAccent = colors?.thinkingXhigh ?? [180, 90, 220];
13 - const toolTitle = colors?.syntaxType ?? [90, 180, 220];
14 - const warning = colors?.mdHeading ?? [220, 180, 90];
15 -
16 - const colors_arr = [
17 - readableScale(...accent, 1.2),
18 - readableScale(...borderAccent, 1.2),
19 - readableScale(...toolTitle, 1.2),
20 - readableScale(...warning, 1.2),
21 - ];
22 -
23 - const dimC = colors?.dim ?? [20, 10, 30];
24 - const [dimR, dimG, dimB] = readableScale(...dimC, 0.8);
25 -
26 - let line = "";
27 - for (let i = 0; i < W; i++) {
28 - const dist = Math.abs(i - W / 2);
29 - const starPhase = (f * 0.3 + i * 0.2) % 4;
30 - const ci = Math.floor((f * 0.1 + i * 0.3) % colors_arr.length);
31 - const [r, g, b] = colors_arr[ci];
32 - if (dist < 2 + glowSize) {
33 - const bright = 1 - (dist / (W / 2)) * 0.5;
34 - const [br, bg, bb] = readableScale(r, g, b, bright);
35 - line += bold + rgb(br, bg, bb) + glyphs[Math.floor(starPhase)] + nobold;
36 - } else if (dist < 5 + glowSize) {
37 - const fade = 1 - (dist - 2 - glowSize) / 4;
38 - const [fr, fg, fb] = readableScale(r, g, b, fade * 0.5);
39 - line += rgb(fr, fg, fb) + "✧";
40 - } else { line += rgb(dimR, dimG, dimB) + "·"; }
41 - }
42 - return line + reset;
43 -};
45 -export const def: AnimationDef = { name: "magic", fn: magicGlow, category: "thinking", description: "◈ Magic unicorn glow", lines: 1 };

pi/agent/extensions/animations/animations/matrix.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -let matrixDrops: { x: number; phase: number; speed: number }[] = [];
7 -let matrixLastW = 0;
8 -const matrixChars = "ハミヒーウシナモニサワツオリ012789Z";
10 -const matrixRain: AnimationFn = (f, w, _phase, colors) => {
11 - const W = w;
12 - if (W !== matrixLastW) {
13 - const count = Math.max(15, Math.floor(W * 0.4));
14 - matrixDrops = Array.from({ length: count }, () => ({
15 - x: Math.floor(Math.random() * W),
16 - phase: Math.random() * 100,
17 - speed: 0.3 + Math.random() * 0.5,
18 - }));
19 - matrixLastW = W;
20 - }
21 - const success = colors?.syntaxComment ?? [0, 255, 0];
22 - const dimC = colors?.dim ?? [60, 60, 60];
23 - const [br, bg_c, bb] = readableScale(success[0], success[1], success[2], 1.0);
24 - const bright = rgb(br, bg_c, bb);
25 - const [mr, mg, mb] = readableScale(success[0], success[1], success[2], 0.6);
26 - const mid = rgb(mr, mg, mb);
27 - const [dr, dg, db] = readableScale(success[0], success[1], success[2], 0.35);
28 - const dark = rgb(dr, dg, db);
30 - const buf = new Array(W).fill(" ");
31 - for (const d of matrixDrops) {
32 - const pos = Math.floor((f * d.speed + d.phase) % (W + 5));
33 - if (pos < W) {
34 - buf[pos] = bright + bold + matrixChars[Math.floor(Math.random() * matrixChars.length)] + nobold;
35 - }
36 - if (pos - 1 >= 0 && pos - 1 < W && buf[pos - 1] === " ") {
37 - buf[pos - 1] = mid + matrixChars[Math.floor(Math.random() * matrixChars.length)];
38 - }
39 - if (pos - 2 >= 0 && pos - 2 < W && buf[pos - 2] === " ") {
40 - buf[pos - 2] = dark + matrixChars[Math.floor(Math.random() * matrixChars.length)];
41 - }
42 - }
43 - return buf.join("") + reset;
44 -};
46 -export const def: AnimationDef = { name: "matrix", fn: matrixRain, category: "both", description: "Matrix rain", lines: 1 };

pi/agent/extensions/animations/animations/neon-bounce.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset, PI_GRAD, lerpGrad } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -let bounceTrail: { pos: number; age: number; color: number[] }[] = [];
7 -let bounceLastW = 0;
8 -const trailGlyphs = ["█", "▓", "▒", "░", "·"];
10 -const neonBounce: AnimationFn = (f, w, _phase, colors) => {
11 - const W = w;
12 - const accent = colors?.accent ?? [200, 150, 255];
13 - if (W !== bounceLastW) { bounceTrail = []; bounceLastW = W; }
14 - const cycle = (f * 0.6) % (W * 2), pos = Math.floor(cycle < W ? cycle : W * 2 - cycle);
15 - const [r, g, b] = lerpGrad(PI_GRAD, pos / W);
16 -
17 - // Scale the color for visibility
18 - const [sr, sg, sb] = readableScale(r, g, b, 1.0);
19 - bounceTrail.push({ pos, age: 0, color: [sr, sg, sb] });
20 -
21 - const buf: string[] = [];
22 - for (let i = 0; i < W; i++) buf.push(" ");
23 -
24 - for (const t of bounceTrail) {
25 - if (t.age < trailGlyphs.length && t.pos < W) {
26 - const fade = Math.max(0, 1 - t.age / 5);
27 - const [fr, fg, fb] = readableScale(t.color[0], t.color[1], t.color[2], fade);
28 - buf[t.pos] = rgb(Math.round(fr), Math.round(fg), Math.round(fb)) + trailGlyphs[Math.min(t.age, trailGlyphs.length - 1)];
29 - }
30 - t.age++;
31 - }
32 - if (pos < W) {
33 - const [br, bg, bb] = readableScale(sr, sg, sb, 1.3);
34 - buf[pos] = bold + rgb(br, bg, bb) + "█" + nobold;
35 - }
36 - while (bounceTrail.length > 0 && bounceTrail[0].age > 5) bounceTrail.shift();
37 -
38 - const dimC = colors?.dim ?? [60, 60, 80];
39 - const [dr, dg, db] = readableScale(...dimC, 0.8);
40 - return rgb(dr, dg, db) + "▐" + buf.join("") + rgb(dr, dg, db) + "▌" + reset;
41 -};
43 -export const def: AnimationDef = { name: "neon-bounce", fn: neonBounce, category: "working", description: "Neon ball bouncing", lines: 1 };

pi/agent/extensions/animations/animations/neural-pulse.ts

Deleted
deleted file mode 100644
1 -import { rgb, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const neuralPulse: AnimationFn = (f, w, _phase, colors) => {
7 - const N = Math.floor(w / 3);
8 - const accent = colors?.thinkingMedium ?? [160, 120, 220];
9 - const dimC = colors?.dim ?? [50, 50, 70];
11 - // Pulse colors: accent fades through intensity levels
12 - const intensityLevels = [0.3, 0.5, 0.7, 0.85, 1.0, 0.85, 0.7];
13 - const pulse: string[] = intensityLevels.map(level => {
14 - const [r, g, b] = readableScale(...accent, level);
15 - return rgb(r, g, b);
16 - });
17 -
18 - const [dr, dg, db] = readableScale(...dimC, 0.6);
20 - let line = "";
21 - for (let i = 0; i < N; i++) {
22 - const dist = ((i - f * 0.5) % N + N) % N;
23 - const pi = dist < pulse.length ? Math.floor(dist) : -1;
24 - line += (pi >= 0 ? pulse[pi] : rgb(dr, dg, db)) + (pi >= 0 ? "●" : "○");
25 - if (i < N - 1) {
26 - const cd = ((i + 0.5 - f * 0.5) % N + N) % N;
27 - line += (cd < pulse.length
28 - ? pulse[Math.min(Math.floor(cd), pulse.length - 1)]
29 - : rgb(dr, dg, db)) + "──";
30 - }
31 - }
32 - return line + reset;
33 -};
35 -export const def: AnimationDef = { name: "neural-pulse", fn: neuralPulse, category: "thinking", description: "Energy pulses along neural pathway", lines: 1 };

pi/agent/extensions/animations/animations/orbit-dots.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset, PI_GRAD, lerpGrad, ellipsis } from "../utils";
2 -import { PHASE_LABELS } from "../types";
3 -import type { AnimationFn, AnimationDef } from "../types";
4 -import type { ThemeColors } from "../theme-colors";
5 -import { readableScale } from "../theme-colors";
7 -const dotChars = ["·", "∘", "○", "●", "◉", "●", "○", "∘"];
9 -const orbitDots: AnimationFn = (f, w, phase, colors) => {
10 - const count = 7;
11 - const spacing = Math.max(3, Math.floor((w - 20) / count));
12 - const labelC = colors?.text ?? [160, 160, 180];
13 - const [lr, lg, lb] = readableScale(...labelC, 0.9);
14 -
15 - let line = "";
16 - for (let i = 0; i < count; i++) {
17 - const dp = Math.sin(f * 0.12 - i * 0.8), norm = (dp + 1) / 2;
18 - const ci = Math.floor(norm * (dotChars.length - 1));
19 - const [r, g, b] = lerpGrad(PI_GRAD, ((i + f * 0.1) % PI_GRAD.length) / PI_GRAD.length);
20 - // Apply readableScale to ensure visibility
21 - const [sr, sg, sb] = readableScale(r, g, b, 1.0);
22 - const br = 0.4 + norm * 0.6;
23 - const [fr, fg, fb] = readableScale(sr, sg, sb, br);
24 - line += (norm > 0.7 ? bold : "") + rgb(fr, fg, fb) + dotChars[ci] + nobold + " ".repeat(spacing);
25 - }
26 - const [labelR, labelG, labelB] = lerpGrad(PI_GRAD, (f * 0.08 % PI_GRAD.length) / PI_GRAD.length);
27 - const [lr2, lg2, lb2] = readableScale(labelR, labelG, labelB, 1.0);
28 - const label = PHASE_LABELS[phase || "thinking"];
29 - line += rgb(lr2, lg2, lb2) + label + rgb(lr, lg, lb) + ellipsis(f);
30 - return line + reset;
31 -};
33 -export const def: AnimationDef = { name: "orbit-dots", fn: orbitDots, category: "thinking", description: "Pulsing orbit dots", lines: 1 };

pi/agent/extensions/animations/animations/packets.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const packetStorm: AnimationFn = (f, w, _phase, colors) => {
7 - const W = w;
8 - const glyphs = ["◉", "●", "○", "◎", "•"];
9 - const accent = colors?.syntaxVariable ?? [0, 220, 220];
10 - const error = colors?.syntaxKeyword ?? [220, 0, 220];
11 - const success = colors?.syntaxType ?? [0, 220, 180];
12 - const warning = colors?.syntaxString ?? [220, 90, 180];
13 - const colors_arr = [
14 - readableScale(...accent, 1.3),
15 - readableScale(...error, 1.3),
16 - readableScale(...success, 1.3),
17 - readableScale(...warning, 1.3),
18 - ];
19 - const dimC = colors?.dim ?? [20, 20, 30];
20 - const [dr, dg, db] = readableScale(...dimC, 0.8);
21 -
22 - let line = "";
23 - for (let i = 0; i < W; i++) {
24 - const speed = 0.3 + (i % 3) * 0.2;
25 - const pos = (f * speed + i * 0.5) % W;
26 - const dist = Math.abs(i - pos);
27 - const ci = Math.floor((f * 0.1 + i * 0.2) % 4);
28 - const [r, g, b] = colors_arr[ci];
29 - if (dist < 1) {
30 - const [br, bg, bb] = readableScale(r, g, b, 1.2);
31 - line += bold + rgb(br, bg, bb) + glyphs[ci % glyphs.length] + nobold;
32 - }
33 - else if (dist < 2 && Math.random() < 0.3) {
34 - const [mr, mg, mb] = readableScale(r, g, b, 0.5);
35 - line += rgb(mr, mg, mb) + "·";
36 - }
37 - else { line += rgb(dr, dg, db) + "-"; }
38 - }
39 - return line + reset;
40 -};
42 -export const def: AnimationDef = { name: "packets", fn: packetStorm, category: "both", description: "◉ Packet data storm", lines: 1 };

pi/agent/extensions/animations/animations/pacman.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const pacmanChase: AnimationFn = (f, w, _phase, colors) => {
7 - const W = w;
8 -
9 - // Theme-aware colors
10 - const warning = colors?.warning ?? [255, 180, 50];
11 - const [warningR, warningG, warningB] = readableScale(warning[0], warning[1], warning[2], 1.1);
12 -
13 - const error = colors?.error ?? [220, 70, 70];
14 - const [errorR, errorG, errorB] = readableScale(error[0], error[1], error[2], 1.1);
15 -
16 - const mutedC = colors?.muted ?? [180, 140, 80];
17 - const [mutedR, mutedG, mutedB] = readableScale(mutedC[0], mutedC[1], mutedC[2], 0.8);
18 -
19 - const dimC = colors?.dim ?? [50, 50, 50];
20 -
21 - // Power pellet - use accent for visibility
22 - const accent = colors?.accent ?? warning;
23 - const [accentR, accentG, accentB] = readableScale(accent[0], accent[1], accent[2], 1.3);
24 -
25 - const pac = [
26 - rgb(warningR, warningG, warningB) + "ᗧ",
27 - rgb(warningR, warningG, warningB) + "●"
28 - ];
29 - const ghost = rgb(errorR, errorG, errorB) + "ᗣ";
30 - const dot = rgb(mutedR, mutedG, mutedB) + "·";
31 - const power = bold + rgb(accentR, accentG, accentB) + "●" + nobold;
32 -
33 - const pp = f % (W + 8), gp = (f - 4 + W + 8) % (W + 8);
34 - let line = "";
35 - for (let i = 0; i < W; i++) {
36 - if (i === pp % W && pp < W) line += pac[f % 4 < 2 ? 0 : 1];
37 - else if (i === gp % W && gp < W) line += ghost;
38 - else if (i > pp || pp >= W) line += i % 8 === 0 ? power : dot;
39 - else line += " ";
40 - }
41 - return line + reset;
42 -};
44 -export const def: AnimationDef = { name: "pacman", fn: pacmanChase, category: "working", description: "Pac-Man eating dots", lines: 1 };

pi/agent/extensions/animations/animations/phosphor.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const phosphorEcho: AnimationFn = (f, w, _phase, colors) => {
7 - const W = Math.min(w, 25);
8 - const trail = ["✦", "✧", "·", "·", " ", " ", " ", " "];
9 - const accent = colors?.syntaxComment ?? [50, 180, 50];
10 - const [ar, ag, ab] = readableScale(...accent, 1.2);
11 -
12 - let line = "";
13 - for (let i = 0; i < W; i++) {
14 - const dist = (i + f * 0.8) % W;
15 - const ti = Math.floor(dist) % trail.length;
16 - const bright = Math.max(0, 1 - dist / W);
17 - const [r, g, b] = readableScale(ar * 0.3, ag, ab * 0.5, bright);
18 - line += rgb(r, g, b) + trail[ti];
19 - }
20 - return bold + line + nobold + reset;
21 -};
23 -export const def: AnimationDef = { name: "phosphor", fn: phosphorEcho, category: "thinking", description: "✦ Terminal phosphor trail", lines: 1 };

pi/agent/extensions/animations/animations/pi-pulse.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset, PI_GRAD } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -// pi-pulse uses the brand PI_GRAD — readableScale ensures visibility on light backgrounds
7 -const piLogoPulse: AnimationFn = (f, _w, _phase, colors) => {
8 - const piGlyph = "\ue22c", label = "";
9 - const breath = (Math.sin(f * 0.08) + 1) / 2;
10 - const gi = Math.floor((f * 0.3) % PI_GRAD.length);
11 - const gi2 = (gi + 1) % PI_GRAD.length;
12 - const t = (f * 0.3) % 1;
13 - let r = Math.round(PI_GRAD[gi][0] + (PI_GRAD[gi2][0] - PI_GRAD[gi][0]) * t);
14 - let g = Math.round(PI_GRAD[gi][1] + (PI_GRAD[gi2][1] - PI_GRAD[gi][1]) * t);
15 - let b = Math.round(PI_GRAD[gi][2] + (PI_GRAD[gi2][2] - PI_GRAD[gi][2]) * t);
16 -
17 - // Ensure brand colors are visible on light backgrounds
18 - [r, g, b] = readableScale(r, g, b, 1.1);
19 -
20 - const br = 0.6 + breath * 0.4;
21 - const trailChars = "·∘○◎●";
22 - let trail = "";
23 - for (let i = 0; i < 20; i++) {
24 - const phase = i / 20 * Math.PI * 2 + f * 0.1;
25 - const ti = Math.floor((Math.sin(phase) + 1) / 2 * (trailChars.length - 1));
26 - const fade = Math.max(30, 200 - i * 8);
27 - const [tr, tg, tb] = readableScale(
28 - Math.floor(r * fade / 255),
29 - Math.floor(g * fade / 255),
30 - Math.floor(b * fade / 255),
31 - 1.0
32 - );
33 - trail += rgb(tr, tg, tb) + trailChars[ti];
34 - }
35 - const [fr, fg, fb] = readableScale(Math.round(r * br), Math.round(g * br), Math.round(b * br), 1.1);
36 - return bold + rgb(fr, fg, fb) + piGlyph + label + nobold + " " + trail + reset;
37 -};
39 -export const def: AnimationDef = { name: "pi-pulse", fn: piLogoPulse, category: "both", description: "Pi logo with gradient pulse", lines: 1 };

pi/agent/extensions/animations/animations/pipeline.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, dim, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const pipeline: AnimationFn = (f, _w, _phase, colors) => {
7 - const accent = colors?.accent ?? [200, 160, 50];
8 - const success = colors?.success ?? [80, 200, 150];
9 - const warning = colors?.warning ?? [220, 130, 80];
10 - const toolTitle = colors?.toolTitle ?? [80, 150, 220];
11 - const mutedColor = colors?.dim ?? [50, 50, 70];
13 - // Use readableScale to ensure bright colors stay visible on light backgrounds
14 - const [accentR, accentG, accentB] = readableScale(accent[0], accent[1], accent[2], 1.2);
15 - const [successR, successG, successB] = readableScale(success[0], success[1], success[2], 1.2);
16 - const [warningR, warningG, warningB] = readableScale(warning[0], warning[1], warning[2], 1.2);
17 - const [toolR, toolG, toolB] = readableScale(toolTitle[0], toolTitle[1], toolTitle[2], 1.2);
18 - const [activeR, activeG, activeB] = readableScale(accentR, accentG, accentB, 1.4);
20 - const icons = [
21 - { i: "\uf0e7", c: rgb(accentR, accentG, accentB) },
22 - { i: "\uf013", c: rgb(toolR, toolG, toolB) },
23 - { i: "\uf121", c: rgb(successR, successG, successB) },
24 - { i: "\uf00d", c: rgb(warningR, warningG, warningB) },
25 - { i: "\uf00c", c: rgb(successR, successG, successB) },
26 - ];
27 - const pw = 5,
28 - total = icons.length * (pw + 1) + 1,
29 - pp = (f * 0.4) % total;
30 - let line = "";
31 - for (let i = 0; i < icons.length; i++) {
32 - const ss = i * (pw + 1),
33 - active = pp >= ss && pp < ss + pw + 1;
34 - line += (active ? bold : dim) + icons[i].c + icons[i].i + " " + reset;
35 - if (i < icons.length - 1) {
36 - for (let p = 0; p < pw; p++) {
37 - const pos = ss + 1 + p;
38 - line +=
39 - Math.abs(pp - pos) < 1.5
40 - ? bold + rgb(activeR, activeG, activeB) + "═"
41 - : pp > pos
42 - ? icons[i].c + "─"
43 - : rgb(mutedColor[0], mutedColor[1], mutedColor[2]) + "─";
44 - }
45 - }
46 - }
47 - return line + reset;
48 -};
50 -export const def: AnimationDef = { name: "pipeline", fn: pipeline, category: "working", description: "CI/CD pipeline with icons", lines: 1 };

pi/agent/extensions/animations/animations/plasma-wave.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -// plasma-wave — theme-derived color cycling
7 -const plasmaWave: AnimationFn = (f, w, _phase, colors) => {
8 - const chars = " ·∘○◎●◉█";
9 - const W = w;
10 - const accent = colors?.thinkingLow ?? [0, 150, 220];
11 - const success = colors?.thinkingXhigh ?? [0, 220, 100];
12 - const warning = colors?.mdHeading ?? [220, 180, 50];
13 -
14 - // Pre-scale colors
15 - const [accentR, accentG, accentB] = readableScale(...accent, 1.1);
16 - const [successR, successG, successB] = readableScale(...success, 1.1);
17 - const [warningR, warningG, warningB] = readableScale(...warning, 1.1);
18 -
19 - let line = "";
20 - for (let x = 0; x < W; x++) {
21 - const v = (Math.sin(x * 0.15 + f * 0.08) + Math.sin(x * 0.1 + f * 0.06) + Math.sin(Math.sqrt(x * x) * 0.15 + f * 0.1)) / 3;
22 - const n = (v + 1) / 2;
23 - // Interpolate accent → success → warning
24 - let r: number, g: number, b: number;
25 - if (n < 0.5) {
26 - const t = n * 2;
27 - r = Math.round(accentR + (successR - accentR) * t);
28 - g = Math.round(accentG + (successG - accentG) * t);
29 - b = Math.round(accentB + (successB - accentB) * t);
30 - } else {
31 - const t = (n - 0.5) * 2;
32 - r = Math.round(successR + (warningR - successR) * t);
33 - g = Math.round(successG + (warningG - successG) * t);
34 - b = Math.round(successB + (warningB - successB) * t);
35 - }
36 - line += rgb(r, g, b) + chars[Math.floor(n * (chars.length - 1))];
37 - }
38 - return line + reset;
39 -};
41 -export const def: AnimationDef = { name: "plasma-wave", fn: plasmaWave, category: "thinking", description: "Colorful plasma band", lines: 1 };

pi/agent/extensions/animations/animations/radar.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const radarBlip: AnimationFn = (f, w, _phase, colors) => {
7 - const W = Math.min(w, 30);
8 - const center = Math.floor(W / 2);
9 - const radius = 8;
10 - const success = colors?.syntaxType ?? [50, 220, 100];
11 - const [sr, sg, sb] = readableScale(...success, 1.2);
12 -
13 - const dimC = colors?.dim ?? [0, 25, 15];
14 - const [dr, dg, db] = readableScale(...dimC, 1.0);
15 -
16 - let line = "";
17 - for (let i = 0; i < W; i++) {
18 - const dist = Math.abs(i - center);
19 - const sweep = (f * 0.1) % (Math.PI * 2);
20 - const angle = Math.atan2(0, i - center);
21 - const diff = Math.abs(sweep - angle);
22 - if (dist < 2 && dist < radius * Math.abs(Math.cos(sweep))) {
23 - line += bold + rgb(sr, sg, sb) + "▓" + nobold;
24 - }
25 - else if (dist < radius && diff < 0.3) {
26 - const fade = Math.max(0, 1 - diff * 2);
27 - const [fr, fg, fb] = readableScale(0, sg, sb * 0.5, fade);
28 - line += rgb(fr, fg, fb) + "│";
29 - }
30 - else if (dist < radius && dist > radius - 2) {
31 - const [or, og, ob] = readableScale(sr, sg, sb, 0.25);
32 - line += rgb(or, og, ob) + "○";
33 - }
34 - else if (dist < radius) {
35 - line += rgb(dr, dg, db) + "·";
36 - }
37 - else { line += " "; }
38 - }
39 - return line + reset;
40 -};
42 -export const def: AnimationDef = { name: "radar", fn: radarBlip, category: "both", description: "▓ Radar sweep blip", lines: 1 };

pi/agent/extensions/animations/animations/rainbow.ts

Deleted
deleted file mode 100644
1 -import { rgb, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const rainbowMane: AnimationFn = (f, w, _phase, colors) => {
7 - const W = w;
8 - const chars = "~≈~≋~";
9 - const accent = colors?.thinkingLow ?? [220, 50, 80];
10 - const error = colors?.thinkingMedium ?? [220, 90, 160];
11 - const borderAccent = colors?.thinkingHigh ?? [160, 90, 220];
12 - const toolTitle = colors?.thinkingXhigh ?? [90, 140, 220];
13 - const success = colors?.syntaxType ?? [50, 180, 220];
14 - const borderMuted = colors?.thinkingLow ?? [90, 220, 180];
15 -
16 - const rainbow = [
17 - readableScale(...accent, 1.1),
18 - readableScale(...error, 1.1),
19 - readableScale(...borderAccent, 1.1),
20 - readableScale(...toolTitle, 1.1),
21 - readableScale(...success, 1.1),
22 - readableScale(...borderMuted, 1.1),
23 - ];
24 -
25 - let line = "";
26 - for (let x = 0; x < W; x++) {
27 - const phase = (x / W + f * 0.1) % 1;
28 - const ci = Math.floor(phase * rainbow.length) % rainbow.length;
29 - const [r, g, b] = rainbow[ci];
30 - const wave = Math.sin(x * 0.2 + f * 0.3) * 0.5 + 0.5;
31 - const ch = chars[Math.floor(wave * (chars.length - 1))];
32 - const bright = 0.6 + wave * 0.4;
33 - const [cr, cg, cb] = readableScale(r, g, b, bright);
34 - line += rgb(cr, cg, cb) + ch;
35 - }
36 - return line + reset;
37 -};
39 -export const def: AnimationDef = { name: "rainbow", fn: rainbowMane, category: "thinking", description: "≋ Rainbow flowing wave", lines: 1 };

pi/agent/extensions/animations/animations/shimmer.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset, PI_GRAD } from "../utils";
2 -import { PHASE_LABELS } from "../types";
3 -import type { AnimationFn, AnimationDef } from "../types";
4 -import type { ThemeColors } from "../theme-colors";
5 -import { readableScale } from "../theme-colors";
7 -const shimmerText: AnimationFn = (f, w, phase, colors) => {
8 - const text = PHASE_LABELS[phase || "thinking"] + "...";
9 - // Use text token - adapts to theme automatically
10 - const base = colors?.text ?? [150, 150, 150];
11 - const pad = Math.max(0, Math.floor((w - text.length) / 2));
12 -
13 - // Scale base color to ensure readability on light backgrounds
14 - const [baseR, baseG, baseB] = readableScale(base[0], base[1], base[2], 0.9);
15 -
16 - // Dim background dots using accent color, scaled down
17 - const accent = colors?.accent ?? base;
18 - const [dimR, dimG, dimB] = readableScale(accent[0], accent[1], accent[2], 0.2);
20 - let line = "";
21 - for (let i = 0; i < w; i++) {
22 - const wave = Math.sin((i - f * 0.3) * 0.8);
23 - if (i >= pad && i < pad + text.length) {
24 - const ti = i - pad;
25 - if (wave > 0.3) {
26 - const intensity = (wave - 0.3) / 0.7;
27 - const gi = Math.floor((i + f * 0.5) % (PI_GRAD.length * 2));
28 - const gIdx = gi < PI_GRAD.length ? gi : PI_GRAD.length * 2 - 1 - gi;
29 - const gc = PI_GRAD[Math.min(gIdx, PI_GRAD.length - 1)];
30 - // Use theme-aware gradient
31 - const [r, g, b] = readableScale(
32 - baseR + (gc[0] - baseR) * intensity,
33 - baseG + (gc[1] - baseG) * intensity,
34 - baseB + (gc[2] - baseB) * intensity,
35 - 1.0,
36 - );
37 - line += bold + rgb(r, g, b) + text[ti] + nobold;
38 - } else {
39 - line += rgb(baseR, baseG, baseB) + text[ti];
40 - }
41 - } else {
42 - if (wave > 0.4) {
43 - const gi = Math.floor((i + f * 0.5) % (PI_GRAD.length * 2));
44 - const gIdx = gi < PI_GRAD.length ? gi : PI_GRAD.length * 2 - 1 - gi;
45 - const gc = PI_GRAD[Math.min(gIdx, PI_GRAD.length - 1)];
46 - const intensity = ((wave - 0.4) / 0.6) * 0.35;
47 - const [r, g, b] = readableScale(gc[0], gc[1], gc[2], intensity);
48 - line += rgb(r, g, b) + "·";
49 - } else {
50 - // Use dim accent instead of hardcoded dark
51 - line += rgb(dimR, dimG, dimB) + " ";
52 - }
53 - }
54 - }
55 - return line + reset;
56 -};
58 -export const def: AnimationDef = { name: "shimmer", fn: shimmerText, category: "thinking", description: "Rainbow shimmer text", lines: 1 };

pi/agent/extensions/animations/animations/sparkles.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const sparkleTrail: AnimationFn = (f, w, _phase, colors) => {
7 - const W = Math.min(w, 28);
8 - const stars = ["✦", "✧", "✨", "✦"];
9 - const accent = colors?.thinkingHigh ?? [220, 90, 180];
10 - const error = colors?.thinkingXhigh ?? [220, 90, 90];
11 - const warning = colors?.mdHeading ?? [220, 220, 80];
12 - const success = colors?.syntaxString ?? [90, 220, 180];
13 - const toolTitle = colors?.thinkingMedium ?? [90, 90, 220];
14 - const borderAccent = colors?.borderAccent ?? [180, 90, 220];
15 -
16 - const rainbow = [
17 - readableScale(...error, 1.2),
18 - readableScale(...warning, 1.1),
19 - readableScale(...success, 1.1),
20 - readableScale(...accent, 1.1),
21 - readableScale(...toolTitle, 1.1),
22 - readableScale(...borderAccent, 1.1),
23 - readableScale(...accent, 1.0),
24 - ];
25 -
26 - let line = "";
27 - for (let i = 0; i < W; i++) {
28 - const dist = (i + f * 1.2) % W;
29 - const ci = Math.floor((f * 0.3 + i * 0.4) % rainbow.length);
30 - const si = Math.floor((f * 0.5 + i * 0.3) % stars.length);
31 - const [r, g, b] = rainbow[ci];
32 - if (dist < 2) {
33 - const [br, bg, bb] = readableScale(r, g, b, 1.2);
34 - line += bold + rgb(br, bg, bb) + stars[si] + nobold;
35 - }
36 - else if (dist < 4) {
37 - const [mr, mg, mb] = readableScale(r, g, b, 0.7);
38 - line += rgb(mr, mg, mb) + stars[(si + 1) % stars.length];
39 - }
40 - else {
41 - const [dr, dg, db] = readableScale(r, g, b, 0.25);
42 - line += rgb(dr, dg, db) + "·";
43 - }
44 - }
45 - return line + reset;
46 -};
48 -export const def: AnimationDef = { name: "sparkles", fn: sparkleTrail, category: "thinking", description: "✨ Rainbow sparkle trail", lines: 1 };

pi/agent/extensions/animations/animations/starburst.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const starburst: AnimationFn = (f, w, _phase, colors) => {
7 - const W = w;
8 - const stars = ["✦", "★", "✧", "⁕", "✦"];
9 -
10 - // Theme-aware colors
11 - const textC = colors?.syntaxVariable ?? [180, 180, 220];
12 - const accent = colors?.mdHeading ?? [220, 180, 50];
13 - const warning = colors?.thinkingXhigh ?? [220, 90, 50];
14 - const error = colors?.thinkingHigh ?? [180, 50, 50];
15 -
16 - // Scale colors for visibility
17 - const colors_arr = [
18 - readableScale(...textC, 1.1),
19 - readableScale(...textC, 0.9),
20 - readableScale(...accent, 1.2),
21 - readableScale(...warning, 1.2),
22 - readableScale(...error, 1.1),
23 - ];
24 -
25 - const center = W / 2;
26 - const burst = (f * 0.3) % (colors_arr.length);
27 - const idx = Math.floor(burst);
28 - const next = Math.floor((burst + 1) % colors_arr.length);
29 - const t = burst % 1;
30 -
31 - // Dim background using accent
32 - const [dimR, dimG, dimB] = readableScale(accent[0], accent[1], accent[2], 0.15);
33 -
34 - let line = "";
35 - for (let i = 0; i < W; i++) {
36 - const dist = Math.abs(i - center);
37 - if (dist < 1) {
38 - const [r, g, b] = colors_arr[0];
39 - line += bold + rgb(r, g, b) + "✦" + nobold;
40 - }
41 - else if (dist < 3) {
42 - const [r, g, b] = colors_arr[idx];
43 - const [r2, g2, b2] = colors_arr[next];
44 - line += rgb(Math.round(r + (r2 - r) * t), Math.round(g + (g2 - g) * t), Math.round(b + (b2 - b) * t)) + stars[Math.floor(dist) % stars.length];
45 - } else {
46 - line += rgb(dimR, dimG, dimB) + "·";
47 - }
48 - }
49 - return line + reset;
50 -};
52 -export const def: AnimationDef = { name: "starburst", fn: starburst, category: "both", description: "★ Starburst explosion", lines: 1 };

pi/agent/extensions/animations/animations/starfield.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const starChars = ["·", "∙", "•", "✦", "★"];
7 -type Star = { x: number; speed: number; bright: number; ch: string };
8 -let stars: Star[] = [];
9 -let starsLastW = 0;
11 -function ensureStars(W: number, baseColor: [number, number, number]) {
12 - if (W !== starsLastW) {
13 - const count = Math.max(20, Math.floor(W * 0.6));
14 - stars = Array.from({ length: count }, () => {
15 - const speed = 0.2 + Math.random() * 1.2;
16 - const layer = Math.floor(speed / 0.3);
17 - // Use readableScale for contrast on light backgrounds
18 - const [r, g, b] = readableScale(baseColor[0], baseColor[1], baseColor[2], 0.4 + layer * 0.2);
19 - return {
20 - x: Math.random() * W,
21 - speed,
22 - bright: r, // Use R channel as brightness proxy
23 - ch: starChars[Math.min(layer, starChars.length - 1)],
24 - };
25 - });
26 - starsLastW = W;
27 - }
28 -}
30 -const starfield: AnimationFn = (f, w, _phase, colors) => {
31 - const W = w;
32 - // Use accent for star color - it adapts to theme
33 - const accent = colors?.accent ?? colors?.text ?? [180, 140, 255];
34 - const [baseR, baseG, baseB] = readableScale(accent[0], accent[1], accent[2], 0.7);
35 - ensureStars(W, accent);
37 - const buf: string[] = [];
38 - for (let i = 0; i < W; i++) buf.push(rgb(baseR, baseG, baseB) + " ");
39 -
40 - for (const s of stars) {
41 - const xi = Math.floor(s.x);
42 - if (xi >= 0 && xi < W) {
43 - const intensity = s.bright / 255;
44 - const [r, g, b] = readableScale(accent[0], accent[1], accent[2], 0.3 + intensity * 0.7);
45 - buf[xi] = rgb(r, g, b) + s.ch;
46 - }
47 - s.x += s.speed;
48 - if (s.x >= W) {
49 - s.x = 0;
50 - s.speed = 0.2 + Math.random() * 1.2;
51 - const l = Math.floor(s.speed / 0.3);
52 - s.bright = Math.min(255, 100 + l * 40);
53 - s.ch = starChars[Math.min(l, starChars.length - 1)];
54 - }
55 - }
56 - return buf.join("") + reset;
57 -};
59 -export const def: AnimationDef = { name: "starfield", fn: starfield, category: "thinking", description: "Horizontal parallax stars", lines: 1 };

pi/agent/extensions/animations/animations/synth.ts

Deleted
deleted file mode 100644
1 -import { reset, hsl } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -// synth uses HSL color cycling — theme-aware base hue
7 -const synthWave: AnimationFn = (f, w, _phase, colors) => {
8 - const W = w;
9 - const chars = " ▁▂▃▄▅▆▇█";
10 - const accent = colors?.thinkingMedium ?? [120, 150, 220];
11 -
12 - // Derive base hue from accent RGB
13 - const max = Math.max(...accent);
14 - const min = Math.min(...accent);
15 - let baseHue = 0;
16 - if (max !== min) {
17 - const d = max - min;
18 - if (max === accent[0]) baseHue = ((accent[1] - accent[2]) / d + (accent[1] < accent[2] ? 6 : 0)) * 60;
19 - else if (max === accent[1]) baseHue = ((accent[2] - accent[0]) / d + 2) * 60;
20 - else baseHue = ((accent[0] - accent[1]) / d + 4) * 60;
21 - }
22 -
23 - let line = "";
24 - for (let x = 0; x < W; x++) {
25 - const wave1 = Math.sin(x * 0.15 + f * 0.08);
26 - const wave2 = Math.sin(x * 0.1 + f * 0.06) * 0.5;
27 - const wave3 = Math.sin(x * 0.25 + f * 0.12) * 0.3;
28 - const v = (wave1 + wave2 + wave3) / 1.8;
29 - const n = (v + 1) / 2;
30 - const ci = Math.floor(n * (chars.length - 1));
31 - const hue = (baseHue + x * 2 + f * 3) % 360;
32 - // Boost saturation and luminance for visibility
33 - const sat = 0.7 + n * 0.3;
34 - const lum = 0.35 + n * 0.45;
35 - line += hsl(hue, sat, lum) + chars[ci];
36 - }
37 - return line + reset;
38 -};
40 -export const def: AnimationDef = { name: "synth", fn: synthWave, category: "thinking", description: "▁▂▃ Synthwave waveform", lines: 1 };

pi/agent/extensions/animations/animations/typewriter.ts

Deleted
deleted file mode 100644
1 -import { rgb, bold, nobold, reset } from "../utils";
2 -import type { AnimationFn, AnimationDef } from "../types";
3 -import type { ThemeColors } from "../theme-colors";
4 -import { readableScale } from "../theme-colors";
6 -const vibeMessages = [
7 - "Engaging warp drive...",
8 - "Running diagnostics...",
9 - "Recalibrating sensors...",
10 - "Scanning the horizon...",
11 - "Channeling the cosmos...",
12 - "Weaving neural threads...",
13 - "Parsing the matrix...",
14 -];
15 -const cursorChars = ["✦", "✧", "⚡", "★", "·"];
16 -let vibeIdx = 0, vibeCharIdx = 0, vibeHold = 0;
18 -const vibeTypewriter: AnimationFn = (f, _w, _phase, colors) => {
19 - const vibe = vibeMessages[vibeIdx];
20 - if (vibeHold > 0) {
21 - vibeHold--;
22 - if (vibeHold === 0) {
23 - vibeIdx = (vibeIdx + 1) % vibeMessages.length;
24 - vibeCharIdx = 0;
25 - }
26 - }
27 - else if (vibeCharIdx < vibe.length) vibeCharIdx++;
28 - else vibeHold = 30;
29 -
30 - const shown = vibe.slice(0, vibeCharIdx);
31 -
32 - // Theme-aware colors with readableScale
33 - const textC = colors?.text ?? [160, 160, 180];
34 - const [textR, textG, textB] = readableScale(textC[0], textC[1], textC[2], 1.0);
35 -
36 - const accent = colors?.thinkingHigh ?? [220, 180, 80];
37 - const success = colors?.thinkingXhigh ?? [80, 180, 220];
38 - const warning = colors?.mdHeading ?? [220, 80, 180];
39 -
40 - const cursorColors = [
41 - readableScale(accent[0], accent[1], accent[2], 1.3),
42 - readableScale(success[0], success[1], success[2], 1.3),
43 - readableScale(warning[0], warning[1], warning[2], 1.3),
44 - readableScale(success[0], success[1], success[2], 1.3),
45 - ];
46 -
47 - const cc = cursorColors[f % cursorColors.length];
48 - const cursor = vibeCharIdx < vibe.length
49 - ? rgb(cc[0], cc[1], cc[2]) + bold + cursorChars[f % cursorChars.length] + nobold
50 - : "";
51 -
52 - return rgb(textR, textG, textB) + shown + cursor + reset;
53 -};
55 -export const def: AnimationDef = { name: "typewriter", fn: vibeTypewriter, category: "both", description: "Themed typewriter text", lines: 1 };

pi/agent/extensions/animations/config.ts

Deleted
deleted file mode 100644
1 -/**
2 - * Animation configuration.
3 - *
4 - * Settings are stored in settings.json under the "animations" namespace.
5 - */
7 -import { getSettings, updateSettings } from "../../lib/settings";
9 -export interface AnimConfig {
10 - workingAnim?: string;
11 - thinkingAnim?: string;
12 - toolAnim?: string;
13 - width?: "full" | "default" | number;
14 - randomMode?: boolean;
15 - enabled?: boolean;
16 - fps?: number;
17 -}
19 -interface AnimSettings {
20 - working?: string;
21 - thinking?: string;
22 - tool?: string;
23 - width?: "full" | "default" | number;
24 - random?: boolean;
25 - enabled?: boolean;
26 - fps?: number;
27 -}
29 -function toAnimConfig(s: AnimSettings): AnimConfig {
30 - return {
31 - workingAnim: s.working,
32 - thinkingAnim: s.thinking,
33 - toolAnim: s.tool,
34 - width: s.width,
35 - randomMode: s.random,
36 - enabled: s.enabled,
37 - fps: s.fps,
38 - };
39 -}
41 -function fromAnimConfig(c: AnimConfig): AnimSettings {
42 - return {
43 - working: c.workingAnim,
44 - thinking: c.thinkingAnim,
45 - tool: c.toolAnim,
46 - width: c.width,
47 - random: c.randomMode,
48 - enabled: c.enabled,
49 - fps: c.fps,
50 - };
51 -}
53 -export function loadConfig(): AnimConfig {
54 - return toAnimConfig(getSettings<AnimSettings>("animations"));
55 -}
57 -export function saveConfig(config: AnimConfig): void {
58 - updateSettings<AnimSettings>("animations", fromAnimConfig(config));
59 -}
61 -export function resolveWidth(
62 - w: "full" | "default" | number | undefined,
63 -): number {
64 - if (w === "full" || w === undefined) {
65 - return (process.stdout.columns || 80) - 4;
66 - }
67 - if (w === "default") return 50;
68 - return Math.max(10, Math.min(w, (process.stdout.columns || 80) - 4));
69 -}
71 -export function resolveInterval(fps: number): number {
72 - return Math.round(1000 / fps);
73 -}

pi/agent/extensions/animations/index.ts

Deleted
deleted file mode 100644
1 -/**
2 - * animations — Animated thinking/working/tool indicators
3 - *
4 - * Commands:
5 - * /animation Show status + list
6 - * /animation showcase Interactive browser
7 - * /animation <name> Set all states
8 - * /animation working:<name> Set working only
9 - * /animation thinking:<name> Set thinking only
10 - * /animation tool:<name> Set tool only
11 - * /animation width full|default|<n>
12 - * /animation fps <n> (default 144)
13 - * /animation on|off|random
14 - */
16 -import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
17 -import type { AnimPhase, AnimationDef } from "./types";
18 -import type { ThemeColors } from "./theme-colors";
19 -import { ANIMATIONS, getAnimation, getAnimationsForCategory } from "./registry";
20 -import { loadConfig, saveConfig, resolveWidth, resolveInterval } from "./config";
21 -import type { AnimConfig } from "./config";
22 -import { runShowcase } from "./showcase";
23 -import { extractThemeColors } from "./theme-colors";
25 -// ─── Global state key ───────────────────────────────────────────
26 -const STATE_KEY = Symbol.for("pi.ext.animatedThinking.state");
28 -// ─── Runtime state ──────────────────────────────────────────────
29 -interface AnimState {
30 - workingAnim: string;
31 - thinkingAnim: string;
32 - toolAnim: string;
33 - width: "full" | "default" | number;
34 - randomMode: boolean;
35 - fps: number;
36 - workingStartTime: number;
37 - workingTimer: ReturnType<typeof setInterval> | null;
38 - theme?: ExtensionContext["ui"]["theme"];
39 - themeColors?: ThemeColors;
40 - enabled: boolean;
41 - isThinking: boolean;
42 - isToolRunning: boolean;
43 - currentWorkingCtx: ExtensionContext | null;
46 -function getState(): AnimState {
47 - return (globalThis as any)[STATE_KEY];
50 -// ─── Frame rendering ────────────────────────────────────────────
51 -function renderFrame(
52 - animName: string,
53 - frame: number,
54 - width: number,
55 - phase?: AnimPhase,
56 - colors?: ThemeColors,
57 -): string[] {
58 - const anim = getAnimation(animName);
59 - if (!anim) return ["Working..."];
60 - const result = anim.fn(frame, width, phase, colors);
61 - return Array.isArray(result) ? result : [result];
64 -function pickRandom(cat: AnimPhase): string {
65 - // tool phase maps to working category for animation purposes
66 - const animCat = cat === "tool" ? "working" : cat;
67 - const anims = getAnimationsForCategory(animCat);
68 - return anims[Math.floor(Math.random() * anims.length)].name;
71 -// ─── Thinking animation via setWorkingMessage ─────────────────────────────────
72 -// Note: The visible "Thinking..." label inside messages cannot be animated via public API.
73 -// We animate the working message (status area) instead when thinking is active.
74 -// This runs via the existing workingTimer interval - see startWorkingAnimation().
76 -// ═══════════════════════════════════════════════════════════════
77 -// Extension entry point
78 -// ═══════════════════════════════════════════════════════════════
80 -export default function (pi: ExtensionAPI) {
81 - const cfg = loadConfig();
82 - const state: AnimState = {
83 - workingAnim: cfg.workingAnim || "crush",
84 - thinkingAnim: cfg.thinkingAnim || "shimmer",
85 - toolAnim: cfg.toolAnim || "pipeline",
86 - width: cfg.width ?? "full",
87 - randomMode: cfg.randomMode ?? false,
88 - enabled: cfg.enabled ?? true,
89 - fps: cfg.fps ?? 144,
90 - workingStartTime: 0,
91 - workingTimer: null,
92 - theme: undefined,
93 - isThinking: false,
94 - isToolRunning: false,
95 - currentWorkingCtx: null,
96 - };
97 - (globalThis as any)[STATE_KEY] = state;
99 - function persistConfig() {
100 - saveConfig({
101 - workingAnim: state.workingAnim,
102 - thinkingAnim: state.thinkingAnim,
103 - toolAnim: state.toolAnim,
104 - width: state.width,
105 - randomMode: state.randomMode,
106 - enabled: state.enabled,
107 - fps: state.fps,
108 - });
109 - }
111 - // ─── Working animation ─────────────────────────────────────
112 - function startWorkingAnimation(ctx: ExtensionContext) {
113 - stopWorkingAnimation(ctx);
114 - if (!state.enabled) return;
115 - state.workingStartTime = performance.now();
116 - state.currentWorkingCtx = ctx;
117 - const randomWorkingName = state.randomMode
118 - ? pickRandom("working")
119 - : null;
120 - const randomThinkingName = state.randomMode
121 - ? pickRandom("thinking")
122 - : null;
123 - const randomToolName = state.randomMode
124 - ? pickRandom("working")
125 - : null;
126 - state.workingTimer = setInterval(() => {
127 - const frame = Math.floor(
128 - (performance.now() - state.workingStartTime) / 1000 * 60,
129 - );
130 - let animName: string;
131 - let phase: AnimPhase;
132 - if (state.isThinking) {
133 - animName = randomThinkingName || state.thinkingAnim;
134 - phase = "thinking";
135 - } else if (state.isToolRunning) {
136 - animName = randomToolName || state.toolAnim;
137 - phase = "tool";
138 - } else {
139 - animName = randomWorkingName || state.workingAnim;
140 - phase = "working";
141 - }
142 - const w = resolveWidth(state.width);
143 - const text = renderFrame(animName, frame, w, phase, state.themeColors)[0];
144 - ctx.ui.setWorkingMessage(text);
145 - }, resolveInterval(state.fps));
146 - }
148 - function stopWorkingAnimation(ctx?: ExtensionContext) {
149 - if (state.workingTimer) {
150 - clearInterval(state.workingTimer);
151 - state.workingTimer = null;
152 - }
153 - state.currentWorkingCtx = null;
154 - }
157 - // ─── Events ────────────────────────────────────────────────
158 - pi.on("session_start", async (_e, ctx) => {
159 - state.theme = ctx.ui.theme;
160 - state.themeColors = extractThemeColors(ctx.ui.theme);
161 - });
163 - pi.on("agent_start", async (_e, ctx) => {
164 - startWorkingAnimation(ctx);
165 - });
167 - pi.on("agent_end", async (_e, ctx) => {
168 - state.isThinking = false;
169 - state.isToolRunning = false;
170 - stopWorkingAnimation(ctx);
171 - // Don't clear the message — agent_start will restart animation.
172 - // Passing empty string prevents the TUI from showing its default "Working..." label.
173 - ctx.ui.setWorkingMessage("");
174 - });
176 - pi.on("message_update", async (event, ctx) => {
177 - state.theme = ctx.ui.theme;
178 - state.themeColors = extractThemeColors(ctx.ui.theme);
179 - const se = event.assistantMessageEvent as any;
180 - if (!se || typeof se.type !== "string") return;
181 - if (se.type === "thinking_start" || se.type === "thinking_delta") {
182 - state.isThinking = true;
183 - }
184 - if (se.type === "thinking_end") {
185 - state.isThinking = false;
186 - }
187 - if (se.type === "text_delta") {
188 - state.isThinking = false;
189 - }
190 - });
192 - pi.on("message_end", async () => {
193 - state.isThinking = false;
194 - });
196 - pi.on("tool_execution_start", async () => {
197 - state.isToolRunning = true;
198 - });
200 - pi.on("tool_execution_end", async () => {
201 - state.isToolRunning = false;
202 - });
204 - pi.on("session_switch", async (_e, ctx) => {
205 - stopWorkingAnimation(ctx);
206 - ctx.ui.setWorkingMessage();
207 - });
209 - pi.on("session_shutdown", async () => {
210 - stopWorkingAnimation();
211 - });
213 - // ─── /animation command ────────────────────────────────────
214 - pi.registerCommand("animation", {
215 - description:
216 - "Animated indicators: showcase, set <name>, width, on/off",
217 - getArgumentCompletions: (prefix) => {
218 - const items = [
219 - {
220 - value: "showcase",
221 - label: "showcase",
222 - description: "Browse all animations interactively",
223 - },
224 - { value: "on", label: "on", description: "Enable animations" },
225 - { value: "off", label: "off", description: "Disable animations" },
226 - {
227 - value: "random",
228 - label: "random",
229 - description: "Random animation each time",
230 - },
231 - {
232 - value: "width full",
233 - label: "width full",
234 - description: "Full terminal width",
235 - },
236 - {
237 - value: "width default",
238 - label: "width default",
239 - description: "50 columns",
240 - },
241 - {
242 - value: "fps 60",
243 - label: "fps 60",
244 - description: "60 FPS",
245 - },
246 - {
247 - value: "fps 120",
248 - label: "fps 120",
249 - description: "120 FPS",
250 - },
251 - {
252 - value: "fps 144",
253 - label: "fps 144",
254 - description: "144 FPS (default)",
255 - },
256 - {
257 - value: "fps 240",
258 - label: "fps 240",
259 - description: "240 FPS",
260 - },
261 - ...ANIMATIONS.map((a) => ({
262 - value: a.name,
263 - label: a.name,
264 - description: `[${a.category}, ${a.lines}L] ${a.description}`,
265 - })),
266 - ...ANIMATIONS.map((a) => ({
267 - value: `working:${a.name}`,
268 - label: `working:${a.name}`,
269 - description: `Working → ${a.description}`,
270 - })),
271 - ...ANIMATIONS.map((a) => ({
272 - value: `thinking:${a.name}`,
273 - label: `thinking:${a.name}`,
274 - description: `Thinking → ${a.description}`,
275 - })),
276 - ...ANIMATIONS.map((a) => ({
277 - value: `tool:${a.name}`,
278 - label: `tool:${a.name}`,
279 - description: `Tool → ${a.description}`,
280 - })),
281 - ];
282 - if (!prefix) return items;
283 - return items.filter((i) => i.value.startsWith(prefix));
284 - },
285 - handler: async (args, ctx) => {
286 - const arg = args.trim().toLowerCase();
288 - // ── No args: show status ──
289 - if (!arg) {
290 - const status = state.enabled
291 - ? `Working: ${state.workingAnim} • Thinking: ${state.thinkingAnim} • Tool: ${state.toolAnim} • Width: ${state.width}${state.randomMode ? " • (random)" : ""}`
292 - : "Animations disabled";
293 - const list = ANIMATIONS.map(
294 - (a) =>
295 - ` ${a.name.padEnd(20)} [${a.category.padEnd(8)} ${a.lines}L] ${a.description}`,
296 - ).join("\n");
297 - ctx.ui.notify(
298 - `${status}\n\nAnimations:\n${list}\n\nUsage:\n /animation showcase Browse & pick\n /animation <name> Set all states\n /animation working:<name> Set working only\n /animation thinking:<name> Set thinking only\n /animation tool:<name> Set tool only\n /animation width full|default|<n>\n /animation fps <n> (default 144)\n /animation on|off|random`,
299 - "info",
300 - );
301 - return;
302 - }
304 - // ── showcase ──
305 - if (arg === "showcase") {
306 - const selected = await runShowcase(ctx, {
307 - fps: state.fps,
308 - width: state.width,
309 - });
310 - if (selected) {
311 - state.enabled = true;
312 - state.randomMode = false;
313 - state.workingAnim = selected;
314 - state.thinkingAnim = selected;
315 - state.toolAnim = selected;
316 - persistConfig();
317 - ctx.ui.notify(
318 - `Animation set to: ${selected} (all states)`,
319 - "info",
320 - );
321 - }
322 - return;
323 - }
325 - // ── on/off/random ──
326 - if (arg === "off") {
327 - state.enabled = false;
328 - stopWorkingAnimation();
329 - ctx.ui.setWorkingMessage();
330 - persistConfig();
331 - ctx.ui.notify("Animations disabled", "info");
332 - return;
333 - }
334 - if (arg === "on") {
335 - state.enabled = true;
336 - state.randomMode = false;
337 - persistConfig();
338 - ctx.ui.notify("Animations enabled", "info");
339 - return;
340 - }
341 - if (arg === "random") {
342 - state.enabled = true;
343 - state.randomMode = true;
344 - persistConfig();
345 - ctx.ui.notify("Random mode enabled", "info");
346 - return;
347 - }
349 - // ── width ──
350 - if (arg.startsWith("width")) {
351 - const val = arg.slice(5).trim();
352 - if (!val) {
353 - ctx.ui.notify(`Width: ${state.width}`, "info");
354 - return;
355 - }
356 - if (val === "full") {
357 - state.width = "full";
358 - } else if (val === "default") {
359 - state.width = "default";
360 - } else {
361 - const n = parseInt(val, 10);
362 - if (isNaN(n) || n < 10) {
363 - ctx.ui.notify("Width: full | default | number >= 10", "error");
364 - return;
365 - }
366 - state.width = n;
367 - }
368 - persistConfig();
369 - ctx.ui.notify(`Width set to: ${state.width}`, "info");
370 - return;
371 - }
373 - // ── fps ──
374 - if (arg.startsWith("fps")) {
375 - const val = arg.slice(3).trim();
376 - if (!val) {
377 - ctx.ui.notify(`FPS: ${state.fps}`, "info");
378 - return;
379 - }
380 - const n = parseInt(val, 10);
381 - if (isNaN(n) || n < 1 || n > 500) {
382 - ctx.ui.notify("FPS: number between 1-500", "error");
383 - return;
384 - }
385 - state.fps = n;
386 - persistConfig();
387 - ctx.ui.notify(`FPS set to: ${state.fps}`, "info");
388 - return;
389 - }
391 - // ── Set animation: "name" or "working:name" etc ──
392 - let target: "all" | "working" | "thinking" | "tool" = "all";
393 - let name = arg;
394 - if (arg.startsWith("working:")) {
395 - target = "working";
396 - name = arg.slice(8);
397 - } else if (arg.startsWith("thinking:")) {
398 - target = "thinking";
399 - name = arg.slice(9);
400 - } else if (arg.startsWith("tool:")) {
401 - target = "tool";
402 - name = arg.slice(5);
403 - }
405 - const anim = getAnimation(name);
406 - if (!anim) {
407 - ctx.ui.notify(
408 - `Unknown: "${name}". Try /animation showcase`,
409 - "error",
410 - );
411 - return;
412 - }
414 - state.enabled = true;
415 - state.randomMode = false;
416 - if (target === "all" || target === "working") state.workingAnim = name;
417 - if (target === "all" || target === "thinking") state.thinkingAnim = name;
418 - if (target === "all" || target === "tool") state.toolAnim = name;
419 - persistConfig();
421 - const msg = target === "all" ? `All → ${name}` : `${target} → ${name}`;
422 - ctx.ui.notify(msg, "info");
423 - },
424 - });

pi/agent/extensions/animations/registry.ts

Deleted
deleted file mode 100644
1 -import type { AnimCategory, AnimationDef } from "./types";
2 -import { def as neuralPulse } from "./animations/neural-pulse";
3 -import { def as glitchText } from "./animations/glitch-text";
4 -import { def as plasmaWave } from "./animations/plasma-wave";
5 -import { def as pacman } from "./animations/pacman";
6 -import { def as matrix } from "./animations/matrix";
7 -import { def as pipeline } from "./animations/pipeline";
8 -import { def as starfield } from "./animations/starfield";
9 -import { def as fire } from "./animations/fire";
10 -import { def as iconMorph } from "./animations/icon-morph";
11 -import { def as brainstorm } from "./animations/brainstorm";
12 -import { def as devConstellation } from "./animations/dev-constellation";
13 -import { def as crush } from "./animations/crush";
14 -import { def as piPulse } from "./animations/pi-pulse";
15 -import { def as shimmer } from "./animations/shimmer";
16 -import { def as typewriter } from "./animations/typewriter";
17 -import { def as orbitDots } from "./animations/orbit-dots";
18 -import { def as neonBounce } from "./animations/neon-bounce";
19 -import { def as electric } from "./animations/electric";
20 -import { def as dataBurst } from "./animations/data-burst";
21 -import { def as phosphor } from "./animations/phosphor";
22 -import { def as starburst } from "./animations/starburst";
23 -import { def as heartbeat } from "./animations/heartbeat";
24 -import { def as packets } from "./animations/packets";
25 -import { def as laserGrid } from "./animations/laser-grid";
26 -import { def as commits } from "./animations/commits";
27 -import { def as blackhole } from "./animations/blackhole";
28 -import { def as synth } from "./animations/synth";
29 -import { def as radar } from "./animations/radar";
30 -import { def as hexdump } from "./animations/hexdump";
31 -import { def as kitt } from "./animations/kitt";
32 -import { def as cylon } from "./animations/cylon";
33 -import { def as sparkles } from "./animations/sparkles";
34 -import { def as rainbow } from "./animations/rainbow";
35 -import { def as magic } from "./animations/magic";
36 -import { def as horn } from "./animations/horn";
38 -export const ANIMATIONS: AnimationDef[] = [
39 - neuralPulse,
40 - glitchText,
41 - plasmaWave,
42 - pacman,
43 - matrix,
44 - pipeline,
45 - starfield,
46 - fire,
47 - iconMorph,
48 - brainstorm,
49 - devConstellation,
50 - crush,
51 - piPulse,
52 - shimmer,
53 - typewriter,
54 - orbitDots,
55 - neonBounce,
56 - electric,
57 - dataBurst,
58 - phosphor,
59 - starburst,
60 - heartbeat,
61 - packets,
62 - laserGrid,
63 - commits,
64 - blackhole,
65 - synth,
66 - radar,
67 - hexdump,
68 - kitt,
69 - cylon,
70 - sparkles,
71 - rainbow,
72 - magic,
73 - horn,
74 -];
76 -export function getAnimation(name: string): AnimationDef | undefined {
77 - return ANIMATIONS.find((a) => a.name === name);
78 -}
80 -export function getAnimationsForCategory(
81 - cat: AnimCategory,
82 -): AnimationDef[] {
83 - return ANIMATIONS.filter((a) => a.category === cat || a.category === "both");
84 -}

pi/agent/extensions/animations/showcase.ts

Deleted
deleted file mode 100644
1 -import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
2 -import { matchesKey } from "@mariozechner/pi-tui";
3 -import { ANIMATIONS } from "./registry";
4 -import { resolveWidth } from "./config";
5 -import { extractThemeColors, type ThemeColors } from "./theme-colors";
7 -interface ShowcaseOpts {
8 - fps: number;
9 - width: "full" | "default" | number;
10 -}
12 -export async function runShowcase(
13 - ctx: ExtensionContext,
14 - opts: ShowcaseOpts,
15 -): Promise<string | null> {
16 - return ctx.ui.custom((tui, theme, _keybindings, done) => {
17 - let idx = 0;
18 - const startTime = performance.now();
19 - const colors = extractThemeColors(theme);
21 - const timer = setInterval(() => {
22 - tui.requestRender();
23 - }, 1000 / opts.fps);
25 - return {
26 - invalidate() {},
27 - dispose() {
28 - clearInterval(timer);
29 - },
30 - handleInput(data: string) {
31 - if (matchesKey(data, "escape") || data === "q") {
32 - clearInterval(timer);
33 - done(null);
34 - } else if (
35 - matchesKey(data, "right") ||
36 - data === "l" ||
37 - data === "n"
38 - ) {
39 - idx = (idx + 1) % ANIMATIONS.length;
40 - } else if (
41 - matchesKey(data, "left") ||
42 - data === "h" ||
43 - data === "p"
44 - ) {
45 - idx = (idx - 1 + ANIMATIONS.length) % ANIMATIONS.length;
46 - } else if (matchesKey(data, "enter") || data === " ") {
47 - clearInterval(timer);
48 - done(ANIMATIONS[idx].name);
49 - }
50 - },
51 - render(width: number): string[] {
52 - const frame = Math.floor(
53 - (performance.now() - startTime) / 1000 * 60,
54 - );
55 - const anim = ANIMATIONS[idx];
56 - const w = resolveWidth(opts.width);
57 - const raw = anim.fn(frame, Math.min(w, width - 4), undefined, colors);
58 - const rendered = Array.isArray(raw) ? raw : [raw];
59 - const out: string[] = [];
60 - out.push("");
61 - out.push(theme.fg("accent", " ▶ Animation Showcase"));
62 - out.push("");
63 - for (const line of rendered) out.push(` ${line}`);
64 - out.push("");
65 - out.push(
66 - theme.fg("muted", ` [${idx + 1}/${ANIMATIONS.length}] `) +
67 - theme.fg("text", anim.name) +
68 - theme.fg(
69 - "muted",
70 - ` (${anim.category}, ${anim.lines}L) — ${anim.description}`,
71 - ),
72 - );
73 - out.push("");
74 - out.push(
75 - theme.fg(
76 - "dim",
77 - " ←/→ switch • Enter/Space select • Esc/q quit",
78 - ),
79 - );
80 - out.push("");
81 - return out;
82 - },
83 - };
84 - });
85 -}

pi/agent/extensions/animations/theme-colors.ts

Deleted
deleted file mode 100644
1 -/**
2 - * Extract RGB values from the pi theme for use in animations.
3 - *
4 - * The theme object only exposes `theme.fg(token, text)` which returns
5 - * ANSI-wrapped strings. We extract RGB by calling theme.fg with known
6 - * text and parsing the resulting ANSI escape codes.
7 - */
9 -export interface ThemeColors {
10 - // Core UI
11 - accent: [number, number, number];
12 - success: [number, number, number];
13 - error: [number, number, number];
14 - warning: [number, number, number];
15 - muted: [number, number, number];
16 - dim: [number, number, number];
17 - text: [number, number, number];
18 - toolTitle: [number, number, number];
19 - border: [number, number, number];
20 - borderAccent: [number, number, number];
21 - borderMuted: [number, number, number];
22 - // Thinking levels — purple/blue gradient, great for thinking/working states
23 - thinkingLow: [number, number, number];
24 - thinkingMedium: [number, number, number];
25 - thinkingHigh: [number, number, number];
26 - thinkingXhigh: [number, number, number];
27 - // Syntax — distinctive, saturated, great for visual effects
28 - syntaxKeyword: [number, number, number]; // blue
29 - syntaxString: [number, number, number]; // salmon/orange
30 - syntaxType: [number, number, number]; // turquoise
31 - syntaxComment: [number, number, number]; // green
32 - syntaxVariable: [number, number, number]; // light blue
33 - // Markdown
34 - mdHeading: [number, number, number]; // warm gold
37 -type ThemeLike = { fg: (token: string, text: string) => string };
39 -function extractRgb(ansi: string): [number, number, number] {
40 - const m24 = ansi.match(/\x1b\[38;2;(\d+);(\d+);(\d+)m/);
41 - if (m24) return [+m24[1], +m24[2], +m24[3]];
43 - const m256 = ansi.match(/\x1b\[38;5;(\d+)m/);
44 - if (m256) {
45 - const idx = +m256[1];
46 - if (idx >= 16 && idx < 232) {
47 - const r = Math.floor((idx - 16) / 36);
48 - const g = Math.floor(((idx - 16) % 36) / 6);
49 - const b = (idx - 16) % 6;
50 - return [
51 - Math.round(r ? r * 40 + 55 : 0),
52 - Math.round(g ? g * 40 + 55 : 0),
53 - Math.round(b ? b * 40 + 55 : 0),
54 - ];
55 - }
56 - if (idx >= 232) {
57 - const gray = Math.round(8 + (idx - 232) * 10);
58 - return [gray, gray, gray];
59 - }
60 - }
62 - return [255, 255, 255];
65 -export function extractThemeColors(theme: ThemeLike): ThemeColors {
66 - const probe = "X";
67 - const fg = (token: string) => extractRgb(theme.fg(token, probe));
68 - return {
69 - accent: fg("accent"),
70 - success: fg("success"),
71 - error: fg("error"),
72 - warning: fg("warning"),
73 - muted: fg("muted"),
74 - dim: fg("dim"),
75 - text: fg("text"),
76 - toolTitle: fg("toolTitle"),
77 - border: fg("border"),
78 - borderAccent: fg("borderAccent"),
79 - borderMuted: fg("borderMuted"),
80 - thinkingLow: fg("thinkingLow"),
81 - thinkingMedium: fg("thinkingMedium"),
82 - thinkingHigh: fg("thinkingHigh"),
83 - thinkingXhigh: fg("thinkingXhigh"),
84 - syntaxKeyword: fg("syntaxKeyword"),
85 - syntaxString: fg("syntaxString"),
86 - syntaxType: fg("syntaxType"),
87 - syntaxComment: fg("syntaxComment"),
88 - syntaxVariable: fg("syntaxVariable"),
89 - mdHeading: fg("mdHeading"),
90 - };
93 -// ─── Readability helpers ────────────────────────────────────────
95 -/** Relative luminance from sRGB [0-255] */
96 -export function luminance(r: number, g: number, b: number): number {
97 - const s = [r, g, b].map((c) => {
98 - const f = c / 255;
99 - return f <= 0.03928 ? f / 12.92 : Math.pow((f + 0.055) / 1.055, 2.4);
100 - });
101 - return 0.2126 * s[0] + 0.7152 * s[1] + 0.0722 * s[2];
104 -/** Contrast ratio between two luminance values */
105 -export function contrastRatio(l1: number, l2: number): number {
106 - const lighter = Math.max(l1, l2);
107 - const darker = Math.min(l1, l2);
108 - return (lighter + 0.05) / (darker + 0.05);
111 -/** Approximate dark terminal background luminance */
112 -const BG_LUM = 0.046;
114 -/** Minimum contrast for WCAG AA large text */
115 -const MIN_CONTRAST = 3.0;
117 -/** Minimum luminance for readable foreground */
118 -const MIN_FG_LUM = MIN_CONTRAST * (BG_LUM + 0.05) - 0.05;
120 -/**
121 - * Scale an RGB color by brightness, clamping to minimum readability.
122 - * Preserves hue while boosting if needed.
123 - */
124 -export function readableScale(
125 - r: number,
126 - g: number,
127 - b: number,
128 - multiplier: number,
129 -): [number, number, number] {
130 - const sr = Math.round(r * multiplier);
131 - const sg = Math.round(g * multiplier);
132 - const sb = Math.round(b * multiplier);
133 - const lum = luminance(sr, sg, sb);
134 - if (lum < MIN_FG_LUM && lum > 0) {
135 - const boost = Math.sqrt(MIN_FG_LUM / lum);
136 - return [
137 - Math.min(255, Math.round(sr * boost)),
138 - Math.min(255, Math.round(sg * boost)),
139 - Math.min(255, Math.round(sb * boost)),
140 - ];
141 - }
142 - return [sr, sg, sb];

pi/agent/extensions/animations/types.ts

Deleted
deleted file mode 100644
1 -import type { ThemeColors } from "./theme-colors";
3 -export type AnimPhase = "thinking" | "working" | "tool";
5 -export type AnimationFn = (
6 - frame: number,
7 - width: number,
8 - phase?: AnimPhase,
9 - colors?: ThemeColors,
10 -) => string | string[];
12 -export type AnimCategory = "thinking" | "working" | "both";
14 -export interface AnimationDef {
15 - name: string;
16 - fn: AnimationFn;
17 - category: AnimCategory;
18 - description: string;
19 - lines: number;
20 -}
22 -export const PHASE_LABELS: Record<AnimPhase, string> = {
23 - thinking: "Thinking",
24 - working: "Working",
25 - tool: "Running",
26 -};

pi/agent/extensions/animations/utils.ts

Deleted
deleted file mode 100644
1 -export const rgb = (r: number, g: number, b: number) =>
2 - `\x1b[38;2;${r};${g};${b}m`;
3 -export const bold = "\x1b[1m";
4 -export const dim = "\x1b[2m";
5 -export const reset = "\x1b[0m";
6 -export const nobold = "\x1b[22m";
8 -// Pi gradient (nicobailon style): magenta → purple → cyan
9 -export const PI_GRAD = [
10 - [255, 0, 135],
11 - [175, 95, 175],
12 - [135, 95, 215],
13 - [95, 95, 255],
14 - [95, 175, 255],
15 - [0, 255, 255],
16 -];
18 -export function hsl(h: number, s = 1, l = 0.5): string {
19 - const c = (1 - Math.abs(2 * l - 1)) * s;
20 - const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
21 - const m = l - c / 2;
22 - let r = 0,
23 - g = 0,
24 - b = 0;
25 - if (h < 60) {
26 - r = c;
27 - g = x;
28 - } else if (h < 120) {
29 - r = x;
30 - g = c;
31 - } else if (h < 180) {
32 - g = c;
33 - b = x;
34 - } else if (h < 240) {
35 - g = x;
36 - b = c;
37 - } else if (h < 300) {
38 - r = x;
39 - b = c;
40 - } else {
41 - r = c;
42 - b = x;
43 - }
44 - return rgb(
45 - Math.round((r + m) * 255),
46 - Math.round((g + m) * 255),
47 - Math.round((b + m) * 255),
48 - );
49 -}
51 -export function lerpGrad(
52 - grad: number[][],
53 - t: number,
54 -): [number, number, number] {
55 - const i = Math.floor(t * (grad.length - 1));
56 - const i2 = Math.min(i + 1, grad.length - 1);
57 - const lt = (t * (grad.length - 1)) % 1;
58 - return [
59 - Math.round(grad[i][0] + (grad[i2][0] - grad[i][0]) * lt),
60 - Math.round(grad[i][1] + (grad[i2][1] - grad[i][1]) * lt),
61 - Math.round(grad[i][2] + (grad[i2][2] - grad[i][2]) * lt),
62 - ];
63 -}
65 -export const ellipsis = (f: number) =>
66 - [".", "..", "...", ""][Math.floor(f / 10) % 4];

pi/agent/extensions/process.json

Deleted
deleted file mode 100644
1 -{
2 - "interception": {
3 - "blockBackgroundCommands": true
4 - },
5 - "widget": {
6 - "showStatusWidget": true
7 - }
8 -}

pi/agent/extensions/tps.ts

Deleted
deleted file mode 100644
1 -import type { AssistantMessage } from "@mariozechner/pi-ai";
2 -import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
4 -function isAssistantMessage(message: unknown): message is AssistantMessage {
5 - if (!message || typeof message !== "object") return false;
6 - const role = (message as { role?: unknown }).role;
7 - return role === "assistant";
8 -}
10 -export default function (pi: ExtensionAPI) {
11 - let agentStartMs: number | null = null;
13 - pi.on("agent_start", () => {
14 - agentStartMs = Date.now();
15 - });
17 - pi.on("agent_end", (event, ctx) => {
18 - if (!ctx.hasUI) return;
19 - if (agentStartMs === null) return;
21 - const elapsedMs = Date.now() - agentStartMs;
22 - agentStartMs = null;
23 - if (elapsedMs <= 0) return;
25 - let input = 0;
26 - let output = 0;
27 - let cacheRead = 0;
28 - let cacheWrite = 0;
29 - let totalTokens = 0;
31 - for (const message of event.messages) {
32 - if (!isAssistantMessage(message)) continue;
33 - input += message.usage.input || 0;
34 - output += message.usage.output || 0;
35 - cacheRead += message.usage.cacheRead || 0;
36 - cacheWrite += message.usage.cacheWrite || 0;
37 - totalTokens += message.usage.totalTokens || 0;
38 - }
40 - if (output <= 0) return;
42 - const elapsedSeconds = elapsedMs / 1000;
43 - const tokensPerSecond = output / elapsedSeconds;
44 - const message = `TPS ${
45 - tokensPerSecond.toFixed(1)
46 - } tok/s. out ${output.toLocaleString()}, in ${input.toLocaleString()}, cache r/w ${cacheRead.toLocaleString()}/${cacheWrite.toLocaleString()}, total ${totalTokens.toLocaleString()}, ${
47 - elapsedSeconds.toFixed(1)
48 - }s`;
49 - ctx.ui.notify(message, "info");
50 - });
51 -}