dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Compare Notes Search Review guide pi(ext): remove animations and tps extensions
c3727038c6c79df49e30476ff15b5e26ef0330ad
Oliver Jan Krylow <oliver@bugabinga.net > · 6 May 2026
unsigned
Browse files Compare 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 ];
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 );
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 ;
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 ),
35 - line
+= rgb (
Math .
round (hr),
Math .
round (hg),
Math .
round (hb))
+ "◎" ;
37 - const [dr, dg, db]
= readableScale (dimR
* 3 , dimG
* 2 , dimB
* 3 ,
1.0 );
38 - line
+= rgb (dr, dg, db)
+ "·" ;
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)
+ "·" ;
46 - else { line
+= rgb (dimR, dimG, dimB)
+ " " ; }
49 - return line
+ reset;
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" },
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 ];
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 ),
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);
33 - const dimC
= colors?.dim
?? [
80 ,
80 ,
70 ];
34 - const [dimR, dimG, dimB]
= readableScale (
... dimC,
0.5 );
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
+= " " ;
44 - return rgb (r, g, b)
+ bold
+ p.icon
+ " " + p.
label + nobold
+ " " + sparks
+ reset;
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)
=> {
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 ];
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 ),
22 - const dimC
= colors?.dim
?? [
35 ,
35 ,
45 ];
23 - const [dimR, dimG, dimB]
= readableScale (
... dimC,
0.7 );
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)
+ "─" ; }
35 - return line
+ reset;
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
++ ) {
12 - a
= t
* Math .
PI * 2 ;
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 ),
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 ];
27 - for (
let i
= 0 ; i
< sw; i
++ ) {
28 - const ci
= (i
+ (init
? f
: 0 ))
% scrambleRamp.
length ,
29 - [r, g, b]
= scrambleRamp[ci];
32 - (
! init
&& f
< scrambleBirths[i
% scrambleBirths.
length ]
34 - : scrambleChars[
Math .
floor (
Math .
random ()
* scrambleChars.
length )]);
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;
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)
=> {
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 ;
19 - ? ease (cf
/ sweepFrames)
20 - : 1 - ease ((cf
- sweepFrames)
/ sweepFrames);
21 - const center
= t
* (W
- 1 );
23 - const goingRight
= cf
< sweepFrames;
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);
33 - const tailSpread
= 12 ;
34 - const leadSpread
= 5 ;
37 - const bgDim
= colors?.dim
?? [
18 ,
6 ,
6 ];
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;
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);
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)
+ "╌" ;
63 - line
+= rgb (bgDim[
0 ], bgDim[
1 ], bgDim[
2 ])
+ "╌" ;
67 - return line
+ reset;
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)
=> {
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 ];
15 - const glyphs
= [
"◉" ,
"●" ,
"○" ,
"◎" ];
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 ),
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;
37 - const [dr, dg, db]
= readableScale (r, g, b, bright
* 0.35 );
38 - line
+= rgb (dr, dg, db)
+ "·" ;
41 - return line
+ reset;
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" ;
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 ];
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 ),
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 ];
38 - const [activeR, activeG, activeB]
= readableScale (accent[
0 ], accent[
1 ], accent[
2 ],
1.6 );
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);
49 - ? bold
+ rgb (activeR, activeG, activeB)
+ "━" 51 - ? rgb (borderC[
0 ], borderC[
1 ], borderC[
2 ])
+ "─" 52 - : rgb (dimC[
0 ], dimC[
1 ], dimC[
2 ])
+ "·" ;
56 - return line
+ reset;
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)
=> {
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 ];
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);
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)
+ "·" );
30 - buf.
push (
rgb (dimC[
0 ], dimC[
1 ], dimC[
2 ])
+ " " );
33 - return buf.
join (
"" )
+ reset;
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 []
= [];
10 - const fire : AnimationFn = (f, w, _phase, colors)
=> {
12 - if (W
!== fireLastW) {
13 - fireBuf
= Array .
from ({ length:
4 }, ()
=> new Float64Array (W));
17 - const error
= colors?.syntaxString
?? [
220 ,
0 ,
0 ];
18 - const warning
= colors?.mdHeading
?? [
220 ,
180 ,
50 ];
20 - const firePalette
= [
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 ),
30 - for (
let x
= 0 ; x
< W; x
++ ) {
31 - fireBuf[
3 ][x]
= Math .
random ()
> 0.35 ? 1 : Math .
random ()
* 0.5 ;
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 ;
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];
46 - return line
+ reset;
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 ];
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),
29 - const mainColor
= rgb (accentR, accentG, accentB);
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;
41 - const jitter
= Math .
random ()
< 0.1 ? " " .
repeat (
Math .
floor (
Math .
random ()
* 3 ))
: "" ;
42 - return jitter
+ line
+ reset;
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 );
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
: "" ;
16 - const error
= colors?.thinkingXhigh
?? [
220 ,
50 ,
140 ];
17 - const [r, g, b]
= readableScale (
19 - error[
1 ]
+ intensity
* 25 ,
20 - error[
2 ]
- intensity
* 15 ,
24 - return spaces
+ pulse
+ rgb (r, g, b)
+ heart
+ " " + heart
+ " " + heart
+ nobold
+ spaces
+ reset;
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)
=> {
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 ];
13 - const colors_arr
= [
14 - readableScale (
... success,
1.1 ),
15 - readableScale (
... accent,
1.1 ),
16 - readableScale (
... toolTitle,
1.1 ),
19 - const seed
= Math .
floor (f
* 0.1 );
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 ;
29 - const [br, bg, bb]
= readableScale (r, g, b,
1.2 );
30 - line
+= bold
+ rgb (br, bg, bb)
+ byte1
+ byte2
+ nobold;
33 - const [dr, dg, db]
= readableScale (r, g, b,
0.5 );
34 - line
+= rgb (dr, dg, db)
+ byte1
+ byte2;
36 - if (i
+ 2 < W) line
+= " " ;
38 - return line
+ reset;
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 );
11 - const textC
= colors?.
text ?? [
200 ,
200 ,
220 ];
12 - const [textR, textG, textB]
= readableScale (textC[
0 ], textC[
1 ], textC[
2 ],
1.2 );
14 - const accent
= colors?.thinkingHigh
?? [
220 ,
180 ,
80 ];
15 - const success
= colors?.thinkingXhigh
?? [
80 ,
180 ,
220 ];
16 - const warning
= colors?.mdHeading
?? [
220 ,
80 ,
180 ];
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 ),
27 - const dimC
= colors?.dim
?? [
30 ,
20 ,
40 ];
28 - const [dimR, dimG, dimB]
= readableScale (dimC[
0 ], dimC[
1 ], dimC[
2 ],
1.0 );
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 ;
35 - line
+= bold
+ rgb (textR, textG, textB)
+ "│" + nobold;
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)
+ "✦" ;
46 - line
+= rgb (dimR, dimG, dimB)
+ " " ;
49 - return line
+ reset;
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" ;
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 ];
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 ),
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),
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 ];
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;
54 - return rgb (r, g, b)
+ display
+ " " + trail
+ reset;
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" ;
9 - const kittScanner : AnimationFn = (f, w, _phase, colors)
=> {
13 - const red
= colors?.error
?? [
200 ,
50 ,
50 ];
16 - const bgDim
= colors?.dim
?? [
18 ,
6 ,
6 ];
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 {
26 - return 2 * t
* t
* t
* t;
28 - return 1 - Math .
pow (
- 2 * t
+ 2 ,
4 )
/ 2 ;
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);
40 - t
= cf
< sweepFrames
+ dwellFrames
/ 2 ? 1 : 0 ;
43 - const center
= t
* (W
- 1 );
44 - const dwellPulse
= isDwelling
? Math .
sin (f
* 0.15 )
* 0.15 + 0.85 : 1.0 ;
47 - const tailSpread
= 14 ;
48 - const leadSpread
= 4 ;
51 - for (
let x
= 0 ; x
< W; x
++ ) {
52 - const dist
= Math .
abs (x
- center);
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;
64 - const [cr, cg, cb]
= readableScale (red[
0 ], red[
1 ], red[
2 ], brightness
* 0.8 );
65 - line
+= rgb (cr, cg, cb)
+ "─" ;
68 - return line
+ reset;
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)
=> {
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 ];
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 );
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)
+ " " ; }
33 - return line
+ reset;
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 ];
16 - const colors_arr
= [
17 - readableScale (
... accent,
1.2 ),
18 - readableScale (
... borderAccent,
1.2 ),
19 - readableScale (
... toolTitle,
1.2 ),
20 - readableScale (
... warning,
1.2 ),
23 - const dimC
= colors?.dim
?? [
20 ,
10 ,
30 ];
24 - const [dimR, dimG, dimB]
= readableScale (
... dimC,
0.8 );
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)
+ "·" ; }
42 - return line
+ reset;
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 }[]
= [];
8 - const matrixChars
= "ハミヒーウシナモニサワツオリ012789Z" ;
10 - const matrixRain : AnimationFn = (f, w, _phase, colors)
=> {
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 ,
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 ));
34 - buf[pos]
= bright
+ bold
+ matrixChars[
Math .
floor (
Math .
random ()
* matrixChars.
length )]
+ nobold;
36 - if (pos
- 1 >= 0 && pos
- 1 < W
&& buf[pos
- 1 ]
=== " " ) {
37 - buf[pos
- 1 ]
= mid
+ matrixChars[
Math .
floor (
Math .
random ()
* matrixChars.
length )];
39 - if (pos
- 2 >= 0 && pos
- 2 < W
&& buf[pos
- 2 ]
=== " " ) {
40 - buf[pos
- 2 ]
= dark
+ matrixChars[
Math .
floor (
Math .
random ()
* matrixChars.
length )];
43 - return buf.
join (
"" )
+ reset;
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 [] }[]
= [];
8 - const trailGlyphs
= [
"█" ,
"▓" ,
"▒" ,
"░" ,
"·" ];
10 - const neonBounce : AnimationFn = (f, w, _phase, colors)
=> {
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);
18 - const [sr, sg, sb]
= readableScale (r, g, b,
1.0 );
19 - bounceTrail.
push ({ pos, age:
0 , color: [sr, sg, sb] });
21 - const buf
: string []
= [];
22 - for (
let i
= 0 ; i
< W; i
++ ) buf.
push (
" " );
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 )];
33 - const [br, bg, bb]
= readableScale (sr, sg, sb,
1.3 );
34 - buf[pos]
= bold
+ rgb (br, bg, bb)
+ "█" + nobold;
36 - while (bounceTrail.
length > 0 && bounceTrail[
0 ].age
> 5 ) bounceTrail.
shift ();
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;
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 ];
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);
18 - const [dr, dg, db]
= readableScale (
... dimC,
0.6 );
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 ? "●" : "○" );
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))
+ "──" ;
32 - return line
+ reset;
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)
=> {
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 );
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 );
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);
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;
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)
=> {
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 ),
19 - const dimC
= colors?.dim
?? [
20 ,
20 ,
30 ];
20 - const [dr, dg, db]
= readableScale (
... dimC,
0.8 );
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];
30 - const [br, bg, bb]
= readableScale (r, g, b,
1.2 );
31 - line
+= bold
+ rgb (br, bg, bb)
+ glyphs[ci
% glyphs.
length ]
+ nobold;
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)
+ "·" ;
37 - else { line
+= rgb (dr, dg, db)
+ "-" ; }
39 - return line
+ reset;
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)
=> {
10 - const warning
= colors?.warning
?? [
255 ,
180 ,
50 ];
11 - const [warningR, warningG, warningB]
= readableScale (warning[
0 ], warning[
1 ], warning[
2 ],
1.1 );
13 - const error
= colors?.error
?? [
220 ,
70 ,
70 ];
14 - const [errorR, errorG, errorB]
= readableScale (error[
0 ], error[
1 ], error[
2 ],
1.1 );
16 - const mutedC
= colors?.muted
?? [
180 ,
140 ,
80 ];
17 - const [mutedR, mutedG, mutedB]
= readableScale (mutedC[
0 ], mutedC[
1 ], mutedC[
2 ],
0.8 );
19 - const dimC
= colors?.dim
?? [
50 ,
50 ,
50 ];
22 - const accent
= colors?.accent
?? warning;
23 - const [accentR, accentG, accentB]
= readableScale (accent[
0 ], accent[
1 ], accent[
2 ],
1.3 );
26 - rgb (warningR, warningG, warningB)
+ "ᗧ" ,
27 - rgb (warningR, warningG, warningB)
+ "●" 29 - const ghost
= rgb (errorR, errorG, errorB)
+ "ᗣ" ;
30 - const dot
= rgb (mutedR, mutedG, mutedB)
+ "·" ;
31 - const power
= bold
+ rgb (accentR, accentG, accentB)
+ "●" + nobold;
33 - const pp
= f
% (W
+ 8 ), gp
= (f
- 4 + W
+ 8 )
% (W
+ 8 );
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;
41 - return line
+ reset;
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 );
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];
20 - return bold
+ line
+ nobold
+ reset;
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" ;
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);
18 - [r, g, b]
= readableScale (r, g, b,
1.1 );
20 - const br
= 0.6 + breath
* 0.4 ;
21 - const trailChars
= "·∘○◎●" ;
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 ),
33 - trail
+= rgb (tr, tg, tb)
+ trailChars[ti];
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;
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 ];
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 );
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) },
28 - total
= icons.
length * (pw
+ 1 )
+ 1 ,
29 - pp
= (f
* 0.4 )
% total;
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;
39 - Math .
abs (pp
- pos)
< 1.5 40 - ? bold
+ rgb (activeR, activeG, activeB)
+ "═" 43 - : rgb (mutedColor[
0 ], mutedColor[
1 ], mutedColor[
2 ])
+ "─" ;
47 - return line
+ reset;
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" ;
7 - const plasmaWave : AnimationFn = (f, w, _phase, colors)
=> {
8 - const chars
= " ·∘○◎●◉█" ;
10 - const accent
= colors?.thinkingLow
?? [
0 ,
150 ,
220 ];
11 - const success
= colors?.thinkingXhigh
?? [
0 ,
220 ,
100 ];
12 - const warning
= colors?.mdHeading
?? [
220 ,
180 ,
50 ];
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 );
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 ;
24 - let r
: number , g
: number , b
: number ;
27 - r
= Math .
round (accentR
+ (successR
- accentR)
* t);
28 - g
= Math .
round (accentG
+ (successG
- accentG)
* t);
29 - b
= Math .
round (accentB
+ (successB
- accentB)
* t);
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);
36 - line
+= rgb (r, g, b)
+ chars[
Math .
floor (n
* (chars.
length - 1 ))];
38 - return line
+ reset;
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 );
10 - const success
= colors?.syntaxType
?? [
50 ,
220 ,
100 ];
11 - const [sr, sg, sb]
= readableScale (
... success,
1.2 );
13 - const dimC
= colors?.dim
?? [
0 ,
25 ,
15 ];
14 - const [dr, dg, db]
= readableScale (
... dimC,
1.0 );
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;
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)
+ "│" ;
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)
+ "○" ;
34 - else if (dist
< radius) {
35 - line
+= rgb (dr, dg, db)
+ "·" ;
37 - else { line
+= " " ; }
39 - return line
+ reset;
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)
=> {
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 ];
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 ),
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;
36 - return line
+ reset;
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" ]
+ "..." ;
10 - const base
= colors?.
text ?? [
150 ,
150 ,
150 ];
11 - const pad
= Math .
max (
0 ,
Math .
floor ((w
- text.
length )
/ 2 ));
14 - const [baseR, baseG, baseB]
= readableScale (base[
0 ], base[
1 ], base[
2 ],
0.9 );
17 - const accent
= colors?.accent
?? base;
18 - const [dimR, dimG, dimB]
= readableScale (accent[
0 ], accent[
1 ], accent[
2 ],
0.2 );
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 ) {
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 )];
31 - const [r, g, b]
= readableScale (
32 - baseR
+ (gc[
0 ]
- baseR)
* intensity,
33 - baseG
+ (gc[
1 ]
- baseG)
* intensity,
34 - baseB
+ (gc[
2 ]
- baseB)
* intensity,
37 - line
+= bold
+ rgb (r, g, b)
+ text[ti]
+ nobold;
39 - line
+= rgb (baseR, baseG, baseB)
+ text[ti];
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)
+ "·" ;
51 - line
+= rgb (dimR, dimG, dimB)
+ " " ;
55 - return line
+ reset;
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 ];
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 ),
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];
33 - const [br, bg, bb]
= readableScale (r, g, b,
1.2 );
34 - line
+= bold
+ rgb (br, bg, bb)
+ stars[si]
+ nobold;
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 ];
41 - const [dr, dg, db]
= readableScale (r, g, b,
0.25 );
42 - line
+= rgb (dr, dg, db)
+ "·" ;
45 - return line
+ reset;
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)
=> {
8 - const stars
= [
"✦" ,
"★" ,
"✧" ,
"⁕" ,
"✦" ];
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 ];
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 ),
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 ;
32 - const [dimR, dimG, dimB]
= readableScale (accent[
0 ], accent[
1 ], accent[
2 ],
0.15 );
35 - for (
let i
= 0 ; i
< W; i
++ ) {
36 - const dist
= Math .
abs (i
- center);
38 - const [r, g, b]
= colors_arr[
0 ];
39 - line
+= bold
+ rgb (r, g, b)
+ "✦" + nobold;
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 ];
46 - line
+= rgb (dimR, dimG, dimB)
+ "·" ;
49 - return line
+ reset;
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 []
= [];
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 );
18 - const [r, g, b]
= readableScale (baseColor[
0 ], baseColor[
1 ], baseColor[
2 ],
0.4 + layer
* 0.2 );
20 - x:
Math .
random ()
* W,
23 - ch: starChars[
Math .
min (layer, starChars.
length - 1 )],
30 - const starfield : AnimationFn = (f, w, _phase, colors)
=> {
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)
+ " " );
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 ;
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 )];
56 - return buf.
join (
"" )
+ reset;
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" ;
7 - const synthWave : AnimationFn = (f, w, _phase, colors)
=> {
9 - const chars
= " ▁▂▃▄▅▆▇█" ;
10 - const accent
= colors?.thinkingMedium
?? [
120 ,
150 ,
220 ];
13 - const max
= Math .
max (
... accent);
14 - const min
= Math .
min (
... accent);
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 ;
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 ;
33 - const sat
= 0.7 + n
* 0.3 ;
34 - const lum
= 0.35 + n
* 0.45 ;
35 - line
+= hsl (hue, sat, lum)
+ chars[ci];
37 - return line
+ reset;
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..." ,
15 - const cursorChars
= [
"✦" ,
"✧" ,
"⚡" ,
"★" ,
"·" ];
16 - let vibeIdx
= 0 , vibeCharIdx
= 0 , vibeHold
= 0 ;
18 - const vibeTypewriter : AnimationFn = (f, _w, _phase, colors)
=> {
19 - const vibe
= vibeMessages[vibeIdx];
22 - if (vibeHold
=== 0 ) {
23 - vibeIdx
= (vibeIdx
+ 1 )
% vibeMessages.
length ;
27 - else if (vibeCharIdx
< vibe.
length ) vibeCharIdx
++ ;
30 - const shown
= vibe.
slice (
0 , vibeCharIdx);
33 - const textC
= colors?.
text ?? [
160 ,
160 ,
180 ];
34 - const [textR, textG, textB]
= readableScale (textC[
0 ], textC[
1 ], textC[
2 ],
1.0 );
36 - const accent
= colors?.thinkingHigh
?? [
220 ,
180 ,
80 ];
37 - const success
= colors?.thinkingXhigh
?? [
80 ,
180 ,
220 ];
38 - const warning
= colors?.mdHeading
?? [
220 ,
80 ,
180 ];
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 ),
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
52 - return rgb (textR, textG, textB)
+ shown
+ cursor
+ reset;
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 7 - import { getSettings, updateSettings }
from "../../lib/settings" ;
9 - export interface AnimConfig {
10 - workingAnim
?: string ;
11 - thinkingAnim
?: string ;
13 - width
?: "full" | "default" | number ;
14 - randomMode
?: boolean ;
19 - interface AnimSettings {
23 - width
?: "full" | "default" | number ;
29 - function toAnimConfig (s
: AnimSettings )
: AnimConfig {
31 - workingAnim: s.working,
32 - thinkingAnim: s.thinking,
35 - randomMode: s.random,
41 - function fromAnimConfig (c
: AnimConfig )
: AnimSettings {
43 - working: c.workingAnim,
44 - thinking: c.thinkingAnim,
47 - random: c.randomMode,
53 - export function loadConfig ()
: AnimConfig {
54 - return toAnimConfig (
getSettings <
AnimSettings >(
"animations" ));
57 - export function saveConfig (config
: AnimConfig )
: void {
58 - updateSettings <
AnimSettings >(
"animations" ,
fromAnimConfig (config));
61 - export function resolveWidth (
62 - w
: "full" | "default" | number | undefined ,
64 - if (w
=== "full" || w
=== undefined ) {
65 - return (
process .
stdout .columns
|| 80 )
- 4 ;
67 - if (w
=== "default" )
return 50 ;
68 - return Math .
max (
10 ,
Math .
min (w, (
process .
stdout .columns
|| 80 )
- 4 ));
71 - export function resolveInterval (fps
: number )
: number {
72 - return Math .
round (
1000 / fps);
pi/agent/extensions/animations/index.ts Deleted deleted file mode 100644 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" ;
26 - const STATE_KEY
= Symbol .
for (
"pi.ext.animatedThinking.state" );
29 - interface AnimState {
30 - workingAnim
: string ;
31 - thinkingAnim
: string ;
33 - width
: "full" | "default" | number ;
34 - randomMode
: boolean ;
36 - workingStartTime
: number ;
37 - workingTimer
: ReturnType <
typeof setInterval>
| null ;
38 - theme
?: ExtensionContext [
"ui" ][
"theme" ];
39 - themeColors
?: ThemeColors ;
41 - isThinking
: boolean ;
42 - isToolRunning
: boolean ;
43 - currentWorkingCtx
: ExtensionContext | null ;
46 - function getState ()
: AnimState {
47 - return (globalThis
as any )[STATE_KEY];
51 - function renderFrame (
56 - colors
?: ThemeColors ,
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 {
66 - const animCat
= cat
=== "tool" ? "working" : cat;
67 - const anims
= getAnimationsForCategory (animCat);
68 - return anims[
Math .
floor (
Math .
random ()
* anims.
length )].
name ;
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 ,
94 - isToolRunning:
false ,
95 - currentWorkingCtx:
null ,
97 - (globalThis
as any )[STATE_KEY]
= state;
99 - function persistConfig () {
101 - workingAnim: state.workingAnim,
102 - thinkingAnim: state.thinkingAnim,
103 - toolAnim: state.toolAnim,
104 - width: state.
width ,
105 - randomMode: state.randomMode,
106 - enabled: state.enabled,
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" )
120 - const randomThinkingName
= state.randomMode
121 - ? pickRandom (
"thinking" )
123 - const randomToolName
= state.randomMode
124 - ? pickRandom (
"working" )
126 - state.workingTimer
= setInterval (()
=> {
127 - const frame
= Math .
floor (
128 - (
performance .
now ()
- state.workingStartTime)
/ 1000 * 60 ,
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;
139 - animName
= randomWorkingName
|| state.workingAnim;
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));
148 - function stopWorkingAnimation (ctx
?: ExtensionContext ) {
149 - if (state.workingTimer) {
150 - clearInterval (state.workingTimer);
151 - state.workingTimer
= null ;
153 - state.currentWorkingCtx
= null ;
158 - pi.
on (
"session_start" ,
async (_e, ctx)
=> {
159 - state.theme
= ctx.ui.theme;
160 - state.themeColors
= extractThemeColors (ctx.ui.theme);
163 - pi.
on (
"agent_start" ,
async (_e, ctx)
=> {
164 - startWorkingAnimation (ctx);
167 - pi.
on (
"agent_end" ,
async (_e, ctx)
=> {
168 - state.isThinking
= false ;
169 - state.isToolRunning
= false ;
170 - stopWorkingAnimation (ctx);
173 - ctx.ui.
setWorkingMessage (
"" );
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 ;
184 - if (se.
type === "thinking_end" ) {
185 - state.isThinking
= false ;
187 - if (se.
type === "text_delta" ) {
188 - state.isThinking
= false ;
192 - pi.
on (
"message_end" ,
async ()
=> {
193 - state.isThinking
= false ;
196 - pi.
on (
"tool_execution_start" ,
async ()
=> {
197 - state.isToolRunning
= true ;
200 - pi.
on (
"tool_execution_end" ,
async ()
=> {
201 - state.isToolRunning
= false ;
204 - pi.
on (
"session_switch" ,
async (_e, ctx)
=> {
205 - stopWorkingAnimation (ctx);
206 - ctx.ui.
setWorkingMessage ();
209 - pi.
on (
"session_shutdown" ,
async ()
=> {
210 - stopWorkingAnimation ();
214 - pi.
registerCommand (
"animation" , {
216 - "Animated indicators: showcase, set <name>, width, on/off" ,
217 - getArgumentCompletions : (prefix)
=> {
222 - description:
"Browse all animations interactively" ,
224 - { value:
"on" , label:
"on" , description:
"Enable animations" },
225 - { value:
"off" , label:
"off" , description:
"Disable animations" },
229 - description:
"Random animation each time" ,
232 - value:
"width full" ,
233 - label:
"width full" ,
234 - description:
"Full terminal width" ,
237 - value:
"width default" ,
238 - label:
"width default" ,
239 - description:
"50 columns" ,
244 - description:
"60 FPS" ,
249 - description:
"120 FPS" ,
254 - description:
"144 FPS (default)" ,
259 - description:
"240 FPS" ,
261 - ... ANIMATIONS.
map ((a)
=> ({
264 - description:
`[${a.category}, ${a.lines}L] ${a. description }` ,
266 - ... ANIMATIONS.
map ((a)
=> ({
267 - value:
`working:${a. name }` ,
268 - label:
`working:${a. name }` ,
269 - description:
`Working → ${a. description }` ,
271 - ... ANIMATIONS.
map ((a)
=> ({
272 - value:
`thinking:${a. name }` ,
273 - label:
`thinking:${a. name }` ,
274 - description:
`Thinking → ${a. description }` ,
276 - ... ANIMATIONS.
map ((a)
=> ({
277 - value:
`tool:${a. name }` ,
278 - label:
`tool:${a. name }` ,
279 - description:
`Tool → ${a. description }` ,
282 - if (
! prefix)
return items;
283 - return items.
filter ((i)
=> i.
value .
startsWith (prefix));
285 - handler :
async (args, ctx)
=> {
286 - const arg
= args.
trim ().
toLowerCase ();
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 (
295 - ` ${a. name . padEnd (20)} [${a.category. padEnd (8)} ${a.lines}L] ${a. description }` ,
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` ,
305 - if (arg
=== "showcase" ) {
306 - const selected
= await runShowcase (ctx, {
308 - width: state.
width ,
311 - state.enabled
= true ;
312 - state.randomMode
= false ;
313 - state.workingAnim
= selected;
314 - state.thinkingAnim
= selected;
315 - state.toolAnim
= selected;
318 - `Animation set to: ${selected} (all states)` ,
326 - if (arg
=== "off" ) {
327 - state.enabled
= false ;
328 - stopWorkingAnimation ();
329 - ctx.ui.
setWorkingMessage ();
331 - ctx.ui.
notify (
"Animations disabled" ,
"info" );
334 - if (arg
=== "on" ) {
335 - state.enabled
= true ;
336 - state.randomMode
= false ;
338 - ctx.ui.
notify (
"Animations enabled" ,
"info" );
341 - if (arg
=== "random" ) {
342 - state.enabled
= true ;
343 - state.randomMode
= true ;
345 - ctx.ui.
notify (
"Random mode enabled" ,
"info" );
350 - if (arg.
startsWith (
"width" )) {
351 - const val
= arg.
slice (
5 ).
trim ();
353 - ctx.ui.
notify (
`Width: ${state. width }` ,
"info" );
356 - if (val
=== "full" ) {
357 - state.
width = "full" ;
358 - }
else if (val
=== "default" ) {
359 - state.
width = "default" ;
361 - const n
= parseInt (val,
10 );
362 - if (
isNaN (n)
|| n
< 10 ) {
363 - ctx.ui.
notify (
"Width: full | default | number >= 10" ,
"error" );
369 - ctx.ui.
notify (
`Width set to: ${state. width }` ,
"info" );
374 - if (arg.
startsWith (
"fps" )) {
375 - const val
= arg.
slice (
3 ).
trim ();
377 - ctx.ui.
notify (
`FPS: ${state.fps}` ,
"info" );
380 - const n
= parseInt (val,
10 );
381 - if (
isNaN (n)
|| n
< 1 || n
> 500 ) {
382 - ctx.ui.
notify (
"FPS: number between 1-500" ,
"error" );
387 - ctx.ui.
notify (
`FPS set to: ${state.fps}` ,
"info" );
392 - let target
: "all" | "working" | "thinking" | "tool" = "all" ;
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:" )) {
402 - name
= arg.
slice (
5 );
405 - const anim
= getAnimation (name);
408 - `Unknown: "${name}". Try /animation showcase` ,
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;
421 - const msg
= target
=== "all" ? `All → ${name}` : `${target} → ${name}` ;
422 - ctx.ui.
notify (msg,
"info" );
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 []
= [
76 - export function getAnimation (name
: string )
: AnimationDef | undefined {
77 - return ANIMATIONS.
find ((a)
=> a.
name === name);
80 - export function getAnimationsForCategory (
83 - return ANIMATIONS.
filter ((a)
=> a.category
=== cat
|| a.category
=== "both" );
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 {
9 - width
: "full" | "default" | number ;
12 - export async function runShowcase (
13 - ctx
: ExtensionContext ,
15 - )
: Promise <
string | null > {
16 - return ctx.ui.
custom ((tui, theme, _keybindings, done)
=> {
18 - const startTime
= performance .
now ();
19 - const colors
= extractThemeColors (theme);
21 - const timer
= setInterval (()
=> {
22 - tui.
requestRender ();
23 - },
1000 / opts.fps);
28 - clearInterval (timer);
30 - handleInput (data
: string ) {
31 - if (
matchesKey (data,
"escape" )
|| data
=== "q" ) {
32 - clearInterval (timer);
35 - matchesKey (data,
"right" )
|| 39 - idx
= (idx
+ 1 )
% ANIMATIONS.
length ;
41 - matchesKey (data,
"left" )
|| 45 - idx
= (idx
- 1 + ANIMATIONS.
length )
% ANIMATIONS.
length ;
46 - }
else if (
matchesKey (data,
"enter" )
|| data
=== " " ) {
47 - clearInterval (timer);
48 - done (ANIMATIONS[idx].
name );
51 - render (width
: number )
: string [] {
52 - const frame
= Math .
floor (
53 - (
performance .
now ()
- startTime)
/ 1000 * 60 ,
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 []
= [];
61 - out.
push (theme.
fg (
"accent" ,
" ▶ Animation Showcase" ));
63 - for (
const line
of rendered) out.
push (
` ${line}` );
66 - theme.
fg (
"muted" ,
` [${idx + 1}/${ANIMATIONS. length }] ` )
+ 67 - theme.
fg (
"text" , anim.
name )
+ 70 - ` (${anim.category}, ${anim.lines}L) — ${anim. description }` ,
77 - " ←/→ switch • Enter/Space select • Esc/q quit" ,
pi/agent/extensions/animations/theme-colors.ts Deleted deleted file mode 100644 9 - export interface ThemeColors {
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 ];
23 - thinkingLow
: [
number ,
number ,
number ];
24 - thinkingMedium
: [
number ,
number ,
number ];
25 - thinkingHigh
: [
number ,
number ,
number ];
26 - thinkingXhigh
: [
number ,
number ,
number ];
28 - syntaxKeyword
: [
number ,
number ,
number ];
29 - syntaxString
: [
number ,
number ,
number ];
30 - syntaxType
: [
number ,
number ,
number ];
31 - syntaxComment
: [
number ,
number ,
number ];
32 - syntaxVariable
: [
number ,
number ,
number ];
34 - mdHeading
: [
number ,
number ,
number ];
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/ );
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 ;
51 - Math .
round (r
? r
* 40 + 55 : 0 ),
52 - Math .
round (g
? g
* 40 + 55 : 0 ),
53 - Math .
round (b
? b
* 40 + 55 : 0 ),
57 - const gray
= Math .
round (
8 + (idx
- 232 )
* 10 );
58 - return [gray, gray, gray];
62 - return [
255 ,
255 ,
255 ];
65 - export function extractThemeColors (theme
: ThemeLike )
: ThemeColors {
67 - const fg = (token
: string )
=> extractRgb (theme.
fg (token, probe));
69 - accent:
fg (
"accent" ),
70 - success:
fg (
"success" ),
72 - warning:
fg (
"warning" ),
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" ),
96 - export function luminance (r
: number , g
: number , b
: number )
: number {
97 - const s
= [r, g, b].
map ((c)
=> {
99 - return f
<= 0.03928 ? f
/ 12.92 : Math .
pow ((f
+ 0.055 )
/ 1.055 ,
2.4 );
101 - return 0.2126 * s[
0 ]
+ 0.7152 * s[
1 ]
+ 0.0722 * s[
2 ];
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 );
112 - const BG_LUM
= 0.046 ;
115 - const MIN_CONTRAST
= 3.0 ;
118 - const MIN_FG_LUM
= MIN_CONTRAST
* (BG_LUM
+ 0.05 )
- 0.05 ;
124 - export function readableScale (
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);
137 - Math .
min (
255 ,
Math .
round (sr
* boost)),
138 - Math .
min (
255 ,
Math .
round (sg
* boost)),
139 - Math .
min (
255 ,
Math .
round (sb
* boost)),
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 = (
9 - colors
?: ThemeColors ,
10 - )
=> string | string [];
12 - export type AnimCategory = "thinking" | "working" | "both" ;
14 - export interface AnimationDef {
17 - category
: AnimCategory ;
18 - description
: string ;
22 - export const PHASE_LABELS
: Record <
AnimPhase ,
string >
= {
23 - thinking:
"Thinking" ,
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" ;
9 - export const PI_GRAD
= [
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 ;
28 - }
else if (h
< 120 ) {
31 - }
else if (h
< 180 ) {
34 - }
else if (h
< 240 ) {
37 - }
else if (h
< 300 ) {
45 - Math .
round ((r
+ m)
* 255 ),
46 - Math .
round ((g
+ m)
* 255 ),
47 - Math .
round ((b
+ m)
* 255 ),
51 - export function lerpGrad (
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 ;
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),
65 - export const ellipsis = (f
: number )
=> 66 - [
"." ,
".." ,
"..." ,
"" ][
Math .
floor (f
/ 10 )
% 4 ];
pi/agent/extensions/process.json Deleted deleted file mode 1006443 - "blockBackgroundCommands" :
true 6 - "showStatusWidget" :
true 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" ;
10 - export default function (pi
: ExtensionAPI ) {
11 - let agentStartMs
: number | null = null ;
13 - pi.
on (
"agent_start" , ()
=> {
14 - agentStartMs
= Date .
now ();
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 ;
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 ;
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) 49 - ctx.ui.
notify (message,
"info" );