@toddzheng024/dscode-bundle 0.7.11 → 0.7.13

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 (154) hide show
  1. package/THIRD_PARTY_NOTICES.md +3 -3
  2. package/cordis.patch.yml +1 -1
  3. package/package.json +5 -4
  4. package/plugins/i18n/messages.mjs +6 -6
  5. package/plugins/session-metrics/view.mjs +16 -5
  6. package/plugins/tui-tools/index.mjs +14 -1
  7. package/vendor/tui/lib/app.mjs +6674 -0
  8. package/vendor/tui/lib/approval.mjs +122 -0
  9. package/vendor/tui/lib/attachments.mjs +218 -0
  10. package/vendor/tui/lib/authorization-panel.mjs +242 -0
  11. package/vendor/tui/lib/authorization.mjs +111 -0
  12. package/vendor/tui/lib/commands.mjs +123 -0
  13. package/vendor/tui/lib/dscode/chat.mjs +64 -0
  14. package/vendor/tui/lib/dscode/flags.mjs +32 -0
  15. package/vendor/tui/lib/dscode/model-search.mjs +68 -0
  16. package/vendor/tui/lib/dscode/paste.mjs +87 -0
  17. package/vendor/tui/lib/dscode/telemetry.mjs +82 -0
  18. package/vendor/tui/lib/dscode/welcome.mjs +100 -0
  19. package/vendor/tui/lib/editor-keys.mjs +346 -0
  20. package/vendor/tui/lib/editor.mjs +50 -0
  21. package/vendor/tui/lib/fork.mjs +24 -0
  22. package/vendor/tui/lib/git-workflow.mjs +278 -0
  23. package/vendor/tui/{types/history.d.ts → lib/history.mjs} +69 -26
  24. package/vendor/tui/{types/i18n.d.ts → lib/i18n.mjs} +23 -15
  25. package/vendor/tui/lib/index.mjs +2198 -0
  26. package/vendor/tui/lib/input-split.mjs +170 -0
  27. package/vendor/tui/lib/internals.mjs +90 -0
  28. package/vendor/tui/lib/invariant.mjs +22 -0
  29. package/vendor/tui/lib/kernel-panels.mjs +1265 -0
  30. package/vendor/tui/lib/keyboard.mjs +283 -0
  31. package/vendor/tui/lib/language-panel.mjs +41 -0
  32. package/vendor/tui/lib/locales/en.mjs +495 -0
  33. package/vendor/tui/lib/locales/zh.mjs +495 -0
  34. package/vendor/tui/lib/mentions.mjs +150 -0
  35. package/vendor/tui/lib/model-capabilities.mjs +245 -0
  36. package/vendor/tui/lib/models.mjs +215 -0
  37. package/vendor/tui/{types/panel-accent.d.ts → lib/panel-accent.mjs} +11 -7
  38. package/vendor/tui/lib/permissions.mjs +45 -0
  39. package/vendor/tui/lib/plugin-inventory.mjs +27 -0
  40. package/vendor/tui/lib/presets.mjs +46 -0
  41. package/vendor/tui/lib/provider-settings.mjs +600 -0
  42. package/vendor/tui/lib/questions.mjs +116 -0
  43. package/vendor/tui/lib/rainbow.mjs +181 -0
  44. package/vendor/tui/lib/render/animations.mjs +665 -0
  45. package/vendor/tui/lib/render/editor.mjs +437 -0
  46. package/vendor/tui/lib/render/export.mjs +119 -0
  47. package/vendor/tui/lib/render/fuzzy.mjs +79 -0
  48. package/vendor/tui/lib/render/ime-cursor.mjs +135 -0
  49. package/vendor/tui/lib/render/inspector.mjs +93 -0
  50. package/vendor/tui/lib/render/lines.mjs +538 -0
  51. package/vendor/tui/lib/render/markdown.mjs +592 -0
  52. package/vendor/tui/lib/render/projection.mjs +1862 -0
  53. package/vendor/tui/lib/render/status.mjs +591 -0
  54. package/vendor/tui/lib/render/text.mjs +157 -0
  55. package/vendor/tui/lib/render/tool-detail.mjs +187 -0
  56. package/vendor/tui/lib/render/tool-preview.mjs +79 -0
  57. package/vendor/tui/lib/render/usage.mjs +336 -0
  58. package/vendor/tui/lib/render/width.mjs +191 -0
  59. package/vendor/tui/lib/session-directory.mjs +329 -0
  60. package/vendor/tui/lib/session-query.mjs +184 -0
  61. package/vendor/tui/lib/session-switch.mjs +51 -0
  62. package/vendor/tui/lib/settings-file.mjs +75 -0
  63. package/vendor/tui/lib/skills.mjs +119 -0
  64. package/vendor/tui/lib/startup.mjs +111 -0
  65. package/vendor/tui/lib/store.mjs +129 -0
  66. package/vendor/tui/lib/subagents.mjs +200 -0
  67. package/vendor/tui/lib/terminal-title.mjs +186 -0
  68. package/vendor/tui/lib/theme-panel.mjs +60 -0
  69. package/vendor/tui/lib/theme.mjs +379 -0
  70. package/vendor/tui/lib/update-panel.mjs +239 -0
  71. package/vendor/tui/lib/update.mjs +101 -0
  72. package/vendor/tui/lib/version.mjs +105 -0
  73. package/vendor/tui/lib/whale-glyph.mjs +20 -0
  74. package/vendor/tui/LICENSE +0 -21
  75. package/vendor/tui/devtools-CdTl3MNy.mjs +0 -3643
  76. package/vendor/tui/dscode-email/cli.mjs +0 -32
  77. package/vendor/tui/dscode-email/contacts.mjs +0 -36
  78. package/vendor/tui/dscode-email/gmail-oauth.mjs +0 -69
  79. package/vendor/tui/dscode-email/gmail-store.mjs +0 -2
  80. package/vendor/tui/dscode-email/gmail.mjs +0 -194
  81. package/vendor/tui/dscode-email/imap.mjs +0 -136
  82. package/vendor/tui/dscode-email/inbox.d.mts +0 -25
  83. package/vendor/tui/dscode-email/inbox.mjs +0 -76
  84. package/vendor/tui/dscode-email/smtp.mjs +0 -69
  85. package/vendor/tui/dscode-email/store.mjs +0 -32
  86. package/vendor/tui/dscode-providers/catalog.mjs +0 -136
  87. package/vendor/tui/dscode-providers/effort.mjs +0 -35
  88. package/vendor/tui/dscode-providers/openrouter-account.mjs +0 -171
  89. package/vendor/tui/index.mjs +0 -44483
  90. package/vendor/tui/invariant.mjs +0 -21
  91. package/vendor/tui/rolldown-runtime-CMFfr-1z.mjs +0 -26
  92. package/vendor/tui/session-query.mjs +0 -150
  93. package/vendor/tui/startup.mjs +0 -109
  94. package/vendor/tui/theme-7u5Qo3dF.mjs +0 -1265
  95. package/vendor/tui/types/app.d.ts +0 -348
  96. package/vendor/tui/types/approval.d.ts +0 -59
  97. package/vendor/tui/types/attachments.d.ts +0 -52
  98. package/vendor/tui/types/authorization-panel.d.ts +0 -22
  99. package/vendor/tui/types/authorization.d.ts +0 -36
  100. package/vendor/tui/types/commands.d.ts +0 -52
  101. package/vendor/tui/types/editor-keys.d.ts +0 -105
  102. package/vendor/tui/types/editor.d.ts +0 -6
  103. package/vendor/tui/types/fork.d.ts +0 -8
  104. package/vendor/tui/types/git-workflow.d.ts +0 -121
  105. package/vendor/tui/types/index.d.ts +0 -223
  106. package/vendor/tui/types/input-split.d.ts +0 -54
  107. package/vendor/tui/types/internals.d.ts +0 -26
  108. package/vendor/tui/types/invariant.d.ts +0 -15
  109. package/vendor/tui/types/kernel-panels.d.ts +0 -245
  110. package/vendor/tui/types/keyboard.d.ts +0 -80
  111. package/vendor/tui/types/language-panel.d.ts +0 -12
  112. package/vendor/tui/types/locales/en.d.ts +0 -450
  113. package/vendor/tui/types/locales/zh.d.ts +0 -9
  114. package/vendor/tui/types/mentions.d.ts +0 -85
  115. package/vendor/tui/types/model-capabilities.d.ts +0 -82
  116. package/vendor/tui/types/models.d.ts +0 -133
  117. package/vendor/tui/types/permissions.d.ts +0 -27
  118. package/vendor/tui/types/plugin-inventory.d.ts +0 -11
  119. package/vendor/tui/types/presets.d.ts +0 -22
  120. package/vendor/tui/types/provider-settings.d.ts +0 -239
  121. package/vendor/tui/types/questions.d.ts +0 -54
  122. package/vendor/tui/types/rainbow.d.ts +0 -69
  123. package/vendor/tui/types/render/animations.d.ts +0 -307
  124. package/vendor/tui/types/render/editor.d.ts +0 -163
  125. package/vendor/tui/types/render/export.d.ts +0 -9
  126. package/vendor/tui/types/render/fuzzy.d.ts +0 -21
  127. package/vendor/tui/types/render/ime-cursor.d.ts +0 -60
  128. package/vendor/tui/types/render/inspector.d.ts +0 -62
  129. package/vendor/tui/types/render/lines.d.ts +0 -86
  130. package/vendor/tui/types/render/markdown.d.ts +0 -29
  131. package/vendor/tui/types/render/projection.d.ts +0 -587
  132. package/vendor/tui/types/render/status.d.ts +0 -196
  133. package/vendor/tui/types/render/text.d.ts +0 -64
  134. package/vendor/tui/types/render/tool-detail.d.ts +0 -94
  135. package/vendor/tui/types/render/tool-preview.d.ts +0 -28
  136. package/vendor/tui/types/render/usage.d.ts +0 -113
  137. package/vendor/tui/types/render/width.d.ts +0 -29
  138. package/vendor/tui/types/session-directory.d.ts +0 -190
  139. package/vendor/tui/types/session-query.d.ts +0 -92
  140. package/vendor/tui/types/session-switch.d.ts +0 -17
  141. package/vendor/tui/types/settings-file.d.ts +0 -41
  142. package/vendor/tui/types/skills.d.ts +0 -47
  143. package/vendor/tui/types/startup.d.ts +0 -65
  144. package/vendor/tui/types/store.d.ts +0 -58
  145. package/vendor/tui/types/subagents.d.ts +0 -70
  146. package/vendor/tui/types/terminal-title.d.ts +0 -66
  147. package/vendor/tui/types/theme-panel.d.ts +0 -24
  148. package/vendor/tui/types/theme.d.ts +0 -434
  149. package/vendor/tui/types/update-panel.d.ts +0 -49
  150. package/vendor/tui/types/update.d.ts +0 -75
  151. package/vendor/tui/types/version.d.ts +0 -19
  152. package/vendor/tui/types/whale-glyph.d.ts +0 -6
  153. /package/vendor/tui/{dscode-clipboard-image → lib/dscode/clipboard-image}/clipboard-image.swift +0 -0
  154. /package/vendor/tui/{dscode-clipboard-image → lib/dscode/clipboard-image}/index.mjs +0 -0
