dsh-smooth-stream 0.4.2 → 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/README.en.md +98 -89
- package/README.md +95 -87
- package/lib/client.js +801 -1040
- package/lib/client.js.map +1 -1
- package/lib/index.js +8 -8
- package/package.json +11 -5
- package/src/client/AgentRowEntrance.module.css +43 -0
- package/src/client/FollowHost.tsx +18 -1
- package/src/client/SmoothStreamCard.tsx +10 -10
- package/src/client/TypewriterAssistantNodeView.tsx +15 -5
- package/src/client/TypewriterToolNodeView.tsx +9 -1
- package/src/client/clientStore.ts +71 -12
- package/src/client/index.ts +13 -29
- package/src/client/locales.ts +5 -5
- package/src/client/smooth-stream-card-controller.ts +6 -6
- package/src/client/smooth-stream-settings-api.ts +4 -4
- package/src/client/teleprompterGlide.ts +1021 -75
- package/src/plugin.ts +17 -8
- package/src/settings-api.ts +2 -2
- package/src/settings.ts +6 -8
- package/src/client/auto-collapse-controller.ts +0 -1072
package/src/plugin.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis'
|
|
2
2
|
import type {} from '@deepseek-ai/dsh-host-webserver'
|
|
3
3
|
import type { ConnectionRpcHandler } from '@deepseek-ai/dsh-client-connection'
|
|
4
|
-
|
|
4
|
+
// Type-only: erased at runtime, so the host entry never link-fails on kernels
|
|
5
|
+
// whose dsh-settings no longer ships the value-side helper (issue #17).
|
|
6
|
+
import type { SettingsNamespace } from '@deepseek-ai/dsh-settings'
|
|
5
7
|
import Schema from '@deepseek-ai/schemastery'
|
|
6
8
|
import { DEFAULT_STREAM_CONFIG, type StreamConfig } from './config.ts'
|
|
7
9
|
import { injectStreamConfig } from './boot-config.ts'
|
|
@@ -53,8 +55,8 @@ export const Config: Schema<Config> = Schema.object({
|
|
|
53
55
|
*/
|
|
54
56
|
export const StreamSettingsSchema: Schema<StreamSettings> = Schema.object({
|
|
55
57
|
enabled: Schema.boolean().default(DEFAULT_STREAM_SETTINGS.enabled),
|
|
58
|
+
controlScroll: Schema.boolean().default(DEFAULT_STREAM_SETTINGS.controlScroll),
|
|
56
59
|
thinkAutoExpand: Schema.boolean().default(DEFAULT_STREAM_SETTINGS.thinkAutoExpand),
|
|
57
|
-
autoCollapse: Schema.boolean().default(DEFAULT_STREAM_SETTINGS.autoCollapse),
|
|
58
60
|
debugEnabled: Schema.boolean().default(DEFAULT_STREAM_SETTINGS.debugEnabled),
|
|
59
61
|
debugTuning: Schema.object({
|
|
60
62
|
revealScale: Schema.number().min(0.25).max(2).default(DEFAULT_STREAM_SETTINGS.debugTuning.revealScale),
|
|
@@ -93,8 +95,14 @@ export function apply(ctx: Context, config: Config): void {
|
|
|
93
95
|
// the durable provider as the authority, but expose this one schema through
|
|
94
96
|
// the plugin's own loopback-only connection channel instead.
|
|
95
97
|
ctx.inject(['settings'], (settingsCtx) => {
|
|
98
|
+
// 0.1.2 kernels dropped the `settingsNamespace()` helper — a validating
|
|
99
|
+
// identity on ≤ 0.1.1 — and take the raw string, so the rc-era brand is
|
|
100
|
+
// reproduced locally instead of statically importing a removed symbol.
|
|
101
|
+
// The namespace is a compile-time constant matching the kernel's
|
|
102
|
+
// /^[a-z][a-z0-9-]*$/ pattern.
|
|
103
|
+
const settingsNamespace = STREAM_SETTINGS_NS as SettingsNamespace
|
|
96
104
|
const scope = settingsCtx.settings.register(
|
|
97
|
-
settingsNamespace
|
|
105
|
+
settingsNamespace,
|
|
98
106
|
StreamSettingsSchema,
|
|
99
107
|
{ applies: 'live' },
|
|
100
108
|
)
|
|
@@ -109,8 +117,8 @@ export function apply(ctx: Context, config: Config): void {
|
|
|
109
117
|
installation: installation.kind,
|
|
110
118
|
writable: connectionCtx.settings.writable,
|
|
111
119
|
enabled: settings.enabled,
|
|
120
|
+
controlScroll: settings.controlScroll,
|
|
112
121
|
thinkAutoExpand: settings.thinkAutoExpand,
|
|
113
|
-
autoCollapse: settings.autoCollapse,
|
|
114
122
|
canUpgrade: installation.kind === 'npm',
|
|
115
123
|
}
|
|
116
124
|
}
|
|
@@ -151,13 +159,14 @@ export function apply(ctx: Context, config: Config): void {
|
|
|
151
159
|
if (endpoint === STREAM_SETTINGS_RPC.write) {
|
|
152
160
|
if (typeof payload !== 'object' || payload === null || Array.isArray(payload)
|
|
153
161
|
|| typeof (payload as { enabled?: unknown }).enabled !== 'boolean'
|
|
162
|
+
|| typeof (payload as { controlScroll?: unknown }).controlScroll !== 'boolean'
|
|
154
163
|
|| typeof (payload as { thinkAutoExpand?: unknown }).thinkAutoExpand !== 'boolean'
|
|
155
|
-
|
|
164
|
+
) {
|
|
156
165
|
return {
|
|
157
166
|
ok: false,
|
|
158
167
|
error: {
|
|
159
168
|
code: 'settings-rejected',
|
|
160
|
-
message: 'enabled,
|
|
169
|
+
message: 'enabled, controlScroll and thinkAutoExpand must be booleans',
|
|
161
170
|
details: { ns: STREAM_SETTINGS_NS },
|
|
162
171
|
},
|
|
163
172
|
}
|
|
@@ -175,8 +184,8 @@ export function apply(ctx: Context, config: Config): void {
|
|
|
175
184
|
try {
|
|
176
185
|
const next = payload as {
|
|
177
186
|
enabled: boolean
|
|
187
|
+
controlScroll: boolean
|
|
178
188
|
thinkAutoExpand: boolean
|
|
179
|
-
autoCollapse: boolean
|
|
180
189
|
debugEnabled?: unknown
|
|
181
190
|
debugTuning?: unknown
|
|
182
191
|
}
|
|
@@ -193,8 +202,8 @@ export function apply(ctx: Context, config: Config): void {
|
|
|
193
202
|
}
|
|
194
203
|
await scope.update({
|
|
195
204
|
enabled: next.enabled,
|
|
205
|
+
controlScroll: next.controlScroll,
|
|
196
206
|
thinkAutoExpand: next.thinkAutoExpand,
|
|
197
|
-
autoCollapse: next.autoCollapse,
|
|
198
207
|
...(hasDebug ? { debugEnabled: next.debugEnabled, debugTuning: next.debugTuning } : {}),
|
|
199
208
|
})
|
|
200
209
|
} catch {
|
package/src/settings-api.ts
CHANGED
|
@@ -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
|
}
|