dsh-smooth-stream 0.5.0 → 0.6.1

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/src/settings.ts CHANGED
@@ -45,6 +45,18 @@ export const DEFAULT_STREAM_DEBUG_TUNING: StreamDebugTuning = {
45
45
  backpressureMinScale: 0.55,
46
46
  }
47
47
 
48
+ /**
49
+ * How the typewriter reveal responds to the OS reduced-motion preference.
50
+ * Credit: three-state design proposed by @Zn-Dk in #21/#22.
51
+ */
52
+ export type StreamMotionPreference =
53
+ /** Follow the OS preference: reduced-motion users get raw text (accessibility first). */
54
+ | 'auto'
55
+ /** Always run the smoothing engine, ignoring the OS preference. */
56
+ | 'force-smooth'
57
+ /** Always render raw text, ignoring the OS preference. */
58
+ | 'force-reduced'
59
+
48
60
  /**
49
61
  * Preferences a user may set. Deliberately separate from {@link StreamConfig}
50
62
  * because the two change at different times: composition-time values go
@@ -61,12 +73,21 @@ export interface StreamSettings {
61
73
  * scroll ownership to the Harness; text reveal still runs.
62
74
  */
63
75
  controlScroll: boolean
76
+ /**
77
+ * How the reveal honors the OS reduced-motion preference. `auto` preserves
78
+ * the accessibility-first default; `force-smooth` keeps the engine on
79
+ * machines where a system-wide reduce-motion switch (performance tooling,
80
+ * RDP sessions, forced browser flags) would otherwise bypass it silently.
81
+ */
82
+ motionPreference: StreamMotionPreference
64
83
  /**
65
84
  * Whether a reasoning ("Think") block auto-expands while it is the
66
85
  * streaming tail. Off keeps the block collapsed — the user can still open
67
86
  * it by hand — and stops the running state from re-owning the disclosure.
68
87
  */
69
88
  thinkAutoExpand: boolean
89
+ /** Logarithmic text fade for the answer and expanded thinking body. */
90
+ logarithmicFade: boolean
70
91
  /** Whether the live renderer diagnostics panel is enabled. */
71
92
  debugEnabled: boolean
72
93
  /** Values edited by the diagnostics panel. */
@@ -77,7 +98,9 @@ export interface StreamSettings {
77
98
  export const DEFAULT_STREAM_SETTINGS: StreamSettings = {
78
99
  enabled: true,
79
100
  controlScroll: true,
101
+ motionPreference: 'auto',
80
102
  thinkAutoExpand: true,
103
+ logarithmicFade: true,
81
104
  debugEnabled: false,
82
105
  debugTuning: DEFAULT_STREAM_DEBUG_TUNING,
83
106
  }