@hydranium/client-theia 1.0.0-next.14 → 1.0.0-next.148

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.
Files changed (81) hide show
  1. package/README.md +35 -8
  2. package/lib/browser/channel-logger.d.ts +4 -3
  3. package/lib/browser/channel-logger.d.ts.map +1 -1
  4. package/lib/browser/channel-logger.js +9 -4
  5. package/lib/browser/channel-logger.js.map +1 -1
  6. package/lib/browser/connection-diagnostics-contribution.d.ts +69 -0
  7. package/lib/browser/connection-diagnostics-contribution.d.ts.map +1 -0
  8. package/lib/browser/connection-diagnostics-contribution.js +153 -0
  9. package/lib/browser/connection-diagnostics-contribution.js.map +1 -0
  10. package/lib/browser/editor-disk-sync.d.ts +133 -0
  11. package/lib/browser/editor-disk-sync.d.ts.map +1 -0
  12. package/lib/browser/editor-disk-sync.js +232 -0
  13. package/lib/browser/editor-disk-sync.js.map +1 -0
  14. package/lib/browser/hydranium-file-service.d.ts +44 -0
  15. package/lib/browser/hydranium-file-service.d.ts.map +1 -0
  16. package/lib/browser/hydranium-file-service.js +61 -0
  17. package/lib/browser/hydranium-file-service.js.map +1 -0
  18. package/lib/browser/index.d.ts +4 -0
  19. package/lib/browser/index.d.ts.map +1 -1
  20. package/lib/browser/index.js +4 -0
  21. package/lib/browser/index.js.map +1 -1
  22. package/lib/browser/log-level-preference.d.ts.map +1 -1
  23. package/lib/browser/log-level-preference.js +11 -0
  24. package/lib/browser/log-level-preference.js.map +1 -1
  25. package/lib/browser/memory-diagnostics-contribution.d.ts +40 -4
  26. package/lib/browser/memory-diagnostics-contribution.d.ts.map +1 -1
  27. package/lib/browser/memory-diagnostics-contribution.js +161 -31
  28. package/lib/browser/memory-diagnostics-contribution.js.map +1 -1
  29. package/lib/browser/session-aware-connection-source.d.ts +98 -0
  30. package/lib/browser/session-aware-connection-source.d.ts.map +1 -0
  31. package/lib/browser/session-aware-connection-source.js +167 -0
  32. package/lib/browser/session-aware-connection-source.js.map +1 -0
  33. package/lib/common/clock.d.ts +19 -0
  34. package/lib/common/clock.d.ts.map +1 -0
  35. package/lib/common/clock.js +13 -0
  36. package/lib/common/clock.js.map +1 -0
  37. package/lib/common/connection-resilience-options.d.ts +24 -0
  38. package/lib/common/connection-resilience-options.d.ts.map +1 -0
  39. package/lib/common/connection-resilience-options.js +11 -0
  40. package/lib/common/connection-resilience-options.js.map +1 -0
  41. package/lib/common/framed-socket-write-buffer.d.ts +121 -0
  42. package/lib/common/framed-socket-write-buffer.d.ts.map +1 -0
  43. package/lib/common/framed-socket-write-buffer.js +190 -0
  44. package/lib/common/framed-socket-write-buffer.js.map +1 -0
  45. package/lib/common/index.d.ts +12 -0
  46. package/lib/common/index.d.ts.map +1 -0
  47. package/lib/common/index.js +31 -0
  48. package/lib/common/index.js.map +1 -0
  49. package/lib/node/abstract-socket-forwarding-connection-handler.d.ts +8 -7
  50. package/lib/node/abstract-socket-forwarding-connection-handler.d.ts.map +1 -1
  51. package/lib/node/abstract-socket-forwarding-connection-handler.js +28 -7
  52. package/lib/node/abstract-socket-forwarding-connection-handler.js.map +1 -1
  53. package/lib/node/index.d.ts +2 -0
  54. package/lib/node/index.d.ts.map +1 -1
  55. package/lib/node/index.js +2 -0
  56. package/lib/node/index.js.map +1 -1
  57. package/lib/node/session-bound-frontend-connection-service.d.ts +77 -0
  58. package/lib/node/session-bound-frontend-connection-service.d.ts.map +1 -0
  59. package/lib/node/session-bound-frontend-connection-service.js +128 -0
  60. package/lib/node/session-bound-frontend-connection-service.js.map +1 -0
  61. package/lib/node/socket-channel-forwarder.d.ts +54 -0
  62. package/lib/node/socket-channel-forwarder.d.ts.map +1 -0
  63. package/lib/node/socket-channel-forwarder.js +93 -0
  64. package/lib/node/socket-channel-forwarder.js.map +1 -0
  65. package/package.json +24 -9
  66. package/src/browser/channel-logger.ts +9 -4
  67. package/src/browser/connection-diagnostics-contribution.ts +142 -0
  68. package/src/browser/editor-disk-sync.ts +236 -0
  69. package/src/browser/hydranium-file-service.ts +56 -0
  70. package/src/browser/index.ts +4 -0
  71. package/src/browser/log-level-preference.ts +11 -0
  72. package/src/browser/memory-diagnostics-contribution.ts +268 -45
  73. package/src/browser/session-aware-connection-source.ts +179 -0
  74. package/src/common/clock.ts +20 -0
  75. package/src/common/connection-resilience-options.ts +24 -0
  76. package/src/common/framed-socket-write-buffer.ts +227 -0
  77. package/src/common/index.ts +15 -0
  78. package/src/node/abstract-socket-forwarding-connection-handler.ts +19 -9
  79. package/src/node/index.ts +2 -0
  80. package/src/node/session-bound-frontend-connection-service.ts +155 -0
  81. package/src/node/socket-channel-forwarder.ts +99 -0
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.Clock = void 0;
12
+ exports.Clock = Symbol('Clock');
13
+ //# sourceMappingURL=clock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clock.js","sourceRoot":"","sources":["../../src/common/clock.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAYrE,QAAA,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ /**
10
+ * Options for the `bindConnectionResilience` helper each tier exports.
11
+ *
12
+ * Lives in `common` rather than beside either helper so the server entry can
13
+ * name the type without importing the browser module, and the other way round.
14
+ */
15
+ export interface ConnectionResilienceOptions {
16
+ /**
17
+ * Size of the buffer holding messages while the socket is down, in bytes.
18
+ * Defaults to Theia's own limit. It decides how long an outage can last
19
+ * before changes start being rejected, so a deployment on a poor network
20
+ * trades memory for tolerance here.
21
+ */
22
+ readonly bufferBytes?: number;
23
+ }
24
+ //# sourceMappingURL=connection-resilience-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-resilience-options.d.ts","sourceRoot":"","sources":["../../src/common/connection-resilience-options.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAChC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ //# sourceMappingURL=connection-resilience-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-resilience-options.js","sourceRoot":"","sources":["../../src/common/connection-resilience-options.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF"}
@@ -0,0 +1,121 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ import { Emitter, type Event } from '@theia/core/lib/common/event';
10
+ import { SocketWriteBuffer } from '@theia/core/lib/common/messaging/socket-write-buffer';
11
+ /**
12
+ * Prefix on every connection log line, deliberately shared by the browser and the
13
+ * server so one pattern greps a console and a pod log at once.
14
+ */
15
+ export declare const CONNECTION_LOG_PREFIX = "[connection]";
16
+ /**
17
+ * The part of a socket this buffer uses. Narrower than the socket type Theia
18
+ * declares, which keeps the dependency honest and lets the class be tested
19
+ * without a connection.
20
+ */
21
+ export interface MessageSink {
22
+ send(data: Uint8Array): void;
23
+ }
24
+ /**
25
+ * Reported when the buffer runs out of room. The message that did not fit is
26
+ * rejected, and so is every further one for as long as the buffer stays full.
27
+ * Reconnecting drains it and sending resumes, but whatever was rejected
28
+ * meanwhile is gone, so the two sides no longer agree about the session.
29
+ */
30
+ export interface ConnectionBufferOverflow {
31
+ /** Messages held when the limit was reached. */
32
+ readonly messages: number;
33
+ /** Bytes held when the limit was reached. */
34
+ readonly bytes: number;
35
+ /** The limit in force, so a reader can tell what to raise it to. */
36
+ readonly maxBytes: number;
37
+ }
38
+ /**
39
+ * Holds messages while the peer is away and re-sends them when it returns.
40
+ *
41
+ * Theia copies them into one growing byte array and flushes that with a single
42
+ * `send`. A websocket delivers whole messages rather than a byte stream, so
43
+ * Theia's encoding adds no length prefix and every reader assumes one delivery
44
+ * is one message. The concatenated flush breaks that assumption: the reader
45
+ * decodes the first message and throws away the bytes behind it.
46
+ *
47
+ * Changed here: one entry per message, sent one at a time, so each arrives as
48
+ * its own delivery. The buffer also decides whether a message may go out
49
+ * directly — see {@link sendOrQueue} — because a caller that decides for itself
50
+ * is how messages end up overtaking a backlog.
51
+ *
52
+ * Unchanged from Theia: exceeding the limit rejects the message rather than
53
+ * dropping something silently. The limit is settable, since the right value
54
+ * depends on how long an outage has to survive.
55
+ *
56
+ * Logging goes to `console` rather than through a `Logger`. On the browser side
57
+ * Theia's preloader builds this before any Output channel exists, so there is
58
+ * nothing else to write to; the {@link CONNECTION_LOG_PREFIX} keeps the lines
59
+ * findable on both sides.
60
+ */
61
+ export declare class FramedSocketWriteBuffer extends SocketWriteBuffer {
62
+ /** Theia's fixed limit, kept as the default. */
63
+ static readonly DEFAULT_MAX_BYTES: number;
64
+ /**
65
+ * Settable so a deployment can trade memory for longer outages.
66
+ *
67
+ * Consulted directly rather than through the base class's `maxBufferSize`,
68
+ * which does not exist before Theia 1.71 — an `override` of it would not
69
+ * compile against the oldest release this package supports. Nothing is lost:
70
+ * `buffer`, `flush` and `drain` are all replaced here, so the base's own
71
+ * limit is never reached.
72
+ */
73
+ maxBytes: number;
74
+ protected pending: Uint8Array[];
75
+ protected pendingBytes: number;
76
+ protected overflowReported: boolean;
77
+ protected readonly onOverflowEmitter: Emitter<ConnectionBufferOverflow>;
78
+ /** Fires once per outage when the limit is reached. */
79
+ get onOverflow(): Event<ConnectionBufferOverflow>;
80
+ /**
81
+ * Sends `data` now only if nothing is waiting, and queues it otherwise.
82
+ *
83
+ * Callers say whether the peer is ready for a message; the buffer decides
84
+ * whether it may go ahead of one already waiting. Splitting it this way is
85
+ * the point: a caller that answers both questions from one flag is how a
86
+ * fresh message ends up overtaking a backlog.
87
+ */
88
+ sendOrQueue(socket: MessageSink | undefined, data: Uint8Array): void;
89
+ buffer(data: Uint8Array): void;
90
+ flush(socket: MessageSink): void;
91
+ drain(): void;
92
+ /** Whether messages are still waiting to go out. */
93
+ get hasBacklog(): boolean;
94
+ protected reportOverflow(): void;
95
+ protected reset(): void;
96
+ }
97
+ /** Named in the warning a skipped install emits, so the reader is told what to upgrade to. */
98
+ export declare const REQUIRED_THEIA_HINT = "@theia/core 1.71 or newer";
99
+ /**
100
+ * Whether this Theia exposes the seam the reconnect hardening replaces.
101
+ *
102
+ * Theia only began binding {@link SocketWriteBuffer} in 1.71; before that each
103
+ * connection built one privately, so there is no binding to rebind and no way
104
+ * in. Every other API involved has been there throughout, which makes this one
105
+ * probe the whole compatibility question — and it is a binding check rather
106
+ * than a version parse, so it answers about the container actually in front of
107
+ * us instead of a number that may have been overridden or vendored.
108
+ *
109
+ * Callers that get `false` must leave Theia's own wiring alone: rebinding half
110
+ * of it would be worse than not rebinding at all.
111
+ */
112
+ export declare function supportsConnectionResilience(isBound: (identifier: typeof SocketWriteBuffer) => boolean): boolean;
113
+ /**
114
+ * The warning a skipped install emits. Says what is lost rather than only what
115
+ * is missing: the failures this guards against are silent, so an adopter who
116
+ * never sees this line has no other way to learn the guard is absent.
117
+ */
118
+ export declare function warnConnectionResilienceUnavailable(tier: 'frontend' | 'backend'): void;
119
+ /** Builds a buffer with the given limit, or Theia's default when none is configured. */
120
+ export declare function createFramedSocketWriteBuffer(maxBytes?: number): FramedSocketWriteBuffer;
121
+ //# sourceMappingURL=framed-socket-write-buffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framed-socket-write-buffer.d.ts","sourceRoot":"","sources":["../../src/common/framed-socket-write-buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACzB,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACtC,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,uBAAwB,SAAQ,iBAAiB;IAC3D,gDAAgD;IAChD,MAAM,CAAC,QAAQ,CAAC,iBAAiB,SAAc;IAE/C;;;;;;;;OAQG;IACH,QAAQ,SAA6C;IAErD,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAM;IACrC,SAAS,CAAC,YAAY,SAAK;IAC3B,SAAS,CAAC,gBAAgB,UAAS;IACnC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,oCAA2C;IAE/E,uDAAuD;IACvD,IAAI,UAAU,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAEhD;IAED;;;;;;;OAOG;IACH,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;IAQ3D,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAa9B,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAmChC,KAAK,IAAI,IAAI;IAOtB,oDAAoD;IACpD,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,SAAS,CAAC,cAAc,IAAI,IAAI;IAahC,SAAS,CAAC,KAAK,IAAI,IAAI;CAKzB;AAED,8FAA8F;AAC9F,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,OAAO,iBAAiB,KAAK,OAAO,GAAG,OAAO,CAEhH;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,GAAG,IAAI,CAMtF;AAED,wFAAwF;AACxF,wBAAgB,6BAA6B,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAMxF"}
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.REQUIRED_THEIA_HINT = exports.FramedSocketWriteBuffer = exports.CONNECTION_LOG_PREFIX = void 0;
12
+ exports.supportsConnectionResilience = supportsConnectionResilience;
13
+ exports.warnConnectionResilienceUnavailable = warnConnectionResilienceUnavailable;
14
+ exports.createFramedSocketWriteBuffer = createFramedSocketWriteBuffer;
15
+ const event_1 = require("@theia/core/lib/common/event");
16
+ const socket_write_buffer_1 = require("@theia/core/lib/common/messaging/socket-write-buffer");
17
+ /**
18
+ * Prefix on every connection log line, deliberately shared by the browser and the
19
+ * server so one pattern greps a console and a pod log at once.
20
+ */
21
+ exports.CONNECTION_LOG_PREFIX = '[connection]';
22
+ /**
23
+ * Holds messages while the peer is away and re-sends them when it returns.
24
+ *
25
+ * Theia copies them into one growing byte array and flushes that with a single
26
+ * `send`. A websocket delivers whole messages rather than a byte stream, so
27
+ * Theia's encoding adds no length prefix and every reader assumes one delivery
28
+ * is one message. The concatenated flush breaks that assumption: the reader
29
+ * decodes the first message and throws away the bytes behind it.
30
+ *
31
+ * Changed here: one entry per message, sent one at a time, so each arrives as
32
+ * its own delivery. The buffer also decides whether a message may go out
33
+ * directly — see {@link sendOrQueue} — because a caller that decides for itself
34
+ * is how messages end up overtaking a backlog.
35
+ *
36
+ * Unchanged from Theia: exceeding the limit rejects the message rather than
37
+ * dropping something silently. The limit is settable, since the right value
38
+ * depends on how long an outage has to survive.
39
+ *
40
+ * Logging goes to `console` rather than through a `Logger`. On the browser side
41
+ * Theia's preloader builds this before any Output channel exists, so there is
42
+ * nothing else to write to; the {@link CONNECTION_LOG_PREFIX} keeps the lines
43
+ * findable on both sides.
44
+ */
45
+ class FramedSocketWriteBuffer extends socket_write_buffer_1.SocketWriteBuffer {
46
+ /** Theia's fixed limit, kept as the default. */
47
+ static DEFAULT_MAX_BYTES = 100 * 1024;
48
+ /**
49
+ * Settable so a deployment can trade memory for longer outages.
50
+ *
51
+ * Consulted directly rather than through the base class's `maxBufferSize`,
52
+ * which does not exist before Theia 1.71 — an `override` of it would not
53
+ * compile against the oldest release this package supports. Nothing is lost:
54
+ * `buffer`, `flush` and `drain` are all replaced here, so the base's own
55
+ * limit is never reached.
56
+ */
57
+ maxBytes = FramedSocketWriteBuffer.DEFAULT_MAX_BYTES;
58
+ pending = [];
59
+ pendingBytes = 0;
60
+ overflowReported = false;
61
+ onOverflowEmitter = new event_1.Emitter();
62
+ /** Fires once per outage when the limit is reached. */
63
+ get onOverflow() {
64
+ return this.onOverflowEmitter.event;
65
+ }
66
+ /**
67
+ * Sends `data` now only if nothing is waiting, and queues it otherwise.
68
+ *
69
+ * Callers say whether the peer is ready for a message; the buffer decides
70
+ * whether it may go ahead of one already waiting. Splitting it this way is
71
+ * the point: a caller that answers both questions from one flag is how a
72
+ * fresh message ends up overtaking a backlog.
73
+ */
74
+ sendOrQueue(socket, data) {
75
+ if (socket && !this.hasBacklog) {
76
+ socket.send(data);
77
+ }
78
+ else {
79
+ this.buffer(data);
80
+ }
81
+ }
82
+ buffer(data) {
83
+ if (this.pendingBytes + data.byteLength > this.maxBytes) {
84
+ this.reportOverflow();
85
+ throw new Error(`Max disconnected buffer size exceeded by adding ${data.byteLength} bytes`);
86
+ }
87
+ // Copied for the same reason the base class copies: the caller owns `data`.
88
+ this.pending.push(data.slice());
89
+ this.pendingBytes += data.byteLength;
90
+ if (this.pending.length === 1) {
91
+ console.info(`${exports.CONNECTION_LOG_PREFIX} buffering messages, the peer is disconnected`);
92
+ }
93
+ }
94
+ flush(socket) {
95
+ if (this.pending.length === 0) {
96
+ return;
97
+ }
98
+ const count = this.pending.length;
99
+ const bytes = this.pendingBytes;
100
+ // Walked with an index and dropped in one slice, not shifted per message: a shift re-indexes
101
+ // the whole array, so the drain would cost the square of a backlog `bufferBytes` invites an
102
+ // adopter to enlarge. Leaving the queue in place is what keeps `hasBacklog` true until the
103
+ // last message is out, and re-reading the length is what drains one appended by a nested send.
104
+ let index = 0;
105
+ try {
106
+ while (index < this.pending.length) {
107
+ const message = this.pending[index];
108
+ socket.send(message);
109
+ index++;
110
+ this.pendingBytes -= message.byteLength;
111
+ }
112
+ }
113
+ catch (error) {
114
+ // Said here because nothing retries: Theia flushes once, from a reconnect handler that has
115
+ // deregistered by now, so the stall would otherwise surface much later as an overflow —
116
+ // which names the wrong cause, the socket being up rather than absent.
117
+ console.error(`${exports.CONNECTION_LOG_PREFIX} send failed ${index} message(s) into a ${count}-message backlog; ` +
118
+ `${this.pending.length - index} still queued and nothing will retry them`, error);
119
+ throw error;
120
+ }
121
+ finally {
122
+ this.pending = this.pending.slice(index);
123
+ }
124
+ this.overflowReported = false;
125
+ console.info(`${exports.CONNECTION_LOG_PREFIX} sent ${count} buffered message(s), ${bytes} bytes`);
126
+ }
127
+ drain() {
128
+ if (this.pending.length > 0) {
129
+ console.warn(`${exports.CONNECTION_LOG_PREFIX} discarded ${this.pending.length} buffered message(s), ${this.pendingBytes} bytes`);
130
+ }
131
+ this.reset();
132
+ }
133
+ /** Whether messages are still waiting to go out. */
134
+ get hasBacklog() {
135
+ return this.pending.length > 0;
136
+ }
137
+ reportOverflow() {
138
+ if (this.overflowReported) {
139
+ return;
140
+ }
141
+ this.overflowReported = true;
142
+ const overflow = { messages: this.pending.length, bytes: this.pendingBytes, maxBytes: this.maxBytes };
143
+ console.error(`${exports.CONNECTION_LOG_PREFIX} buffer full at ${overflow.maxBytes} bytes after ${overflow.messages} message(s); ` +
144
+ 'this message is rejected, and so is every further one until the peer returns');
145
+ this.onOverflowEmitter.fire(overflow);
146
+ }
147
+ reset() {
148
+ this.pending = [];
149
+ this.pendingBytes = 0;
150
+ this.overflowReported = false;
151
+ }
152
+ }
153
+ exports.FramedSocketWriteBuffer = FramedSocketWriteBuffer;
154
+ /** Named in the warning a skipped install emits, so the reader is told what to upgrade to. */
155
+ exports.REQUIRED_THEIA_HINT = '@theia/core 1.71 or newer';
156
+ /**
157
+ * Whether this Theia exposes the seam the reconnect hardening replaces.
158
+ *
159
+ * Theia only began binding {@link SocketWriteBuffer} in 1.71; before that each
160
+ * connection built one privately, so there is no binding to rebind and no way
161
+ * in. Every other API involved has been there throughout, which makes this one
162
+ * probe the whole compatibility question — and it is a binding check rather
163
+ * than a version parse, so it answers about the container actually in front of
164
+ * us instead of a number that may have been overridden or vendored.
165
+ *
166
+ * Callers that get `false` must leave Theia's own wiring alone: rebinding half
167
+ * of it would be worse than not rebinding at all.
168
+ */
169
+ function supportsConnectionResilience(isBound) {
170
+ return isBound(socket_write_buffer_1.SocketWriteBuffer);
171
+ }
172
+ /**
173
+ * The warning a skipped install emits. Says what is lost rather than only what
174
+ * is missing: the failures this guards against are silent, so an adopter who
175
+ * never sees this line has no other way to learn the guard is absent.
176
+ */
177
+ function warnConnectionResilienceUnavailable(tier) {
178
+ console.warn(`${exports.CONNECTION_LOG_PREFIX} ${tier} reconnect hardening NOT installed: this Theia does not expose an injectable ` +
179
+ `socket write buffer (needs ${exports.REQUIRED_THEIA_HINT}). Theia's own behaviour is left in place, which can lose or ` +
180
+ 'reorder messages when a socket drops and reconnects.');
181
+ }
182
+ /** Builds a buffer with the given limit, or Theia's default when none is configured. */
183
+ function createFramedSocketWriteBuffer(maxBytes) {
184
+ const buffer = new FramedSocketWriteBuffer();
185
+ if (typeof maxBytes === 'number' && maxBytes > 0) {
186
+ buffer.maxBytes = maxBytes;
187
+ }
188
+ return buffer;
189
+ }
190
+ //# sourceMappingURL=framed-socket-write-buffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framed-socket-write-buffer.js","sourceRoot":"","sources":["../../src/common/framed-socket-write-buffer.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAmMlF,oEAEC;AAOD,kFAMC;AAGD,sEAMC;AAzND,wDAAmE;AACnE,8FAAyF;AAEzF;;;GAGG;AACU,QAAA,qBAAqB,GAAG,cAAc,CAAC;AA0BpD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAa,uBAAwB,SAAQ,uCAAiB;IAC3D,gDAAgD;IAChD,MAAM,CAAU,iBAAiB,GAAG,GAAG,GAAG,IAAI,CAAC;IAE/C;;;;;;;;OAQG;IACH,QAAQ,GAAG,uBAAuB,CAAC,iBAAiB,CAAC;IAE3C,OAAO,GAAiB,EAAE,CAAC;IAC3B,YAAY,GAAG,CAAC,CAAC;IACjB,gBAAgB,GAAG,KAAK,CAAC;IAChB,iBAAiB,GAAG,IAAI,eAAO,EAA4B,CAAC;IAE/E,uDAA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AACjB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ export * from './framed-socket-write-buffer';
10
+ export * from './connection-resilience-options';
11
+ export * from './clock';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAKlF,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,SAAS,CAAC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ // Environment-neutral primitives that the browser and the server tiers each
26
+ // bind for their own side, such as the buffer for each half of the socket.
27
+ // Kept out of both tier barrels for that reason.
28
+ __exportStar(require("./framed-socket-write-buffer"), exports);
29
+ __exportStar(require("./connection-resilience-options"), exports);
30
+ __exportStar(require("./clock"), exports);
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,4EAA4E;AAC5E,2EAA2E;AAC3E,iDAAiD;AACjD,+DAA6C;AAC7C,kEAAgD;AAChD,0CAAwB"}
@@ -8,6 +8,7 @@
8
8
  ********************************************************************************/
