@cplieger/web-terminal-engine 2.7.0 → 2.8.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/jsr.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/status-stream.ts +13 -5
package/jsr.json
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { wsURL } from "./wsurl.js";
|
|
|
13
13
|
export { WS_PATH, SESSIONS_PATH, SESSION_EVENTS_PATH } from "./routes.js";
|
|
14
14
|
export { connectStatusStream } from "./status-stream.js";
|
|
15
15
|
export type {
|
|
16
|
+
SessionInfo,
|
|
16
17
|
SessionStatus,
|
|
17
18
|
StatusStream,
|
|
18
19
|
StatusStreamCallbacks,
|
package/src/status-stream.ts
CHANGED
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import { nextBackoffDelay } from "./reconnect.js";
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
|
|
10
|
+
/** SessionInfo is one session's wire shape: the JSON object the session REST
|
|
11
|
+
* API (GET/POST /api/sessions) returns per session. Mirrors the Go
|
|
12
|
+
* terminal.SessionInfo — the two are kept in lockstep by hand (single 6-field
|
|
13
|
+
* type; flip to wiregen if this surface grows). */
|
|
14
|
+
export interface SessionInfo {
|
|
13
15
|
readonly id: string;
|
|
14
16
|
readonly status: "working" | "idle" | "input" | "done" | "exited";
|
|
15
17
|
readonly title: string;
|
|
@@ -18,8 +20,6 @@ export interface SessionStatus {
|
|
|
18
20
|
* this instead of `title`. */
|
|
19
21
|
readonly clientTitle?: string;
|
|
20
22
|
readonly createdAt: string;
|
|
21
|
-
/** true when the session is gone (closed or reaped); the consumer drops it. */
|
|
22
|
-
readonly removed?: boolean;
|
|
23
23
|
/** true once the session has emitted a genuine activity signal — OSC 9;4
|
|
24
24
|
* progress (kiro-cli, Claude Code, …) or a classified OSC 9 notification.
|
|
25
25
|
* Sticky for the session's life. Consumers reveal the per-tab activity dot
|
|
@@ -28,6 +28,14 @@ export interface SessionStatus {
|
|
|
28
28
|
readonly reportsActivity?: boolean;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/** SessionStatus is one session's current status as carried on the status
|
|
32
|
+
* stream (SSE): the REST wire shape plus the stream-only removal marker. It
|
|
33
|
+
* mirrors the server's status event. */
|
|
34
|
+
export interface SessionStatus extends SessionInfo {
|
|
35
|
+
/** true when the session is gone (closed or reaped); the consumer drops it. */
|
|
36
|
+
readonly removed?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
/** StatusStreamCallbacks are the consumer's hooks. Declared as function-typed
|
|
32
40
|
* properties (not method shorthand) so destructuring them is safe. */
|
|
33
41
|
export interface StatusStreamCallbacks {
|