green-screen-proxy 1.3.1 → 1.4.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.md +1 -1
- package/dist/controller.d.ts +14 -2
- package/dist/controller.d.ts.map +1 -1
- package/dist/controller.js +19 -0
- package/dist/controller.js.map +1 -1
- package/dist/protocols/tn5250-handler.d.ts +12 -0
- package/dist/protocols/tn5250-handler.d.ts.map +1 -1
- package/dist/protocols/tn5250-handler.js +28 -1
- package/dist/protocols/tn5250-handler.js.map +1 -1
- package/dist/protocols/types.d.ts +30 -1
- package/dist/protocols/types.d.ts.map +1 -1
- package/dist/protocols/types.js +26 -0
- package/dist/protocols/types.js.map +1 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +229 -60
- package/dist/routes.js.map +1 -1
- package/dist/session-keys.d.ts +16 -0
- package/dist/session-keys.d.ts.map +1 -0
- package/dist/session-keys.js +77 -0
- package/dist/session-keys.js.map +1 -0
- package/dist/session.d.ts +71 -2
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +198 -7
- package/dist/session.js.map +1 -1
- package/dist/structural-signature.d.ts +18 -0
- package/dist/structural-signature.d.ts.map +1 -0
- package/dist/structural-signature.js +73 -0
- package/dist/structural-signature.js.map +1 -0
- package/dist/tn5250/connection.d.ts +29 -1
- package/dist/tn5250/connection.d.ts.map +1 -1
- package/dist/tn5250/connection.js +74 -4
- package/dist/tn5250/connection.js.map +1 -1
- package/dist/tn5250/constants.d.ts.map +1 -1
- package/dist/tn5250/constants.js +14 -0
- package/dist/tn5250/constants.js.map +1 -1
- package/dist/tn5250/ebcdic.d.ts +15 -3
- package/dist/tn5250/ebcdic.d.ts.map +1 -1
- package/dist/tn5250/ebcdic.js +63 -3
- package/dist/tn5250/ebcdic.js.map +1 -1
- package/dist/tn5250/parser.d.ts.map +1 -1
- package/dist/tn5250/parser.js +30 -11
- package/dist/tn5250/parser.js.map +1 -1
- package/dist/tn5250/screen-id.d.ts +26 -0
- package/dist/tn5250/screen-id.d.ts.map +1 -0
- package/dist/tn5250/screen-id.js +183 -0
- package/dist/tn5250/screen-id.js.map +1 -0
- package/dist/tn5250/screen.d.ts +13 -11
- package/dist/tn5250/screen.d.ts.map +1 -1
- package/dist/tn5250/screen.js +76 -18
- package/dist/tn5250/screen.js.map +1 -1
- package/dist/websocket.d.ts +10 -0
- package/dist/websocket.d.ts.map +1 -1
- package/dist/websocket.js +115 -12
- package/dist/websocket.js.map +1 -1
- package/package.json +1 -1
package/dist/session.d.ts
CHANGED
|
@@ -10,12 +10,54 @@ export declare class Session extends EventEmitter {
|
|
|
10
10
|
private _host;
|
|
11
11
|
private _port;
|
|
12
12
|
private _idleTimer;
|
|
13
|
+
private _connectWatchdog;
|
|
13
14
|
private _lastActivity;
|
|
15
|
+
/** The options the session was last connected with. Replayed verbatim on
|
|
16
|
+
* reconnect() so a stable display device name (DEVNAME), code page and
|
|
17
|
+
* terminal type survive a reconnect — otherwise the host would auto-assign a
|
|
18
|
+
* fresh QPADEVxxxx and the reattach-by-device-name guarantee would break. */
|
|
19
|
+
private _connectOptions?;
|
|
20
|
+
/** When true (set via the ``autoReconnect`` connect option), the proxy itself
|
|
21
|
+
* re-establishes the TCP on an UNEXPECTED host drop — replaying the stable
|
|
22
|
+
* DEVNAME — and emits ``session.reconnected`` so the integrator re-drives only
|
|
23
|
+
* sign-on, instead of detecting staleness and opening a fresh session. Off by
|
|
24
|
+
* default (legacy: the integrator owns all recovery). */
|
|
25
|
+
private _autoReconnect;
|
|
26
|
+
/** Set on any caller-initiated teardown so the auto-reconnect path stands
|
|
27
|
+
* down — we only auto-recover from drops we did NOT ask for. */
|
|
28
|
+
private _intentionalClose;
|
|
29
|
+
/** Guards the auto-reconnect loop against re-entrancy. */
|
|
30
|
+
private _reconnecting;
|
|
31
|
+
/** Server-side single-writer lock. When non-null, an exclusive driver (e.g.
|
|
32
|
+
* ``agent:<id>`` set by the integrator for the duration of an automated run)
|
|
33
|
+
* owns input — the proxy rejects WS key/text/cursor commands from anyone else,
|
|
34
|
+
* so a dashboard operator can't type into a session mid-transaction even if a
|
|
35
|
+
* client-side guard fails. Null = unlocked (interactive clients may drive). */
|
|
36
|
+
private _driveHolder;
|
|
14
37
|
/** Timeout (ms) to wait for screen data after connect or key send (default 5000) */
|
|
15
38
|
screenTimeout: number;
|
|
16
|
-
/** Idle timeout (ms) — session auto-destroys if no activity.
|
|
17
|
-
*
|
|
39
|
+
/** Idle timeout (ms) — session auto-destroys if no REST/screen activity.
|
|
40
|
+
* Safety net for backend crashes; the backend's own keepalive handles
|
|
41
|
+
* IBM i QINACTITV separately. 30 min is long enough that hot-reload
|
|
42
|
+
* restarts and slow startup sequences don't race against this timer. */
|
|
18
43
|
static IDLE_TIMEOUT: number;
|
|
44
|
+
/** Default connect-watchdog deadline (ms) for a session pinned in
|
|
45
|
+
* 'connecting'. The idle timer only arms AFTER a successful connect, so a
|
|
46
|
+
* connect that never completes — a TCP blackhole (SYN with no SYN-ACK/RST),
|
|
47
|
+
* or a reject the caller forgot to tear down — would otherwise leave the
|
|
48
|
+
* session in the store forever holding a half-open socket. This watchdog is
|
|
49
|
+
* the backstop: 30s default socket connectTimeout + the grace below. */
|
|
50
|
+
static CONNECT_TIMEOUT: number;
|
|
51
|
+
/** Grace (ms) added on top of the socket's own connectTimeout before the
|
|
52
|
+
* watchdog reaps. Keeps the watchdog strictly a backstop — the socket-level
|
|
53
|
+
* timeout/reject (and the caller's error handling) get first crack at a
|
|
54
|
+
* failed connect; the watchdog only fires when that path doesn't. */
|
|
55
|
+
static CONNECT_WATCHDOG_GRACE: number;
|
|
56
|
+
/** Backoff schedule (ms) for proxy-driven auto-reconnect after an unexpected
|
|
57
|
+
* host drop. Bounded + capped so a host that's truly down can't be stormed
|
|
58
|
+
* (respects IBM i QMAXSIGN); on exhaustion the session reports ``session.lost``
|
|
59
|
+
* and the integrator's own reconnect policy takes over. */
|
|
60
|
+
static RECONNECT_BACKOFF_MS: number[];
|
|
19
61
|
constructor(protocol?: ProtocolType);
|
|
20
62
|
/** Reset idle timer — called on any API activity (screen read, key send, etc.) */
|
|
21
63
|
touch(): void;
|
|
@@ -23,15 +65,42 @@ export declare class Session extends EventEmitter {
|
|
|
23
65
|
startIdleTimer(): void;
|
|
24
66
|
/** Stop the idle timer. */
|
|
25
67
|
stopIdleTimer(): void;
|
|
68
|
+
/** Arm the connect watchdog. Called when the session enters 'connecting'.
|
|
69
|
+
* If it's still 'connecting' when the deadline elapses, the session never
|
|
70
|
+
* connected — destroy it so it can't leak in the store. A successful
|
|
71
|
+
* connect (or any teardown) clears it first. */
|
|
72
|
+
private startConnectWatchdog;
|
|
73
|
+
/** Stop the connect watchdog. */
|
|
74
|
+
private stopConnectWatchdog;
|
|
26
75
|
get status(): ConnectionStatus;
|
|
76
|
+
/** The current exclusive input owner, or null when unlocked. */
|
|
77
|
+
get driveHolder(): string | null;
|
|
78
|
+
/** Claim exclusive input for ``holder``. Idempotent for the same holder;
|
|
79
|
+
* refused (returns false) if a different holder already owns it. */
|
|
80
|
+
acquireDrive(holder: string): boolean;
|
|
81
|
+
/** Release the input lock. A ``holder`` mismatch is ignored (returns false)
|
|
82
|
+
* so a stale releaser can't free a lock it doesn't own; pass no holder to
|
|
83
|
+
* force-release (teardown). */
|
|
84
|
+
releaseDrive(holder?: string): boolean;
|
|
27
85
|
/** Mark this session as authenticated after a successful auto-sign-in */
|
|
28
86
|
markAuthenticated(username: string): void;
|
|
29
87
|
connect(host: string, port: number, options?: ProtocolOptions): Promise<void>;
|
|
30
88
|
disconnect(): void;
|
|
31
89
|
reconnect(): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Proxy-driven recovery from an UNEXPECTED host drop (autoReconnect sessions
|
|
92
|
+
* only). Re-establishes the TCP with the original connect options (so the
|
|
93
|
+
* stable DEVNAME makes IBM i reattach the disconnected job instead of minting
|
|
94
|
+
* a fresh QPADEVxxxx), with bounded backoff. On success it emits
|
|
95
|
+
* ``session.reconnected`` with ``needsSignOn`` so the integrator re-drives only
|
|
96
|
+
* its sign-on cascade (the proxy holds no credentials). On exhaustion it emits
|
|
97
|
+
* ``session.lost`` and the integrator's own reconnect policy takes over.
|
|
98
|
+
*/
|
|
99
|
+
private _attemptAutoReconnect;
|
|
32
100
|
sendText(text: string): boolean;
|
|
33
101
|
sendKey(keyName: string): boolean;
|
|
34
102
|
setCursor(row: number, col: number): boolean;
|
|
103
|
+
eraseEOF(): boolean;
|
|
35
104
|
getScreenData(): ScreenData;
|
|
36
105
|
/** Read input field values from the current screen.
|
|
37
106
|
* @param modifiedOnly — when true (default), only fields with MDT bit set. */
|
package/dist/session.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,eAAe,EAAyB,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGvE,qBAAa,OAAQ,SAAQ,YAAY;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAEhC,OAAO,CAAC,OAAO,CAAkE;IACjF,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,UAAU,CAA8C;IAChE,OAAO,CAAC,aAAa,CAAsB;IAE3C,oFAAoF;IACpF,aAAa,EAAE,MAAM,CAAQ;IAE7B;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,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EAAE,UAAU,CAAA;KAAE,CAAC;IAwBhG,OAAO,IAAI,IAAI;IAQf;;;;;;;;OAQG;IACG,eAAe,CAAC,SAAS,GAAE,MAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAe/D;AAMD,wBAAgB,aAAa,CAAC,QAAQ,GAAE,YAAuB,GAAG,OAAO,CAIxE;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAE1D;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAO/C;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,GAAE,MAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CASlG;AAED,wBAAgB,iBAAiB,IAAI,OAAO,GAAG,SAAS,CAMvD;AAED,wBAAgB,cAAc,IAAI,OAAO,EAAE,CAE1C"}
|
package/dist/session.js
CHANGED
|
@@ -10,12 +10,54 @@ export class Session extends EventEmitter {
|
|
|
10
10
|
_host = '';
|
|
11
11
|
_port = 23;
|
|
12
12
|
_idleTimer = null;
|
|
13
|
+
_connectWatchdog = null;
|
|
13
14
|
_lastActivity = Date.now();
|
|
15
|
+
/** The options the session was last connected with. Replayed verbatim on
|
|
16
|
+
* reconnect() so a stable display device name (DEVNAME), code page and
|
|
17
|
+
* terminal type survive a reconnect — otherwise the host would auto-assign a
|
|
18
|
+
* fresh QPADEVxxxx and the reattach-by-device-name guarantee would break. */
|
|
19
|
+
_connectOptions;
|
|
20
|
+
/** When true (set via the ``autoReconnect`` connect option), the proxy itself
|
|
21
|
+
* re-establishes the TCP on an UNEXPECTED host drop — replaying the stable
|
|
22
|
+
* DEVNAME — and emits ``session.reconnected`` so the integrator re-drives only
|
|
23
|
+
* sign-on, instead of detecting staleness and opening a fresh session. Off by
|
|
24
|
+
* default (legacy: the integrator owns all recovery). */
|
|
25
|
+
_autoReconnect = false;
|
|
26
|
+
/** Set on any caller-initiated teardown so the auto-reconnect path stands
|
|
27
|
+
* down — we only auto-recover from drops we did NOT ask for. */
|
|
28
|
+
_intentionalClose = false;
|
|
29
|
+
/** Guards the auto-reconnect loop against re-entrancy. */
|
|
30
|
+
_reconnecting = false;
|
|
31
|
+
/** Server-side single-writer lock. When non-null, an exclusive driver (e.g.
|
|
32
|
+
* ``agent:<id>`` set by the integrator for the duration of an automated run)
|
|
33
|
+
* owns input — the proxy rejects WS key/text/cursor commands from anyone else,
|
|
34
|
+
* so a dashboard operator can't type into a session mid-transaction even if a
|
|
35
|
+
* client-side guard fails. Null = unlocked (interactive clients may drive). */
|
|
36
|
+
_driveHolder = null;
|
|
14
37
|
/** Timeout (ms) to wait for screen data after connect or key send (default 5000) */
|
|
15
38
|
screenTimeout = 5000;
|
|
16
|
-
/** Idle timeout (ms) — session auto-destroys if no activity.
|
|
17
|
-
*
|
|
18
|
-
|
|
39
|
+
/** Idle timeout (ms) — session auto-destroys if no REST/screen activity.
|
|
40
|
+
* Safety net for backend crashes; the backend's own keepalive handles
|
|
41
|
+
* IBM i QINACTITV separately. 30 min is long enough that hot-reload
|
|
42
|
+
* restarts and slow startup sequences don't race against this timer. */
|
|
43
|
+
static IDLE_TIMEOUT = 30 * 60 * 1000;
|
|
44
|
+
/** Default connect-watchdog deadline (ms) for a session pinned in
|
|
45
|
+
* 'connecting'. The idle timer only arms AFTER a successful connect, so a
|
|
46
|
+
* connect that never completes — a TCP blackhole (SYN with no SYN-ACK/RST),
|
|
47
|
+
* or a reject the caller forgot to tear down — would otherwise leave the
|
|
48
|
+
* session in the store forever holding a half-open socket. This watchdog is
|
|
49
|
+
* the backstop: 30s default socket connectTimeout + the grace below. */
|
|
50
|
+
static CONNECT_TIMEOUT = 45 * 1000;
|
|
51
|
+
/** Grace (ms) added on top of the socket's own connectTimeout before the
|
|
52
|
+
* watchdog reaps. Keeps the watchdog strictly a backstop — the socket-level
|
|
53
|
+
* timeout/reject (and the caller's error handling) get first crack at a
|
|
54
|
+
* failed connect; the watchdog only fires when that path doesn't. */
|
|
55
|
+
static CONNECT_WATCHDOG_GRACE = 15 * 1000;
|
|
56
|
+
/** Backoff schedule (ms) for proxy-driven auto-reconnect after an unexpected
|
|
57
|
+
* host drop. Bounded + capped so a host that's truly down can't be stormed
|
|
58
|
+
* (respects IBM i QMAXSIGN); on exhaustion the session reports ``session.lost``
|
|
59
|
+
* and the integrator's own reconnect policy takes over. */
|
|
60
|
+
static RECONNECT_BACKOFF_MS = [2000, 4000, 8000, 15000, 30000];
|
|
19
61
|
constructor(protocol = 'tn5250') {
|
|
20
62
|
super();
|
|
21
63
|
this.id = randomUUID();
|
|
@@ -29,12 +71,25 @@ export class Session extends EventEmitter {
|
|
|
29
71
|
this._status = { connected: false, status: 'disconnected', protocol: this.protocol, host: this._host };
|
|
30
72
|
this.stopIdleTimer();
|
|
31
73
|
this.emit('statusChange', this._status);
|
|
74
|
+
// Auto-reconnect path: an UNEXPECTED drop on an autoReconnect session is
|
|
75
|
+
// recovered in place (proxy re-establishes the TCP on the same DEVNAME).
|
|
76
|
+
// We do NOT emit session.lost here — that would unbind the connect-by-key
|
|
77
|
+
// mapping and let a fresh session open. session.lost is emitted only if
|
|
78
|
+
// auto-reconnect exhausts its attempts.
|
|
79
|
+
if (this._autoReconnect && !this._intentionalClose) {
|
|
80
|
+
this._attemptAutoReconnect().catch(() => { });
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
32
83
|
sessionLifecycle.emit('session.lost', this.id, this._status);
|
|
33
84
|
});
|
|
34
85
|
this.handler.on('error', (err) => {
|
|
35
86
|
this._status = { connected: false, status: 'error', protocol: this.protocol, host: this._host, error: err.message };
|
|
36
87
|
this.emit('statusChange', this._status);
|
|
37
|
-
|
|
88
|
+
// For an autoReconnect session, let the ensuing disconnect drive recovery
|
|
89
|
+
// (don't unbind the key via session.lost first).
|
|
90
|
+
if (!(this._autoReconnect && !this._intentionalClose)) {
|
|
91
|
+
sessionLifecycle.emit('session.lost', this.id, this._status);
|
|
92
|
+
}
|
|
38
93
|
// Close the upstream TCP socket on unrecoverable protocol errors.
|
|
39
94
|
// Without this, a parser exception would leak the half-open 5250
|
|
40
95
|
// session on the host until the 5-min idle timeout — and on IBM i
|
|
@@ -54,8 +109,11 @@ export class Session extends EventEmitter {
|
|
|
54
109
|
this.stopIdleTimer();
|
|
55
110
|
this._idleTimer = setInterval(() => {
|
|
56
111
|
if (Date.now() - this._lastActivity > Session.IDLE_TIMEOUT) {
|
|
57
|
-
console.log(`[Session ${this.id.slice(0, 8)}] Idle timeout (${Session.IDLE_TIMEOUT / 1000}s) —
|
|
58
|
-
|
|
112
|
+
console.log(`[Session ${this.id.slice(0, 8)}] Idle timeout (${Session.IDLE_TIMEOUT / 1000}s) — signing off`);
|
|
113
|
+
// Graceful SIGNOFF + TCP close, not a bare destroy: a hard drop leaves
|
|
114
|
+
// the IBM i QPADEV device hanging (it accumulates and, under churn,
|
|
115
|
+
// trips QMAXSIGN/QAUTOVRT and gets disabled). Best-effort + non-blocking.
|
|
116
|
+
void gracefullyDestroySession(this.id).catch(() => { });
|
|
59
117
|
}
|
|
60
118
|
}, 30_000); // Check every 30s
|
|
61
119
|
}
|
|
@@ -66,9 +124,58 @@ export class Session extends EventEmitter {
|
|
|
66
124
|
this._idleTimer = null;
|
|
67
125
|
}
|
|
68
126
|
}
|
|
127
|
+
/** Arm the connect watchdog. Called when the session enters 'connecting'.
|
|
128
|
+
* If it's still 'connecting' when the deadline elapses, the session never
|
|
129
|
+
* connected — destroy it so it can't leak in the store. A successful
|
|
130
|
+
* connect (or any teardown) clears it first. */
|
|
131
|
+
startConnectWatchdog(deadlineMs) {
|
|
132
|
+
this.stopConnectWatchdog();
|
|
133
|
+
this._connectWatchdog = setTimeout(() => {
|
|
134
|
+
this._connectWatchdog = null;
|
|
135
|
+
// Reap only if the session never left 'connecting'. A successful
|
|
136
|
+
// connect flips status to 'connected'/'authenticated' (and clears this
|
|
137
|
+
// timer); a connect that hung — or rejected without the caller tearing
|
|
138
|
+
// the session down — is still pinned here.
|
|
139
|
+
if (this._status.status !== 'connecting')
|
|
140
|
+
return;
|
|
141
|
+
console.log(`[connect-reap] Session ${this.id.slice(0, 8)} stuck in 'connecting' for ${Math.round(deadlineMs / 1000)}s — destroying (never connected)`);
|
|
142
|
+
// Bare destroy, not a graceful SIGNOFF: the TCP connect never
|
|
143
|
+
// completed, so there is no signed-on host job to end. This closes any
|
|
144
|
+
// half-open socket and drops the store entry.
|
|
145
|
+
destroySession(this.id);
|
|
146
|
+
}, deadlineMs);
|
|
147
|
+
}
|
|
148
|
+
/** Stop the connect watchdog. */
|
|
149
|
+
stopConnectWatchdog() {
|
|
150
|
+
if (this._connectWatchdog) {
|
|
151
|
+
clearTimeout(this._connectWatchdog);
|
|
152
|
+
this._connectWatchdog = null;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
69
155
|
get status() {
|
|
70
156
|
return { ...this._status };
|
|
71
157
|
}
|
|
158
|
+
/** The current exclusive input owner, or null when unlocked. */
|
|
159
|
+
get driveHolder() {
|
|
160
|
+
return this._driveHolder;
|
|
161
|
+
}
|
|
162
|
+
/** Claim exclusive input for ``holder``. Idempotent for the same holder;
|
|
163
|
+
* refused (returns false) if a different holder already owns it. */
|
|
164
|
+
acquireDrive(holder) {
|
|
165
|
+
if (this._driveHolder && this._driveHolder !== holder)
|
|
166
|
+
return false;
|
|
167
|
+
this._driveHolder = holder;
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
/** Release the input lock. A ``holder`` mismatch is ignored (returns false)
|
|
171
|
+
* so a stale releaser can't free a lock it doesn't own; pass no holder to
|
|
172
|
+
* force-release (teardown). */
|
|
173
|
+
releaseDrive(holder) {
|
|
174
|
+
if (holder !== undefined && this._driveHolder && this._driveHolder !== holder)
|
|
175
|
+
return false;
|
|
176
|
+
this._driveHolder = null;
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
72
179
|
/** Mark this session as authenticated after a successful auto-sign-in */
|
|
73
180
|
markAuthenticated(username) {
|
|
74
181
|
this._status = {
|
|
@@ -81,23 +188,100 @@ export class Session extends EventEmitter {
|
|
|
81
188
|
async connect(host, port, options) {
|
|
82
189
|
this._host = host;
|
|
83
190
|
this._port = port;
|
|
191
|
+
// Remember the options so reconnect() can replay them (esp. DEVNAME).
|
|
192
|
+
this._connectOptions = options;
|
|
193
|
+
// Opt-in proxy-driven recovery: when set, an unexpected host drop is
|
|
194
|
+
// re-established in place rather than surfaced as a lost session.
|
|
195
|
+
this._autoReconnect = !!options?.autoReconnect;
|
|
196
|
+
this._intentionalClose = false;
|
|
84
197
|
this._status = { connected: false, status: 'connecting', protocol: this.protocol, host };
|
|
85
198
|
this.emit('statusChange', this._status);
|
|
199
|
+
// Arm the connect watchdog before awaiting the handshake. Sit it beyond
|
|
200
|
+
// the socket's own connectTimeout (default 30s) so it only fires when the
|
|
201
|
+
// socket-level timeout/reject fails to. If handler.connect() hangs or
|
|
202
|
+
// rejects without the caller cleaning up, the watchdog reaps the session.
|
|
203
|
+
const socketConnectTimeout = options?.connectTimeout;
|
|
204
|
+
const deadlineMs = typeof socketConnectTimeout === 'number' && socketConnectTimeout > 0
|
|
205
|
+
? socketConnectTimeout + Session.CONNECT_WATCHDOG_GRACE
|
|
206
|
+
: Session.CONNECT_TIMEOUT;
|
|
207
|
+
this.startConnectWatchdog(deadlineMs);
|
|
86
208
|
await this.handler.connect(host, port, options);
|
|
209
|
+
this.stopConnectWatchdog();
|
|
87
210
|
this._status = { connected: true, status: 'connected', protocol: this.protocol, host };
|
|
88
211
|
this.touch();
|
|
89
212
|
this.startIdleTimer();
|
|
90
213
|
this.emit('statusChange', this._status);
|
|
91
214
|
}
|
|
92
215
|
disconnect() {
|
|
216
|
+
this._intentionalClose = true;
|
|
93
217
|
this.stopIdleTimer();
|
|
218
|
+
this.stopConnectWatchdog();
|
|
94
219
|
this.handler.disconnect();
|
|
95
220
|
this._status = { connected: false, status: 'disconnected', protocol: this.protocol, host: this._host };
|
|
96
221
|
this.emit('statusChange', this._status);
|
|
97
222
|
}
|
|
98
223
|
async reconnect() {
|
|
99
224
|
this.disconnect();
|
|
100
|
-
|
|
225
|
+
// Replay the original connect options so the reconnect keeps the same
|
|
226
|
+
// stable device name / code page / terminal type — without them the host
|
|
227
|
+
// auto-assigns a fresh QPADEVxxxx and the device-reattach guarantee breaks.
|
|
228
|
+
await this.connect(this._host, this._port, this._connectOptions);
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Proxy-driven recovery from an UNEXPECTED host drop (autoReconnect sessions
|
|
232
|
+
* only). Re-establishes the TCP with the original connect options (so the
|
|
233
|
+
* stable DEVNAME makes IBM i reattach the disconnected job instead of minting
|
|
234
|
+
* a fresh QPADEVxxxx), with bounded backoff. On success it emits
|
|
235
|
+
* ``session.reconnected`` with ``needsSignOn`` so the integrator re-drives only
|
|
236
|
+
* its sign-on cascade (the proxy holds no credentials). On exhaustion it emits
|
|
237
|
+
* ``session.lost`` and the integrator's own reconnect policy takes over.
|
|
238
|
+
*/
|
|
239
|
+
async _attemptAutoReconnect() {
|
|
240
|
+
if (this._reconnecting || this._intentionalClose)
|
|
241
|
+
return;
|
|
242
|
+
this._reconnecting = true;
|
|
243
|
+
// Tell watchers the proxy has taken ownership of recovery so an integrator
|
|
244
|
+
// with its own stale-detection/watchdog stands down instead of racing us
|
|
245
|
+
// into a second reconnect. We always conclude with session.reconnected
|
|
246
|
+
// (success) or session.lost (exhaustion), so the integrator never defers
|
|
247
|
+
// forever.
|
|
248
|
+
sessionLifecycle.emit('session.reconnecting', this.id);
|
|
249
|
+
const schedule = Session.RECONNECT_BACKOFF_MS;
|
|
250
|
+
try {
|
|
251
|
+
for (let attempt = 0; attempt < schedule.length; attempt++) {
|
|
252
|
+
await new Promise((r) => setTimeout(r, schedule[attempt]));
|
|
253
|
+
if (this._intentionalClose)
|
|
254
|
+
return;
|
|
255
|
+
this._status = { connected: false, status: 'connecting', protocol: this.protocol, host: this._host };
|
|
256
|
+
this.emit('statusChange', this._status);
|
|
257
|
+
try {
|
|
258
|
+
await this.handler.connect(this._host, this._port, this._connectOptions);
|
|
259
|
+
}
|
|
260
|
+
catch (err) {
|
|
261
|
+
console.warn(`[auto-reconnect] Session ${this.id.slice(0, 8)} attempt ${attempt + 1}/${schedule.length} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
if (this._intentionalClose) {
|
|
265
|
+
try {
|
|
266
|
+
this.handler.disconnect();
|
|
267
|
+
}
|
|
268
|
+
catch { /* ignore */ }
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
this._status = { connected: true, status: 'connected', protocol: this.protocol, host: this._host };
|
|
272
|
+
this.touch();
|
|
273
|
+
this.startIdleTimer();
|
|
274
|
+
this.emit('statusChange', this._status);
|
|
275
|
+
console.log(`[auto-reconnect] Session ${this.id.slice(0, 8)} re-established TCP on attempt ${attempt + 1} — signalling needsSignOn`);
|
|
276
|
+
sessionLifecycle.emit('session.reconnected', this.id, { needsSignOn: true });
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
console.warn(`[auto-reconnect] Session ${this.id.slice(0, 8)} exhausted ${schedule.length} attempts — reporting lost`);
|
|
280
|
+
sessionLifecycle.emit('session.lost', this.id, this._status);
|
|
281
|
+
}
|
|
282
|
+
finally {
|
|
283
|
+
this._reconnecting = false;
|
|
284
|
+
}
|
|
101
285
|
}
|
|
102
286
|
sendText(text) {
|
|
103
287
|
return this.handler.sendText(text);
|
|
@@ -108,6 +292,9 @@ export class Session extends EventEmitter {
|
|
|
108
292
|
setCursor(row, col) {
|
|
109
293
|
return this.handler.setCursor(row, col);
|
|
110
294
|
}
|
|
295
|
+
eraseEOF() {
|
|
296
|
+
return this.handler.eraseEOF();
|
|
297
|
+
}
|
|
111
298
|
getScreenData() {
|
|
112
299
|
return this.handler.getScreenData();
|
|
113
300
|
}
|
|
@@ -156,7 +343,9 @@ export class Session extends EventEmitter {
|
|
|
156
343
|
});
|
|
157
344
|
}
|
|
158
345
|
destroy() {
|
|
346
|
+
this._intentionalClose = true;
|
|
159
347
|
this.stopIdleTimer();
|
|
348
|
+
this.stopConnectWatchdog();
|
|
160
349
|
this.handler.destroy();
|
|
161
350
|
this.removeAllListeners();
|
|
162
351
|
}
|
|
@@ -170,7 +359,9 @@ export class Session extends EventEmitter {
|
|
|
170
359
|
* store entry is not removed here.
|
|
171
360
|
*/
|
|
172
361
|
async gracefulDestroy(timeoutMs = 1500) {
|
|
362
|
+
this._intentionalClose = true;
|
|
173
363
|
this.stopIdleTimer();
|
|
364
|
+
this.stopConnectWatchdog();
|
|
174
365
|
const isAuth = this._status.status === 'authenticated';
|
|
175
366
|
if (isAuth && typeof this.handler.attemptSignOff === 'function') {
|
|
176
367
|
try {
|
package/dist/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAmB,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAG9E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEvE,MAAM,OAAO,OAAQ,SAAQ,YAAY;IAC9B,EAAE,CAAS;IACX,OAAO,CAAkB;IACzB,QAAQ,CAAe;IAExB,OAAO,GAAqB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IACzE,KAAK,GAAW,EAAE,CAAC;IACnB,KAAK,GAAW,EAAE,CAAC;IACnB,UAAU,GAAyC,IAAI,CAAC;IACxD,aAAa,GAAW,IAAI,CAAC,GAAG,EAAE,CAAC;IAE3C,oFAAoF;IACpF,aAAa,GAAW,IAAI,CAAC;IAE7B;4FACwF;IACxF,MAAM,CAAC,YAAY,GAAG,CAAC,GAAG,EAA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,MAAM,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,EAAU,EAAE,YAAoB,IAAI;IACjF,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC9B,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;YAAS,CAAC;QACT,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAgB,CAAC;IAChD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Field } from 'green-screen-types';
|
|
2
|
+
/**
|
|
3
|
+
* Bottom-region cutoff. Rows at/above this index are treated as the transient
|
|
4
|
+
* host status / F-key footer and excluded from identity. 21 matches a standard
|
|
5
|
+
* 24-row screen's status region and is the value the LegacyBridge backend's
|
|
6
|
+
* input-skeleton dedup uses (`_FOOTER_CUTOFF`); keep them aligned for parity.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_FOOTER_CUTOFF = 21;
|
|
9
|
+
/** Canonical scheme tag, prefixed onto the serialized skeleton. Bump on format change. */
|
|
10
|
+
export declare const STRUCTURAL_SIGNATURE_SCHEME = "v1";
|
|
11
|
+
/**
|
|
12
|
+
* Compute the structural signature of a screen from its field list.
|
|
13
|
+
* @param fields the screen's `Field[]` (as built for `ScreenData.fields`).
|
|
14
|
+
* @param footerCutoff rows >= this are excluded (default {@link DEFAULT_FOOTER_CUTOFF}).
|
|
15
|
+
* @returns the sha256 hex id, or `undefined` if the screen has no input fields.
|
|
16
|
+
*/
|
|
17
|
+
export declare function computeStructuralSignature(fields: Field[], footerCutoff?: number): string | undefined;
|
|
18
|
+
//# sourceMappingURL=structural-signature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-signature.d.ts","sourceRoot":"","sources":["../src/structural-signature.ts"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,0FAA0F;AAC1F,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,KAAK,EAAE,EACf,YAAY,GAAE,MAA8B,GAC3C,MAAM,GAAG,SAAS,CAapB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural screen signature — a value- and text-independent identity for a
|
|
3
|
+
* block-mode terminal screen, derived from the geometry of its INPUT fields.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS
|
|
6
|
+
* ---------------
|
|
7
|
+
* The wire `ScreenData.screen_signature` is `md5(rendered_content)` — it flips
|
|
8
|
+
* on every keystroke, counter tick, or status line, so it cannot answer the one
|
|
9
|
+
* question every consumer actually asks: *which screen is this?* Downstream
|
|
10
|
+
* integrators (e.g. the LegacyBridge backend) therefore reconstruct screen
|
|
11
|
+
* identity several different ways from the rendered grid. The raw material for a
|
|
12
|
+
* stable answer is already on the wire — every `Field` carries its protocol
|
|
13
|
+
* structure (row/col/length/is_input). This primitive computes the canonical
|
|
14
|
+
* structural id once, at the layer that owns the field structure, so consumers
|
|
15
|
+
* can carry it instead of re-deriving it.
|
|
16
|
+
*
|
|
17
|
+
* Protocol-generic: it operates only on `Field[]`, so 5250 / 3270 / VT / HP6530
|
|
18
|
+
* screen builders can all emit it. It bakes in no host-specific semantics.
|
|
19
|
+
*
|
|
20
|
+
* DEFINITION (scheme `v1`)
|
|
21
|
+
* ------------------------
|
|
22
|
+
* 1. Keep only INPUT (unprotected) fields.
|
|
23
|
+
* 2. Drop fields in the bottom status/function-key region (row >= footerCutoff).
|
|
24
|
+
* Block-mode hosts re-paint transient messages there as input-shaped fields;
|
|
25
|
+
* excluding the region keeps a screen's identity stable mid-error-recovery.
|
|
26
|
+
* 3. Sort the surviving (row, col, length) triples.
|
|
27
|
+
* 4. signature = sha256( "v1:" + triples.join(";") ) where each triple is "r,c,l".
|
|
28
|
+
* Returns `undefined` when there are no qualifying input fields (identity
|
|
29
|
+
* degrades to a no-op; consumers fall back to their own keys).
|
|
30
|
+
*
|
|
31
|
+
* The serialization is a stable, language-neutral string so an independent
|
|
32
|
+
* re-implementation (the backend mirrors it in `ai/services/structural_signature.py`)
|
|
33
|
+
* produces a byte-identical hash. Keep the two in lockstep.
|
|
34
|
+
*
|
|
35
|
+
* PARITY VECTOR (must match the backend mirror exactly):
|
|
36
|
+
* fields with input (row,col,length) = (3,20,10),(5,35,8),(7,20,12)
|
|
37
|
+
* canonical = "v1:3,20,10;5,35,8;7,20,12"
|
|
38
|
+
* sha256 = 1837c10a7a6733441e2810bb6fd62213ec9929de384e27fb2b8eb86246511968
|
|
39
|
+
* verify: node -e "import('crypto').then(c=>console.log(c.createHash('sha256').update('v1:3,20,10;5,35,8;7,20,12').digest('hex')))"
|
|
40
|
+
*/
|
|
41
|
+
import { createHash } from 'crypto';
|
|
42
|
+
/**
|
|
43
|
+
* Bottom-region cutoff. Rows at/above this index are treated as the transient
|
|
44
|
+
* host status / F-key footer and excluded from identity. 21 matches a standard
|
|
45
|
+
* 24-row screen's status region and is the value the LegacyBridge backend's
|
|
46
|
+
* input-skeleton dedup uses (`_FOOTER_CUTOFF`); keep them aligned for parity.
|
|
47
|
+
*/
|
|
48
|
+
export const DEFAULT_FOOTER_CUTOFF = 21;
|
|
49
|
+
/** Canonical scheme tag, prefixed onto the serialized skeleton. Bump on format change. */
|
|
50
|
+
export const STRUCTURAL_SIGNATURE_SCHEME = 'v1';
|
|
51
|
+
/**
|
|
52
|
+
* Compute the structural signature of a screen from its field list.
|
|
53
|
+
* @param fields the screen's `Field[]` (as built for `ScreenData.fields`).
|
|
54
|
+
* @param footerCutoff rows >= this are excluded (default {@link DEFAULT_FOOTER_CUTOFF}).
|
|
55
|
+
* @returns the sha256 hex id, or `undefined` if the screen has no input fields.
|
|
56
|
+
*/
|
|
57
|
+
export function computeStructuralSignature(fields, footerCutoff = DEFAULT_FOOTER_CUTOFF) {
|
|
58
|
+
const triples = [];
|
|
59
|
+
for (const f of fields) {
|
|
60
|
+
if (f.is_protected)
|
|
61
|
+
continue; // structural skeleton = input fields only
|
|
62
|
+
if (f.row >= footerCutoff)
|
|
63
|
+
continue; // skip transient status/error region
|
|
64
|
+
triples.push([f.row, f.col, f.length]);
|
|
65
|
+
}
|
|
66
|
+
if (triples.length === 0)
|
|
67
|
+
return undefined;
|
|
68
|
+
triples.sort((a, b) => a[0] - b[0] || a[1] - b[1] || a[2] - b[2]);
|
|
69
|
+
const canonical = `${STRUCTURAL_SIGNATURE_SCHEME}:` +
|
|
70
|
+
triples.map(([r, c, l]) => `${r},${c},${l}`).join(';');
|
|
71
|
+
return createHash('sha256').update(canonical).digest('hex');
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=structural-signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-signature.js","sourceRoot":"","sources":["../src/structural-signature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH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,KAAK,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -20,11 +20,36 @@ export declare class TN5250Connection extends EventEmitter {
|
|
|
20
20
|
/** Environment variables to send in NEW_ENVIRON (e.g., DEVNAME for device name). */
|
|
21
21
|
private envVars;
|
|
22
22
|
private keepAliveTimer;
|
|
23
|
+
/**
|
|
24
|
+
* Wall-clock ms timestamp of the most recent byte received from the
|
|
25
|
+
* host (any byte — telnet IAC, 5250 record header, payload, anything).
|
|
26
|
+
* Set to ``connect()`` resolution time on session open. Updated in
|
|
27
|
+
* ``onData`` before any parsing. This is the unambiguous liveness
|
|
28
|
+
* signal: if (now - lastRecvAtMs) is large AND we sent something
|
|
29
|
+
* after lastRecvAtMs, the host stopped replying. No interpretation of
|
|
30
|
+
* screen state, no overlap with kbd-locked-for-error / etc.
|
|
31
|
+
*/
|
|
32
|
+
private lastRecvAtMs;
|
|
33
|
+
/**
|
|
34
|
+
* Wall-clock ms timestamp of the most recent AID byte sent to the
|
|
35
|
+
* host. Updated only on ``sendRaw`` calls that follow a host-bound
|
|
36
|
+
* AID write (AID/PRINT/CLEAR/SYS_REQUEST/etc.); telnet keepalive
|
|
37
|
+
* probes and negotiation traffic do NOT count, since "is the host
|
|
38
|
+
* sending us anything?" is what we're measuring against.
|
|
39
|
+
* Set by callers via ``recordHostBoundSend()``.
|
|
40
|
+
*/
|
|
41
|
+
private lastHostBoundSendAtMs;
|
|
23
42
|
private static readonly KEEP_ALIVE_INTERVAL;
|
|
24
43
|
private static readonly KEEP_ALIVE_TM;
|
|
25
44
|
get isConnected(): boolean;
|
|
26
45
|
get remoteHost(): string;
|
|
27
46
|
get remotePort(): number;
|
|
47
|
+
/** Wall-clock ms of the most recent byte received from the host. 0 if never. */
|
|
48
|
+
get lastReceivedAtMs(): number;
|
|
49
|
+
/** Wall-clock ms of the most recent byte sent to the host. 0 if never.
|
|
50
|
+
* Includes 5250 records, telnet negotiation, telnet keepalive — every
|
|
51
|
+
* write that expects a reply. */
|
|
52
|
+
get lastSentAtMs(): number;
|
|
28
53
|
/**
|
|
29
54
|
* Set environment variables to send during NEW_ENVIRON negotiation.
|
|
30
55
|
* Per lib5250 telnetstr.c:632-664, these are sent as VAR name VALUE value
|
|
@@ -33,7 +58,10 @@ export declare class TN5250Connection extends EventEmitter {
|
|
|
33
58
|
setEnvVars(vars: Record<string, string>): void;
|
|
34
59
|
connect(host: string, port: number, terminalType?: string, connectTimeout?: number): Promise<void>;
|
|
35
60
|
disconnect(): void;
|
|
36
|
-
/** Send raw bytes over the socket
|
|
61
|
+
/** Send raw bytes over the socket. Stamps ``lastHostBoundSendAtMs``
|
|
62
|
+
* so the liveness check has a definitive "did the host respond
|
|
63
|
+
* since I last asked it something?" comparison. Includes telnet
|
|
64
|
+
* negotiation and keepalive — they all expect host replies. */
|
|
37
65
|
sendRaw(data: Buffer): void;
|
|
38
66
|
private startKeepAlive;
|
|
39
67
|
private stopKeepAlive;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/tn5250/connection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,KAAK,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;CAC7B;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,YAAY,CAAiC;IACrD,oF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