dsh-ssh-tui 0.5.8 → 0.5.10
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 +1 -0
- package/README.md +13 -0
- package/lib/display-sock.js +52 -19
- package/lib/display-sock.js.map +1 -1
- package/lib/i18n/en.js +1 -0
- package/lib/i18n/en.js.map +1 -1
- package/lib/i18n/zh.js +1 -0
- package/lib/i18n/zh.js.map +1 -1
- package/lib/index.js +64 -7
- package/lib/index.js.map +1 -1
- package/lib/paint.js +19 -1
- package/lib/paint.js.map +1 -1
- package/lib/picker.js +19 -15
- package/lib/picker.js.map +1 -1
- package/lib/session-lock.js +5 -2
- package/lib/session-lock.js.map +1 -1
- package/lib/tui.js +25 -0
- package/lib/tui.js.map +1 -1
- package/lib/types/display-sock.d.ts +18 -5
- package/lib/types/index.d.ts +4 -0
- package/lib/types/paint.d.ts +2 -0
- package/lib/types/picker.d.ts +6 -5
- package/lib/types/tui.d.ts +2 -0
- package/package.json +1 -1
|
@@ -90,12 +90,15 @@ export declare class DisplayHost {
|
|
|
90
90
|
close(): Promise<void>;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
* True once
|
|
93
|
+
* True once a Host is actually accepting on the display channel.
|
|
94
94
|
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
95
|
+
* Always a real connect, never a filesystem check: a leftover `.sock` file
|
|
96
|
+
* (killed Host, or one that is mid-dispose) is a directory entry, not a peer,
|
|
97
|
+
* and `fs.access()` used to report it as ready — the launcher then wrote HELLO
|
|
98
|
+
* into a dead socket and the first reconnect after a drop died with
|
|
99
|
+
* `write EPIPE`. Windows pipes additionally cannot be seen by `fs.access` at
|
|
100
|
+
* all. The Host treats a connect without HELLO as a liveness probe and drops
|
|
101
|
+
* it without stealing the display.
|
|
99
102
|
*/
|
|
100
103
|
export declare function displaySockExists(path: string, timeoutMs?: number): Promise<boolean>;
|
|
101
104
|
/** Watches a freshly spawned Host so a crash is reported immediately. */
|
|
@@ -116,6 +119,16 @@ export interface SpawnedHost {
|
|
|
116
119
|
/** Exit watch so a Host that dies before listening is reported at once. */
|
|
117
120
|
exitWatch: HostExitWatch;
|
|
118
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Keep the terminal quiet while the launcher retries or waits for a Host.
|
|
124
|
+
*
|
|
125
|
+
* Between attempts the TTY is back in cooked mode, so a DSR reply still in
|
|
126
|
+
* flight from the previous probe is echoed to the screen as `^[[17;1R`-style
|
|
127
|
+
* garbage. Raw mode plus a drain swallows those bytes instead: they are either
|
|
128
|
+
* stale replies or keys typed before any display existed, and neither should
|
|
129
|
+
* reach the shell.
|
|
130
|
+
*/
|
|
131
|
+
export declare function quietTerminalInput(stdin?: NodeJS.ReadStream): number;
|
|
119
132
|
/** Spawn a detached Host copy of this `dsh` invocation and return its sock path. */
|
|
120
133
|
export declare function spawnDetachedHost(sessionId: string): SpawnedHost;
|
|
121
134
|
export declare function probeDisplaySock(path: string, timeoutMs?: number): Promise<boolean>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
* subagents, sandbox approvals) is the same one the web surface uses.
|
|
6
6
|
*/
|
|
7
7
|
import type { Context } from '@deepseek-ai/cordis';
|
|
8
|
+
/** A relay that dies this soon after connecting reached a Host that was leaving. */
|
|
9
|
+
export declare const ATTACH_RECOVERY_WINDOW_MS = 5000;
|
|
10
|
+
/** True when a relay error means the peer vanished rather than a real fault. */
|
|
11
|
+
export declare function attachPeerVanished(error: unknown, elapsedMs: number): boolean;
|
|
8
12
|
export declare const name = "ssh-tui";
|
|
9
13
|
/** Core services required before the terminal channel can drive an agent. */
|
|
10
14
|
export declare const inject: string[];
|
package/lib/types/paint.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ export declare function findCursorPositionReply(text: string): {
|
|
|
86
86
|
* reply never arrives (dumb pipe, blocked DSR). Does not interpret the
|
|
87
87
|
* coordinates — only the elapsed milliseconds matter.
|
|
88
88
|
*/
|
|
89
|
+
/** Ask up to `attempts` times, pausing between misses. */
|
|
90
|
+
export declare function probeRttWithRetry(run: () => Promise<number | undefined>, attempts?: number, delayMs?: number): Promise<number | undefined>;
|
|
89
91
|
export declare function probeTerminalRttMs(stdin?: NodeJS.ReadStream, stdout?: NodeJS.WriteStream, timeoutMs?: number): Promise<number | undefined>;
|
|
90
92
|
/** Sliding window of `windowSize` items that keeps `cursor` visible. */
|
|
91
93
|
export declare function pickerWindowStart(cursor: number, total: number, windowSize?: number): number;
|
package/lib/types/picker.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* typing filters by title / id / cwd, and Enter confirms the focused row.
|
|
9
9
|
*/
|
|
10
10
|
import type { Context } from '@deepseek-ai/cordis';
|
|
11
|
-
import { type ResumableSession } from './session-list.js';
|
|
11
|
+
import { listResumableSessionsProgressive, type ResumableSession } from './session-list.js';
|
|
12
12
|
/** What the launch picker decided. */
|
|
13
13
|
export type SessionPickerResult = {
|
|
14
14
|
kind: 'resume';
|
|
@@ -119,9 +119,10 @@ export declare function feedPicker(state: SessionPickerState, text: string, wind
|
|
|
119
119
|
* @param signal - optional abort signal (fiber dispose) to cancel the picker.
|
|
120
120
|
* @returns the selection, or null when cancelled.
|
|
121
121
|
*/
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
streams?: {
|
|
122
|
+
/** Injection seams for tests; production uses the TTY and the session index. */
|
|
123
|
+
export interface SessionPickerOptions {
|
|
125
124
|
stdin?: NodeJS.ReadStream;
|
|
126
125
|
stdout?: NodeJS.WriteStream;
|
|
127
|
-
|
|
126
|
+
listSessions?: typeof listResumableSessionsProgressive;
|
|
127
|
+
}
|
|
128
|
+
export declare function showSessionPicker(ctx: Context, color: boolean, signal?: AbortSignal, options?: SessionPickerOptions): Promise<SessionPickerResult>;
|
package/lib/types/tui.d.ts
CHANGED
|
@@ -185,6 +185,8 @@ export declare class SshTui {
|
|
|
185
185
|
private liveStreamOwner;
|
|
186
186
|
/** Live events parked while the (yielding) history replay holds the floor. */
|
|
187
187
|
private replayQueue;
|
|
188
|
+
/** A relay claimed the display while a hangup was still cancelling/flushing. */
|
|
189
|
+
private reattachedDuringHangup;
|
|
188
190
|
private readonly pendingToolTimes;
|
|
189
191
|
private readonly usageByStep;
|
|
190
192
|
private lastStatsTurn;
|