dsh-smooth-stream 0.4.3 → 0.5.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/src/plugin.ts CHANGED
@@ -55,8 +55,8 @@ export const Config: Schema<Config> = Schema.object({
55
55
  */
56
56
  export const StreamSettingsSchema: Schema<StreamSettings> = Schema.object({
57
57
  enabled: Schema.boolean().default(DEFAULT_STREAM_SETTINGS.enabled),
58
+ controlScroll: Schema.boolean().default(DEFAULT_STREAM_SETTINGS.controlScroll),
58
59
  thinkAutoExpand: Schema.boolean().default(DEFAULT_STREAM_SETTINGS.thinkAutoExpand),
59
- autoCollapse: Schema.boolean().default(DEFAULT_STREAM_SETTINGS.autoCollapse),
60
60
  debugEnabled: Schema.boolean().default(DEFAULT_STREAM_SETTINGS.debugEnabled),
61
61
  debugTuning: Schema.object({
62
62
  revealScale: Schema.number().min(0.25).max(2).default(DEFAULT_STREAM_SETTINGS.debugTuning.revealScale),
@@ -117,8 +117,8 @@ export function apply(ctx: Context, config: Config): void {
117
117
  installation: installation.kind,
118
118
  writable: connectionCtx.settings.writable,
119
119
  enabled: settings.enabled,
120
+ controlScroll: settings.controlScroll,
120
121
  thinkAutoExpand: settings.thinkAutoExpand,
121
- autoCollapse: settings.autoCollapse,
122
122
  canUpgrade: installation.kind === 'npm',
123
123
  }
124
124
  }
@@ -159,13 +159,14 @@ export function apply(ctx: Context, config: Config): void {
159
159
  if (endpoint === STREAM_SETTINGS_RPC.write) {
160
160
  if (typeof payload !== 'object' || payload === null || Array.isArray(payload)
161
161
  || typeof (payload as { enabled?: unknown }).enabled !== 'boolean'
162
+ || typeof (payload as { controlScroll?: unknown }).controlScroll !== 'boolean'
162
163
  || typeof (payload as { thinkAutoExpand?: unknown }).thinkAutoExpand !== 'boolean'
163
- || typeof (payload as { autoCollapse?: unknown }).autoCollapse !== 'boolean') {
164
+ ) {
164
165
  return {
165
166
  ok: false,
166
167
  error: {
167
168
  code: 'settings-rejected',
168
- message: 'enabled, thinkAutoExpand and autoCollapse must be booleans',
169
+ message: 'enabled, controlScroll and thinkAutoExpand must be booleans',
169
170
  details: { ns: STREAM_SETTINGS_NS },
170
171
  },
171
172
  }
@@ -183,8 +184,8 @@ export function apply(ctx: Context, config: Config): void {
183
184
  try {
184
185
  const next = payload as {
185
186
  enabled: boolean
187
+ controlScroll: boolean
186
188
  thinkAutoExpand: boolean
187
- autoCollapse: boolean
188
189
  debugEnabled?: unknown
189
190
  debugTuning?: unknown
190
191
  }
@@ -201,8 +202,8 @@ export function apply(ctx: Context, config: Config): void {
201
202
  }
202
203
  await scope.update({
203
204
  enabled: next.enabled,
205
+ controlScroll: next.controlScroll,
204
206
  thinkAutoExpand: next.thinkAutoExpand,
205
- autoCollapse: next.autoCollapse,
206
207
  ...(hasDebug ? { debugEnabled: next.debugEnabled, debugTuning: next.debugTuning } : {}),
207
208
  })
208
209
  } catch {
@@ -25,10 +25,10 @@ export interface StreamSettingsView {
25
25
  writable: boolean
26
26
  /** Whether smooth-stream currently owns conversation rendering. */
27
27
  enabled: boolean
28
+ /** Whether smooth-stream also owns conversation bottom-follow. */
29
+ controlScroll: boolean
28
30
  /** Current resolved preference. */
29
31
  thinkAutoExpand: boolean
30
- /** Whether finished turns fold their work process behind a summary row. */
31
- autoCollapse: boolean
32
32
  /** Whether a fixed npm update command is safe to offer. */
33
33
  canUpgrade: boolean
34
34
  }
package/src/settings.ts CHANGED
@@ -56,19 +56,17 @@ export interface StreamSettings {
56
56
  * Off returns all rendering ownership to the built-in UI.
57
57
  */
58
58
  enabled: boolean
59
+ /**
60
+ * Whether this plugin also takes over conversation bottom-follow. Off leaves
61
+ * scroll ownership to the Harness; text reveal still runs.
62
+ */
63
+ controlScroll: boolean
59
64
  /**
60
65
  * Whether a reasoning ("Think") block auto-expands while it is the
61
66
  * streaming tail. Off keeps the block collapsed — the user can still open
62
67
  * it by hand — and stops the running state from re-owning the disclosure.
63
68
  */
64
69
  thinkAutoExpand: boolean
65
- /**
66
- * Whether a finished turn folds its work process (thinking, tool calls,
67
- * context injection, intermediate replies) behind one "已处理" summary row,
68
- * leaving only the final answer visible. The summary row can always be
69
- * toggled by hand, and turns still expand live while they stream.
70
- */
71
- autoCollapse: boolean
72
70
  /** Whether the live renderer diagnostics panel is enabled. */
73
71
  debugEnabled: boolean
74
72
  /** Values edited by the diagnostics panel. */
@@ -78,8 +76,8 @@ export interface StreamSettings {
78
76
  /** Defaults shared by the Host schema and the client-side fallback. */
79
77
  export const DEFAULT_STREAM_SETTINGS: StreamSettings = {
80
78
  enabled: true,
79
+ controlScroll: true,
81
80
  thinkAutoExpand: true,
82
- autoCollapse: true,
83
81
  debugEnabled: false,
84
82
  debugTuning: DEFAULT_STREAM_DEBUG_TUNING,
85
83
  }