@kenkaiiii/ggcoder 4.2.72 → 4.2.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +174 -0
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +2 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +14 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/modes/agent-home-mode.d.ts +21 -0
- package/dist/modes/agent-home-mode.d.ts.map +1 -0
- package/dist/modes/agent-home-mode.js +553 -0
- package/dist/modes/agent-home-mode.js.map +1 -0
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +25 -3
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/buddy/Buddy.d.ts +15 -0
- package/dist/ui/buddy/Buddy.d.ts.map +1 -0
- package/dist/ui/buddy/Buddy.js +118 -0
- package/dist/ui/buddy/Buddy.js.map +1 -0
- package/dist/ui/buddy/gacha.d.ts +8 -0
- package/dist/ui/buddy/gacha.d.ts.map +1 -0
- package/dist/ui/buddy/gacha.js +94 -0
- package/dist/ui/buddy/gacha.js.map +1 -0
- package/dist/ui/buddy/species.d.ts +52 -0
- package/dist/ui/buddy/species.d.ts.map +1 -0
- package/dist/ui/buddy/species.js +257 -0
- package/dist/ui/buddy/species.js.map +1 -0
- package/dist/ui/components/ActivityIndicator.d.ts +6 -1
- package/dist/ui/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/ui/components/ActivityIndicator.js +52 -8
- package/dist/ui/components/ActivityIndicator.js.map +1 -1
- package/dist/ui/components/AnimationContext.d.ts +5 -0
- package/dist/ui/components/AnimationContext.d.ts.map +1 -1
- package/dist/ui/components/AnimationContext.js +8 -1
- package/dist/ui/components/AnimationContext.js.map +1 -1
- package/dist/ui/components/AssistantMessage.d.ts.map +1 -1
- package/dist/ui/components/AssistantMessage.js +3 -2
- package/dist/ui/components/AssistantMessage.js.map +1 -1
- package/dist/ui/components/BackgroundTasksBar.js +2 -2
- package/dist/ui/components/BackgroundTasksBar.js.map +1 -1
- package/dist/ui/components/Footer.d.ts +3 -1
- package/dist/ui/components/Footer.d.ts.map +1 -1
- package/dist/ui/components/Footer.js +23 -48
- package/dist/ui/components/Footer.js.map +1 -1
- package/dist/ui/components/Markdown.d.ts +4 -0
- package/dist/ui/components/Markdown.d.ts.map +1 -1
- package/dist/ui/components/Markdown.js +109 -6
- package/dist/ui/components/Markdown.js.map +1 -1
- package/dist/ui/components/MessageResponse.d.ts +25 -0
- package/dist/ui/components/MessageResponse.d.ts.map +1 -0
- package/dist/ui/components/MessageResponse.js +42 -0
- package/dist/ui/components/MessageResponse.js.map +1 -0
- package/dist/ui/components/NoSelect.d.ts +20 -0
- package/dist/ui/components/NoSelect.d.ts.map +1 -0
- package/dist/ui/components/NoSelect.js +14 -0
- package/dist/ui/components/NoSelect.js.map +1 -0
- package/dist/ui/components/Ratchet.d.ts +20 -0
- package/dist/ui/components/Ratchet.d.ts.map +1 -0
- package/dist/ui/components/Ratchet.js +30 -0
- package/dist/ui/components/Ratchet.js.map +1 -0
- package/dist/ui/components/ServerToolExecution.d.ts.map +1 -1
- package/dist/ui/components/ServerToolExecution.js +5 -6
- package/dist/ui/components/ServerToolExecution.js.map +1 -1
- package/dist/ui/components/Spinner.d.ts +8 -2
- package/dist/ui/components/Spinner.d.ts.map +1 -1
- package/dist/ui/components/Spinner.js +51 -5
- package/dist/ui/components/Spinner.js.map +1 -1
- package/dist/ui/components/StreamingArea.d.ts.map +1 -1
- package/dist/ui/components/StreamingArea.js +4 -3
- package/dist/ui/components/StreamingArea.js.map +1 -1
- package/dist/ui/components/SubAgentPanel.d.ts.map +1 -1
- package/dist/ui/components/SubAgentPanel.js +4 -3
- package/dist/ui/components/SubAgentPanel.js.map +1 -1
- package/dist/ui/components/ToolExecution.d.ts.map +1 -1
- package/dist/ui/components/ToolExecution.js +38 -12
- package/dist/ui/components/ToolExecution.js.map +1 -1
- package/dist/ui/components/ToolGroupExecution.d.ts.map +1 -1
- package/dist/ui/components/ToolGroupExecution.js +21 -17
- package/dist/ui/components/ToolGroupExecution.js.map +1 -1
- package/dist/ui/components/ToolUseLoader.d.ts +19 -0
- package/dist/ui/components/ToolUseLoader.d.ts.map +1 -0
- package/dist/ui/components/ToolUseLoader.js +42 -0
- package/dist/ui/components/ToolUseLoader.js.map +1 -0
- package/dist/ui/constants/figures.d.ts +30 -0
- package/dist/ui/constants/figures.d.ts.map +1 -0
- package/dist/ui/constants/figures.js +41 -0
- package/dist/ui/constants/figures.js.map +1 -0
- package/dist/ui/hooks/useAgentLoop.d.ts +8 -0
- package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -1
- package/dist/ui/hooks/useAgentLoop.js +16 -0
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/hooks/useBlink.d.ts +11 -0
- package/dist/ui/hooks/useBlink.d.ts.map +1 -0
- package/dist/ui/hooks/useBlink.js +19 -0
- package/dist/ui/hooks/useBlink.js.map +1 -0
- package/dist/ui/hooks/useMinDisplayTime.d.ts +11 -0
- package/dist/ui/hooks/useMinDisplayTime.d.ts.map +1 -0
- package/dist/ui/hooks/useMinDisplayTime.js +34 -0
- package/dist/ui/hooks/useMinDisplayTime.js.map +1 -0
- package/dist/ui/spinner-frames.d.ts +1 -0
- package/dist/ui/spinner-frames.d.ts.map +1 -1
- package/dist/ui/spinner-frames.js +15 -5
- package/dist/ui/spinner-frames.js.map +1 -1
- package/dist/ui/theme/dark.json +2 -1
- package/dist/ui/theme/light.json +2 -1
- package/dist/ui/theme/theme.d.ts +1 -0
- package/dist/ui/theme/theme.d.ts.map +1 -1
- package/dist/ui/utils/markdown-cache.d.ts +12 -0
- package/dist/ui/utils/markdown-cache.d.ts.map +1 -0
- package/dist/ui/utils/markdown-cache.js +43 -0
- package/dist/ui/utils/markdown-cache.js.map +1 -0
- package/dist/ui/utils/word-diff.d.ts +11 -0
- package/dist/ui/utils/word-diff.d.ts.map +1 -0
- package/dist/ui/utils/word-diff.js +23 -0
- package/dist/ui/utils/word-diff.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { hostname, userInfo, homedir } from "node:os";
|
|
2
|
+
import { ALL_SPECIES, SPECIES_RARITY, RARITY_WEIGHTS, RARITY_STAT_FLOORS, EYE_STYLES, } from "./species.js";
|
|
3
|
+
// ── FNV-1a hash ──────────────────────────────────────────────
|
|
4
|
+
function fnv1a(str) {
|
|
5
|
+
let hash = 0x811c9dc5;
|
|
6
|
+
for (let i = 0; i < str.length; i++) {
|
|
7
|
+
hash ^= str.charCodeAt(i);
|
|
8
|
+
hash = Math.imul(hash, 0x01000193);
|
|
9
|
+
}
|
|
10
|
+
return hash >>> 0;
|
|
11
|
+
}
|
|
12
|
+
// ── Mulberry32 PRNG ──────────────────────────────────────────
|
|
13
|
+
function mulberry32(seed) {
|
|
14
|
+
let s = seed | 0;
|
|
15
|
+
return () => {
|
|
16
|
+
s = (s + 0x6d2b79f5) | 0;
|
|
17
|
+
let t = Math.imul(s ^ (s >>> 15), 1 | s);
|
|
18
|
+
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
|
|
19
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
// ── Seed ─────────────────────────────────────────────────────
|
|
23
|
+
function getUserSeed() {
|
|
24
|
+
const identity = `${hostname()}:${userInfo().username}:${homedir()}:friend-2026-401`;
|
|
25
|
+
return fnv1a(identity);
|
|
26
|
+
}
|
|
27
|
+
// ── Roll helpers ─────────────────────────────────────────────
|
|
28
|
+
function rollRarity(rand) {
|
|
29
|
+
const roll = rand * 100;
|
|
30
|
+
let cumulative = 0;
|
|
31
|
+
for (const [rarity, weight] of RARITY_WEIGHTS) {
|
|
32
|
+
cumulative += weight;
|
|
33
|
+
if (roll < cumulative)
|
|
34
|
+
return rarity;
|
|
35
|
+
}
|
|
36
|
+
return "common";
|
|
37
|
+
}
|
|
38
|
+
function rollStats(rng, rarity) {
|
|
39
|
+
const floor = RARITY_STAT_FLOORS[rarity];
|
|
40
|
+
const keys = ["debugging", "patience", "chaos", "wisdom", "snark"];
|
|
41
|
+
const peakIdx = Math.floor(rng() * keys.length);
|
|
42
|
+
let dumpIdx = Math.floor(rng() * keys.length);
|
|
43
|
+
while (dumpIdx === peakIdx)
|
|
44
|
+
dumpIdx = Math.floor(rng() * keys.length);
|
|
45
|
+
const stats = { debugging: 0, patience: 0, chaos: 0, wisdom: 0, snark: 0 };
|
|
46
|
+
for (let i = 0; i < keys.length; i++) {
|
|
47
|
+
const key = keys[i];
|
|
48
|
+
if (i === peakIdx) {
|
|
49
|
+
stats[key] = Math.min(100, 50 + Math.floor(rng() * 30) + floor);
|
|
50
|
+
}
|
|
51
|
+
else if (i === dumpIdx) {
|
|
52
|
+
stats[key] = Math.max(1, -10 + Math.floor(rng() * 15) + floor);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
stats[key] = floor + Math.floor(rng() * 40);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return stats;
|
|
59
|
+
}
|
|
60
|
+
// ── Main roll (cached) ───────────────────────────────────────
|
|
61
|
+
const HATS = [
|
|
62
|
+
"none",
|
|
63
|
+
"crown",
|
|
64
|
+
"tophat",
|
|
65
|
+
"propeller",
|
|
66
|
+
"halo",
|
|
67
|
+
"wizard",
|
|
68
|
+
"beanie",
|
|
69
|
+
"tinyduck",
|
|
70
|
+
];
|
|
71
|
+
let rollCache = null;
|
|
72
|
+
/**
|
|
73
|
+
* Get the user's deterministic buddy companion.
|
|
74
|
+
* Same machine always gets the same species, eyes, hat, stats.
|
|
75
|
+
* Result is cached for hot paths (500ms sprite tick).
|
|
76
|
+
*/
|
|
77
|
+
export function getPlayerBuddy() {
|
|
78
|
+
if (rollCache)
|
|
79
|
+
return rollCache;
|
|
80
|
+
const seed = getUserSeed();
|
|
81
|
+
const rng = mulberry32(seed);
|
|
82
|
+
const rarity = rollRarity(rng());
|
|
83
|
+
// Pick species from this rarity tier
|
|
84
|
+
const candidates = ALL_SPECIES.filter((s) => SPECIES_RARITY[s] === rarity);
|
|
85
|
+
const speciesIdx = Math.floor(rng() * candidates.length);
|
|
86
|
+
const species = candidates[speciesIdx];
|
|
87
|
+
const eyes = EYE_STYLES[Math.floor(rng() * EYE_STYLES.length)];
|
|
88
|
+
const hat = rarity === "common" ? "none" : HATS[Math.floor(rng() * HATS.length)];
|
|
89
|
+
const stats = rollStats(rng, rarity);
|
|
90
|
+
const isShiny = rng() < 0.01;
|
|
91
|
+
rollCache = { species, eyes, hat, stats, isShiny, rarity };
|
|
92
|
+
return rollCache;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=gacha.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gacha.js","sourceRoot":"","sources":["../../../src/ui/buddy/gacha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,UAAU,GAKX,MAAM,cAAc,CAAC;AAEtB,gEAAgE;AAEhE,SAAS,KAAK,CAAC,GAAW;IACxB,IAAI,IAAI,GAAG,UAAU,CAAC;IACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,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AAK,GAAG,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;IAE7B,SAAS,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3D,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Buddy companion species definitions.
|
|
3
|
+
*
|
|
4
|
+
* Each species has ASCII art frames (5 lines tall, 12 chars wide),
|
|
5
|
+
* eye placeholder {E} for expression variants, and a rarity tier.
|
|
6
|
+
* Matches Claude Code's buddy system architecture.
|
|
7
|
+
*
|
|
8
|
+
* Line 0 is the hat slot — left blank so hats can overlay it.
|
|
9
|
+
* {E} is replaced with the companion's eye character at render time.
|
|
10
|
+
* Blink replaces {E} with "-" rather than using separate frames.
|
|
11
|
+
*/
|
|
12
|
+
export type Rarity = "common" | "uncommon" | "rare" | "epic" | "legendary";
|
|
13
|
+
export type EyeStyle = "\u00B7" | "\u2726" | "\u00D7" | "\u25C9" | "@" | "\u00B0";
|
|
14
|
+
export type Hat = "none" | "crown" | "tophat" | "propeller" | "halo" | "wizard" | "beanie" | "tinyduck";
|
|
15
|
+
export type Species = "duck" | "goose" | "blob" | "cat" | "dragon" | "octopus" | "owl" | "penguin" | "turtle" | "snail" | "ghost" | "axolotl" | "capybara" | "cactus" | "robot" | "rabbit" | "mushroom" | "chonk" | "phoenix";
|
|
16
|
+
/** Hat art for line 0 (replaces blank first line when hat present). */
|
|
17
|
+
export declare const HAT_LINES: Record<Hat, string>;
|
|
18
|
+
export interface CompanionStats {
|
|
19
|
+
debugging: number;
|
|
20
|
+
patience: number;
|
|
21
|
+
chaos: number;
|
|
22
|
+
wisdom: number;
|
|
23
|
+
snark: number;
|
|
24
|
+
}
|
|
25
|
+
export declare const RARITY_WEIGHTS: [Rarity, number][];
|
|
26
|
+
export declare const RARITY_STAT_FLOORS: Record<Rarity, number>;
|
|
27
|
+
export declare const RARITY_STARS: Record<Rarity, string>;
|
|
28
|
+
export declare const RARITY_THEME_KEYS: Record<Rarity, string>;
|
|
29
|
+
export declare const BODIES: Record<Species, string[][]>;
|
|
30
|
+
/** All species names. */
|
|
31
|
+
export declare const ALL_SPECIES: Species[];
|
|
32
|
+
/** Species rarity mapping. */
|
|
33
|
+
export declare const SPECIES_RARITY: Record<Species, Rarity>;
|
|
34
|
+
/** All available eye styles. */
|
|
35
|
+
export declare const EYE_STYLES: EyeStyle[];
|
|
36
|
+
export interface CompanionBones {
|
|
37
|
+
species: Species;
|
|
38
|
+
eyes: EyeStyle;
|
|
39
|
+
hat: Hat;
|
|
40
|
+
stats: CompanionStats;
|
|
41
|
+
isShiny: boolean;
|
|
42
|
+
rarity: Rarity;
|
|
43
|
+
}
|
|
44
|
+
/** Render sprite lines with eyes and hat applied. */
|
|
45
|
+
export declare function renderSprite(bones: CompanionBones, frame: number): string[];
|
|
46
|
+
/** Render blink frame (eyes replaced with -). */
|
|
47
|
+
export declare function renderBlink(bones: CompanionBones): string[];
|
|
48
|
+
/** Compact one-line face for narrow terminals. */
|
|
49
|
+
export declare function renderFace(bones: CompanionBones): string;
|
|
50
|
+
/** Number of animation frames for a species (always 3). */
|
|
51
|
+
export declare function spriteFrameCount(_species: Species): number;
|
|
52
|
+
//# sourceMappingURL=species.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"species.d.ts","sourceRoot":"","sources":["../../../src/ui/buddy/species.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;AAE3E,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC;AAEl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F,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qDAAqD;AACrD,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAgB3E;AAED,iDAAiD;AACjD,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,EAAE,CAU3D;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAuBxD;AAED,2DAA2D;AAC3D,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAE1D"}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Buddy companion species definitions.
|
|
3
|
+
*
|
|
4
|
+
* Each species has ASCII art frames (5 lines tall, 12 chars wide),
|
|
5
|
+
* eye placeholder {E} for expression variants, and a rarity tier.
|
|
6
|
+
* Matches Claude Code's buddy system architecture.
|
|
7
|
+
*
|
|
8
|
+
* Line 0 is the hat slot — left blank so hats can overlay it.
|
|
9
|
+
* {E} is replaced with the companion's eye character at render time.
|
|
10
|
+
* Blink replaces {E} with "-" rather than using separate frames.
|
|
11
|
+
*/
|
|
12
|
+
/** Hat art for line 0 (replaces blank first line when hat present). */
|
|
13
|
+
export const HAT_LINES = {
|
|
14
|
+
none: "",
|
|
15
|
+
crown: " \\^^^/ ",
|
|
16
|
+
tophat: " ___ ",
|
|
17
|
+
propeller: " ~+~ ",
|
|
18
|
+
halo: " ooo ",
|
|
19
|
+
wizard: " /^\\ ",
|
|
20
|
+
beanie: " --- ",
|
|
21
|
+
tinyduck: " ,> ",
|
|
22
|
+
};
|
|
23
|
+
// ── Rarity config ────────────────────────────────────────────
|
|
24
|
+
export const RARITY_WEIGHTS = [
|
|
25
|
+
["common", 60],
|
|
26
|
+
["uncommon", 25],
|
|
27
|
+
["rare", 10],
|
|
28
|
+
["epic", 4],
|
|
29
|
+
["legendary", 1],
|
|
30
|
+
];
|
|
31
|
+
export const RARITY_STAT_FLOORS = {
|
|
32
|
+
common: 5,
|
|
33
|
+
uncommon: 15,
|
|
34
|
+
rare: 25,
|
|
35
|
+
epic: 35,
|
|
36
|
+
legendary: 50,
|
|
37
|
+
};
|
|
38
|
+
export const RARITY_STARS = {
|
|
39
|
+
common: "\u2605",
|
|
40
|
+
uncommon: "\u2605\u2605",
|
|
41
|
+
rare: "\u2605\u2605\u2605",
|
|
42
|
+
epic: "\u2605\u2605\u2605\u2605",
|
|
43
|
+
legendary: "\u2605\u2605\u2605\u2605\u2605",
|
|
44
|
+
};
|
|
45
|
+
// Rarity colors mapped to theme keys (like CC), with fallback hex
|
|
46
|
+
export const RARITY_THEME_KEYS = {
|
|
47
|
+
common: "textDim",
|
|
48
|
+
uncommon: "success",
|
|
49
|
+
rare: "primary",
|
|
50
|
+
epic: "accent",
|
|
51
|
+
legendary: "warning",
|
|
52
|
+
};
|
|
53
|
+
// ── Bodies: Record<Species, string[][]> ──────────────────────
|
|
54
|
+
// 3 frames per species, 5 lines each, 12 chars wide.
|
|
55
|
+
// Frame 0: idle rest. Frame 1: fidget. Frame 2: alternate/effect.
|
|
56
|
+
export const BODIES = {
|
|
57
|
+
duck: [
|
|
58
|
+
[" ", " __ ", " ({E} > ", " /||\\ ", " ~~~~ "],
|
|
59
|
+
[" ", " __ ", " ({E} > ", " \\||/ ", " ~~~~ "],
|
|
60
|
+
[" ", " __ ", " ({E} > ", " /||\\ ", " ~~~~ "],
|
|
61
|
+
],
|
|
62
|
+
goose: [
|
|
63
|
+
[" ", " __ ", " ({E} } ", " /||\\ ", " d b "],
|
|
64
|
+
[" ", " __ ", " ({E} } ", " /|~|\\ ", " d b "],
|
|
65
|
+
[" ", " _/__ ", " ({E} } ", " /||\\ ", " d b "],
|
|
66
|
+
],
|
|
67
|
+
blob: [
|
|
68
|
+
[" ", " .-----. ", " ( {E} {E} ) ", " ( __ ) ", " '---' "],
|
|
69
|
+
[" ", " .-----. ", " ( {E} {E} ) ", " ( __ ) ", " '--' "],
|
|
70
|
+
[" ", " .-----. ", " ( {E} {E} ) ", " (__) ", " '---' "],
|
|
71
|
+
],
|
|
72
|
+
cat: [
|
|
73
|
+
[" ", " /\\_/\\ ", " ( {E}.{E} ) ", " > ^ < ", " ||| "],
|
|
74
|
+
[" ", " /\\_/\\ ", " ( {E}.{E} ) ", " > ^< ", " ||| "],
|
|
75
|
+
[" ", " /\\_/\\ ", " ( {E}.{E} ) ", " > ^ < ", " ~|| "],
|
|
76
|
+
],
|
|
77
|
+
snail: [
|
|
78
|
+
[" ", " @/ ", " {E} __ ", " /_/ ", " ~~~~ "],
|
|
79
|
+
[" ", " @/ ", " {E} __ ", " /_/ ", " ~~~~ "],
|
|
80
|
+
[" ", " @/ ", " {E} __ ", " /_/ ", " ~~~~ "],
|
|
81
|
+
],
|
|
82
|
+
turtle: [
|
|
83
|
+
[" ", " ____ ", " ({E} {E}) ", " /|==|\\ ", " d b "],
|
|
84
|
+
[" ", " ____ ", " ({E} {E}) ", " /|==|\\ ", " d b "],
|
|
85
|
+
[" ", " ____ ", " ({E} {E}) ", " \\|==|/ ", " d b "],
|
|
86
|
+
],
|
|
87
|
+
owl: [
|
|
88
|
+
[" ", " /{\\ ", " ({E},{E}) ", " /) ) ", ' " " '],
|
|
89
|
+
[" ", " /{\\ ", " ({E},{E}) ", " ( (\\ ", ' " " '],
|
|
90
|
+
[" ", " /{\\ ", " ({E},{E}) ", " /) ) ", ' " " '],
|
|
91
|
+
],
|
|
92
|
+
penguin: [
|
|
93
|
+
[" ", " (^) ", " /{E}\\ ", " / | \\ ", " d b "],
|
|
94
|
+
[" ", " (^) ", " \\{E}/ ", " \\|/ ", " d b "],
|
|
95
|
+
[" ", " (^) ", " /{E}\\ ", " / | \\ ", " d b "],
|
|
96
|
+
],
|
|
97
|
+
rabbit: [
|
|
98
|
+
[" ", " (\\(\\ ", " ({E} {E}) ", " (> <) ", ' (" ") '],
|
|
99
|
+
[" ", " (\\(\\ ", " ({E} {E}) ", " (>~<) ", ' (" ") '],
|
|
100
|
+
[" ", " /)/) ", " ({E} {E}) ", " (> <) ", ' (" ") '],
|
|
101
|
+
],
|
|
102
|
+
ghost: [
|
|
103
|
+
[" ", " .---. ", " ( {E} {E}) ", " | | ", " ~v~v~ "],
|
|
104
|
+
[" ", " .---. ", " ({E} {E} ) ", " | | ", " ~v~v~ "],
|
|
105
|
+
[" ", " .---. ", " ( {E} {E}) ", " | | ", " ~v~v~ "],
|
|
106
|
+
],
|
|
107
|
+
mushroom: [
|
|
108
|
+
[" ", " ,---. ", " / * * \\ ", " |({E}{E})| ", " |__| "],
|
|
109
|
+
[" ", " ,---. ", " /* * *\\ ", " |({E}{E})| ", " |__| "],
|
|
110
|
+
[" ", " .---. ", " / * * \\ ", " |({E}{E})| ", " |__| "],
|
|
111
|
+
],
|
|
112
|
+
robot: [
|
|
113
|
+
[" ", " [=====] ", " [{E} {E}] ", " /|=|\\ ", " d b "],
|
|
114
|
+
[" ", " [=====] ", " [{E} {E}] ", " \\|=|/ ", " d b "],
|
|
115
|
+
[" ", " [==o==] ", " [{E} {E}] ", " /|=|\\ ", " d b "],
|
|
116
|
+
],
|
|
117
|
+
octopus: [
|
|
118
|
+
[" ", " ,--, ", " ({E} {E}) ", " /||||\\ ", " ~~~~~~ "],
|
|
119
|
+
[" ", " ,--, ", " ({E} {E}) ", " \\||||/ ", " ~~~~~~ "],
|
|
120
|
+
[" ", " ,--, ", " ({E} {E}) ", " /||\\/ ", " ~~~~~~ "],
|
|
121
|
+
],
|
|
122
|
+
axolotl: [
|
|
123
|
+
[" ", " ~\\/~\\/ ", " ({E} {E}) ", " \\__/ ", " ~~~~ "],
|
|
124
|
+
[" ", " ~\\/~\\/ ", " ({E} {E}) ", " \\__/ ", " ~~~~ "],
|
|
125
|
+
[" ", " /~\\/~\\ ", " ({E} {E}) ", " \\__/ ", " ~~~~ "],
|
|
126
|
+
],
|
|
127
|
+
dragon: [
|
|
128
|
+
[" ", " /\\_/\\_ ", " ( {E} {E} ) ", " ~\\/\\/~ ", " ~/ \\~ "],
|
|
129
|
+
[" ", " /\\_/\\_ ", " ( {E} {E} ) ", " ~\\/\\/~ ", " ~/ ~\\~ "],
|
|
130
|
+
[" ", " /\\_/\\_ ", " ( {E} {E} ) ", " ~/\\/~ ", " ~/ \\~ "],
|
|
131
|
+
],
|
|
132
|
+
capybara: [
|
|
133
|
+
[" ", " .__. ", " ({E} {E}) ", " (___/) ", ' (" ") '],
|
|
134
|
+
[" ", " .__. ", " ({E} {E}) ", " (___/) ", ' (" ") '],
|
|
135
|
+
[" ", " .__. ", " ( {E}{E}) ", " (___/) ", ' (" ") '],
|
|
136
|
+
],
|
|
137
|
+
phoenix: [
|
|
138
|
+
[" ", " ,/|\\, ", " ({E} {E}) ", " '|^|' ", " ~\\/\\/ ~ "],
|
|
139
|
+
[" ", " '/|\\` ", " ({E} {E}) ", " ,|^|, ", " ~ \\/\\/~ "],
|
|
140
|
+
[" ", " ,/|\\, ", " ({E} {E}) ", " '|^|' ", " ~\\/\\/ ~ "],
|
|
141
|
+
],
|
|
142
|
+
cactus: [
|
|
143
|
+
[" ", " | ", " ({E} {E}) ", " -| |- ", " ~~~~~ "],
|
|
144
|
+
[" ", " | ", " ({E} {E}) ", " -| |- ", " ~~~~~ "],
|
|
145
|
+
[" ", " | ", " ( {E}{E}) ", " -| |- ", " ~~~~~ "],
|
|
146
|
+
],
|
|
147
|
+
chonk: [
|
|
148
|
+
[" ", " .-----. ", " ({E} {E}) ", " ( ) ", " '~~~~' "],
|
|
149
|
+
[" ", " .-----. ", " ({E} {E}) ", " ( ) ", " '~~~~' "],
|
|
150
|
+
[" ", " .------. ", " ({E} {E}) ", " ( ) ", " '~~~~' "],
|
|
151
|
+
],
|
|
152
|
+
};
|
|
153
|
+
/** All species names. */
|
|
154
|
+
export const ALL_SPECIES = [
|
|
155
|
+
"duck",
|
|
156
|
+
"goose",
|
|
157
|
+
"blob",
|
|
158
|
+
"cat",
|
|
159
|
+
"snail",
|
|
160
|
+
"turtle",
|
|
161
|
+
"owl",
|
|
162
|
+
"penguin",
|
|
163
|
+
"rabbit",
|
|
164
|
+
"ghost",
|
|
165
|
+
"mushroom",
|
|
166
|
+
"robot",
|
|
167
|
+
"octopus",
|
|
168
|
+
"axolotl",
|
|
169
|
+
"dragon",
|
|
170
|
+
"capybara",
|
|
171
|
+
"phoenix",
|
|
172
|
+
"cactus",
|
|
173
|
+
"chonk",
|
|
174
|
+
];
|
|
175
|
+
/** Species rarity mapping. */
|
|
176
|
+
export const SPECIES_RARITY = {
|
|
177
|
+
duck: "common",
|
|
178
|
+
goose: "common",
|
|
179
|
+
blob: "common",
|
|
180
|
+
cat: "common",
|
|
181
|
+
snail: "common",
|
|
182
|
+
turtle: "common",
|
|
183
|
+
owl: "uncommon",
|
|
184
|
+
penguin: "uncommon",
|
|
185
|
+
rabbit: "uncommon",
|
|
186
|
+
ghost: "uncommon",
|
|
187
|
+
mushroom: "uncommon",
|
|
188
|
+
robot: "rare",
|
|
189
|
+
octopus: "rare",
|
|
190
|
+
axolotl: "rare",
|
|
191
|
+
dragon: "epic",
|
|
192
|
+
capybara: "epic",
|
|
193
|
+
phoenix: "legendary",
|
|
194
|
+
cactus: "legendary",
|
|
195
|
+
chonk: "legendary",
|
|
196
|
+
};
|
|
197
|
+
/** All available eye styles. */
|
|
198
|
+
export const EYE_STYLES = ["\u00B7", "\u2726", "\u00D7", "\u25C9", "@", "\u00B0"];
|
|
199
|
+
/** Render sprite lines with eyes and hat applied. */
|
|
200
|
+
export function renderSprite(bones, frame) {
|
|
201
|
+
const frames = BODIES[bones.species];
|
|
202
|
+
const lines = [...(frames[frame] ?? frames[0])];
|
|
203
|
+
// Replace eye placeholders
|
|
204
|
+
for (let i = 0; i < lines.length; i++) {
|
|
205
|
+
lines[i] = lines[i].replaceAll("{E}", bones.eyes);
|
|
206
|
+
}
|
|
207
|
+
// Apply hat on line 0 if present
|
|
208
|
+
if (bones.hat !== "none" && lines[0].trim() === "") {
|
|
209
|
+
const hatLine = HAT_LINES[bones.hat];
|
|
210
|
+
if (hatLine)
|
|
211
|
+
lines[0] = hatLine;
|
|
212
|
+
}
|
|
213
|
+
return lines;
|
|
214
|
+
}
|
|
215
|
+
/** Render blink frame (eyes replaced with -). */
|
|
216
|
+
export function renderBlink(bones) {
|
|
217
|
+
const lines = [...BODIES[bones.species][0]];
|
|
218
|
+
for (let i = 0; i < lines.length; i++) {
|
|
219
|
+
lines[i] = lines[i].replaceAll("{E}", "-");
|
|
220
|
+
}
|
|
221
|
+
if (bones.hat !== "none" && lines[0].trim() === "") {
|
|
222
|
+
const hatLine = HAT_LINES[bones.hat];
|
|
223
|
+
if (hatLine)
|
|
224
|
+
lines[0] = hatLine;
|
|
225
|
+
}
|
|
226
|
+
return lines;
|
|
227
|
+
}
|
|
228
|
+
/** Compact one-line face for narrow terminals. */
|
|
229
|
+
export function renderFace(bones) {
|
|
230
|
+
const e = bones.eyes;
|
|
231
|
+
switch (bones.species) {
|
|
232
|
+
case "cat":
|
|
233
|
+
return `=${e}.${e}=`;
|
|
234
|
+
case "duck":
|
|
235
|
+
case "goose":
|
|
236
|
+
return `(${e}>`;
|
|
237
|
+
case "blob":
|
|
238
|
+
case "chonk":
|
|
239
|
+
return `(${e} ${e})`;
|
|
240
|
+
case "owl":
|
|
241
|
+
return `{${e},${e}}`;
|
|
242
|
+
case "robot":
|
|
243
|
+
return `[${e}_${e}]`;
|
|
244
|
+
case "ghost":
|
|
245
|
+
return `(${e} ${e})~`;
|
|
246
|
+
case "dragon":
|
|
247
|
+
case "phoenix":
|
|
248
|
+
return `<${e} ${e}>`;
|
|
249
|
+
default:
|
|
250
|
+
return `(${e}${e})`;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/** Number of animation frames for a species (always 3). */
|
|
254
|
+
export function spriteFrameCount(_species) {
|
|
255
|
+
return 3;
|
|
256
|
+
}
|
|
257
|
+
//# sourceMappingURL=species.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"species.js","sourceRoot":"","sources":["../../../src/ui/buddy/species.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqCH,uEAAuE;AACvE,MAAM,CAAC,MAAM,SAAS,GAAwB;IAC5C,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,cAAc;IACtB,SAAS,EAAE,cAAc;IACzB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,cAAc;IACtB,QAAQ,EAAE,cAAc;CACzB,CAAC;AAUF,gEAAgE;AAEhE,MAAM,CAAC,MAAM,cAAc,GAAuB;IAChD,CAAC,QAAQ,EAAE,EAAE,CAAC;IACd,CAAC,UAAU,EAAE,EAAE,CAAC;IAChB,CAAC,MAAM,EAAE,EAAE,CAAC;IACZ,CAAC,MAAM,EAAE,CAAC,CAAC;IACX,CAAC,WAAW,EAAE,CAAC,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAA2B;IACxD,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,SAAS,EAAE,EAAE;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,0BAA0B;IAChC,SAAS,EAAE,gCAAgC;CAC5C,CAAC;AAEF,kEAAkE;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,SAAS;IAC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IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QACvB,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO;YACV,OAAO,IAAI,CAAC,GAAG,CAAC;QAClB,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO;YACV,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QACvB,KAAK,KAAK;YACR,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QACvB,KAAK,OAAO;YACV,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QACvB,KAAK,OAAO;YACV,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QACxB,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS;YACZ,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QACvB;YACE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IACxB,CAAC;AACH,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,gBAAgB,CAAC,QAAiB;IAChD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { ActivityPhase, RetryInfo } from "../hooks/useAgentLoop.js";
|
|
2
3
|
interface ActivityIndicatorProps {
|
|
3
4
|
phase: ActivityPhase;
|
|
@@ -5,6 +6,10 @@ interface ActivityIndicatorProps {
|
|
|
5
6
|
thinkingMs: number;
|
|
6
7
|
isThinking: boolean;
|
|
7
8
|
tokenEstimate: number;
|
|
9
|
+
/** Raw character count ref for smooth token animation (read every tick). */
|
|
10
|
+
charCountRef?: React.RefObject<number>;
|
|
11
|
+
/** Accumulated real tokens from completed turns. */
|
|
12
|
+
realTokensAccumRef?: React.RefObject<number>;
|
|
8
13
|
userMessage?: string;
|
|
9
14
|
activeToolNames?: string[];
|
|
10
15
|
planMode?: boolean;
|
|
@@ -12,6 +17,6 @@ interface ActivityIndicatorProps {
|
|
|
12
17
|
planDone?: number;
|
|
13
18
|
planTotal?: number;
|
|
14
19
|
}
|
|
15
|
-
export declare function ActivityIndicator({ phase, elapsedMs, thinkingMs, isThinking, tokenEstimate, userMessage, activeToolNames, planMode, retryInfo, planDone, planTotal, }: ActivityIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function ActivityIndicator({ phase, elapsedMs, thinkingMs, isThinking, tokenEstimate, charCountRef: charCountRefProp, realTokensAccumRef: realTokensAccumRefProp, userMessage, activeToolNames, planMode, retryInfo, planDone, planTotal, }: ActivityIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
16
21
|
export {};
|
|
17
22
|
//# sourceMappingURL=ActivityIndicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ActivityIndicator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ActivityIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AA4GzE,UAAU,sBAAsB;IAC9B,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACvC,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AASD,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,aAAa,EACb,YAAY,EAAE,gBAAgB,EAC9B,kBAAkB,EAAE,sBAAsB,EAC1C,WAAgB,EAChB,eAAoB,EACpB,QAAQ,EACR,SAAS,EACT,QAAY,EACZ,SAAa,GACd,EAAE,sBAAsB,2CAoJxB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useMemo } from "react";
|
|
2
|
+
import React, { useMemo, useRef } from "react";
|
|
3
3
|
import { Text, Box } from "ink";
|
|
4
4
|
import { useTheme } from "../theme/theme.js";
|
|
5
|
-
import { SPINNER_FRAMES, SPINNER_INTERVAL } from "../spinner-frames.js";
|
|
5
|
+
import { SPINNER_FRAMES, SPINNER_INTERVAL, REDUCED_MOTION_DOT } from "../spinner-frames.js";
|
|
6
6
|
import { PLANNING_PHRASES, selectPhrases, shuffleArray } from "../activity-phrases.js";
|
|
7
|
-
import { useAnimationTick, useAnimationActive, deriveFrame } from "./AnimationContext.js";
|
|
7
|
+
import { useAnimationTick, useAnimationActive, deriveFrame, useReducedMotion, } from "./AnimationContext.js";
|
|
8
8
|
// ── Color pulse cycle ─────────────────────────────────────
|
|
9
9
|
const PULSE_COLORS = [
|
|
10
10
|
"#60a5fa", // blue
|
|
@@ -75,15 +75,59 @@ const RETRY_REASON_LABELS = {
|
|
|
75
75
|
empty_response: "Empty response",
|
|
76
76
|
context_overflow: "Context overflow, compacting",
|
|
77
77
|
};
|
|
78
|
-
export function ActivityIndicator({ phase, elapsedMs, thinkingMs, isThinking, tokenEstimate, userMessage = "", activeToolNames = [], planMode, retryInfo, planDone = 0, planTotal = 0, }) {
|
|
78
|
+
export function ActivityIndicator({ phase, elapsedMs, thinkingMs, isThinking, tokenEstimate, charCountRef: charCountRefProp, realTokensAccumRef: realTokensAccumRefProp, userMessage = "", activeToolNames = [], planMode, retryInfo, planDone = 0, planTotal = 0, }) {
|
|
79
79
|
const theme = useTheme();
|
|
80
|
+
const reducedMotion = useReducedMotion();
|
|
80
81
|
// Use the global animation tick instead of a local timer.
|
|
81
82
|
// This eliminates a duplicate 100ms setInterval that was causing
|
|
82
83
|
// independent re-renders on top of the global AnimationProvider tick.
|
|
83
84
|
useAnimationActive();
|
|
84
85
|
const tick = useAnimationTick();
|
|
86
|
+
// ── Smooth token counter animation ─────────────────────
|
|
87
|
+
// Smooths the TOTAL token estimate (real + estimated) so it never
|
|
88
|
+
// jumps — whether tokens arrive from streaming deltas or from
|
|
89
|
+
// turn_end replacing char estimates with real API counts.
|
|
90
|
+
//
|
|
91
|
+
// On each 100ms animation tick the displayed count catches up to
|
|
92
|
+
// the target at a speed that scales with the gap, producing a
|
|
93
|
+
// rolling-odometer effect.
|
|
94
|
+
const displayedTokensRef = useRef(0);
|
|
95
|
+
const currentChars = charCountRefProp?.current ?? 0;
|
|
96
|
+
const realTokens = realTokensAccumRefProp?.current ?? 0;
|
|
97
|
+
const targetTokens = charCountRefProp ? realTokens + Math.ceil(currentChars / 4) : tokenEstimate;
|
|
98
|
+
if (reducedMotion || !charCountRefProp) {
|
|
99
|
+
displayedTokensRef.current = targetTokens;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
const gap = targetTokens - displayedTokensRef.current;
|
|
103
|
+
if (gap > 0) {
|
|
104
|
+
// Scale increment with gap size for smooth catch-up
|
|
105
|
+
let increment;
|
|
106
|
+
if (gap < 20) {
|
|
107
|
+
increment = 1;
|
|
108
|
+
}
|
|
109
|
+
else if (gap < 50) {
|
|
110
|
+
increment = Math.max(2, Math.ceil(gap * 0.1));
|
|
111
|
+
}
|
|
112
|
+
else if (gap < 200) {
|
|
113
|
+
increment = Math.max(5, Math.ceil(gap * 0.12));
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
// Large jump (e.g. turn_end real tokens) — faster catch-up
|
|
117
|
+
increment = Math.max(15, Math.ceil(gap * 0.08));
|
|
118
|
+
}
|
|
119
|
+
displayedTokensRef.current = Math.min(displayedTokensRef.current + increment, targetTokens);
|
|
120
|
+
}
|
|
121
|
+
else if (gap < 0) {
|
|
122
|
+
// Reset happened (new run) — snap to target
|
|
123
|
+
displayedTokensRef.current = targetTokens;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const smoothTokenEstimate = displayedTokensRef.current;
|
|
85
127
|
// Derive all animation frames from the single tick counter
|
|
86
|
-
const spinnerFrame =
|
|
128
|
+
const spinnerFrame = reducedMotion
|
|
129
|
+
? 0
|
|
130
|
+
: deriveFrame(tick, SPINNER_INTERVAL, SPINNER_FRAMES.length);
|
|
87
131
|
const pulseColors = planMode ? PLAN_PULSE_COLORS : PULSE_COLORS;
|
|
88
132
|
const colorFrame = deriveFrame(tick, PULSE_INTERVAL, pulseColors.length);
|
|
89
133
|
const ellipsisFrame = deriveFrame(tick, ELLIPSIS_INTERVAL, ELLIPSIS_FRAMES.length);
|
|
@@ -102,7 +146,7 @@ export function ActivityIndicator({ phase, elapsedMs, thinkingMs, isThinking, to
|
|
|
102
146
|
const shimmerPos = (tick % shimmerCycle) - SHIMMER_WIDTH;
|
|
103
147
|
// Pad ellipsis to prevent text from shifting
|
|
104
148
|
const paddedEllipsis = ellipsis + " ".repeat(3 - ellipsis.length);
|
|
105
|
-
const meta = buildMetaSuffix(elapsedMs, thinkingMs, isThinking,
|
|
149
|
+
const meta = buildMetaSuffix(elapsedMs, thinkingMs, isThinking, smoothTokenEstimate);
|
|
106
150
|
// ── Plan progress bar ──────────────────────────────────
|
|
107
151
|
const planBar = useMemo(() => {
|
|
108
152
|
if (planTotal <= 0)
|
|
@@ -116,8 +160,8 @@ export function ActivityIndicator({ phase, elapsedMs, thinkingMs, isThinking, to
|
|
|
116
160
|
const retryLabel = RETRY_REASON_LABELS[retryInfo.reason];
|
|
117
161
|
const retryColor = "#f59e0b"; // amber
|
|
118
162
|
const delaySec = retryInfo.delayMs > 0 ? ` waiting ${Math.round(retryInfo.delayMs / 1000)}s` : "";
|
|
119
|
-
return (_jsxs(Box, { children: [_jsxs(Text, { color: retryColor, bold: true, children: [SPINNER_FRAMES[spinnerFrame], " "] }), _jsxs(Text, { color: retryColor, children: [retryLabel, " \u2014 retrying (", retryInfo.attempt, "/", retryInfo.maxAttempts, ")"] }), _jsxs(Text, { color: theme.textDim, children: [delaySec, " (", formatElapsed(elapsedMs), ")"] })] }));
|
|
163
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { color: retryColor, bold: true, children: [reducedMotion ? REDUCED_MOTION_DOT : SPINNER_FRAMES[spinnerFrame], " "] }), _jsxs(Text, { color: retryColor, children: [retryLabel, " \u2014 retrying (", retryInfo.attempt, "/", retryInfo.maxAttempts, ")"] }), _jsxs(Text, { color: theme.textDim, children: [delaySec, " (", formatElapsed(elapsedMs), ")"] })] }));
|
|
120
164
|
}
|
|
121
|
-
return (_jsxs(Box, { children: [_jsxs(Text, { color: spinnerColor, bold: true, children: [SPINNER_FRAMES[spinnerFrame], " "] }), _jsx(ShimmerText, { text: phrase, color: spinnerColor, shimmerPos: shimmerPos }), _jsx(Text, { color: theme.textDim, children: paddedEllipsis }), meta && (_jsxs(Text, { color: theme.textDim, children: [" (", meta, ")"] })), planBar && (_jsxs(Text, { children: [" ", _jsx(Text, { color: planDone === planTotal ? theme.success : theme.planPrimary, children: planBar }), _jsxs(Text, { color: theme.textDim, children: [" ", planDone, "/", planTotal] })] }))] }));
|
|
165
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { color: spinnerColor, bold: true, children: [reducedMotion ? REDUCED_MOTION_DOT : SPINNER_FRAMES[spinnerFrame], " "] }), reducedMotion ? (_jsx(Text, { dimColor: true, color: spinnerColor, children: phrase })) : (_jsx(ShimmerText, { text: phrase, color: spinnerColor, shimmerPos: shimmerPos })), _jsx(Text, { color: theme.textDim, children: reducedMotion ? "..." : paddedEllipsis }), meta && (_jsxs(Text, { color: theme.textDim, children: [" (", meta, ")"] })), planBar && (_jsxs(Text, { children: [" ", _jsx(Text, { color: planDone === planTotal ? theme.success : theme.planPrimary, children: planBar }), _jsxs(Text, { color: theme.textDim, children: [" ", planDone, "/", planTotal] })] }))] }));
|
|
122
166
|
}
|
|
123
167
|
//# sourceMappingURL=ActivityIndicator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.js","sourceRoot":"","sources":["../../../src/ui/components/ActivityIndicator.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.js","sourceRoot":"","sources":["../../../src/ui/components/ActivityIndicator.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,6DAA6D;AAE7D,MAAM,YAAY,GAAG;IACnB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,gBAAgB;IAC3B,SAAS,EAAE,cAAc;IACzB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,cAAc;CAC1B,CAAC;AAEF,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@@ export declare function useAnimationTick(): number;
|
|
|
25
25
|
export declare function useAnimationActive(): void;
|
|
26
26
|
/** Derive a frame index from the global tick for a given interval and frame count. */
|
|
27
27
|
export declare function deriveFrame(tick: number, intervalMs: number, frameCount: number): number;
|
|
28
|
+
/**
|
|
29
|
+
* Check if reduced-motion is requested.
|
|
30
|
+
* Respects NO_MOTION and REDUCE_MOTION env vars.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useReducedMotion(): boolean;
|
|
28
33
|
export { TICK_INTERVAL };
|
|
29
34
|
//# sourceMappingURL=AnimationContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationContext.d.ts","sourceRoot":"","sources":["../../../src/ui/components/AnimationContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8E,MAAM,OAAO,CAAC;AAEnG;;;;;;;;;;;GAWG;AAEH,QAAA,MAAM,aAAa,MAAM,CAAC;AAO1B,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CA4C5E;AAED,yDAAyD;AACzD,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAKzC;AAED,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAExF;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"AnimationContext.d.ts","sourceRoot":"","sources":["../../../src/ui/components/AnimationContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8E,MAAM,OAAO,CAAC;AAEnG;;;;;;;;;;;GAWG;AAEH,QAAA,MAAM,aAAa,MAAM,CAAC;AAO1B,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CA4C5E;AAED,yDAAyD;AACzD,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAKzC;AAED,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAExF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|