@hydranium/data-client-theia 1.0.0-next.24 → 1.0.0-next.27
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/lib/node/data-server-connection-handler.d.ts +10 -0
- package/lib/node/data-server-connection-handler.d.ts.map +1 -1
- package/lib/node/data-server-connection-handler.js +1 -1
- package/lib/node/data-server-connection-handler.js.map +1 -1
- package/lib/node/socket-channel-forwarder.d.ts.map +1 -1
- package/lib/node/socket-channel-forwarder.js +6 -1
- package/lib/node/socket-channel-forwarder.js.map +1 -1
- package/package.json +7 -7
- package/src/node/data-server-connection-handler.ts +11 -1
- package/src/node/socket-channel-forwarder.ts +6 -1
|
@@ -25,6 +25,16 @@ export interface DataServerConnectionHandlerOptions {
|
|
|
25
25
|
* Defaults to the framework `DATA_SERVER_PORT_COMMAND`; override to match
|
|
26
26
|
* an adopter's established id. */
|
|
27
27
|
readonly portCommand?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Product name for the connect-failure dialog this handler raises.
|
|
30
|
+
*
|
|
31
|
+
* It reaches the adopter's UI verbatim, so the framework default leaks a
|
|
32
|
+
* framework noun into a product that is not ours. Not a translation concern —
|
|
33
|
+
* routing it through a catalogue would ask an adopter to "translate" English
|
|
34
|
+
* into their own product name, and would make their branding
|
|
35
|
+
* locale-dependent.
|
|
36
|
+
*/
|
|
37
|
+
readonly serverName?: string;
|
|
28
38
|
readonly findPortTimeout?: number;
|
|
29
39
|
readonly findPortAttempts?: number;
|
|
30
40
|
readonly connectTimeoutMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-server-connection-handler.d.ts","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,yCAAyC,EAAE,MAAM,kCAAkC,CAAC;AAE7F,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;A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;IAC7B,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;;;;;;;;;;;GAWG;AACH,qBACa,2BAA4B,SAAQ,yCAAyC;gBAC9D,OAAO,GAAE,kCAAuC;IAazE,SAAS,CAAC,yBAAyB,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,UAAU;CAG7F"}
|
|
@@ -43,7 +43,7 @@ let DataServerConnectionHandler = class DataServerConnectionHandler extends node
|
|
|
43
43
|
path: options.servicePath ?? protocol_1.DATA_SERVER_PATH,
|
|
44
44
|
portCommand: options.portCommand ?? protocol_1.DATA_SERVER_PORT_COMMAND,
|
|
45
45
|
logComponent: 'DataServer',
|
|
46
|
-
serverName: 'Model Server',
|
|
46
|
+
serverName: options.serverName ?? 'Model Server',
|
|
47
47
|
findPortTimeout: options.findPortTimeout,
|
|
48
48
|
findPortAttempts: options.findPortAttempts,
|
|
49
49
|
connectTimeoutMs: options.connectTimeoutMs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-server-connection-handler.js","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAElF,2DAA6F;AAC7F,kDAAiF;AAEjF,4DAAqE;AAErE,yEAAoE;
|
|
1
|
+
{"version":3,"file":"data-server-connection-handler.js","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAElF,2DAA6F;AAC7F,kDAAiF;AAEjF,4DAAqE;AAErE,y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MAAM,EAAE,GAAG,CAAC,MAAM;IAJxC,SAAS,CAAC,QAAQ,CAAC,SAAS,uBAA8B;gBAGpC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,GAAG,CAAC,MAAM;
|
|
1
|
+
{"version":3,"file":"socket-channel-forwarder.d.ts","sourceRoot":"","sources":["../../src/node/socket-channel-forwarder.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,KAAK,KAAK,GAAG,MAAM,UAAU,CAAC;AACrC,OAAO,EAA2B,KAAK,OAAO,EAA4C,MAAM,qBAAqB,CAAC;AAEtH;;;;;;;;;;;;GAYG;AACH,qBAAa,sBAAuB,YAAW,UAAU;IAInD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO;IACnC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM;IAJxC,SAAS,CAAC,QAAQ,CAAC,SAAS,uBAA8B;gBAGpC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,GAAG,CAAC,MAAM;IAuBxC,SAAS,CAAC,oBAAoB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO;IAKlE,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAMhD,OAAO,IAAI,IAAI;CAGjB"}
|
|
@@ -34,8 +34,13 @@ class SocketChannelForwarder {
|
|
|
34
34
|
const reader = new node_1.SocketMessageReader(socket);
|
|
35
35
|
const writer = new node_1.SocketMessageWriter(socket);
|
|
36
36
|
const connection = (0, node_1.createMessageConnection)(reader, writer);
|
|
37
|
+
// Nothing here destroys the socket, and adding it back would be dead
|
|
38
|
+
// code in both directions. `SocketMessageWriter.dispose()` destroys it
|
|
39
|
+
// itself, which covers the dispose path; and `connection.onClose` fires
|
|
40
|
+
// only from the reader's or writer's own close, which for a socket means
|
|
41
|
+
// the socket has already gone — so a destroy handler there is downstream
|
|
42
|
+
// of the effect it would be trying to cause.
|
|
37
43
|
this.toDispose.pushAll([
|
|
38
|
-
connection.onClose(() => socket.destroy()),
|
|
39
44
|
reader.listen(message => this.writeToChannel(message)),
|
|
40
45
|
channel.onMessage(provider => void writer.write(this.decodeChannelMessage(provider))),
|
|
41
46
|
channel.onClose(() => connection.dispose()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket-channel-forwarder.js","sourceRoot":"","sources":["../../src/node/socket-channel-forwarder.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,sCAAmG;AAEnG,8CAAsH;AAEtH;;;;;;;;;;;;GAYG;AACH,MAAa,sBAAsB;IAIV;IACA;IAJH,SAAS,GAAG,IAAI,2BAAoB,EAAE,CAAC;IAE1D,YACsB,OAAgB,EAChB,MAAkB;QADlB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAY;QAErC,MAAM,MAAM,GAAG,IAAI,0BAAmB,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,0BAAmB,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,UAAU,GAAG,IAAA,8BAAuB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3D,
|
|
1
|
+
{"version":3,"file":"socket-channel-forwarder.js","sourceRoot":"","sources":["../../src/node/socket-channel-forwarder.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,sCAAmG;AAEnG,8CAAsH;AAEtH;;;;;;;;;;;;GAYG;AACH,MAAa,sBAAsB;IAIV;IACA;IAJH,SAAS,GAAG,IAAI,2BAAoB,EAAE,CAAC;IAE1D,YACsB,OAAgB,EAChB,MAAkB;QADlB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAY;QAErC,MAAM,MAAM,GAAG,IAAI,0BAAmB,CAAC,MAAM,CAAC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C,CAAC;QAC1E,WAAW,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;IAED,OAAO;QACJ,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;CACH;AA1CD,wDA0CC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/data-client-theia",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.27",
|
|
4
4
|
"description": "Theia-coupled client primitives for the hydranium data-server protocol head; companion of @hydranium/data-server. Bridges framework typed errors (e.g. ConflictError) across Theia's RPC boundary so their code + data survive the wire.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hydranium",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@hydranium/client-theia": "1.0.0-next.
|
|
74
|
-
"@hydranium/core": "1.0.0-next.
|
|
75
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
73
|
+
"@hydranium/client-theia": "1.0.0-next.27",
|
|
74
|
+
"@hydranium/core": "1.0.0-next.27",
|
|
75
|
+
"@hydranium/protocol": "1.0.0-next.27",
|
|
76
76
|
"@theia/core": "^1.70.0",
|
|
77
77
|
"@theia/workspace": "^1.70.0",
|
|
78
78
|
"@types/node": "^22.0.0",
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"vscode-jsonrpc": "9.0.1"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
|
-
"@hydranium/client-theia": "1.0.0-next.
|
|
87
|
-
"@hydranium/core": "1.0.0-next.
|
|
88
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
86
|
+
"@hydranium/client-theia": "1.0.0-next.27",
|
|
87
|
+
"@hydranium/core": "1.0.0-next.27",
|
|
88
|
+
"@hydranium/protocol": "1.0.0-next.27",
|
|
89
89
|
"@theia/core": "^1.70.0",
|
|
90
90
|
"@theia/workspace": "^1.70.0",
|
|
91
91
|
"inversify": "^6.0.0",
|
|
@@ -30,6 +30,16 @@ export interface DataServerConnectionHandlerOptions {
|
|
|
30
30
|
* Defaults to the framework `DATA_SERVER_PORT_COMMAND`; override to match
|
|
31
31
|
* an adopter's established id. */
|
|
32
32
|
readonly portCommand?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Product name for the connect-failure dialog this handler raises.
|
|
35
|
+
*
|
|
36
|
+
* It reaches the adopter's UI verbatim, so the framework default leaks a
|
|
37
|
+
* framework noun into a product that is not ours. Not a translation concern —
|
|
38
|
+
* routing it through a catalogue would ask an adopter to "translate" English
|
|
39
|
+
* into their own product name, and would make their branding
|
|
40
|
+
* locale-dependent.
|
|
41
|
+
*/
|
|
42
|
+
readonly serverName?: string;
|
|
33
43
|
readonly findPortTimeout?: number;
|
|
34
44
|
readonly findPortAttempts?: number;
|
|
35
45
|
readonly connectTimeoutMs?: number;
|
|
@@ -62,7 +72,7 @@ export class DataServerConnectionHandler extends AbstractSocketForwardingConnect
|
|
|
62
72
|
path: options.servicePath ?? DATA_SERVER_PATH,
|
|
63
73
|
portCommand: options.portCommand ?? DATA_SERVER_PORT_COMMAND,
|
|
64
74
|
logComponent: 'DataServer',
|
|
65
|
-
serverName: 'Model Server',
|
|
75
|
+
serverName: options.serverName ?? 'Model Server',
|
|
66
76
|
findPortTimeout: options.findPortTimeout,
|
|
67
77
|
findPortAttempts: options.findPortAttempts,
|
|
68
78
|
connectTimeoutMs: options.connectTimeoutMs,
|
|
@@ -34,8 +34,13 @@ export class SocketChannelForwarder implements Disposable {
|
|
|
34
34
|
const reader = new SocketMessageReader(socket);
|
|
35
35
|
const writer = new SocketMessageWriter(socket);
|
|
36
36
|
const connection = createMessageConnection(reader, writer);
|
|
37
|
+
// Nothing here destroys the socket, and adding it back would be dead
|
|
38
|
+
// code in both directions. `SocketMessageWriter.dispose()` destroys it
|
|
39
|
+
// itself, which covers the dispose path; and `connection.onClose` fires
|
|
40
|
+
// only from the reader's or writer's own close, which for a socket means
|
|
41
|
+
// the socket has already gone — so a destroy handler there is downstream
|
|
42
|
+
// of the effect it would be trying to cause.
|
|
37
43
|
this.toDispose.pushAll([
|
|
38
|
-
connection.onClose(() => socket.destroy()),
|
|
39
44
|
reader.listen(message => this.writeToChannel(message)),
|
|
40
45
|
channel.onMessage(provider => void writer.write(this.decodeChannelMessage(provider))),
|
|
41
46
|
channel.onClose(() => connection.dispose()),
|