@@ -1,307 +0,0 @@
1
- /**
2
- * Terminal animation helpers derived from the web design language:
3
- * thinking uses Codex's slow shimmer sweep, the busy composer marker uses the
4
- * original braille chase, and the streaming caret blink is the Claude-Code
5
- * convention.
6
- *
7
- * The DeepSeek model-switch easter egg ports Codex's effort-ignition "Wave"
8
- * style (`codex-rs/tui/src/bottom_pane/effort_ignition_styles.rs`): switching
9
- * INTO an official DeepSeek route sweeps a blue wave across the composer's
10
- * input row — one column per cell, `backgroundColor` = the sampled wave
11
- * color — then, on the deepseek (Ultra-equivalent) tier, drops the `· ✦ ✧`
12
- * sparkle sequence into the rightmost blank cell before fading. The prompt
13
- * marker keeps the tier accent afterwards (persistent, like Codex's prompt
14
- * charge). Pure functions only — the Ink layer owns timers and colors.
15
- *
16
- * Wave and Pulse deliberately extend the Codex port after in-terminal
17
- * testing: the per-row phase cascade was removed (Codex tints each column
18
- * across the whole band), Wave became a WATER SURFACE — one continuous sine
19
- * swell spanning the band, mirror-symmetric about the center column, its
20
- * crests flowing outward from the center with a symmetric fade envelope
21
- * (the deepseek tier adds one faster harmonic crossing it), painted with
22
- * Aurora's recipe: wide soft gradients, mirrored second-hue mixing, and a
23
- * low alpha cap — no hard core line — while Pulse became true
24
- * two-dimensional, cell-aspect-corrected detonations: soft wide rings whose
25
- * color grades across their width, expanding outward through a symmetric
26
- * fade envelope and each trailing an echo ripple in the next blue. Aurora
27
- * keeps Codex's geometry verbatim.
28
- *
29
- * @module @deepseek-ai/dsh-code/render/animations
30
- */
31
- import type { RgbTriple } from '../theme.ts';
32
- /** Cadence for the original busy braille chase (8 frames × 125ms = 1s). */
33
- export declare const BUSY_CHASE_TICK_MS = 125;
34
- /** Original terminal StateDot chase frames. */
35
- export declare const BUSY_CHASE_FRAMES: readonly ["⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"];
36
- /** Chase frame for a monotonic tick. */
37
- export declare function busyChaseFrame(tick: number): string;
38
- /** Clock cadence for the Codex-style Deep diving shimmer. */
39
- export declare const DEEP_DIVING_SHIMMER_TICK_MS = 33;
40
- /** Codex shimmer timing and geometry. */
41
- export declare const DEEP_DIVING_SHIMMER_DURATION_MS = 2000;
42
- export declare const DEEP_DIVING_SHIMMER_PADDING = 10;
43
- export declare const DEEP_DIVING_SHIMMER_HALF_WIDTH = 5;
44
- export declare const DEEP_DIVING_SPARK_BREATH_DURATION_MS = 2000;
45
- /**
46
- * Codex's 2-second shimmer sweep, expressed in terminal ticks. The sweep has
47
- * ten virtual columns of padding on either side and a five-column cosine
48
- * highlight band, so the text changes gently rather than cycling rapidly.
49
- */
50
- export declare function deepDivingShimmerIntensity(index: number, tick: number, graphemeCount: number): number;
51
- /** Blue RGB color for one grapheme in the Codex-style shimmer. */
52
- export declare function deepDivingGradientColor(index: number, tick: number, graphemeCount: number, base: RgbTriple, highlight: RgbTriple): RgbTriple;
53
- /** Smooth breathing intensity for the always-visible Deep diving sparkle. */
54
- export declare function deepDivingSparkIntensity(tick: number): number;
55
- /** Blue RGB color for the breathing Deep diving sparkle. */
56
- export declare function deepDivingSparkColor(tick: number, base: RgbTriple, highlight: RgbTriple): RgbTriple;
57
- /** One full prismatic flow lap — lively: violet → fuchsia → cyan → violet in 2.4s. */
58
- export declare const FLOW_PERIOD_MS = 2400;
59
- /**
60
- * The prismatic flow color at one elapsed-time sample: a smoothstep walk
61
- * around the anchor triangle, one full lap per {@link FLOW_PERIOD_MS}. Pure —
62
- * the Ink layer owns the timer and passes its tick scaled by its own cadence
63
- * (tick × tickMs). Callers gate on the animations preference and fall back to
64
- * a static palette color when animation is off.
65
- * @param elapsedMs - milliseconds since the flow started (any sign or size).
66
- * @param anchors - the colors to walk, in order (theme.ts FLOW_ANCHORS).
67
- * @returns the interpolated anchor color at this instant.
68
- */
69
- export declare function flowColor(elapsedMs: number, anchors: readonly RgbTriple[]): RgbTriple;
70
- /** Caret blink cadence: one blink step (on or off) per tick. */
71
- export declare const CARET_BLINK_TICK_MS = 530;
72
- /** Caret visibility: half the ticks on, half off (530ms blink). */
73
- export declare function caretVisible(tick: number): boolean;
74
- /**
75
- * The one-shot DeepSeek model-switch easter egg: when the status bar model
76
- * label switches to an official DeepSeek route, the composer's input row
77
- * plays Codex's effort-ignition "Wave" — a blue crest sweeping the content
78
- * row column by column (background tint ≤ 0.55 under the draft), plus the
79
- * Ultra-style `· ✦ ✧` sparkles on the deepseek tier — and the prompt marker
80
- * keeps the tier accent afterwards. The Ink layer owns the timer and reads
81
- * the ACTIVE palette anchors (`getPalette`); everything below is pure
82
- * interpolation over the colors it is given.
83
- */
84
- /** Frame cadence of the DeepSeek wave: Codex's IGNITION_FRAME_TICK (33ms ≈ 30fps). */
85
- export declare const DEEPSEEK_WAVE_TICK_MS = 33;
86
- /**
87
- * The DeepSeek wave tiers. The concept maps Codex's reasoning tiers to
88
- * model ids: `flash` runs the Max parameters, `deepseek` (pro models) runs
89
- * the Ultra parameters (dual band + tail sparkles on the Wave style).
90
- * `unknown` is the "Into the Unknown" variant: it reuses the deepseek tier's
91
- * exact parameters (dual band, durations, sparkles) for NON-DeepSeek models
92
- * running a reasoning effort above high — the wordmark renders differently
93
- * but the motion is identical.
94
- */
95
- export type DeepseekWaveTier = 'flash' | 'deepseek' | 'unknown';
96
- /**
97
- * The three ignition styles — Codex `IgnitionStyle`: a traveling crest
98
- * (Wave), a drifting multi-hue band (Aurora), and an expanding ring (Pulse).
99
- * One style is picked at random per trigger and never repeats the previous.
100
- */
101
- export type DeepseekWaveStyle = 'wave' | 'aurora' | 'pulse';
102
- /**
103
- * The water surface: ONE continuous sine line spanning the whole band,
104
- * mirror-symmetric about the center column, its crests flowing OUTWARD from
105
- * the center (phase k·|x − center| − ω·t). No sweep window, no return trip —
106
- * the surface fades in, flows, and fades out, symmetric in both space and
107
- * time. The deepseek tier adds one faster, finer HARMONIC line whose crests
108
- * cross the fundamental's: interleaved richness with both lines still
109
- * symmetric and still only ever flowing outward.
110
- */
111
- export declare const WAVE_SURFACE_AMPLITUDE = 0.8;
112
- export declare const WAVE_SURFACE_HARMONIC = 0.45;
113
- export declare const WAVE_SURFACE_WAVELENGTH = 40;
114
- export declare const WAVE_SURFACE_OMEGA = 9;
115
- /** Vertical thickness in lane units — Aurora-wide: soft gradients, no hard edges. */
116
- export declare const WAVE_SURFACE_THICKNESS = 1.2;
117
- /**
118
- * The mirrored second-hue profile: the space BELOW the surface carries a
119
- * second blue at this strength, so color (not just brightness) varies
120
- * continuously across the wave — Aurora-style hue mixing instead of a
121
- * single flat tint.
122
- */
123
- export declare const WAVE_SURFACE_MIRROR = 0.6;
124
- /** Aurora-style soft alpha: low gain, capped well under the pulse ring's. */
125
- export declare const WAVE_SURFACE_ALPHA_GAIN = 0.45;
126
- export declare const WAVE_SURFACE_ALPHA_CAP = 0.68;
127
- /** Aurora-grade soft alpha for the detonation — a notch above the swell. */
128
- export declare const PULSE_ALPHA_GAIN = 0.45;
129
- export declare const PULSE_ALPHA_CAP = 0.72;
130
- /** Sparkle glyphs in frame order — Codex SPARK_GLYPHS (`· ✦ ✧`). */
131
- export declare const SPARK_GLYPHS: readonly ["·", "✦", "✧"];
132
- /**
133
- * Band tables — Codex `bands(style, tier)`. Each entry is a triple whose
134
- * meaning depends on the style: Wave/Pulse use `(launch, travel, strength)`;
135
- * Aurora uses `(speed, phase, hueIndex)`.
136
- */
137
- export type DeepseekWaveBand = readonly [number, number, number];
138
- export declare const DEEPSEEK_WAVE_BANDS: Readonly<Record<DeepseekWaveStyle, Readonly<Record<DeepseekWaveTier, readonly DeepseekWaveBand[]>>>>;
139
- /**
140
- * Total visible duration: the Codex ignition duration plus 200ms so its motion
141
- * remains readable in a busy terminal.
142
- * @param tier - the active wave tier.
143
- * @param style - the active ignition style.
144
- * @returns the duration in milliseconds.
145
- */
146
- export declare function deepseekWaveDuration(tier: DeepseekWaveTier, style?: DeepseekWaveStyle): number;
147
- /**
148
- * Pick one ignition style at random, never repeating the previous one —
149
- * Codex `IgnitionStyle::random`. Falls back to the remaining styles.
150
- * @param previous - the style of the last trigger, if any.
151
- * @returns a style different from `previous`.
152
- */
153
- export declare function deepseekWaveStyleRandom(previous: DeepseekWaveStyle | undefined): DeepseekWaveStyle;
154
- /**
155
- * Tier for a `provider/model` label: a MODEL ID containing `flash` runs the
156
- * single-band flash tier; everything else (pro/reasoner/chat) runs the
157
- * dual-band deepseek tier. Mirrors Codex's Max→Ultra mapping. Only the model
158
- * segment (after the `/`) is matched, so a provider whose name contains
159
- * `flash` cannot flip an unrelated model onto the flash tier.
160
- * @param model - the `provider/model` label of the applied model.
161
- * @returns the wave tier for that model.
162
- */
163
- export declare function deepseekWaveTier(model: string): DeepseekWaveTier;
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 declare function crest(distance: number): number;
171
- /**
172
- * Cubic ease-in-out — Codex `ease_in_out`: flat at both ends, steepest in
173
- * the middle, so the crest accelerates and eases instead of sliding linearly.
174
- * @param progress - raw progress (clamped to 0..1).
175
- * @returns the eased progress in 0..1.
176
- */
177
- export declare function easeInOut(progress: number): number;
178
- /**
179
- * Fade-in/fade-out envelope — Codex `envelope`: linear ramp over `fadeIn`
180
- * at the start and `fadeOut` at the end, plateau at 1 between, 0 outside the
181
- * total. The Wave style keeps the envelope at 1 (Codex paints Wave without
182
- * an envelope); exported for the Aurora-style fades and for tests.
183
- * @param elapsed - seconds since the animation started.
184
- * @param total - total duration in seconds.
185
- * @param fadeIn - seconds of fade-in.
186
- * @param fadeOut - seconds of fade-out.
187
- * @returns the envelope value in 0..1.
188
- */
189
- export declare function envelope(elapsed: number, total: number, fadeIn: number, fadeOut: number): number;
190
- /**
191
- * The /rainbow celebration on the three-row composer band: a FIXED
192
- * seven-color spectrum (not the rolled palette) that slides across every
193
- * row as one ribbon. Triggered when switching to rainbow or rerolling the
194
- * seed; independent of RAINBOW_SEED so the burst always reads as a prism.
195
- */
196
- export declare const RAINBOW_BURST_TICK_MS = 33;
197
- export declare const RAINBOW_BURST_DURATION_MS = 1800;
198
- export declare const RAINBOW_BURST_HUES: readonly RgbTriple[];
199
- /**
200
- * Smoothstep in 0..1, then wrap-lerp around the seven burst hues.
201
- * Position 0 is red, wrapping back toward red at 1. Shared by the
202
- * composer burst and the static rainbow whale header.
203
- */
204
- export declare function rainbowSpectrumHue(position: number): RgbTriple;
205
- /**
206
- * Background tint for one composer-band cell during the rainbow burst.
207
- * Every row of a column shares the same hue (a solid ribbon); edge rows
208
- * are slightly dimmer so the middle editor row reads as the crest. The
209
- * spectrum slides ~1.2 widths over the burst, then fades to the band base.
210
- * @param tick - frame index at {@link RAINBOW_BURST_TICK_MS}.
211
- * @param column - band column (0..width-1).
212
- * @param width - band width in columns.
213
- * @param base - the theme's composerBand color to blend toward.
214
- * @param row - band row (0..rows-1).
215
- * @param rows - band height (composer is three rows: pad, editor, pad).
216
- * @returns the blended RGB, or null after the burst (or at zero alpha).
217
- */
218
- export declare function rainbowBurstColumnBg(tick: number, column: number, width: number, base: RgbTriple, row?: number, rows?: number): RgbTriple | null;
219
- /**
220
- * The background color for one composer-band column at a tick — Codex
221
- * `paint_bands` + `Canvas::tint` for all three styles. Bands overlap with a
222
- * max for Wave/Pulse and a SUM for Aurora (Codex differs by style), the
223
- * weighted hues mix per column (Wave/Pulse always end on hue 0), the tint
224
- * blends the mixed hue toward the blank-cell base at the style's alpha cap,
225
- * and Aurora applies its own fade envelope. Returns `null` when the column
226
- * should stay transparent, so the row returns to no `backgroundColor` on
227
- * both ends. With `rows > 1`: Wave is a water surface — every column
228
- * lights the row nearest the surface's current height, so the light reads
229
- * as ONE continuous wavy line spanning the band, symmetric about the center
230
- * column and flowing outward (a single-row band falls back to a flat glow);
231
- * Pulse rings in two dimensions around the band's center cell with trailing
232
- * echo ripples; only Aurora samples the timeline shifted by a per-row phase
233
- * offset.
234
- * @param tick - wave frame (0, 1, … at DEEPSEEK_WAVE_TICK_MS).
235
- * @param column - column index in the content row (0..width-1).
236
- * @param width - content-row width in columns.
237
- * @param tier - the wave tier (flash = Max, deepseek = Ultra parameters).
238
- * @param style - the ignition style.
239
- * @param hues - the tier's three hues.
240
- * @param base - the blank-cell base color the tint blends toward.
241
- * @param row - row index in the band (0..rows-1; default 0 = old single-row).
242
- * @param rows - band height in rows (default 1).
243
- * @returns the blended RGB background, or null for transparent.
244
- */
245
- export declare function deepseekWaveColumnBg(tick: number, column: number, width: number, tier: DeepseekWaveTier, style: DeepseekWaveStyle, hues: readonly [RgbTriple, RgbTriple, RgbTriple], base: RgbTriple, row?: number, rows?: number): RgbTriple | null;
246
- /**
247
- * The sparkle glyph for a tick — Codex `spark_frame`, sampled on the same
248
- * proportionally slowed DeepSeek Wave timeline as the composer background.
249
- * The Ink layer still must skip occupied cells.
250
- * @param tick - wave frame at DEEPSEEK_WAVE_TICK_MS.
251
- * @returns the sparkle glyph, or null outside the stretched tail window.
252
- */
253
- export declare function deepseekWaveSpark(tick: number): string | null;
254
- /**
255
- * Whether the `deepseek` wordmark rides the wave at this tick: it fades in
256
- * shortly after the first crest launches and out before the wave settles,
257
- * so the brand name surfaces through the sweep's middle. The Ink layer
258
- * places it in the row's blank mid-section (never over real draft text).
259
- * @param tick - wave frame at DEEPSEEK_WAVE_TICK_MS.
260
- * @param tier - the wave tier.
261
- * @returns true while the wordmark should be visible.
262
- */
263
- export declare function deepseekWaveWordVisible(tick: number, tier: DeepseekWaveTier, style?: DeepseekWaveStyle): boolean;
264
- /**
265
- * The per-character color for the `deepseek` wordmark: the tier's hues
266
- * cycled per character (d→hue0, e→hue1, e→hue2, …), a brand-gradient text.
267
- * @param index - character index in the wordmark.
268
- * @param hues - the tier's three hues.
269
- * @returns the hue for that character.
270
- */
271
- export declare function deepseekWaveWordHue(index: number, hues: readonly [RgbTriple, RgbTriple, RgbTriple]): RgbTriple;
272
- /**
273
- * True when a `provider/model` status label addresses the official DeepSeek
274
- * route: either segment contains `deepseek` (case-insensitive), covering the
275
- * `deepseek-official` provider route and its `deepseek-*` model ids.
276
- * @param label - the status bar model label (`provider/model`).
277
- * @returns whether the label names an official DeepSeek model.
278
- */
279
- export declare function isOfficialDeepSeekLabel(label: string): boolean;
280
- /**
281
- * True when an effective reasoning effort is STRICTLY above `high` — the
282
- * trigger gate for the "Into the Unknown" wave on non-DeepSeek routes.
283
- * Absent efforts and unrecognized ids never qualify.
284
- * @param effort - the effective reasoning-effort id ('' or undefined when none).
285
- * @returns whether the effort ranks above high.
286
- */
287
- export declare function effortAboveHigh(effort: string | undefined): boolean;
288
- /**
289
- * Parse a persisted animations preference (`animations.json`): timed
290
- * animations are on by default and only an explicit `false` disables them —
291
- * a missing key, corrupt value, or absent file all mean enabled, so the
292
- * /animation toggle degrades exactly like every other user preference.
293
- * @param value - the raw parsed JSON value (expected boolean).
294
- * @returns whether timed animations should run.
295
- */
296
- export declare function parseAnimationsPref(value: unknown): boolean;
297
- /**
298
- * One parsed `/animation` argument: '' toggles, `on|true|1` enables,
299
- * `off|false|0` disables (case-insensitive, surrounding whitespace ignored),
300
- * and anything else is a usage error the caller surfaces. Kept pure so the
301
- * command's entire decision table is unit-testable.
302
- * @param argument - the raw text after `/animation`.
303
- * @returns `{ enabled }`, `'toggle'`, or `'usage'`.
304
- */
305
- export declare function parseAnimationsArgument(argument: string): {
306
- enabled: boolean;
307
- } | 'toggle' | 'usage';
@@ -1,163 +0,0 @@
1
- /**
2
- * Pure composer editor model with Codex textarea semantics: a grapheme
3
- * cursor over a column-safe multiline layout, word/piece motion, single-entry
4
- * kill + yank, and the shell-recall boundary gate that keeps Up/Down usable
5
- * inside a multiline draft.
6
- *
7
- * The model is intentionally string-offset based (UTF-16 indices clamped to
8
- * grapheme boundaries) so the React state stays two primitives
9
- * (value, cursor) and every operation here stays pure and testable.
10
- *
11
- * Word motion follows Codex's piece semantics: whitespace separates runs,
12
- * punctuation runs stay atomic, and each Han grapheme is its own boundary.
13
- *
14
- * @module @deepseek-ai/dsh-code/render/editor
15
- */
16
- /** One grapheme cluster with its source span and display width in cells. */
17
- export interface GraphemeSpan {
18
- text: string;
19
- start: number;
20
- end: number;
21
- width: number;
22
- }
23
- /**
24
- * Split text into grapheme clusters. Falls back to code points when
25
- * Intl.Segmenter is unavailable; the fallback still keeps surrogate pairs
26
- * (emoji) atomic so the cursor can never split one.
27
- */
28
- export declare function splitGraphemes(text: string): readonly GraphemeSpan[];
29
- /** Clamp a cursor offset to the nearest grapheme boundary (surrogates, ZWJ, marks stay whole). */
30
- export declare function clampCursor(value: string, offset: number): number;
31
- /**
32
- * Delete the final grapheme cluster (append-only drafts without a cursor).
33
- * Surrogate pairs and multi-codepoint emoji stay whole instead of leaving a
34
- * lone trailing code unit behind.
35
- */
36
- export declare function deleteLastGrapheme(text: string): string;
37
- /**
38
- * Step the cursor by whole graphemes (negative steps left). The cursor is
39
- * assumed to sit on a boundary; any drift is clamped first.
40
- */
41
- export declare function moveCursorBy(value: string, offset: number, delta: number): number;
42
- /**
43
- * Normalize text entering the draft: CRLF/CR become LF, tabs become two
44
- * spaces (terminal tab stops are contextual and cannot join a deterministic
45
- * row budget), and every other C0 control byte plus DEL is REMOVED — the
46
- * draft is data, so a stray ESC (Windows Terminal file drops) disappears
47
- * instead of rendering as literal backslash-x-1-b text. Newlines survive.
48
- */
49
- export declare function sanitizeDraftText(text: string): string;
50
- /** One physical editor row: wrapped text plus its boundary map. */
51
- export interface EditorRowModel {
52
- /** Display text of the row (never contains `\n`; sanitized upstream). */
53
- readonly text: string;
54
- /** Source offset of the first grapheme on the row. */
55
- readonly start: number;
56
- /** Source offset just past the last grapheme on the row (before its newline). */
57
- readonly end: number;
58
- /** Boundary offsets on the row, start to end inclusive. */
59
- readonly offsets: readonly number[];
60
- /** Display column of each boundary; `columns[i]` pairs with `offsets[i]`. */
61
- readonly columns: readonly number[];
62
- /** Code-unit cut in `text` at each boundary; `cuts[i]` pairs with `offsets[i]`. */
63
- readonly cuts: readonly number[];
64
- }
65
- /** The wrapped physical-row model of one draft. */
66
- export interface EditorModel {
67
- readonly rows: readonly EditorRowModel[];
68
- readonly length: number;
69
- }
70
- /**
71
- * Hard-wrap the draft into column-safe physical rows. Wide graphemes never
72
- * split across rows (a grapheme that does not fit flushes the row first) and
73
- * explicit newlines end their row without occupying a cell.
74
- */
75
- export declare function editorModel(value: string, columns: number): EditorModel;
76
- /** Where a cursor offset renders: the physical row and its display column. */
77
- export interface CaretSite {
78
- row: number;
79
- column: number;
80
- }
81
- /** Text slices for rendering one physical row with at most one caret. */
82
- export interface EditorRowParts {
83
- readonly before: string;
84
- readonly caret: string;
85
- readonly after: string;
86
- readonly hasCaret: boolean;
87
- }
88
- /** Split one row around the authoritative caret; every other row stays whole. */
89
- export declare function editorRowParts(row: EditorRowModel, rowIndex: number, caretRow: number, cursor: number, caretEnabled?: boolean): EditorRowParts;
90
- /** Map a cursor offset to its caret site on the wrapped rows. */
91
- export declare function caretSite(model: EditorModel, offset: number): CaretSite;
92
- /**
93
- * Move the caret across physical rows keeping a preferred display column
94
- * (Codex `preferred_col`): horizontal moves reset the preference, vertical
95
- * moves reuse it, clamped to each row's width.
96
- */
97
- export declare function moveCursorVertically(model: EditorModel, offset: number, preferredColumn: number, delta: number): number;
98
- /** The start/end offsets of the logical line containing the cursor. */
99
- export declare function lineBounds(value: string, offset: number): {
100
- start: number;
101
- end: number;
102
- };
103
- /**
104
- * Codex `beginning_of_previous_word`: skip whitespace left, then land on the
105
- * START of the trailing non-space piece (extending over separator pieces).
106
- */
107
- export declare function moveWordLeft(value: string, offset: number): number;
108
- /**
109
- * Codex `end_of_next_word`: skip whitespace right, then land on the END of
110
- * the leading non-space piece (extending over separator pieces).
111
- */
112
- export declare function moveWordRight(value: string, offset: number): number;
113
- /** One edit outcome: the next draft value, cursor, and killed span (if any). */
114
- export interface EditResult {
115
- value: string;
116
- cursor: number;
117
- /** Text removed into the kill buffer; undefined when nothing was killed. */
118
- killed: string | undefined;
119
- }
120
- /** Delete the grapheme cluster before the cursor. */
121
- export declare function deleteBackward(value: string, cursor: number): EditResult;
122
- /** Delete the grapheme cluster at the cursor. */
123
- export declare function deleteForward(value: string, cursor: number): EditResult;
124
- /** Delete back to the start of the previous word (fills the kill buffer). */
125
- export declare function deleteWordBackward(value: string, cursor: number): EditResult;
126
- /** Delete forward to the end of the next word (fills the kill buffer). */
127
- export declare function deleteWordForward(value: string, cursor: number): EditResult;
128
- /** Ctrl+U: kill from the line start to the cursor; at BOL, kill the newline. */
129
- export declare function killToLineStart(value: string, cursor: number): EditResult;
130
- /** Ctrl+K: kill from the cursor to the line end; at EOL, kill the newline. */
131
- export declare function killToLineEnd(value: string, cursor: number): EditResult;
132
- /** Insert sanitized text at the cursor. */
133
- export declare function insertText(value: string, cursor: number, text: string): EditResult;
134
- /** Ctrl+A: current logical line start, then the previous line start on repeat. */
135
- export declare function moveToLineStart(value: string, cursor: number, crossOnRepeat: boolean): number;
136
- /** Ctrl+E: current logical line end, then the next line end on repeat. */
137
- export declare function moveToLineEnd(value: string, cursor: number, crossOnRepeat: boolean): number;
138
- /** One stable text range captured before an asynchronous draft operation. */
139
- export interface DraftRange {
140
- readonly start: number;
141
- readonly end: number;
142
- }
143
- /**
144
- * Remap a captured range when all intervening edits are wholly before or
145
- * wholly after it. An edit overlapping either boundary invalidates the
146
- * anchor instead of guessing and inserting content at a surprising place.
147
- */
148
- export declare function remapStableRange(original: string, current: string, range: DraftRange): DraftRange | undefined;
149
- /** Replace a current range while preserving a cursor moved after capture. */
150
- export declare function replaceRangePreservingCursor(value: string, cursor: number, range: DraftRange, replacement: string): EditResult;
151
- /**
152
- * Composer editor row budget: the editor itself never grows past this many
153
- * physical rows; deeper drafts scroll internally to keep the caret visible.
154
- * Short terminals collapse toward one row so the live transcript keeps room.
155
- */
156
- export declare function composerMaxRows(terminalRows: number): number;
157
- /**
158
- * History navigation starts with Up on an empty draft, or continues from an
159
- * unchanged recalled entry whenever the caret sits on either text edge
160
- * (start or end) - moving the caret into the interior returns the keys to
161
- * ordinary editing until an edge is reached again.
162
- */
163
- export declare function shouldRecallNavigate(value: string, cursor: number, lastRecalled: string | null, direction: -1 | 1): boolean;
@@ -1,9 +0,0 @@
1
- /**
2
- * Markdown export of one transcript view: the /export command's pure
3
- * formatter. Deterministic and side-effect free — the runner owns the file
4
- * write, so tests drive the builder with folded views directly.
5
- *
6
- * @module @deepseek-ai/dsh-code/render/export
7
- */
8
- import { type TranscriptView } from './projection.ts';
9
- export declare function buildExportMarkdown(view: TranscriptView, sessionId: string): string;
@@ -1,21 +0,0 @@
1
- /**
2
- * Shared fuzzy ranking for `/` and `@` menu candidates: the query must be a
3
- * case-insensitive ordered subsequence of the candidate name. Prefix hits
4
- * rank first, then the strongest alignment score, then the source order of
5
- * the input. Ported from the upstream web client's ui-primitives
6
- * (rank-by-name.ts) so the terminal matches the web menu's discovery feel;
7
- * the algorithm is unchanged, only the module's home moved.
8
- *
9
- * @module @deepseek-ai/dsh-code/render/fuzzy
10
- */
11
- /**
12
- * Rank named items by a menu query.
13
- * @param items - candidates in source order (the caller's composition order
14
- * is the final tie-breaker, e.g. local commands before registry entries).
15
- * @param rawQuery - the text typed after the trigger, matched case-insensitively.
16
- * @returns the matching items: prefix hits first, then by alignment score,
17
- * then in source order. The input list itself for an empty query.
18
- */
19
- export declare function rankByName<T extends {
20
- readonly name: string;
21
- }>(items: readonly T[], rawQuery: string): readonly T[];
@@ -1,60 +0,0 @@
1
- /**
2
- * IME cursor anchoring for the composer.
3
- *
4
- * Ink keeps the real terminal cursor hidden and parks it just below the
5
- * dynamic tree (after the status row). IME composition text and candidate
6
- * windows anchor to that real cursor cell - VS Code's integrated terminal
7
- * positions its hidden IME textarea there, and Windows consoles behave the
8
- * same - so CJK input appeared at the bottom of the screen instead of at the
9
- * caret. The anchor moves the real cursor onto the caret cell without
10
- * touching Ink's relative erase ledger:
11
- *
12
- * - the displacement is owned: before any foreign write or re-anchor, the
13
- * wrapper cancels it (cursor down, column 1), so every writer - Ink's
14
- * log-update rewrites, the resize replay, protocol pushes - keeps seeing
15
- * the cursor exactly where it was left;
16
- * - log-update frame chunks (which start with the erase-line sequence) get
17
- * the anchor re-appended inside the same write, so a repaint can never
18
- * leave the cursor behind - in particular the caret blink keeps the anchor
19
- * stable while an IME composition is open, because the terminal parses the
20
- * rewrite and the re-anchor as one atomic update.
21
- *
22
- * @module @deepseek-ai/dsh-code/render/ime-cursor
23
- */
24
- /** Cancel `rows` of owned upward displacement and return to column 1. */
25
- export declare function imeCursorRestore(rows: number): string;
26
- /** Move onto the caret cell: `rows` up from Ink's parked row, 0-based column. */
27
- export declare function imeCursorMove(rows: number, column: number): string;
28
- /**
29
- * Rows between the caret cell and Ink's parked cursor row: the band's bottom
30
- * blank row, the editor window rows below the caret, the status footer, and
31
- * Ink's own below-frame row. Rows above the composer (gutter, live content)
32
- * never enter this distance.
33
- */
34
- export declare function imeCursorRowsUp(input: {
35
- editorWindowRows: number;
36
- caretRowInWindow: number;
37
- rowsBelowComposer: number;
38
- }): number;
39
- /** The installed anchor handle. */
40
- export interface ImeCursorAnchor {
41
- /** Anchor on the caret cell: `rows` above Ink's parked row at the 0-based
42
- * `column`; `rows <= 0` releases the anchor. */
43
- anchor(rows: number, column: number): void;
44
- /** Cancel the displacement, restore the original write path, and detach. */
45
- release(): void;
46
- }
47
- /**
48
- * Take over `stream.write` so the anchor displacement stays invisible to every
49
- * other writer. Idempotent per stream: a second install returns the live
50
- * handle. Returns `undefined` on non-TTY streams where anchoring is meaningless.
51
- */
52
- export declare function installImeCursorAnchor(stream: NodeJS.WriteStream): ImeCursorAnchor | undefined;
53
- /**
54
- * Keep the real terminal cursor on the composer's caret cell while `active`
55
- * (the editable composer). The second effect runs after every commit without
56
- * a dep list: frame rewrites restore the anchor themselves, but any other
57
- * write (protocol push, resize replay) leaves the cursor at Ink's parked
58
- * position, and the next commit re-anchors it.
59
- */
60
- export declare function useImeCursorAnchor(active: boolean, rows: number, column: number): void;
@@ -1,62 +0,0 @@
1
- /** Pure viewport, selection, and scrolling rules for exclusive TUI panels. */
2
- /** Terminal-space allocation for the inspector's one dynamic screen. */
3
- export interface InspectorViewport {
4
- /** Maximum dynamic rows, kept strictly below the terminal height. */
5
- maxHeight: number;
6
- /** Rows available to the selected entry after border, title, and footer. */
7
- bodyRows: number;
8
- /** Optional blank rows separating title/body/footer on roomy terminals. */
9
- gapRows: 0 | 2;
10
- /** Columns available inside the horizontal border and padding. */
11
- contentColumns: number;
12
- /** Safe outer width for a bordered dynamic panel; never writes column N. */
13
- outerColumns: number;
14
- /** Tiny terminals use a borderless one-line close hint. */
15
- compact: boolean;
16
- }
17
- /** One transcript-to-composer gutter, collapsed on short terminals. */
18
- export declare function layoutGutterRows(rows: number): 0 | 1;
19
- /** Measured chrome that sits below (or in) the live region. */
20
- export interface LiveRegionChrome {
21
- /** Terminal rows. */
22
- readonly terminalRows: number;
23
- /** Editor rows inside the composer band (frozen reports 1). */
24
- readonly composerRows: number;
25
- /** Status footer rows. */
26
- readonly statusBarRows: 1 | 2;
27
- /** Completion menu rows (0 when closed). */
28
- readonly menuRows: number;
29
- /** Transcript-to-composer gutter. */
30
- readonly gutterRows: 0 | 1;
31
- /** Notice line present. */
32
- readonly notice: boolean;
33
- /** Todo summary line present. */
34
- readonly todo: boolean;
35
- /** Agents summary line present. */
36
- readonly agents: boolean;
37
- }
38
- /**
39
- * Rows left for live transcript and streaming after pinning the composer and
40
- * status at the bottom. Variable chrome (menu, notice, todos, agents, extra
41
- * status row, extra editor rows) is deducted here so those rows cover the
42
- * live region instead of growing the tree and moving the bottom bar.
43
- */
44
- export declare function liveRegionBudget(chrome: LiveRegionChrome): number;
45
- /**
46
- * Keep the inspector plus its persistent status/composer chrome below
47
- * `stdout.rows`: at equality Ink clears the terminal and rewrites all
48
- * accumulated `<Static>` output on every frame.
49
- */
50
- export declare function panelViewport(columns: number, rows: number): InspectorViewport;
51
- /** Backward-compatible name for the Ctrl+O-specific caller and tests. */
52
- export declare function inspectorViewport(columns: number, rows: number): InspectorViewport;
53
- /** Clamp a first-visible row to the range representable by one viewport. */
54
- export declare function clampScroll(offset: number, totalRows: number, visibleRows: number): number;
55
- /** Move a viewport by a signed row delta without escaping its content. */
56
- export declare function moveScroll(offset: number, delta: number, totalRows: number, visibleRows: number): number;
57
- /** Keep one focused row visible while preserving the current window when possible. */
58
- export declare function revealRow(offset: number, row: number, totalRows: number, visibleRows: number): number;
59
- /** Center a selected list row where possible, clamped at both ends. */
60
- export declare function selectionWindow(cursor: number, totalRows: number, visibleRows: number): number;
61
- /** Follow appended history only while the inspector cursor was at the tail. */
62
- export declare function followInspectorCursor(cursor: number, previousLength: number, nextLength: number): number;