9
9
  import { type Channel, CommandService, type ConnectionHandler, type Disposable, ILogger, type MessageProvider, MessageService } from '@theia/core';
10
10
  import * as net from 'node:net';
11
+ import { Clock } from '../common/clock';
11
12
  /** Resolved configuration for a {@link AbstractSocketForwardingConnectionHandler}.
12
13
  * A head-specific subclass derives these from its own (adopter-facing) options
13
14
  * and passes them to `super(...)`. */
@@ -47,17 +48,17 @@ export interface SocketForwardingConnectionHandlerOptions {
47
48
  * the same wire protocol the server speaks, so the backend performs no semantic
48
49
  * re-proxy — it relays bytes only and stays oblivious to the server's method set.
49
50
  *
50
- * The single per-head variation — *which* byte forwarder bridges the channel and
51
- * the socket — is the abstract {@link forwardToSocketConnection} hook: the GLSP
52
- * head plugs in `@eclipse-glsp/theia-integration`'s `SocketConnectionForwarder`,
53
- * the data-server head its own `SocketChannelForwarder`. Keeping the forwarder
54
- * behind the hook is what lets the data head stay GLSP-free while sharing the
55
- * port-discovery + buffer-and-replay race fix + connect orchestration here.
51
+ * The byte forwarder that bridges the channel and the socket is
52
+ * {@link forwardToSocketConnection}; both heads use {@link SocketChannelForwarder},
53
+ * and the port discovery, buffer-and-replay race fix and connect orchestration
54
+ * here are shared.
56
55
  */
57
56
  export declare abstract class AbstractSocketForwardingConnectionHandler implements ConnectionHandler {
58
57
  protected messageService: MessageService;
59
58
  protected commandService: CommandService;
60
59
  protected readonly logger: ILogger;
60
+ /** The clock each {@link SocketChannelForwarder} bounds its flush on: the container's {@link Clock}, or a `SystemClock`. */
61
+ protected readonly clock: Clock;
61
62
  readonly path: string;
62
63
  protected readonly portCommand: string;
63
64
  protected readonly logComponent: string;
@@ -79,7 +80,7 @@ export declare abstract class AbstractSocketForwardingConnectionHandler implemen
79
80
  * relay both ways. Called once, after the socket is created and the
80
81
  * pre-forward buffer is about to be replayed.
81
82
  */
82
- protected abstract forwardToSocketConnection(clientChannel: Channel, socket: net.Socket): Disposable;
83
+ protected forwardToSocketConnection(clientChannel: Channel, socket: net.Socket): Disposable;
83
84
  /**
84
85
  * Re-fire pre-forward buffered `MessageProvider`s on the channel's internal
85
86
  * `onMessageEmitter` so the now-subscribed forwarder picks them up in arrival
@@ -1 +1 @@
1
- {"version":3,"file":"abstract-socket-forwarding-connection-handler.d.ts","sourceRoot":"","sources":["../../src/node/abstract-socket-forwarding-connection-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,OAAO,EACZ,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,OAAO,EACP,KAAK,eAAe,EACpB,cAAc,EAChB,MAAM,aAAa,CAAC;AAIrB,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC;;uCAEuC;AACvC,MAAM,WAAW,wCAAwC;IACtD,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;iEAC6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;gCAC4B;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;0BACsB;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;;OAMG;IAC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AyB,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,UAAU;IAEpG;;;;;;;;;;OAUG;IACH,SAAS,CAAC,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,IAAI;CAiBvF"}
1
+ {"version":3,"file":"abstract-socket-forwarding-connection-handler.d.ts","sourceRoot":"","sources":["../../src/node/abstract-socket-forwarding-connection-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EACJ,KAAK,OAAO,EACZ,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,OAAO,EACP,KAAK,eAAe,EACpB,cAAc,EAChB,MAAM,aAAa,CAAC;AAIrB,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAGxC;;uCAEuC;AACvC,MAAM,WAAW,wCAAwC;IACtD,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;iEAC6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;gCAC4B;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;0BACsB;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,8BACsB,yCAA0C,YAAW,iBAAiB;IACjE,SAAS,CAAC,cAAc,EAAG,cAAc,CAAC;IAC1C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AAE,QAAQ,EAAE,eAAe,EAAE,GAAG,IAAI;CAiBvF"}
@@ -51,11 +51,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
53
  exports.AbstractSocketForwardingConnectionHandler = void 0;
54
+ const protocol_1 = require("@hydranium/protocol");
54
55
  const core_1 = require("@theia/core");
55
56
  const channel_1 = require("@theia/core/lib/common/message-rpc/channel");
56
57
  const promise_util_1 = require("@theia/core/lib/common/promise-util");
57
58
  const inversify_1 = require("@theia/core/shared/inversify");
58
59
  const net = __importStar(require("node:net"));
60
+ const clock_1 = require("../common/clock");
61
+ const socket_channel_forwarder_1 = require("./socket-channel-forwarder");
59
62
  /**
60
63
  * Cross-head base for the Theia backend half of a protocol head's transport:
61
64
  * it bridges a Theia browser-frontend {@link Channel} to a server's TCP socket
@@ -68,12 +71,10 @@ const net = __importStar(require("node:net"));
68
71
  * the same wire protocol the server speaks, so the backend performs no semantic
69
72
  * re-proxy — it relays bytes only and stays oblivious to the server's method set.
70
73
  *
71
- * The single per-head variation — *which* byte forwarder bridges the channel and
72
- * the socket — is the abstract {@link forwardToSocketConnection} hook: the GLSP
73
- * head plugs in `@eclipse-glsp/theia-integration`'s `SocketConnectionForwarder`,
74
- * the data-server head its own `SocketChannelForwarder`. Keeping the forwarder
75
- * behind the hook is what lets the data head stay GLSP-free while sharing the
76
- * port-discovery + buffer-and-replay race fix + connect orchestration here.
74
+ * The byte forwarder that bridges the channel and the socket is
75
+ * {@link forwardToSocketConnection}; both heads use {@link SocketChannelForwarder},
76
+ * and the port discovery, buffer-and-replay race fix and connect orchestration
77
+ * here are shared.
77
78
  */
78
79
  let AbstractSocketForwardingConnectionHandler = class AbstractSocketForwardingConnectionHandler {
79
80
  messageService;
@@ -82,6 +83,8 @@ let AbstractSocketForwardingConnectionHandler = class AbstractSocketForwardingCo
82
83
  // not the spawned language-server process, so the framework `LspLogger`
83
84
  // (which needs the Langium connection/services) is out of reach here.
84
85
  logger;
86
+ /** The clock each {@link SocketChannelForwarder} bounds its flush on: the container's {@link Clock}, or a `SystemClock`. */
87
+ clock = new protocol_1.SystemClock();
85
88
  path;
86
89
  portCommand;
87
90
  logComponent;
@@ -173,10 +176,23 @@ let AbstractSocketForwardingConnectionHandler = class AbstractSocketForwardingCo
173
176
  if (channel instanceof channel_1.ForwardingChannel) {
174
177
  socket.on('error', error => channel.onErrorEmitter.fire(error));
175
178
  }
176
- socket.connect({ port });
179
+ // `127.0.0.1`, not the `localhost` Node dials when no host is given, and it
180
+ // has to match the head: the socket launchers bind `127.0.0.1` by default,
181
+ // so on a dual-stack machine where `localhost` resolves to `::1` first the
182
+ // dial fails as ECONNREFUSED with nothing in the message naming the address
183
+ // family as the cause.
184
+ socket.connect({ port, host: '127.0.0.1' });
177
185
  setTimeout(() => connected.reject('Timeout reached.'), this.connectTimeoutMs);
178
186
  return connected.promise;
179
187
  }
188
+ /**
189
+ * Bridge the Theia frontend `clientChannel` and the server `socket` so bytes
190
+ * relay both ways. Called once, after the socket is created and the
191
+ * pre-forward buffer is about to be replayed.
192
+ */
193
+ forwardToSocketConnection(clientChannel, socket) {
194
+ return new socket_channel_forwarder_1.SocketChannelForwarder(clientChannel, socket, this.clock);
195
+ }
180
196
  /**
181
197
  * Re-fire pre-forward buffered `MessageProvider`s on the channel's internal
182
198
  * `onMessageEmitter` so the now-subscribed forwarder picks them up in arrival
@@ -217,6 +233,11 @@ __decorate([
217
233
  (0, inversify_1.inject)(core_1.ILogger),
218
234
  __metadata("design:type", Object)
219
235
  ], AbstractSocketForwardingConnectionHandler.prototype, "logger", void 0);
236
+ __decorate([
237
+ (0, inversify_1.inject)(clock_1.Clock),
238
+ (0, inversify_1.optional)(),
239
+ __metadata("design:type", Object)
240
+ ], AbstractSocketForwardingConnectionHandler.prototype, "clock", void 0);
220
241
  exports.AbstractSocketForwardingConnectionHandler = AbstractSocketForwardingConnectionHandler = __decorate([
221
242
  (0, inversify_1.injectable)(),
222
243
  __metadata("design:paramtypes", [Object])
@@ -1 +1 @@
1
- {"version":3,"file":"abstract-socket-forwarding-connection-handler.js","sourceRoot":"","sources":["../../src/node/abstract-socket-forwarding-connection-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElF,sCAQqB;AACrB,wEAA+E;AAC/E,sEAA+D;AAC/D,4DAAkE;AAClE,8CAAgC;AA8BhC;;;;;;;;;;;;;;;;;;GAkBG;AAEI,IAAe,yCAAyC,GAAxD,MAAe,yCAAyC;IAC1B,cAAc,CAAkB;IAChC,cAAc,CAAkB;IAClE,4EAA4E;IAC5E,wEAAwE;IACxE,sEAAsE;IAClC,MAAM,CAAW;IAE5C,IAAI,CAAS;IAEH,WAAW,CAAS;IACpB,YAAY,CAAS;IACrB,UAAU,CAAS;IACnB,eAAe,CAAS;IACxB,gBAAgB,CAAS;IACzB,gBAAgB,CAAS;IACzB,eAAe,CAAgC;IAElE,YAAY,OAAiD;QAC1D,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,GAAG,CAAC;QACtD,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,IAAI,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,IAAI,KAAK,CAAC;QAC1D,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAClD,CAAC;IAED,YAAY,CAAC,UAAmB;QAC7B,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC;I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AI,CAAC,YAAY,cAAc,QAAQ,CAAC,MAAM,8DAA8D,CAAC,CAAC;YACnI,OAAO;QACV,CAAC;QACD,MAAM,SAAS,GAAG,OAAsF,CAAC;QACzG,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;YAC/B,IAAI,CAAC,MAAM,CAAC,IAAI,CACb,IAAI,IAAI,CAAC,YAAY,cAAc,QAAQ,CAAC,MAAM,6EAA6E,CACjI,CAAC;YACF,OAAO;QACV,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,eAAe,QAAQ,CAAC,MAAM,yDAAyD,CAAC,CAAC;QAC/H,KAAK,MAAM,QAAQ,IAAI,QAAQ,EAAE,CAAC;YAC/B,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,CAAC;IACJ,CAAC;CACH,CAAA;AAlJqB,8FAAyC;AAC1B;IAAjC,IAAA,kBAAM,EAAC,qBAAc,CAAC;8BAA4B,qBAAc;iFAAC;AAChC;IAAjC,IAAA,kBAAM,EAAC,qBAAc,CAAC;;iFAA2C;AAI9B;IAAnC,IAAA,kBAAM,EAAC,cAAO,CAAC;;yEAAqC;oDANlC,yCAAyC;IAD9D,IAAA,sBAAU,GAAE;;GACS,yCAAyC,CAkJ9D"}
1
+ {"version":3,"file":"abstract-socket-forwarding-connection-handler.js","sourceRoot":"","sources":["../../src/node/abstract-socket-forwarding-connection-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElF,kDAAkD;AAClD,sCAQqB;AACrB,wEAA+E;AAC/E,sEAA+D;AAC/D,4DAA4E;AAC5E,8CAAgC;AAChC,2CAAwC;AACxC,yEAAoE;AA8BpE;;;;;;;;;;;;;;;;GAgBG;AAEI,IAAe,yCAAyC,GAAxD,MAAe,yCAAyC;IAC1B,cAAc,CAAkB;IAChC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AAC;QACD,MAAM,SAAS,GAAG,OAAsF,CAAC;QACzG,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;YAC/B,IAAI,CAAC,MAAM,CAAC,IAAI,CACb,IAAI,IAAI,CAAC,YAAY,cAAc,QAAQ,CAAC,MAAM,6EAA6E,CACjI,CAAC;YACF,OAAO;QACV,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,eAAe,QAAQ,CAAC,MAAM,yDAAyD,CAAC,CAAC;QAC/H,KAAK,MAAM,QAAQ,IAAI,QAAQ,EAAE,CAAC;YAC/B,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,CAAC;IACJ,CAAC;CACH,CAAA;AA3JqB,8FAAyC;AAC1B;IAAjC,IAAA,kBAAM,EAAC,qBAAc,CAAC;8BAA4B,qBAAc;iFAAC;AAChC;IAAjC,IAAA,kBAAM,EAAC,qBAAc,CAAC;;iFAA2C;AAI9B;IAAnC,IAAA,kBAAM,EAAC,cAAO,CAAC;;yEAAqC;AAEP;IAA7C,IAAA,kBAAM,EAAC,aAAK,CAAC;IAAE,IAAA,oBAAQ,GAAE;;wEAAqD;oDAR5D,yCAAyC;IAD9D,IAAA,sBAAU,GAAE;;GACS,yCAAyC,CA2J9D"}
@@ -7,4 +7,6 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  export * from './abstract-socket-forwarding-connection-handler';
10
+ export * from './session-bound-frontend-connection-service';
11
+ export * from './socket-channel-forwarder';
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,iDAAiD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,4BAA4B,CAAC"}
package/lib/node/index.js CHANGED
@@ -23,4 +23,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  __exportStar(require("./abstract-socket-forwarding-connection-handler"), exports);
26
+ __exportStar(require("./session-bound-frontend-connection-service"), exports);
27
+ __exportStar(require("./socket-channel-forwarder"), exports);
26
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,kFAAgE"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,kFAAgE;AAChE,8EAA4D;AAC5D,6DAA2C"}