dsh-code 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +2 -2
- package/README.md +2 -2
- package/lib/index.mjs +1473 -899
- package/lib/startup.mjs +21 -9
- package/lib/theme-BEi4i_aN.mjs +624 -0
- package/lib/types/app.d.ts +31 -3
- package/lib/types/index.d.ts +1 -0
- package/lib/types/kernel-panels.d.ts +21 -0
- package/lib/types/mentions.d.ts +29 -12
- package/lib/types/models.d.ts +66 -0
- package/lib/types/render/animations.d.ts +175 -2
- package/lib/types/render/projection.d.ts +28 -0
- package/lib/types/render/status.d.ts +34 -13
- package/lib/types/startup.d.ts +12 -4
- package/lib/types/theme-panel.d.ts +24 -0
- package/lib/types/theme.d.ts +158 -2
- package/package.json +1 -1
- package/src/app.ts +510 -130
- package/src/index.ts +964 -905
- package/src/kernel-panels.ts +481 -419
- package/src/mentions.ts +57 -27
- package/src/models.ts +200 -66
- package/src/render/animations.ts +359 -2
- package/src/render/projection.ts +764 -659
- package/src/render/status.ts +744 -603
- package/src/startup.ts +119 -109
- package/src/theme-panel.ts +72 -0
- package/src/theme.ts +206 -70
package/src/render/animations.ts
CHANGED
|
@@ -3,12 +3,22 @@
|
|
|
3
3
|
* the StateDot "ongoing" pixel chase (3×3 ring, 125ms flat-hold brightness
|
|
4
4
|
* steps, 1s cycle) becomes the single-cell stepped pulse below and the
|
|
5
5
|
* full-ring clockwise braille chase in {@link BUSY_CHASE_FRAMES}, and the
|
|
6
|
-
* streaming caret blink is the Claude-Code convention.
|
|
7
|
-
*
|
|
6
|
+
* streaming caret blink is the Claude-Code convention.
|
|
7
|
+
*
|
|
8
|
+
* The DeepSeek model-switch easter egg ports Codex's effort-ignition "Wave"
|
|
9
|
+
* style (`codex-rs/tui/src/bottom_pane/effort_ignition_styles.rs`): switching
|
|
10
|
+
* INTO an official DeepSeek route sweeps a blue wave across the composer's
|
|
11
|
+
* input row — one column per cell, `backgroundColor` = the sampled wave
|
|
12
|
+
* color — then, on the deepseek (Ultra-equivalent) tier, drops the `· ✦ ✧`
|
|
13
|
+
* sparkle sequence into the rightmost blank cell before fading. The prompt
|
|
14
|
+
* marker keeps the tier accent afterwards (persistent, like Codex's prompt
|
|
15
|
+
* charge). Pure functions only — the Ink layer owns timers and colors.
|
|
8
16
|
*
|
|
9
17
|
* @module @deepseek-ai/dsh-code/render/animations
|
|
10
18
|
*/
|
|
11
19
|
|
|
20
|
+
import type { RgbTriple } from '../theme.ts'
|
|
21
|
+
|
|
12
22
|
/** Single-cell stepped pulse: flat holds mirroring the web's 125ms keyframes. */
|
|
13
23
|
export const PULSE_FRAMES = ['█', '█', '▆', '▃', '▁', '▃', '▆', '█'] as const
|
|
14
24
|
|
|
@@ -33,3 +43,350 @@ export function busyChaseFrame(tick: number): string {
|
|
|
33
43
|
export function caretVisible(tick: number): boolean {
|
|
34
44
|
return tick % 2 === 0
|
|
35
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The one-shot DeepSeek model-switch easter egg: when the status bar model
|
|
49
|
+
* label switches to an official DeepSeek route, the composer's input row
|
|
50
|
+
* plays Codex's effort-ignition "Wave" — a blue crest sweeping the content
|
|
51
|
+
* row column by column (background tint ≤ 0.55 under the draft), plus the
|
|
52
|
+
* Ultra-style `· ✦ ✧` sparkles on the deepseek tier — and the prompt marker
|
|
53
|
+
* keeps the tier accent afterwards. The Ink layer owns the timer and reads
|
|
54
|
+
* the ACTIVE palette anchors (`getPalette`); everything below is pure
|
|
55
|
+
* interpolation over the colors it is given.
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
/** Frame cadence of the DeepSeek wave: Codex's IGNITION_FRAME_TICK (33ms ≈ 30fps). */
|
|
59
|
+
export const DEEPSEEK_WAVE_TICK_MS = 33
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The two DeepSeek wave tiers. The concept maps Codex's reasoning tiers to
|
|
63
|
+
* model ids: `flash` runs the Max parameters, `deepseek` (pro models) runs
|
|
64
|
+
* the Ultra parameters (dual band + tail sparkles on the Wave style).
|
|
65
|
+
*/
|
|
66
|
+
export type DeepseekWaveTier = 'flash' | 'deepseek'
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The three ignition styles — Codex `IgnitionStyle`: a traveling crest
|
|
70
|
+
* (Wave), a drifting multi-hue band (Aurora), and an expanding ring (Pulse).
|
|
71
|
+
* One style is picked at random per trigger and never repeats the previous.
|
|
72
|
+
*/
|
|
73
|
+
export type DeepseekWaveStyle = 'wave' | 'aurora' | 'pulse'
|
|
74
|
+
|
|
75
|
+
/** All styles in canonical order, for random selection and tests. */
|
|
76
|
+
export const DEEPSEEK_WAVE_STYLES: readonly DeepseekWaveStyle[] = ['wave', 'aurora', 'pulse']
|
|
77
|
+
|
|
78
|
+
/** Wave half-width in columns — Codex WAVE_HALF_WIDTH (9). */
|
|
79
|
+
export const WAVE_HALF_WIDTH = 9
|
|
80
|
+
|
|
81
|
+
/** Pulse ring half-width in columns — Codex PULSE_HALF_WIDTH (4.5). */
|
|
82
|
+
export const PULSE_HALF_WIDTH = 4.5
|
|
83
|
+
|
|
84
|
+
/** Sparkle start and frame cadence — Codex SPARK_START / SPARK_FRAME. */
|
|
85
|
+
export const SPARK_START_MS = 900
|
|
86
|
+
export const SPARK_FRAME_MS = 100
|
|
87
|
+
|
|
88
|
+
/** Sparkle glyphs in frame order — Codex SPARK_GLYPHS (`· ✦ ✧`). */
|
|
89
|
+
export const SPARK_GLYPHS = ['·', '✦', '✧'] as const
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Band tables — Codex `bands(style, tier)`. Each entry is a triple whose
|
|
93
|
+
* meaning depends on the style: Wave/Pulse use `(launch, travel, strength)`;
|
|
94
|
+
* Aurora uses `(speed, phase, hueIndex)`.
|
|
95
|
+
*/
|
|
96
|
+
export type DeepseekWaveBand = readonly [number, number, number]
|
|
97
|
+
export const DEEPSEEK_WAVE_BANDS: Readonly<Record<DeepseekWaveStyle, Readonly<Record<DeepseekWaveTier, readonly DeepseekWaveBand[]>>>> = {
|
|
98
|
+
wave: {
|
|
99
|
+
// Wave-Max: one band sweeping 0.10s..0.85s.
|
|
100
|
+
flash: [[0.10, 0.75, 1.0]],
|
|
101
|
+
// Wave-Ultra: two offset bands for a richer crest.
|
|
102
|
+
deepseek: [[0.10, 0.70, 1.0], [0.35, 0.55, 1.0]],
|
|
103
|
+
},
|
|
104
|
+
aurora: {
|
|
105
|
+
// Aurora-Max: two drifting bands (hues 0 and 1).
|
|
106
|
+
flash: [[0.35, 0.15, 0.0], [-0.50, 0.60, 1.0]],
|
|
107
|
+
// Aurora-Ultra: a third band adds hue 2.
|
|
108
|
+
deepseek: [[0.35, 0.15, 0.0], [-0.50, 0.60, 1.0], [0.75, 0.35, 2.0]],
|
|
109
|
+
},
|
|
110
|
+
pulse: {
|
|
111
|
+
// Pulse-Max: one expanding ring.
|
|
112
|
+
flash: [[0.10, 0.60, 1.0]],
|
|
113
|
+
// Pulse-Ultra: two rings (inner weaker, outer stronger).
|
|
114
|
+
deepseek: [[0.10, 0.55, 0.8], [0.45, 0.55, 1.1]],
|
|
115
|
+
},
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Total animation duration — Codex `IgnitionStyle::total_duration`: three
|
|
120
|
+
* styles × two tiers.
|
|
121
|
+
* @param tier - the active wave tier.
|
|
122
|
+
* @param style - the active ignition style.
|
|
123
|
+
* @returns the duration in milliseconds.
|
|
124
|
+
*/
|
|
125
|
+
export function deepseekWaveDuration(tier: DeepseekWaveTier, style: DeepseekWaveStyle = 'wave'): number {
|
|
126
|
+
switch (style) {
|
|
127
|
+
case 'aurora': return tier === 'flash' ? 1300 : 1600
|
|
128
|
+
case 'pulse': return tier === 'flash' ? 900 : 1250
|
|
129
|
+
case 'wave': return tier === 'flash' ? 1000 : 1300
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Pick one ignition style at random, never repeating the previous one —
|
|
135
|
+
* Codex `IgnitionStyle::random`. Falls back to the remaining styles.
|
|
136
|
+
* @param previous - the style of the last trigger, if any.
|
|
137
|
+
* @returns a style different from `previous`.
|
|
138
|
+
*/
|
|
139
|
+
export function deepseekWaveStyleRandom(previous: DeepseekWaveStyle | undefined): DeepseekWaveStyle {
|
|
140
|
+
const candidates = DEEPSEEK_WAVE_STYLES.filter(style => style !== previous)
|
|
141
|
+
return candidates[Math.floor(Math.random() * candidates.length)] ?? 'wave'
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Blank-cell background the wave tint blends toward — fixed approximations
|
|
146
|
+
* of the terminal's default background, mirroring Codex's
|
|
147
|
+
* `user_message_bg_rgb` (which derives a near-black / near-white bubble tint
|
|
148
|
+
* from the terminal background). The Ink layer picks the active theme's one.
|
|
149
|
+
*/
|
|
150
|
+
export const WAVE_BASE_DARK: RgbTriple = [16, 18, 24]
|
|
151
|
+
export const WAVE_BASE_LIGHT: RgbTriple = [242, 244, 248]
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Tier for a `provider/model` label: a model id containing `flash` runs the
|
|
155
|
+
* single-band flash tier; everything else (pro/reasoner/chat) runs the
|
|
156
|
+
* dual-band deepseek tier. Mirrors Codex's Max→Ultra mapping.
|
|
157
|
+
* @param model - the `provider/model` label of the applied model.
|
|
158
|
+
* @returns the wave tier for that model.
|
|
159
|
+
*/
|
|
160
|
+
export function deepseekWaveTier(model: string): DeepseekWaveTier {
|
|
161
|
+
return model.toLowerCase().includes('flash') ? 'flash' : 'deepseek'
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Cosine window — Codex `crest`: 1 exactly under the wave center, 0 from
|
|
166
|
+
* one half-width away.
|
|
167
|
+
* @param distance - distance from the crest center in half-widths.
|
|
168
|
+
* @returns the crest strength in 0..1.
|
|
169
|
+
*/
|
|
170
|
+
export function crest(distance: number): number {
|
|
171
|
+
if (distance >= 1) return 0
|
|
172
|
+
return 0.5 * (1 + Math.cos(Math.PI * distance))
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Cubic ease-in-out — Codex `ease_in_out`: flat at both ends, steepest in
|
|
177
|
+
* the middle, so the crest accelerates and eases instead of sliding linearly.
|
|
178
|
+
* @param progress - raw progress (clamped to 0..1).
|
|
179
|
+
* @returns the eased progress in 0..1.
|
|
180
|
+
*/
|
|
181
|
+
export function easeInOut(progress: number): number {
|
|
182
|
+
const p = Math.min(1, Math.max(0, progress))
|
|
183
|
+
if (p < 0.5) return 4 * p * p * p
|
|
184
|
+
const inverse = -2 * p + 2
|
|
185
|
+
return 1 - (inverse * inverse * inverse) / 2
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Fade-in/fade-out envelope — Codex `envelope`: linear ramp over `fadeIn`
|
|
190
|
+
* at the start and `fadeOut` at the end, plateau at 1 between, 0 outside the
|
|
191
|
+
* total. The Wave style keeps the envelope at 1 (Codex paints Wave without
|
|
192
|
+
* an envelope); exported for the Aurora-style fades and for tests.
|
|
193
|
+
* @param elapsed - seconds since the animation started.
|
|
194
|
+
* @param total - total duration in seconds.
|
|
195
|
+
* @param fadeIn - seconds of fade-in.
|
|
196
|
+
* @param fadeOut - seconds of fade-out.
|
|
197
|
+
* @returns the envelope value in 0..1.
|
|
198
|
+
*/
|
|
199
|
+
export function envelope(elapsed: number, total: number, fadeIn: number, fadeOut: number): number {
|
|
200
|
+
if (elapsed <= 0 || elapsed >= total) return 0
|
|
201
|
+
const rise = elapsed / Math.max(fadeIn, Number.EPSILON)
|
|
202
|
+
const fall = (total - elapsed) / Math.max(fadeOut, Number.EPSILON)
|
|
203
|
+
return Math.min(Math.max(Math.min(rise, fall), 0), 1)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* One band's contribution at a column — Codex `band_sample`, all three
|
|
208
|
+
* branches: Wave sweeps an eased crest across the row; Aurora drifts a
|
|
209
|
+
* sinusoidal center carrying a hue index; Pulse expands a ring from the row
|
|
210
|
+
* center with cubic ease and decaying strength.
|
|
211
|
+
* @param style - the ignition style.
|
|
212
|
+
* @param band - the band triple (meaning depends on the style).
|
|
213
|
+
* @param elapsed - seconds since the animation started.
|
|
214
|
+
* @param column - column index in the content row (0..width-1).
|
|
215
|
+
* @param width - content-row width in columns.
|
|
216
|
+
* @returns `[hueIndex, strength]`.
|
|
217
|
+
*/
|
|
218
|
+
function bandSample(
|
|
219
|
+
style: DeepseekWaveStyle,
|
|
220
|
+
band: DeepseekWaveBand,
|
|
221
|
+
elapsed: number,
|
|
222
|
+
column: number,
|
|
223
|
+
width: number,
|
|
224
|
+
): [number, number] {
|
|
225
|
+
const [first, second, third] = band
|
|
226
|
+
switch (style) {
|
|
227
|
+
case 'wave': {
|
|
228
|
+
const progress = (elapsed - first) / second
|
|
229
|
+
if (progress < 0 || progress > 1) return [0, 0]
|
|
230
|
+
const center = easeInOut(progress) * (width + 2 * WAVE_HALF_WIDTH) - WAVE_HALF_WIDTH
|
|
231
|
+
return [0, crest(Math.abs(column - center) / WAVE_HALF_WIDTH)]
|
|
232
|
+
}
|
|
233
|
+
case 'aurora': {
|
|
234
|
+
const center = (0.5 + 0.38 * Math.sin(Math.PI * 2 * (first * elapsed + second))) * width
|
|
235
|
+
const halfWidth = Math.max(width * 0.22, 4)
|
|
236
|
+
return [Math.trunc(third), crest(Math.abs(column - center) / halfWidth)]
|
|
237
|
+
}
|
|
238
|
+
case 'pulse': {
|
|
239
|
+
const progress = (elapsed - first) / second
|
|
240
|
+
if (progress < 0 || progress > 1) return [0, 0]
|
|
241
|
+
const inverse = 1 - progress
|
|
242
|
+
const radius = (1 - inverse * inverse * inverse) * (width / 2 + 2 * PULSE_HALF_WIDTH)
|
|
243
|
+
const distance = Math.abs(column - width / 2)
|
|
244
|
+
return [0, crest(Math.abs(distance - radius) / PULSE_HALF_WIDTH) * third * (1 - 0.6 * progress)]
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/** Linear RGB blend — Codex `blend`: `fg * alpha + bg * (1 - alpha)`. */
|
|
250
|
+
function blendRgb(fg: RgbTriple, bg: RgbTriple, alpha: number): RgbTriple {
|
|
251
|
+
return [
|
|
252
|
+
Math.round(fg[0] * alpha + bg[0] * (1 - alpha)),
|
|
253
|
+
Math.round(fg[1] * alpha + bg[1] * (1 - alpha)),
|
|
254
|
+
Math.round(fg[2] * alpha + bg[2] * (1 - alpha)),
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* The background color for one composer-row column at a tick — Codex
|
|
260
|
+
* `paint_bands` + `Canvas::tint` for all three styles. Bands overlap with a
|
|
261
|
+
* max for Wave/Pulse and a SUM for Aurora (Codex differs by style), the
|
|
262
|
+
* weighted hues mix per column (Wave/Pulse always end on hue 0), the tint
|
|
263
|
+
* blends the mixed hue toward the blank-cell base at the style's alpha cap,
|
|
264
|
+
* and Aurora applies its own fade envelope. Returns `null` when the column
|
|
265
|
+
* should stay transparent, so the row returns to no `backgroundColor` on
|
|
266
|
+
* both ends.
|
|
267
|
+
* @param tick - wave frame (0, 1, … at DEEPSEEK_WAVE_TICK_MS).
|
|
268
|
+
* @param column - column index in the content row (0..width-1).
|
|
269
|
+
* @param width - content-row width in columns.
|
|
270
|
+
* @param tier - the wave tier (flash = Max, deepseek = Ultra parameters).
|
|
271
|
+
* @param style - the ignition style.
|
|
272
|
+
* @param hues - the tier's three hues.
|
|
273
|
+
* @param base - the blank-cell base color the tint blends toward.
|
|
274
|
+
* @returns the blended RGB background, or null for transparent.
|
|
275
|
+
*/
|
|
276
|
+
export function deepseekWaveColumnBg(
|
|
277
|
+
tick: number,
|
|
278
|
+
column: number,
|
|
279
|
+
width: number,
|
|
280
|
+
tier: DeepseekWaveTier,
|
|
281
|
+
style: DeepseekWaveStyle,
|
|
282
|
+
hues: readonly [RgbTriple, RgbTriple, RgbTriple],
|
|
283
|
+
base: RgbTriple,
|
|
284
|
+
): RgbTriple | null {
|
|
285
|
+
const total = deepseekWaveDuration(tier, style) / 1000
|
|
286
|
+
const elapsed = (tick * DEEPSEEK_WAVE_TICK_MS) / 1000
|
|
287
|
+
const fade = style === 'aurora' ? envelope(elapsed, total, 0.25, 0.40) : 1
|
|
288
|
+
const weights = [0, 0, 0]
|
|
289
|
+
for (const band of DEEPSEEK_WAVE_BANDS[style][tier]) {
|
|
290
|
+
const [hue, strength] = bandSample(style, band, elapsed, column, width)
|
|
291
|
+
weights[hue] = style === 'aurora' ? weights[hue]! + strength : Math.max(weights[hue]!, strength)
|
|
292
|
+
}
|
|
293
|
+
const weight = weights[0]! + weights[1]! + weights[2]!
|
|
294
|
+
if (weight <= 0.01) return null
|
|
295
|
+
let red = 0
|
|
296
|
+
let green = 0
|
|
297
|
+
let blue = 0
|
|
298
|
+
for (let index = 0; index < 3; index += 1) {
|
|
299
|
+
red += weights[index]! * hues[index]![0]
|
|
300
|
+
green += weights[index]! * hues[index]![1]
|
|
301
|
+
blue += weights[index]! * hues[index]![2]
|
|
302
|
+
}
|
|
303
|
+
const mixed: RgbTriple = [
|
|
304
|
+
Math.round(red / weight),
|
|
305
|
+
Math.round(green / weight),
|
|
306
|
+
Math.round(blue / weight),
|
|
307
|
+
]
|
|
308
|
+
const alpha = style === 'aurora' ? Math.min(weight * 0.40, 0.50) * fade : weight * 0.55
|
|
309
|
+
if (alpha < 0.02) return null
|
|
310
|
+
return blendRgb(mixed, base, alpha)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* The sparkle glyph for a tick — Codex `spark_frame`: from 900ms on, one
|
|
315
|
+
* glyph every 100ms through `· ✦ ✧`, then silent. The deepseek (Ultra) tier
|
|
316
|
+
* only; the Ink layer still must skip occupied cells.
|
|
317
|
+
* @param tick - wave frame at DEEPSEEK_WAVE_TICK_MS.
|
|
318
|
+
* @returns the sparkle glyph, or null outside the 900..1200ms window.
|
|
319
|
+
*/
|
|
320
|
+
export function deepseekWaveSpark(tick: number): string | null {
|
|
321
|
+
const elapsed = tick * DEEPSEEK_WAVE_TICK_MS
|
|
322
|
+
if (elapsed < SPARK_START_MS) return null
|
|
323
|
+
const frame = Math.floor((elapsed - SPARK_START_MS) / SPARK_FRAME_MS)
|
|
324
|
+
return SPARK_GLYPHS[frame] ?? null
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* The composer BORDER color at a tick: the frame breathes with the wave —
|
|
329
|
+
* the palette's static dim blends toward the tier accent as the crest is
|
|
330
|
+
* alive and back, so the frame glows up while the wave sweeps and settles to
|
|
331
|
+
* dim on both ends (first==last frame==dim, no hard jump).
|
|
332
|
+
* @param tick - wave frame at DEEPSEEK_WAVE_TICK_MS.
|
|
333
|
+
* @param tier - the wave tier.
|
|
334
|
+
* @param hues - the tier's three hues; the border blends toward hues[0].
|
|
335
|
+
* @param dim - the palette's static dim RGB (the resting border color).
|
|
336
|
+
* @returns the blended border RGB.
|
|
337
|
+
*/
|
|
338
|
+
export function deepseekWaveBorderColor(
|
|
339
|
+
tick: number,
|
|
340
|
+
tier: DeepseekWaveTier,
|
|
341
|
+
style: DeepseekWaveStyle,
|
|
342
|
+
hues: readonly [RgbTriple, RgbTriple, RgbTriple],
|
|
343
|
+
dim: RgbTriple,
|
|
344
|
+
): RgbTriple {
|
|
345
|
+
const total = deepseekWaveDuration(tier, style) / 1000
|
|
346
|
+
const elapsed = (tick * DEEPSEEK_WAVE_TICK_MS) / 1000
|
|
347
|
+
// The border stays visibly on the tier accent for the whole sweep (a
|
|
348
|
+
// floor keeps it glowing, not just cresting mid-wave): it ramps in as the
|
|
349
|
+
// first band launches and relaxes after the last crest passes.
|
|
350
|
+
const glow = envelope(elapsed, total, total * 0.25, total * 0.4)
|
|
351
|
+
return blendRgb(hues[0], dim, 0.25 + glow * 0.6)
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Whether the `deepseek` wordmark rides the wave at this tick: it fades in
|
|
356
|
+
* shortly after the first crest launches and out before the wave settles,
|
|
357
|
+
* so the brand name surfaces through the sweep's middle. The Ink layer
|
|
358
|
+
* places it in the row's blank mid-section (never over real draft text).
|
|
359
|
+
* @param tick - wave frame at DEEPSEEK_WAVE_TICK_MS.
|
|
360
|
+
* @param tier - the wave tier.
|
|
361
|
+
* @returns true while the wordmark should be visible.
|
|
362
|
+
*/
|
|
363
|
+
export function deepseekWaveWordVisible(tick: number, tier: DeepseekWaveTier, style: DeepseekWaveStyle = 'wave'): boolean {
|
|
364
|
+
const total = deepseekWaveDuration(tier, style) / 1000
|
|
365
|
+
const elapsed = (tick * DEEPSEEK_WAVE_TICK_MS) / 1000
|
|
366
|
+
return envelope(elapsed, total, total * 0.2, total * 0.35) > 0.25
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* The per-character color for the `deepseek` wordmark: the tier's hues
|
|
371
|
+
* cycled per character (d→hue0, e→hue1, e→hue2, …), a brand-gradient text.
|
|
372
|
+
* @param index - character index in the wordmark.
|
|
373
|
+
* @param hues - the tier's three hues.
|
|
374
|
+
* @returns the hue for that character.
|
|
375
|
+
*/
|
|
376
|
+
export function deepseekWaveWordHue(index: number, hues: readonly [RgbTriple, RgbTriple, RgbTriple]): RgbTriple {
|
|
377
|
+
return hues[index % hues.length]!
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* True when a `provider/model` status label addresses the official DeepSeek
|
|
382
|
+
* route: either segment contains `deepseek` (case-insensitive), covering the
|
|
383
|
+
* `deepseek-official` provider route and its `deepseek-*` model ids.
|
|
384
|
+
* @param label - the status bar model label (`provider/model`).
|
|
385
|
+
* @returns whether the label names an official DeepSeek model.
|
|
386
|
+
*/
|
|
387
|
+
export function isOfficialDeepSeekLabel(label: string): boolean {
|
|
388
|
+
const slash = label.indexOf('/')
|
|
389
|
+
const provider = slash < 0 ? label : label.slice(0, slash)
|
|
390
|
+
const model = slash < 0 ? '' : label.slice(slash + 1)
|
|
391
|
+
return provider.toLowerCase().includes('deepseek') || model.toLowerCase().includes('deepseek')
|
|
392
|
+
}
|