@duckmind/dm-darwin-x64 0.35.3 → 0.35.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dm +0 -0
  2. package/extensions/.dm-extensions.json +1 -27
  3. package/package.json +1 -1
  4. package/extensions/dm-alps/LICENSE +0 -21
  5. package/extensions/dm-alps/README.md +0 -22
  6. package/extensions/dm-alps/index.ts +0 -172
  7. package/extensions/dm-alps/package.json +0 -49
  8. package/extensions/dm-alps/src/commands.ts +0 -208
  9. package/extensions/dm-alps/src/features/animations/debug.ts +0 -160
  10. package/extensions/dm-alps/src/features/animations/index.ts +0 -33
  11. package/extensions/dm-alps/src/features/animations/patch.ts +0 -112
  12. package/extensions/dm-alps/src/features/animations/preview.ts +0 -117
  13. package/extensions/dm-alps/src/features/animations/registry.ts +0 -593
  14. package/extensions/dm-alps/src/features/animations/runtime.ts +0 -563
  15. package/extensions/dm-alps/src/features/animations/settings.ts +0 -69
  16. package/extensions/dm-alps/src/features/bottom-input/cluster.ts +0 -2
  17. package/extensions/dm-alps/src/features/bottom-input/compositor.ts +0 -2
  18. package/extensions/dm-alps/src/features/bottom-input/editor.ts +0 -148
  19. package/extensions/dm-alps/src/features/bottom-input/frame.ts +0 -224
  20. package/extensions/dm-alps/src/features/bottom-input/icons.ts +0 -36
  21. package/extensions/dm-alps/src/features/bottom-input/index.ts +0 -8
  22. package/extensions/dm-alps/src/features/bottom-input/runtime.ts +0 -1197
  23. package/extensions/dm-alps/src/features/bottom-input/shortcuts.ts +0 -286
  24. package/extensions/dm-alps/src/features/bottom-input/status.ts +0 -663
  25. package/extensions/dm-alps/src/features/bottom-status/index.ts +0 -2
  26. package/extensions/dm-alps/src/features/chrome-frame/chrome.ts +0 -222
  27. package/extensions/dm-alps/src/features/chrome-frame/debug.ts +0 -212
  28. package/extensions/dm-alps/src/features/chrome-frame/image.ts +0 -11
  29. package/extensions/dm-alps/src/features/chrome-frame/index.ts +0 -4
  30. package/extensions/dm-alps/src/features/chrome-frame/osc.ts +0 -111
  31. package/extensions/dm-alps/src/features/chrome-frame/patch.ts +0 -769
  32. package/extensions/dm-alps/src/features/chrome-frame/preview.ts +0 -67
  33. package/extensions/dm-alps/src/features/chrome-frame/styles.ts +0 -105
  34. package/extensions/dm-alps/src/features/fixed-bottom-editor/cluster.ts +0 -161
  35. package/extensions/dm-alps/src/features/fixed-bottom-editor/compositor.ts +0 -1149
  36. package/extensions/dm-alps/src/features/fixed-bottom-editor/index.ts +0 -3
  37. package/extensions/dm-alps/src/features/fixed-bottom-editor/runtime.ts +0 -3
  38. package/extensions/dm-alps/src/settings-store.ts +0 -194
  39. package/extensions/dm-alps/src/settings-ui.ts +0 -653
  40. package/extensions/dm-alps/src/settings.ts +0 -102
  41. package/extensions/dm-alps/src/terminal-sanitizer.ts +0 -91
  42. package/extensions/dm-alps/themes/LICENSE.synthwave-84 +0 -21
  43. package/extensions/dm-alps/themes/alps.json +0 -93
