dsh-ssh-tui 0.3.2 → 0.3.3
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 +21 -9
- package/README.md +12 -7
- package/docs/screenshots/slow-link.gif +0 -0
- package/lib/tui.js +142 -23
- package/lib/tui.js.map +1 -1
- package/lib/types/tui.d.ts +31 -5
- package/package.json +4 -2
package/lib/types/tui.d.ts
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* The renderer uses plain ANSI and coalesces each frame into one stdout
|
|
9
9
|
* write of dirty rows only — jump-host / proxied SSH should see one packet
|
|
10
|
-
* per paint, not one per line. Cadence is DSH_TUI_PAINT_MS
|
|
10
|
+
* per paint, not one per line. Cadence is DSH_TUI_PAINT_MS, else local 80 ms
|
|
11
|
+
* or an SSH tier from a CSI 6n round-trip (default 160 ms).
|
|
11
12
|
*/
|
|
12
13
|
import type { Agent, ModelSelection, ModelSelectionRef } from '@deepseek-ai/dsh-agent';
|
|
13
14
|
import type { Context } from '@deepseek-ai/cordis';
|
|
@@ -160,11 +161,21 @@ interface ToolDiffHunk {
|
|
|
160
161
|
export interface TuiController {
|
|
161
162
|
dispose(): Promise<void>;
|
|
162
163
|
}
|
|
164
|
+
export type PaintLinkKind = 'local' | 'ssh';
|
|
163
165
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
+
* Explicit env/config always wins. Otherwise local TTYs stay snappy and SSH
|
|
167
|
+
* sessions pick a tier from a measured round-trip (CSI 6n), falling back to
|
|
168
|
+
* 160 ms when the probe is missing.
|
|
166
169
|
*/
|
|
167
|
-
export declare function resolvePaintIntervalMs(configured?: number, env?: NodeJS.ProcessEnv
|
|
170
|
+
export declare function resolvePaintIntervalMs(configured?: number, env?: NodeJS.ProcessEnv, options?: {
|
|
171
|
+
ssh?: boolean;
|
|
172
|
+
rttMs?: number;
|
|
173
|
+
}): number;
|
|
174
|
+
/** True when this process is attached to an SSH session (jump host / proxy). */
|
|
175
|
+
export declare function detectSshSession(env?: NodeJS.ProcessEnv): boolean;
|
|
176
|
+
/** Map a CSI-6n round-trip to a paint cadence. Unknown RTT uses the SSH default. */
|
|
177
|
+
export declare function paintIntervalForRtt(rttMs: number | undefined): number;
|
|
178
|
+
export declare function paintLinkLabel(kind: PaintLinkKind, intervalMs: number, probed: boolean): string;
|
|
168
179
|
/** One incremental paint as a single stdout write (one SSH packet when corked). */
|
|
169
180
|
export declare function composePaintOutput(options: {
|
|
170
181
|
width: number;
|
|
@@ -254,6 +265,17 @@ export declare function openCodeSourceFor(provider: string, llmPiAiSection: unkn
|
|
|
254
265
|
export declare function formatOpenCodeGoUsage(payload: unknown, source: OpenCodeSource): string;
|
|
255
266
|
/** Whether `text` could still grow into a recognized escape sequence. */
|
|
256
267
|
export declare function isEscapePrefix(text: string): boolean;
|
|
268
|
+
/** Parse a Device Status Report cursor reply (`CSI row;col R`). */
|
|
269
|
+
export declare function parseCursorPositionReply(text: string): {
|
|
270
|
+
row: number;
|
|
271
|
+
column: number;
|
|
272
|
+
} | undefined;
|
|
273
|
+
/**
|
|
274
|
+
* Round-trip to the attached terminal via CSI 6n. Returns undefined when the
|
|
275
|
+
* reply never arrives (dumb pipe, blocked DSR). Does not interpret the
|
|
276
|
+
* coordinates — only the elapsed milliseconds matter.
|
|
277
|
+
*/
|
|
278
|
+
export declare function probeTerminalRttMs(stdin?: NodeJS.ReadStream, stdout?: NodeJS.WriteStream, timeoutMs?: number): Promise<number | undefined>;
|
|
257
279
|
/** True while a plan still belongs in the dock (latest incomplete work). */
|
|
258
280
|
export declare function planIsLive(plan: {
|
|
259
281
|
active: boolean;
|
|
@@ -423,7 +445,9 @@ export declare class SshTui {
|
|
|
423
445
|
private lastChromeKey;
|
|
424
446
|
private lastPaintWidth;
|
|
425
447
|
private lastPaintHeight;
|
|
426
|
-
private
|
|
448
|
+
private paintIntervalMs;
|
|
449
|
+
private paintLink;
|
|
450
|
+
private paintProbed;
|
|
427
451
|
private searchHits;
|
|
428
452
|
private searchIndex;
|
|
429
453
|
private searchQuery;
|
|
@@ -432,6 +456,8 @@ export declare class SshTui {
|
|
|
432
456
|
constructor(ctx: Context, agent: Agent, config: TuiConfig);
|
|
433
457
|
/** Enter raw mode, switch to the alternate screen, and start listening. */
|
|
434
458
|
start(): void;
|
|
459
|
+
private startRenderTimer;
|
|
460
|
+
private calibratePaintInterval;
|
|
435
461
|
/** Replay the durable session log so a resumed session renders its history. */
|
|
436
462
|
replayHistory(): void;
|
|
437
463
|
/** Show the first-launch provider/API-key onboarding when nothing is configured. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ssh-tui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "SSH-friendly interactive terminal TUI plugin for DeepSeek Harness",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"docs/screenshots/compare.png",
|
|
46
46
|
"docs/screenshots/headless.png",
|
|
47
47
|
"docs/screenshots/workspace.png",
|
|
48
|
+
"docs/screenshots/slow-link.gif",
|
|
48
49
|
"LICENSE"
|
|
49
50
|
],
|
|
50
51
|
"license": "MIT",
|
|
@@ -65,7 +66,8 @@
|
|
|
65
66
|
"install:npm": "bash scripts/install-npm.sh",
|
|
66
67
|
"uninstall:dsh": "bash scripts/uninstall.sh",
|
|
67
68
|
"verify:dsh": "bash scripts/verify.sh",
|
|
68
|
-
"screenshots": "npm run build && node scripts/capture-readme-frames.mjs"
|
|
69
|
+
"screenshots": "npm run build && node scripts/capture-readme-frames.mjs",
|
|
70
|
+
"screenshots:slow": "npm run build && node scripts/capture-slow-link.mjs"
|
|
69
71
|
},
|
|
70
72
|
"engines": {
|
|
71
73
|
"node": ">=22.19"
|