@@ -1,593 +0,0 @@
1
-
2
- const rgb = (r: number, g: number, b: number) => `\x1b[38;2;${r};${g};${b}m`;
3
- const bold = "\x1b[1m";
4
- const dim = "\x1b[2m";
5
- const reset = "\x1b[0m";
6
- const nobold = "\x1b[22m";
7
-
8
- // DM gradient (nicobailon style): magenta → purple → cyan
9
- const DM_GRAD = [
10
- [255, 0, 135], [175, 95, 175], [135, 95, 215],
11
- [95, 95, 255], [95, 175, 255], [0, 255, 255],
12
- ];
13
-
14
- function hsl(h: number, s = 1, l = 0.5): string {
15
- const c = (1 - Math.abs(2 * l - 1)) * s;
16
- const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
17
- const m = l - c / 2;
18
- let r = 0, g = 0, b = 0;
19
- if (h < 60) { r = c; g = x; } else if (h < 120) { r = x; g = c; }
20
- else if (h < 180) { g = c; b = x; } else if (h < 240) { g = x; b = c; }
21
- else if (h < 300) { r = x; b = c; } else { r = c; b = x; }
22
- return rgb(Math.round((r + m) * 255), Math.round((g + m) * 255), Math.round((b + m) * 255));
23
- }
24
-
25
- function lerpGrad(grad: number[][], t: number): [number, number, number] {
26
- const i = Math.floor(t * (grad.length - 1));
27
- const i2 = Math.min(i + 1, grad.length - 1);
28
- const lt = (t * (grad.length - 1)) % 1;
29
- return [
30
- Math.round(grad[i][0] + (grad[i2][0] - grad[i][0]) * lt),
31
- Math.round(grad[i][1] + (grad[i2][1] - grad[i][1]) * lt),
32
- Math.round(grad[i][2] + (grad[i2][2] - grad[i][2]) * lt),
33
- ];
34
- }
35
-
36
- const ellipsis = (f: number) => [".", "..", "...", ""][Math.floor(f / 10) % 4];
37
-
38
- export type AnimationPhase = "thinking" | "working" | "tool";
39
- export type AnimationFn = (frame: number, width: number, phase?: AnimationPhase) => string | string[];
40
-
41
- const PHASE_LABELS: Record<AnimationPhase, string> = {
42
- thinking: "Thinking",
43
- working: "Working",
44
- tool: "Running",
45
- };
46
-
47
- // ─── 02 Neural Pulse ─────────────────────────────────────────────
48
- const neuralPulse: AnimationFn = (f, w) => {
49
- const N = Math.min(14, Math.floor(w / 4));
50
- const d = rgb(60, 60, 80);
51
- const pulse = [rgb(80, 80, 120), rgb(120, 100, 200), rgb(180, 140, 255), rgb(220, 180, 255), rgb(255, 220, 255), rgb(220, 180, 255), rgb(180, 140, 255)];
52
- let line = "";
53
- for (let i = 0; i < N; i++) {
54
- const dist = ((i - (f * 0.5)) % N + N) % N;
55
- const pi = dist < pulse.length ? Math.floor(dist) : -1;
56
- line += (pi >= 0 ? pulse[pi] : d) + (pi >= 0 ? "●" : "○");
57
- if (i < N - 1) { const cd = ((i + 0.5 - (f * 0.5)) % N + N) % N; line += (cd < pulse.length ? pulse[Math.min(Math.floor(cd), pulse.length - 1)] : d) + "──"; }
58
- }
59
- return line + reset;
60
- };
61
-
62
- // ─── 03 Glitch Text ──────────────────────────────────────────────
63
- const glitchText: AnimationFn = (f, _w, phase) => {
64
- const text = PHASE_LABELS[phase || "thinking"];
65
- const glyphs = "█▓▒░╳╱╲¥£€$#@!?&%~*";
66
- const colors = [rgb(0, 255, 200), rgb(255, 0, 100), rgb(100, 200, 255), rgb(255, 255, 0)];
67
- let line = "";
68
- for (let i = 0; i < text.length; i++) {
69
- if (Math.random() < 0.12) line += colors[Math.floor(Math.random() * colors.length)] + glyphs[Math.floor(Math.random() * glyphs.length)];
70
- else if (Math.random() < 0.06) line += rgb(0, 255, 200) + (text[Math.min(Math.max(i + (Math.random() < 0.5 ? -1 : 1), 0), text.length - 1)] || " ");
71
- else line += bold + rgb(255, 255, 255) + text[i] + nobold;
72
- }
73
- const jitter = Math.random() < 0.1 ? " ".repeat(Math.floor(Math.random() * 3)) : "";
74
- return jitter + line + reset;
75
- };
76
-
77
- // ─── 05 Plasma Wave (1-line) ─────────────────────────────────────
78
- const plasmaWave: AnimationFn = (f, w) => {
79
- const chars = " ·∘○◎●◉█";
80
- const W = w;
81
- let line = "";
82
- for (let x = 0; x < W; x++) {
83
- 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;
84
- const n = (v + 1) / 2;
85
- const r = Math.round(Math.sin(n * Math.PI * 2) * 127 + 128);
86
- const g = Math.round(Math.sin(n * Math.PI * 2 + 2.094) * 127 + 128);
87
- const b = Math.round(Math.sin(n * Math.PI * 2 + 4.189) * 127 + 128);
88
- line += rgb(r, g, b) + chars[Math.floor(n * (chars.length - 1))];
89
- }
90
- return line + reset;
91
- };
92
-
93
- // ─── 06 Pac-Man Chase ────────────────────────────────────────────
94
- const pacmanChase: AnimationFn = (f, w) => {
95
- const W = Math.min(40, w);
96
- const pac = [rgb(255, 255, 0) + "ᗧ", rgb(255, 255, 0) + "●"];
97
- const ghost = rgb(255, 80, 80) + "ᗣ";
98
- const dot = rgb(255, 180, 100) + "·";
99
- const power = bold + rgb(255, 255, 255) + "●" + nobold;
100
- const pp = f % (W + 8), gp = (f - 4 + W + 8) % (W + 8);
101
- let line = "";
102
- for (let i = 0; i < W; i++) {
103
- if (i === pp % W && pp < W) line += pac[f % 4 < 2 ? 0 : 1];
104
- else if (i === gp % W && gp < W) line += ghost;
105
- else if (i > pp || pp >= W) line += (i % 8 === 0) ? power : dot;
106
- else line += " ";
107
- }
108
- return line + reset;
109
- };
110
-
111
- // ─── 07 Matrix Rain (1-line) ─────────────────────────────────────
112
- let matrixDrops: { x: number; phase: number; speed: number }[] = [];
113
- let matrixLastW = 0;
114
- const matrixChars = "ハミヒーウシナモニサワツオリ012789Z";
115
- const matrixRain: AnimationFn = (f, w) => {
116
- const W = w;
117
- if (W !== matrixLastW) {
118
- const count = Math.max(15, Math.floor(W * 0.4));
119
- matrixDrops = Array.from({ length: count }, () => ({ x: Math.floor(Math.random() * W), phase: Math.random() * 100, speed: 0.3 + Math.random() * 0.5 }));
120
- matrixLastW = W;
121
- }
122
- const buf = new Array(W).fill(" ");
123
- for (const d of matrixDrops) {
124
- const pos = Math.floor((f * d.speed + d.phase) % (W + 5));
125
- if (pos < W) buf[pos] = rgb(0, 255, 0) + bold + matrixChars[Math.floor(Math.random() * matrixChars.length)] + nobold;
126
- if (pos - 1 >= 0 && pos - 1 < W && buf[pos - 1] === " ") buf[pos - 1] = rgb(0, 160, 0) + matrixChars[Math.floor(Math.random() * matrixChars.length)];
127
- if (pos - 2 >= 0 && pos - 2 < W && buf[pos - 2] === " ") buf[pos - 2] = rgb(0, 80, 0) + matrixChars[Math.floor(Math.random() * matrixChars.length)];
128
- }
129
- return buf.join("") + reset;
130
- };
131
-
132
- // ─── 08 Pipeline ─────────────────────────────────────────────────
133
- const pipeline: AnimationFn = (f) => {
134
- const icons = [
135
- { i: "\uf0e7", c: rgb(255, 200, 50) }, { i: "\uf013", c: rgb(100, 180, 255) },
136
- { i: "\uf121", c: rgb(150, 255, 150) }, { i: "\uf0ad", c: rgb(255, 150, 100) }, { i: "\uf00c", c: rgb(100, 255, 200) }
137
- ];
138
- const pw = 5, total = icons.length * (pw + 1) + 1, pp = (f * 0.4) % total;
139
- let line = "";
140
- for (let i = 0; i < icons.length; i++) {
141
- const ss = i * (pw + 1), active = pp >= ss && pp < ss + pw + 1;
142
- line += (active ? bold : dim) + icons[i].c + icons[i].i + " " + reset;
143
- if (i < icons.length - 1) for (let p = 0; p < pw; p++) { const pos = ss + 1 + p; line += (Math.abs(pp - pos) < 1.5 ? bold + rgb(255, 255, 255) + "═" : pp > pos ? icons[i].c + "─" : rgb(60, 60, 80) + "─"); }
144
- }
145
- return line + reset;
146
- };
147
-
148
- // ─── 10 Starfield ────────────────────────────────────────────────
149
- const starChars = ["·", "∙", "•", "✦", "★"];
150
- type Star = { x: number; speed: number; bright: number; ch: string };
151
- let stars: Star[] = [];
152
- let starsLastW = 0;
153
- function ensureStars(W: number) {
154
- if (W !== starsLastW) {
155
- const count = Math.max(20, Math.floor(W * 0.6));
156
- stars = Array.from({ length: count }, () => {
157
- const speed = 0.2 + Math.random() * 1.2;
158
- const layer = Math.floor(speed / 0.3);
159
- return { x: Math.random() * W, speed, bright: Math.min(255, 80 + layer * 40), ch: starChars[Math.min(layer, starChars.length - 1)] };
160
- });
161
- starsLastW = W;
162
- }
163
- }
164
- const starfield: AnimationFn = (f, w) => {
165
- const W = w;
166
- ensureStars(W);
167
- const buf = new Array(W).fill(" ");
168
- for (const s of stars) {
169
- const xi = Math.floor(s.x);
170
- if (xi >= 0 && xi < W) buf[xi] = rgb(s.bright, s.bright, Math.min(255, s.bright + 40)) + s.ch;
171
- s.x += s.speed;
172
- if (s.x >= W) { s.x = 0; s.speed = 0.2 + Math.random() * 1.2; const l = Math.floor(s.speed / 0.3); s.bright = Math.min(255, 80 + l * 40); s.ch = starChars[Math.min(l, starChars.length - 1)]; }
173
- }
174
- return buf.join("") + reset;
175
- };
176
-
177
- // ─── 12 Fire ─────────────────────────────────────────────────────
178
- const fireChars = " .:-=+*#%@█";
179
- const firePalette = [[0, 0, 0], [50, 0, 0], [120, 30, 0], [200, 80, 0], [240, 160, 30], [255, 230, 120], [255, 255, 200]];
180
- let fireBuf: Float64Array[] = [];
181
- let fireLastW = 0;
182
- const fire: AnimationFn = (f, w) => {
183
- const W = w;
184
- if (W !== fireLastW) { fireBuf = Array.from({ length: 4 }, () => new Float64Array(W)); fireLastW = W; }
185
- for (let x = 0; x < W; x++) fireBuf[3][x] = Math.random() > 0.35 ? 1 : Math.random() * 0.5;
186
- for (let y = 0; y < 3; y++) for (let x = 0; x < W; x++)
187
- fireBuf[y][x] = (fireBuf[y + 1][(x - 1 + W) % W] + fireBuf[y + 1][x] + fireBuf[y + 1][(x + 1) % W]) / 3.1;
188
- let line = "";
189
- for (let x = 0; x < W; x++) {
190
- const v = Math.min(1, Math.max(0, fireBuf[0][x]));
191
- const pi = Math.floor(v * (firePalette.length - 1));
192
- const ci = Math.floor(v * (fireChars.length - 1));
193
- const [r, g, b] = firePalette[pi];
194
- line += rgb(r, g, b) + fireChars[ci];
195
- }
196
- return line + reset;
197
- };
198
-
199
- // ─── 15 Icon Morphing ────────────────────────────────────────────
200
- const morphIcons = [
201
- { ch: "\uf0eb", r: 255, g: 220, b: 50 }, { ch: "\uf013", r: 100, g: 180, b: 255 },
202
- { ch: "\uf0e7", r: 255, g: 150, b: 50 }, { ch: "\uf135", r: 255, g: 100, b: 100 },
203
- { ch: "\uf005", r: 255, g: 255, b: 100 }, { ch: "\uf06d", r: 255, g: 120, b: 30 },
204
- { ch: "\uf0ac", r: 100, g: 200, b: 255 }, { ch: "\uf004", r: 255, g: 80, b: 120 }
205
- ];
206
- const trans = "░▒▓█▓▒░";
207
- const iconMorphing: AnimationFn = (f) => {
208
- const cd = 25, pos = f % (morphIcons.length * cd);
209
- const ci = Math.floor(pos / cd), ni = (ci + 1) % morphIcons.length, p = (pos % cd) / cd;
210
- const cur = morphIcons[ci], nxt = morphIcons[ni];
211
- const r = Math.round(cur.r + (nxt.r - cur.r) * p), g = Math.round(cur.g + (nxt.g - cur.g) * p), b = Math.round(cur.b + (nxt.b - cur.b) * p);
212
- let display = p < 0.3 ? cur.ch : p < 0.7 ? trans[Math.min(Math.floor((p - 0.3) / 0.4 * trans.length), trans.length - 1)] : nxt.ch;
213
- let trail = "";
214
- for (let i = 0; i < 20; i++) { const sp = Math.random() < 0.25 ? (Math.random() < 0.5 ? "✦" : "·") : " "; const br = Math.floor(Math.random() * 155 + 100); trail += rgb(br, br, Math.floor(br * 0.8)) + sp; }
215
- return rgb(r, g, b) + display + " " + trail + reset;
216
- };
217
-
218
- // ─── 16 Brainstorm ───────────────────────────────────────────────
219
- const weatherPhases = [
220
-
221
- { icon: "\ue30d", label: "on the pond", r: 255, g: 220, b: 80 },
222
- { icon: "\ue302", label: "following ripples", r: 180, g: 180, b: 220 },
223
- { icon: "\ue318", label: "ducking deeper", r: 120, g: 160, b: 255 },
224
- { icon: "\ue31d", label: "found something!", r: 255, g: 255, b: 120 },
225
- { icon: "\ue30b", label: "bringing it back", r: 255, g: 220, b: 100 },
226
- { icon: "\ue302", label: "making sense of it", r: 180, g: 200, b: 220 }
227
-
228
- ];
229
- const brainstorm: AnimationFn = (f) => {
230
- const pd = 35, pos = f % (weatherPhases.length * pd), pi = Math.floor(pos / pd), p = weatherPhases[pi];
231
- const glow = Math.sin(f * 0.15) * 30;
232
- const r = Math.min(255, Math.max(0, p.r + glow)), g = Math.min(255, Math.max(0, p.g + glow)), b = Math.min(255, Math.max(0, p.b + glow));
233
- let sparks = "";
234
- for (let i = 0; i < 15; i++) { if (Math.random() < 0.15) { const br = Math.floor(Math.random() * 100 + 155); sparks += rgb(br, br, Math.min(255, br + 50)) + (Math.random() < 0.3 ? "⚡" : "✦"); } else sparks += " "; }
235
- return rgb(r, g, b) + bold + p.icon + " " + p.label + nobold + " " + sparks + reset;
236
- };
237
-
238
- // ─── 19 Dev Constellation ────────────────────────────────────────
239
- const devNodes = [
240
- { ch: "\ue796", c: [50, 150, 255] }, { ch: "\ue718", c: [80, 200, 120] }, { ch: "\ue73c", c: [255, 200, 50] },
241
- { ch: "\ue7a8", c: [200, 100, 255] }, { ch: "\uf13b", c: [100, 200, 255] }, { ch: "\ue61e", c: [255, 100, 100] }
242
- ];
243
- const devConstellation: AnimationFn = (f) => {
244
- const gap = 5, totalW = devNodes.length * (gap + 1) - 1, pp = (f * 0.4) % totalW;
245
- let line = "";
246
- for (let i = 0; i < devNodes.length; i++) {
247
- const np = i * (gap + 1), dist = Math.abs(pp - np);
248
- line += (dist < 1.5 ? bold : dim) + rgb(devNodes[i].c[0], devNodes[i].c[1], devNodes[i].c[2]) + devNodes[i].ch + nobold;
249
- if (i < devNodes.length - 1) for (let g = 0; g < gap; g++) { const cp = np + 1 + g, cd = Math.abs(pp - cp); line += (cd < 1 ? bold + rgb(255, 255, 255) + "━" : cd < 2.5 ? rgb(150, 150, 200) + "─" : rgb(40, 40, 55) + "·"); }
250
- }
251
- return line + reset;
252
- };
253
-
254
- // ─── 20 Crush Scramble ───────────────────────────────────────────
255
- const scrambleChars = "0123456789abcdefABCDEF~!@#$£€%^&*()+=_";
256
- const scrambleBirths = Array.from({ length: 15 }, () => Math.random() * 20);
257
- const scrambleRamp: number[][] = [];
258
- for (let i = 0; i < 24; i++) { const t = i / 24, a = t * Math.PI * 2; scrambleRamp.push([Math.round(Math.sin(a) * 127 + 128), Math.round(Math.sin(a + 2.094) * 80 + 80), Math.round(Math.sin(a + 4.189) * 127 + 128)]); }
259
- const crushScramble: AnimationFn = (f, _w, phase) => {
260
- const sw = 15, init = f > 20;
261
- let line = "";
262
- for (let i = 0; i < sw; i++) {
263
- const ci = (i + (init ? f : 0)) % scrambleRamp.length, [r, g, b] = scrambleRamp[ci];
264
- line += rgb(r, g, b) + (!init && f < scrambleBirths[i] ? "." : scrambleChars[Math.floor(Math.random() * scrambleChars.length)]);
265
- }
266
- const label = PHASE_LABELS[phase || "thinking"];
267
- line += " " + rgb(200, 200, 200) + label;
268
- if (init) line += rgb(200, 200, 200) + ellipsis(f);
269
- return line + reset;
270
- };
271
-
272
- // ─── 21 DM Pulse ────────────────────────────────────────────
273
- const dmPulse: AnimationFn = (f) => {
274
- const dmGlyph = "\ue22c", label = "";
275
- const breath = (Math.sin(f * 0.08) + 1) / 2;
276
- const gi = Math.floor((f * 0.3) % DM_GRAD.length);
277
- const gi2 = (gi + 1) % DM_GRAD.length;
278
- const t = (f * 0.3) % 1;
279
- const r = Math.round(DM_GRAD[gi][0] + (DM_GRAD[gi2][0] - DM_GRAD[gi][0]) * t);
280
- const g = Math.round(DM_GRAD[gi][1] + (DM_GRAD[gi2][1] - DM_GRAD[gi][1]) * t);
281
- const b = Math.round(DM_GRAD[gi][2] + (DM_GRAD[gi2][2] - DM_GRAD[gi][2]) * t);
282
- const br = 0.6 + breath * 0.4;
283
- const trailChars = "·∘○◎●";
284
- let trail = "";
285
- for (let i = 0; i < 20; i++) {
286
- const phase = (i / 20 * Math.PI * 2 + f * 0.1), ti = Math.floor((Math.sin(phase) + 1) / 2 * (trailChars.length - 1));
287
- const fade = Math.max(30, 200 - i * 8);
288
- trail += rgb(Math.floor(r * fade / 255), Math.floor(g * fade / 255), Math.floor(b * fade / 255)) + trailChars[ti];
289
- }
290
- return bold + rgb(Math.round(r * br), Math.round(g * br), Math.round(b * br)) + dmGlyph + label + nobold + " " + trail + reset;
291
- };
292
-
293
- // ─── 22 Shimmer Text ─────────────────────────────────────────────
294
- const shimmerText: AnimationFn = (f, _w, phase) => {
295
- const text = PHASE_LABELS[phase || "thinking"] + "...";
296
- const base = [200, 200, 200];
297
- let line = "";
298
- for (let i = 0; i < text.length; i++) {
299
- const wave = Math.sin((i - f * 0.3) * 0.8);
300
- if (wave > 0.3) {
301
- const intensity = (wave - 0.3) / 0.7;
302
- const gi = Math.floor(((i + f * 0.5) % (DM_GRAD.length * 2)));
303
- const gIdx = gi < DM_GRAD.length ? gi : DM_GRAD.length * 2 - 1 - gi;
304
- const gc = DM_GRAD[Math.min(gIdx, DM_GRAD.length - 1)];
305
- line += bold + rgb(Math.round(base[0] + (gc[0] - base[0]) * intensity), Math.round(base[1] + (gc[1] - base[1]) * intensity), Math.round(base[2] + (gc[2] - base[2]) * intensity)) + text[i] + nobold;
306
- } else {
307
- line += rgb(base[0], base[1], base[2]) + text[i];
308
- }
309
- }
310
- return line + reset;
311
- };
312
-
313
- // ─── 24 Vibe Typewriter ──────────────────────────────────────────
314
- const vibeMessages = [
315
- "Ducking beneath the surface...",
316
- "Paddling through possibilities...",
317
- "Following the breadcrumbs...",
318
- "Fishing for insights...",
319
- "Reading the ripples...",
320
- "Tracing hidden currents...",
321
- "Making sense of the pond...",
322
- "Charting calmer waters...",
323
- "Gathering scattered clues...",
324
- "Connecting distant islands...",
325
-
326
- "Listening to quiet signals...",
327
- "Searching beneath the reflections...",
328
- "Finding patterns in the ripples...",
329
- "Exploring deeper waters...",
330
- "Watching the horizon...",
331
- "Following a promising current...",
332
- "Looking beneath the lily pads...",
333
- "Collecting useful fragments...",
334
- "Mapping unfamiliar waters...",
335
- "Exploring another angle...",
336
-
337
- "Separating ripples from waves...",
338
- "Following the strongest clue...",
339
- "Untangling the current...",
340
- "Inspecting the shoreline...",
341
- "Testing a promising theory...",
342
- "Connecting the dots...",
343
- "Looking for the missing piece...",
344
- "Sorting signal from noise...",
345
- "Making the map clearer...",
346
- "Finding order beneath the waves...",
347
-
348
- "Consulting the pond archives...",
349
- "Comparing a few possibilities...",
350
- "Checking the deeper channels...",
351
- "Following a curious lead...",
352
- "Gathering more context...",
353
- "Examining the evidence...",
354
- "Listening for distant echoes...",
355
- "Looking beyond the reeds...",
356
- "Following the trail downstream...",
357
- "Watching for hidden patterns...",
358
-
359
- "Reducing uncertainty...",
360
- "Bringing scattered clues together...",
361
- "Making sense of the splashes...",
362
- "Finding the signal...",
363
- "Following the evidence...",
364
- "Turning ripples into waves...",
365
- "Connecting scattered islands...",
366
- "Surfacing an insight...",
367
- "Polishing the final thought...",
368
- "Keeping all ducks in a row..."
369
- ];
370
- const cursorChars = ["✦", "✧", "⚡", "★", "·"];
371
- const cursorColors = [[255, 220, 100], [100, 200, 255], [255, 100, 200], [200, 255, 100]];
372
- let vibeIdx = 0, vibeCharIdx = 0, vibeHold = 0;
373
- const vibeTypewriter: AnimationFn = (f) => {
374
- const vibe = vibeMessages[vibeIdx];
375
- if (vibeHold > 0) { vibeHold--; if (vibeHold === 0) { vibeIdx = (vibeIdx + 1) % vibeMessages.length; vibeCharIdx = 0; } }
376
- else if (vibeCharIdx < vibe.length) vibeCharIdx++;
377
- else vibeHold = 30;
378
- const shown = vibe.slice(0, vibeCharIdx);
379
- const cc = cursorColors[f % cursorColors.length];
380
- const cursor = vibeCharIdx < vibe.length ? rgb(cc[0], cc[1], cc[2]) + bold + cursorChars[f % cursorChars.length] + nobold : "";
381
- return rgb(200, 200, 220) + shown + cursor + reset;
382
- };
383
-
384
- // ─── 26 Orbit Dots ───────────────────────────────────────────────
385
- const dotChars = ["·", "∘", "○", "●", "◉", "●", "○", "∘"];
386
- const orbitDots: AnimationFn = (f, _w, phase) => {
387
- let line = "";
388
- for (let i = 0; i < 5; i++) {
389
- const phase = Math.sin(f * 0.12 - i * 0.8), norm = (phase + 1) / 2;
390
- const ci = Math.floor(norm * (dotChars.length - 1));
391
- const [r, g, b] = lerpGrad(DM_GRAD, ((i + f * 0.1) % DM_GRAD.length) / DM_GRAD.length);
392
- const br = 0.4 + norm * 0.6;
393
- line += (norm > 0.7 ? bold : "") + rgb(Math.round(r * br), Math.round(g * br), Math.round(b * br)) + dotChars[ci] + nobold + " ";
394
- }
395
- const [lr, lg, lb] = lerpGrad(DM_GRAD, (f * 0.08 % DM_GRAD.length) / DM_GRAD.length);
396
- const label = PHASE_LABELS[phase || "thinking"];
397
- line += " " + rgb(lr, lg, lb) + label + rgb(180, 180, 200) + ellipsis(f);
398
- return line + reset;
399
- };
400
-
401
- // ─── 27 Neon Bounce ──────────────────────────────────────────────
402
- const bounceTrail: { pos: number; age: number; color: number[] }[] = [];
403
- const trailGlyphs = ["█", "▓", "▒", "░", "·"];
404
- const neonBounce: AnimationFn = (f, w) => {
405
- const W = w;
406
- const cycle = (f * 0.6) % (W * 2), pos = Math.floor(cycle < W ? cycle : W * 2 - cycle);
407
- const [r, g, b] = lerpGrad(DM_GRAD, pos / W);
408
- bounceTrail.push({ pos, age: 0, color: [r, g, b] });
409
- const buf = new Array(W).fill(" ");
410
- for (const t of bounceTrail) {
411
- if (t.age < trailGlyphs.length && t.pos < W) {
412
- const fade = Math.max(0, 1 - t.age / 5);
413
- buf[t.pos] = rgb(Math.round(t.color[0] * fade), Math.round(t.color[1] * fade), Math.round(t.color[2] * fade)) + trailGlyphs[Math.min(t.age, trailGlyphs.length - 1)];
414
- }
415
- t.age++;
416
- }
417
- if (pos < W) buf[pos] = bold + rgb(Math.min(255, r + 50), Math.min(255, g + 50), Math.min(255, b + 50)) + "█" + nobold;
418
- while (bounceTrail.length > 0 && bounceTrail[0].age > 5) bounceTrail.shift();
419
- return rgb(80, 80, 100) + "▐" + buf.join("") + rgb(80, 80, 100) + "▌" + reset;
420
- };
421
-
422
- // ─── 3-LINE: Fire ────────────────────────────────────────────────
423
- let fire3Buf: Float64Array[] = [];
424
- let fire3LastW = 0;
425
- const fire3: AnimationFn = (f, w) => {
426
- const W = w;
427
- if (W !== fire3LastW) { fire3Buf = Array.from({ length: 5 }, () => new Float64Array(W)); fire3LastW = W; }
428
- for (let x = 0; x < W; x++) fire3Buf[4][x] = Math.random() > 0.3 ? 1 : Math.random() * 0.5;
429
- for (let y = 0; y < 4; y++) for (let x = 0; x < W; x++)
430
- fire3Buf[y][x] = (fire3Buf[y + 1][(x - 1 + W) % W] + fire3Buf[y + 1][x] + fire3Buf[y + 1][(x + 1) % W]) / 3.08;
431
- const lines: string[] = [];
432
- for (let row = 0; row < 3; row++) {
433
- let line = "";
434
- for (let x = 0; x < W; x++) {
435
- const v = Math.min(1, Math.max(0, fire3Buf[row][x]));
436
- const ci = Math.floor(v * (fireChars.length - 1));
437
- const pi = Math.floor(v * (firePalette.length - 1));
438
- const [r, g, b] = firePalette[pi];
439
- line += rgb(r, g, b) + fireChars[ci];
440
- }
441
- lines.push(line + reset);
442
- }
443
- return lines;
444
- };
445
-
446
- // ─── 3-LINE: Matrix Rain ─────────────────────────────────────────
447
- let mat3Drops: { x: number; y: number; speed: number; len: number }[] = [];
448
- let mat3LastW = 0;
449
- const matrix3: AnimationFn = (f, w) => {
450
- const W = w, H = 3;
451
- if (W !== mat3LastW) {
452
- const count = Math.max(20, Math.floor(W * 0.5));
453
- mat3Drops = Array.from({ length: count }, () => ({ x: Math.floor(Math.random() * W), y: Math.random() * -5, speed: 0.15 + Math.random() * 0.35, len: 2 + Math.floor(Math.random() * 3) }));
454
- mat3LastW = W;
455
- }
456
- const grid: string[][] = Array.from({ length: H }, () => new Array(W).fill(rgb(10, 30, 10) + " "));
457
- for (const d of mat3Drops) {
458
- d.y += d.speed;
459
- if (d.y > H + d.len) { d.y = -d.len; d.x = Math.floor(Math.random() * W); d.speed = 0.15 + Math.random() * 0.35; }
460
- for (let t = 0; t < d.len; t++) {
461
- const row = Math.floor(d.y - t);
462
- if (row >= 0 && row < H && d.x < W) {
463
- const ch = matrixChars[Math.floor(Math.random() * matrixChars.length)];
464
- const brightness = t === 0 ? 255 : Math.max(40, 200 - t * 60);
465
- grid[row][d.x] = (t === 0 ? bold : "") + rgb(0, brightness, 0) + ch + (t === 0 ? nobold : "");
466
- }
467
- }
468
- }
469
- return grid.map(row => row.join("") + reset);
470
- };
471
-
472
- // ─── 3-LINE: Starfield ───────────────────────────────────────────
473
- let stars3: { x: number; y: number; speed: number; ch: string; bright: number }[] = [];
474
- let stars3LastW = 0;
475
- const starfield3: AnimationFn = (f, w) => {
476
- const W = w, H = 3;
477
- if (W !== stars3LastW) {
478
- const count = Math.max(30, Math.floor(W * 0.7));
479
- stars3 = Array.from({ length: count }, () => {
480
- const speed = 0.15 + Math.random() * 1.0;
481
- const layer = Math.floor(speed / 0.25);
482
- return { x: Math.random() * W, y: Math.floor(Math.random() * 3), speed, ch: starChars[Math.min(layer, starChars.length - 1)], bright: Math.min(255, 60 + layer * 40) };
483
- });
484
- stars3LastW = W;
485
- }
486
- const grid: string[][] = Array.from({ length: H }, () => new Array(W).fill(" "));
487
- for (const s of stars3) {
488
- const xi = Math.floor(s.x);
489
- if (xi >= 0 && xi < W && s.y < H) grid[s.y][xi] = rgb(s.bright, s.bright, Math.min(255, s.bright + 40)) + s.ch;
490
- s.x += s.speed;
491
- if (s.x >= W) { s.x = 0; s.y = Math.floor(Math.random() * 3); s.speed = 0.15 + Math.random() * 1.0; const l = Math.floor(s.speed / 0.25); s.bright = Math.min(255, 60 + l * 40); s.ch = starChars[Math.min(l, starChars.length - 1)]; }
492
- }
493
- return grid.map(row => row.join("") + reset);
494
- };
495
-
496
- // ─── 3-LINE: Aurora ──────────────────────────────────────────────
497
- const aurora3: AnimationFn = (f, w) => {
498
- const W = w, H = 3;
499
- const auroraChars = " ░▒▓█▓▒░";
500
- const lines: string[] = [];
501
- for (let y = 0; y < H; y++) {
502
- let line = "";
503
- for (let x = 0; x < W; x++) {
504
- const v1 = Math.sin(x * 0.08 + f * 0.04 + y * 1.2);
505
- const v2 = Math.sin(x * 0.12 - f * 0.03 + y * 0.8);
506
- const v3 = Math.sin((x + y * 10) * 0.06 + f * 0.05);
507
- const n = (v1 + v2 + v3 + 3) / 6;
508
- const hue = (x * 3 + f * 2 + y * 40) % 360;
509
- const sat = 0.7 + n * 0.3;
510
- const lum = 0.15 + n * 0.45;
511
- const ci = Math.floor(n * (auroraChars.length - 1));
512
- line += hsl(hue, sat, lum) + auroraChars[ci];
513
- }
514
- lines.push(line + reset);
515
- }
516
- return lines;
517
- };
518
-
519
- // ─── Registry ────────────────────────────────────────────────────
520
- export type AnimationCategory = "thinking" | "working" | "both";
521
-
522
- export type AnimationDefinition = {
523
- name: string;
524
- fn: AnimationFn;
525
- category: AnimationCategory;
526
- description: string;
527
- lines: number;
528
- };
529
-
530
- export const ANIMATIONS: AnimationDefinition[] = [
531
- // 1-line
532
- { name: "neural-pulse", fn: neuralPulse, category: "thinking", description: "Energy pulses along neural pathway", lines: 1 },
533
- { name: "glitch-text", fn: glitchText, category: "both", description: "Cyberpunk glitch effect", lines: 1 },
534
- { name: "plasma-wave", fn: plasmaWave, category: "thinking", description: "Colorful plasma band", lines: 1 },
535
- { name: "pacman", fn: pacmanChase, category: "working", description: "Pac-Man eating dots", lines: 1 },
536
- { name: "matrix", fn: matrixRain, category: "both", description: "Matrix rain", lines: 1 },
537
- { name: "pipeline", fn: pipeline, category: "working", description: "CI/CD pipeline with icons", lines: 1 },
538
- { name: "starfield", fn: starfield, category: "thinking", description: "Horizontal parallax stars", lines: 1 },
539
- { name: "fire", fn: fire, category: "working", description: "Demoscene fire", lines: 1 },
540
- { name: "icon-morph", fn: iconMorphing, category: "both", description: "Morphing nerd font icons", lines: 1 },
541
- { name: "brainstorm", fn: brainstorm, category: "thinking", description: "Weather icon storm", lines: 1 },
542
- { name: "dev-constellation", fn: devConstellation, category: "thinking", description: "Dev icons with pulses", lines: 1 },
543
- { name: "crush", fn: crushScramble, category: "both", description: "Crush-style scrambler", lines: 1 },
544
- { name: "dm-pulse", fn: dmPulse, category: "both", description: "DM pulse animation", lines: 1 },
545
- { name: "shimmer", fn: shimmerText, category: "thinking", description: "Rainbow shimmer text", lines: 1 },
546
- { name: "typewriter", fn: vibeTypewriter, category: "both", description: "Themed typewriter text", lines: 1 },
547
- { name: "orbit-dots", fn: orbitDots, category: "thinking", description: "Pulsing orbit dots", lines: 1 },
548
- { name: "neon-bounce", fn: neonBounce, category: "working", description: "Neon ball bouncing", lines: 1 },
549
- // 3-line
550
- { name: "fire3", fn: fire3, category: "working", description: "🔥 Demoscene fire (3-line)", lines: 3 },
551
- { name: "matrix3", fn: matrix3, category: "both", description: "🟢 Matrix rain (3-line)", lines: 3 },
552
- { name: "starfield3", fn: starfield3, category: "thinking", description: "✦ Deep starfield (3-line)", lines: 3 },
553
- { name: "aurora", fn: aurora3, category: "thinking", description: "🌌 Aurora borealis (3-line)", lines: 3 },
554
- ];
555
-
556
- export function getAnimation(name: string): AnimationDefinition | undefined {
557
- return ANIMATIONS.find(a => a.name === name);
558
- }
559
-
560
- export function getAnimationsForCategory(category: AnimationCategory): AnimationDefinition[] {
561
- return ANIMATIONS.filter((animation) => animation.category === category || animation.category === "both");
562
- }
563
-
564
-
565
-
566
- export function renderAnimationFrame(name: string, frame: number, width: number, phase: AnimationPhase = "thinking"): string[] {
567
- const animation = getAnimation(name) ?? getAnimation("shimmer") ?? ANIMATIONS[0];
568
- if (!animation) return ["Thinking..."];
569
- const rendered = animation.fn(frame, Math.max(1, Math.floor(width)), phase);
570
- return Array.isArray(rendered) ? rendered : [rendered];
571
- }
572
-
573
- export function pickRandomAnimation(category: AnimationCategory, previousName?: string): string {
574
- const animations = getAnimationsForCategory(category);
575
- if (animations.length === 0) return "shimmer";
576
- const candidates = previousName && animations.length > 1 ? animations.filter((animation) => animation.name !== previousName) : animations;
577
- const source = candidates.length > 0 ? candidates : animations;
578
- const groups = [
579
- source.filter((animation) => animation.lines <= 1),
580
- source.filter((animation) => animation.lines > 1),
581
- ].filter((group) => group.length > 0);
582
- const group = groups[Math.floor(Math.random() * groups.length)] ?? source;
583
- return group[Math.floor(Math.random() * group.length)]!.name;
584
- }
585
-
586
- export type AnimationWidth = "full" | "default" | number;
587
-
588
- export function resolveAnimationWidth(setting: AnimationWidth, terminalWidth = process.stdout.columns || 80): number {
589
- if (setting === "default") return 50;
590
- const maxWidth = Math.max(10, Math.floor(terminalWidth) - 4);
591
- if (setting === "full") return maxWidth;
592
- return Math.max(10, Math.min(Math.floor(setting), maxWidth));
593
- }