aparavi-client 1.0.2
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/LICENSE +21 -0
- package/README.md +523 -0
- package/dist/aparavi-client-typescript-1.0.0.tgz +0 -0
- package/dist/aparavi-client-typescript-1.0.1.tgz +0 -0
- package/dist/cjs/client.js +1002 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/constants.js +37 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/core/DAPBase.js +313 -0
- package/dist/cjs/core/DAPBase.js.map +1 -0
- package/dist/cjs/core/DAPClient.js +173 -0
- package/dist/cjs/core/DAPClient.js.map +1 -0
- package/dist/cjs/core/TransportBase.js +131 -0
- package/dist/cjs/core/TransportBase.js.map +1 -0
- package/dist/cjs/core/TransportWebSocket.js +492 -0
- package/dist/cjs/core/TransportWebSocket.js.map +1 -0
- package/dist/cjs/exceptions/index.js +109 -0
- package/dist/cjs/exceptions/index.js.map +1 -0
- package/dist/cjs/index.js +56 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/schema/Doc.js +79 -0
- package/dist/cjs/schema/Doc.js.map +1 -0
- package/dist/cjs/schema/DocFilter.js +133 -0
- package/dist/cjs/schema/DocFilter.js.map +1 -0
- package/dist/cjs/schema/DocGroup.js +235 -0
- package/dist/cjs/schema/DocGroup.js.map +1 -0
- package/dist/cjs/schema/DocMetadata.js +57 -0
- package/dist/cjs/schema/DocMetadata.js.map +1 -0
- package/dist/cjs/schema/Question.js +414 -0
- package/dist/cjs/schema/Question.js.map +1 -0
- package/dist/cjs/schema/index.js +50 -0
- package/dist/cjs/schema/index.js.map +1 -0
- package/dist/cjs/types/client.js +26 -0
- package/dist/cjs/types/client.js.map +1 -0
- package/dist/cjs/types/data.js +26 -0
- package/dist/cjs/types/data.js.map +1 -0
- package/dist/cjs/types/events.js +119 -0
- package/dist/cjs/types/events.js.map +1 -0
- package/dist/cjs/types/index.js +50 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/pipeline.js +26 -0
- package/dist/cjs/types/pipeline.js.map +1 -0
- package/dist/cjs/types/task.js +115 -0
- package/dist/cjs/types/task.js.map +1 -0
- package/dist/cli/cli/aparavi.js +1401 -0
- package/dist/cli/cli/aparavi.js.map +1 -0
- package/dist/cli/src/client.js +1002 -0
- package/dist/cli/src/client.js.map +1 -0
- package/dist/cli/src/constants.js +37 -0
- package/dist/cli/src/constants.js.map +1 -0
- package/dist/cli/src/core/DAPBase.js +313 -0
- package/dist/cli/src/core/DAPBase.js.map +1 -0
- package/dist/cli/src/core/DAPClient.js +173 -0
- package/dist/cli/src/core/DAPClient.js.map +1 -0
- package/dist/cli/src/core/TransportBase.js +131 -0
- package/dist/cli/src/core/TransportBase.js.map +1 -0
- package/dist/cli/src/core/TransportWebSocket.js +492 -0
- package/dist/cli/src/core/TransportWebSocket.js.map +1 -0
- package/dist/cli/src/exceptions/index.js +109 -0
- package/dist/cli/src/exceptions/index.js.map +1 -0
- package/dist/cli/src/index.js +56 -0
- package/dist/cli/src/index.js.map +1 -0
- package/dist/cli/src/schema/Doc.js +79 -0
- package/dist/cli/src/schema/Doc.js.map +1 -0
- package/dist/cli/src/schema/DocFilter.js +133 -0
- package/dist/cli/src/schema/DocFilter.js.map +1 -0
- package/dist/cli/src/schema/DocGroup.js +235 -0
- package/dist/cli/src/schema/DocGroup.js.map +1 -0
- package/dist/cli/src/schema/DocMetadata.js +57 -0
- package/dist/cli/src/schema/DocMetadata.js.map +1 -0
- package/dist/cli/src/schema/Question.js +414 -0
- package/dist/cli/src/schema/Question.js.map +1 -0
- package/dist/cli/src/schema/index.js +50 -0
- package/dist/cli/src/schema/index.js.map +1 -0
- package/dist/cli/src/types/client.js +26 -0
- package/dist/cli/src/types/client.js.map +1 -0
- package/dist/cli/src/types/data.js +26 -0
- package/dist/cli/src/types/data.js.map +1 -0
- package/dist/cli/src/types/events.js +119 -0
- package/dist/cli/src/types/events.js.map +1 -0
- package/dist/cli/src/types/index.js +50 -0
- package/dist/cli/src/types/index.js.map +1 -0
- package/dist/cli/src/types/pipeline.js +26 -0
- package/dist/cli/src/types/pipeline.js.map +1 -0
- package/dist/cli/src/types/task.js +115 -0
- package/dist/cli/src/types/task.js.map +1 -0
- package/dist/esm/client.js +997 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/constants.js +34 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/core/DAPBase.js +309 -0
- package/dist/esm/core/DAPBase.js.map +1 -0
- package/dist/esm/core/DAPClient.js +169 -0
- package/dist/esm/core/DAPClient.js.map +1 -0
- package/dist/esm/core/TransportBase.js +127 -0
- package/dist/esm/core/TransportBase.js.map +1 -0
- package/dist/esm/core/TransportWebSocket.js +488 -0
- package/dist/esm/core/TransportWebSocket.js.map +1 -0
- package/dist/esm/exceptions/index.js +100 -0
- package/dist/esm/exceptions/index.js.map +1 -0
- package/dist/esm/index.js +40 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/schema/Doc.js +75 -0
- package/dist/esm/schema/Doc.js.map +1 -0
- package/dist/esm/schema/DocFilter.js +129 -0
- package/dist/esm/schema/DocFilter.js.map +1 -0
- package/dist/esm/schema/DocGroup.js +231 -0
- package/dist/esm/schema/DocGroup.js.map +1 -0
- package/dist/esm/schema/DocMetadata.js +53 -0
- package/dist/esm/schema/DocMetadata.js.map +1 -0
- package/dist/esm/schema/Question.js +409 -0
- package/dist/esm/schema/Question.js.map +1 -0
- package/dist/esm/schema/index.js +34 -0
- package/dist/esm/schema/index.js.map +1 -0
- package/dist/esm/types/client.js +25 -0
- package/dist/esm/types/client.js.map +1 -0
- package/dist/esm/types/data.js +25 -0
- package/dist/esm/types/data.js.map +1 -0
- package/dist/esm/types/events.js +116 -0
- package/dist/esm/types/events.js.map +1 -0
- package/dist/esm/types/index.js +34 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/pipeline.js +25 -0
- package/dist/esm/types/pipeline.js.map +1 -0
- package/dist/esm/types/task.js +112 -0
- package/dist/esm/types/task.js.map +1 -0
- package/dist/types/client.d.ts +395 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/constants.d.ts +34 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/core/DAPBase.d.ts +140 -0
- package/dist/types/core/DAPBase.d.ts.map +1 -0
- package/dist/types/core/DAPClient.d.ts +83 -0
- package/dist/types/core/DAPClient.d.ts.map +1 -0
- package/dist/types/core/TransportBase.d.ts +94 -0
- package/dist/types/core/TransportBase.d.ts.map +1 -0
- package/dist/types/core/TransportWebSocket.d.ts +78 -0
- package/dist/types/core/TransportWebSocket.d.ts.map +1 -0
- package/dist/types/exceptions/index.d.ts +81 -0
- package/dist/types/exceptions/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +36 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/schema/Doc.d.ts +69 -0
- package/dist/types/schema/Doc.d.ts.map +1 -0
- package/dist/types/schema/DocFilter.d.ts +101 -0
- package/dist/types/schema/DocFilter.d.ts.map +1 -0
- package/dist/types/schema/DocGroup.d.ts +113 -0
- package/dist/types/schema/DocGroup.d.ts.map +1 -0
- package/dist/types/schema/DocMetadata.d.ts +61 -0
- package/dist/types/schema/DocMetadata.d.ts.map +1 -0
- package/dist/types/schema/Question.d.ts +163 -0
- package/dist/types/schema/Question.d.ts.map +1 -0
- package/dist/types/schema/index.d.ts +34 -0
- package/dist/types/schema/index.d.ts.map +1 -0
- package/dist/types/types/client.d.ts +140 -0
- package/dist/types/types/client.d.ts.map +1 -0
- package/dist/types/types/data.d.ts +95 -0
- package/dist/types/types/data.d.ts.map +1 -0
- package/dist/types/types/events.d.ts +246 -0
- package/dist/types/types/events.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +34 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/pipeline.d.ts +61 -0
- package/dist/types/types/pipeline.d.ts.map +1 -0
- package/dist/types/types/task.d.ts +265 -0
- package/dist/types/types/task.d.ts.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2024 Aparavi Development Team
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.TransportBase = void 0;
|
|
27
|
+
/**
|
|
28
|
+
* Abstract base class for DAP transport implementations.
|
|
29
|
+
*
|
|
30
|
+
* This class defines the standard interface that all transport implementations
|
|
31
|
+
* must follow for DAP communication. It provides common functionality for
|
|
32
|
+
* callback management, connection state tracking, and debug message routing.
|
|
33
|
+
*
|
|
34
|
+
* Concrete implementations must provide:
|
|
35
|
+
* - connect(): Establish the transport connection
|
|
36
|
+
* - disconnect(): Close the transport connection
|
|
37
|
+
* - send(): Transmit a DAP message
|
|
38
|
+
*
|
|
39
|
+
* @abstract This class must be extended by concrete transport implementations
|
|
40
|
+
*/
|
|
41
|
+
class TransportBase {
|
|
42
|
+
constructor() {
|
|
43
|
+
this._connected = false;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Send debug message to callback if available.
|
|
47
|
+
*/
|
|
48
|
+
_debugMessage(message) {
|
|
49
|
+
if (this._onCallerDebugMessage) {
|
|
50
|
+
this._onCallerDebugMessage(message);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Send protocol debug message to callback if available.
|
|
55
|
+
*/
|
|
56
|
+
_debugProtocol(message) {
|
|
57
|
+
if (this._onCallerDebugProtocol) {
|
|
58
|
+
this._onCallerDebugProtocol(message);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Forward received message to callback if available.
|
|
63
|
+
*/
|
|
64
|
+
async _transportReceive(message) {
|
|
65
|
+
this._debugProtocol(`RECV: ${JSON.stringify(message)}`);
|
|
66
|
+
if (this._onCallerReceive) {
|
|
67
|
+
await this._onCallerReceive(message);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Notify about connection establishment.
|
|
72
|
+
*/
|
|
73
|
+
async _transportConnected(connectionInfo) {
|
|
74
|
+
this._debugMessage(`Connected, info=${connectionInfo}`);
|
|
75
|
+
if (this._onCallerConnected) {
|
|
76
|
+
await this._onCallerConnected(connectionInfo);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Notify about connection closure.
|
|
81
|
+
*/
|
|
82
|
+
async _transportDisconnected(reason, hasError = false) {
|
|
83
|
+
this._debugMessage(`Disconnected, reason=${reason}, error=${hasError}`);
|
|
84
|
+
if (this._onCallerDisconnected) {
|
|
85
|
+
await this._onCallerDisconnected(reason, hasError);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Bind callback functions to the transport.
|
|
90
|
+
*
|
|
91
|
+
* This must be called before using the transport for communication.
|
|
92
|
+
* The callbacks handle debugging, connection events, and message processing.
|
|
93
|
+
*/
|
|
94
|
+
bind(callbacks) {
|
|
95
|
+
if (callbacks.onDebugMessage) {
|
|
96
|
+
this._onCallerDebugMessage = callbacks.onDebugMessage;
|
|
97
|
+
}
|
|
98
|
+
if (callbacks.onDebugProtocol) {
|
|
99
|
+
this._onCallerDebugProtocol = callbacks.onDebugProtocol;
|
|
100
|
+
}
|
|
101
|
+
if (callbacks.onReceive) {
|
|
102
|
+
this._onCallerReceive = callbacks.onReceive;
|
|
103
|
+
}
|
|
104
|
+
if (callbacks.onConnected) {
|
|
105
|
+
this._onCallerConnected = callbacks.onConnected;
|
|
106
|
+
}
|
|
107
|
+
if (callbacks.onDisconnected) {
|
|
108
|
+
this._onCallerDisconnected = callbacks.onDisconnected;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Check if the transport is currently connected.
|
|
113
|
+
*/
|
|
114
|
+
isConnected() {
|
|
115
|
+
return this._connected;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Establish connection to remote endpoint (client-side).
|
|
119
|
+
*/
|
|
120
|
+
async connect() {
|
|
121
|
+
// Default implementation - override in concrete classes
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Accept incoming connection (server-side).
|
|
125
|
+
*/
|
|
126
|
+
async accept(connectionInfo) {
|
|
127
|
+
// Default implementation - override in concrete classes
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.TransportBase = TransportBase;
|
|
131
|
+
//# sourceMappingURL=TransportBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransportBase.js","sourceRoot":"","sources":["../../../../aparavi-client/src/core/TransportBase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAIH;;;;;;;;;;;;;GAaG;AACH,MAAsB,aAAa;IAAnC;QACW,eAAU,GAAG,KAAK,CAAC;IA6G9B,CAAC;IAtGA;;OAEG;IACO,aAAa,CAAC,OAAe;QACtC,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAChC,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,OAAe;QACvC,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;YACjC,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;IACF,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,iBAAiB,CAAC,OAAmB;QACpD,IAAI,CAAC,cAAc,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACxD,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC3B,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;IACF,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,mBAAmB,CAAC,cAAuB;QAC1D,IAAI,CAAC,aAAa,CAAC,mBAAmB,cAAc,EAAE,CAAC,CAAC;QACxD,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC7B,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;QAC/C,CAAC;IACF,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,sBAAsB,CAAC,MAAe,EAAE,QAAQ,GAAG,KAAK;QACvE,IAAI,CAAC,aAAa,CAAC,wBAAwB,MAAM,WAAW,QAAQ,EAAE,CAAC,CAAC;QACxE,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAChC,MAAM,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACpD,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,SAA6B;QACjC,IAAI,SAAS,CAAC,cAAc,EAAE,CAAC;YAC9B,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC,cAAc,CAAC;QACvD,CAAC;QACD,IAAI,SAAS,CAAC,eAAe,EAAE,CAAC;YAC/B,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC,eAAe,CAAC;QACzD,CAAC;QACD,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC,SAAS,CAAC;QAC7C,CAAC;QACD,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;YAC3B,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC,WAAW,CAAC;QACjD,CAAC;QACD,IAAI,SAAS,CAAC,cAAc,EAAE,CAAC;YAC9B,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC,cAAc,CAAC;QACvD,CAAC;IACF,CAAC;IAED;;OAEG;IACH,WAAW;QACV,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO;QACZ,wDAAwD;IACzD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,cAAmB;QAC/B,wDAAwD;IACzD,CAAC;CAWD;AA9GD,sCA8GC"}
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2024 Aparavi Development Team
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.TransportWebSocket = void 0;
|
|
27
|
+
const TransportBase_1 = require("./TransportBase");
|
|
28
|
+
const constants_1 = require("../constants");
|
|
29
|
+
// Conditional import for Node.js WebSocket library (ws package)
|
|
30
|
+
let NodeWebSocket;
|
|
31
|
+
if (typeof window === 'undefined') {
|
|
32
|
+
// Node.js environment - dynamically import ws
|
|
33
|
+
try {
|
|
34
|
+
NodeWebSocket = require('ws');
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// ws not available - will fail if trying to use in Node.js without ws installed
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* WebSocket transport implementation for DAP protocol communication.
|
|
42
|
+
*
|
|
43
|
+
* Provides WebSocket-based communication between Aparavi clients and servers
|
|
44
|
+
* with support for both text (JSON) and binary (CBOR) message formats. Handles
|
|
45
|
+
* connection lifecycle management, message serialization/deserialization, automatic
|
|
46
|
+
* heartbeat/ping messages, and connection timeout detection.
|
|
47
|
+
*
|
|
48
|
+
* Features:
|
|
49
|
+
* - Cross-platform: Works in both browser (native WebSocket) and Node.js (ws library)
|
|
50
|
+
* - Automatic message encoding/decoding (JSON and CBOR)
|
|
51
|
+
* - Connection timeout handling
|
|
52
|
+
* - Authentication via headers
|
|
53
|
+
* - Message queuing during connection
|
|
54
|
+
*
|
|
55
|
+
* @extends TransportBase
|
|
56
|
+
*/
|
|
57
|
+
class TransportWebSocket extends TransportBase_1.TransportBase {
|
|
58
|
+
constructor(uri = constants_1.CONST_DEFAULT_SERVICE, auth) {
|
|
59
|
+
super();
|
|
60
|
+
this._messageTasks = new Set();
|
|
61
|
+
this._uri = uri;
|
|
62
|
+
this._auth = auth;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Process raw WebSocket data into structured messages.
|
|
66
|
+
*
|
|
67
|
+
* Handles both JSON text messages and DAP binary format messages.
|
|
68
|
+
* Binary messages use format: JSON header + newline + binary payload.
|
|
69
|
+
*/
|
|
70
|
+
async _receiveData(data) {
|
|
71
|
+
try {
|
|
72
|
+
if (!this._connected) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (typeof data === 'string') {
|
|
76
|
+
// JSON text message
|
|
77
|
+
const jsonMessage = JSON.parse(data);
|
|
78
|
+
await this._transportReceive(jsonMessage);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
// Binary message - look for JSON header separator
|
|
82
|
+
const dataArray = new Uint8Array(data);
|
|
83
|
+
const newlinePos = dataArray.indexOf(10); // ASCII newline
|
|
84
|
+
if (newlinePos === -1) {
|
|
85
|
+
// No separator - treat as JSON text
|
|
86
|
+
const textData = new TextDecoder().decode(dataArray);
|
|
87
|
+
const jsonMessage = JSON.parse(textData);
|
|
88
|
+
await this._transportReceive(jsonMessage);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
// DAP binary format: JSON header + newline + binary data
|
|
92
|
+
const jsonHeader = dataArray.slice(0, newlinePos);
|
|
93
|
+
const binaryData = dataArray.slice(newlinePos + 1);
|
|
94
|
+
// Parse JSON header
|
|
95
|
+
const headerText = new TextDecoder().decode(jsonHeader);
|
|
96
|
+
const jsonMessage = JSON.parse(headerText);
|
|
97
|
+
// Add binary data to message arguments
|
|
98
|
+
if (!jsonMessage.arguments) {
|
|
99
|
+
jsonMessage.arguments = {};
|
|
100
|
+
}
|
|
101
|
+
jsonMessage.arguments.data = binaryData;
|
|
102
|
+
await this._transportReceive(jsonMessage);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
// Only log errors if still connected
|
|
108
|
+
if (this._connected) {
|
|
109
|
+
this._debugMessage(`Error processing WebSocket message: ${error}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Connect to WebSocket server and start receiving messages.
|
|
115
|
+
* Works in both browser and Node.js environments.
|
|
116
|
+
*/
|
|
117
|
+
async connect() {
|
|
118
|
+
return new Promise((resolve, reject) => {
|
|
119
|
+
let promiseResolved = false;
|
|
120
|
+
const resolveOnce = () => {
|
|
121
|
+
if (!promiseResolved) {
|
|
122
|
+
promiseResolved = true;
|
|
123
|
+
resolve();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const rejectOnce = (error) => {
|
|
127
|
+
if (!promiseResolved) {
|
|
128
|
+
promiseResolved = true;
|
|
129
|
+
reject(error);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
try {
|
|
133
|
+
this._debugMessage(`Connecting to WebSocket server at ${this._uri}`);
|
|
134
|
+
if (this._connectionTimeout) {
|
|
135
|
+
clearTimeout(this._connectionTimeout);
|
|
136
|
+
this._connectionTimeout = undefined;
|
|
137
|
+
}
|
|
138
|
+
const isBrowser = typeof window !== 'undefined';
|
|
139
|
+
if (isBrowser) {
|
|
140
|
+
// ============================================================
|
|
141
|
+
// BROWSER WebSocket (native API)
|
|
142
|
+
// ============================================================
|
|
143
|
+
// For browser, authentication is typically passed as URL parameter
|
|
144
|
+
const wsUrl = this._auth
|
|
145
|
+
? `${this._uri}${this._uri.includes('?') ? '&' : '?'}auth=${encodeURIComponent(this._auth)}`
|
|
146
|
+
: this._uri;
|
|
147
|
+
this._websocket = new WebSocket(wsUrl);
|
|
148
|
+
this._websocket.binaryType = 'arraybuffer';
|
|
149
|
+
this._websocket.onopen = async () => {
|
|
150
|
+
if (this._connectionTimeout) {
|
|
151
|
+
clearTimeout(this._connectionTimeout);
|
|
152
|
+
this._connectionTimeout = undefined;
|
|
153
|
+
}
|
|
154
|
+
this._connected = true;
|
|
155
|
+
this._debugMessage(`Successfully connected to ${this._uri}`);
|
|
156
|
+
try {
|
|
157
|
+
await this._transportConnected(this._uri);
|
|
158
|
+
resolveOnce();
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
this._debugMessage(`Error in _transportConnected: ${error}`);
|
|
162
|
+
rejectOnce(new Error(`Connection callback failed: ${error}`));
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
this._websocket.onmessage = async (event) => {
|
|
166
|
+
const data = typeof event.data === 'string' ? event.data : event.data;
|
|
167
|
+
const task = this._receiveData(data);
|
|
168
|
+
this._messageTasks.add(task);
|
|
169
|
+
task.finally(() => this._messageTasks.delete(task));
|
|
170
|
+
};
|
|
171
|
+
this._websocket.onclose = async (event) => {
|
|
172
|
+
if (this._connectionTimeout) {
|
|
173
|
+
clearTimeout(this._connectionTimeout);
|
|
174
|
+
this._connectionTimeout = undefined;
|
|
175
|
+
}
|
|
176
|
+
this._connected = false;
|
|
177
|
+
const wasClean = event.code === 1000;
|
|
178
|
+
const reasonText = event.reason || (wasClean ? 'Connection closed normally' : 'Connection closed unexpectedly');
|
|
179
|
+
if (!promiseResolved) {
|
|
180
|
+
rejectOnce(new Error(`Connection failed: ${reasonText} (code: ${event.code})`));
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
await this._transportDisconnected(reasonText, !wasClean);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
this._websocket.onerror = async () => {
|
|
187
|
+
if (this._connectionTimeout) {
|
|
188
|
+
clearTimeout(this._connectionTimeout);
|
|
189
|
+
this._connectionTimeout = undefined;
|
|
190
|
+
}
|
|
191
|
+
this._connected = false;
|
|
192
|
+
this._debugMessage(`WebSocket error occurred`);
|
|
193
|
+
if (!promiseResolved) {
|
|
194
|
+
rejectOnce(new Error(`Failed to connect to ${this._uri}`));
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
await this._transportDisconnected('WebSocket error', true);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
// ============================================================
|
|
203
|
+
// NODE.JS WebSocket (ws library)
|
|
204
|
+
// ============================================================
|
|
205
|
+
if (!NodeWebSocket) {
|
|
206
|
+
throw new Error('WebSocket library (ws) not available in Node.js environment');
|
|
207
|
+
}
|
|
208
|
+
// Prepare connection options with authentication headers
|
|
209
|
+
let options = {};
|
|
210
|
+
if (this._auth) {
|
|
211
|
+
options.headers = {
|
|
212
|
+
'Authorization': this._auth
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
this._websocket = new NodeWebSocket.WebSocket(this._uri, options);
|
|
216
|
+
this._websocket.on('open', async () => {
|
|
217
|
+
if (this._connectionTimeout) {
|
|
218
|
+
clearTimeout(this._connectionTimeout);
|
|
219
|
+
this._connectionTimeout = undefined;
|
|
220
|
+
}
|
|
221
|
+
this._connected = true;
|
|
222
|
+
this._debugMessage(`Successfully connected to ${this._uri}`);
|
|
223
|
+
try {
|
|
224
|
+
await this._transportConnected(this._uri);
|
|
225
|
+
resolveOnce();
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
this._debugMessage(`Error in _transportConnected: ${error}`);
|
|
229
|
+
rejectOnce(new Error(`Connection callback failed: ${error}`));
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
this._websocket.on('message', async (data) => {
|
|
233
|
+
// Convert Buffer to ArrayBuffer for compatibility
|
|
234
|
+
let messageData;
|
|
235
|
+
if (typeof data === 'string') {
|
|
236
|
+
messageData = data;
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
// Properly convert Buffer to ArrayBuffer
|
|
240
|
+
const arrayBuffer = new ArrayBuffer(data.length);
|
|
241
|
+
const view = new Uint8Array(arrayBuffer);
|
|
242
|
+
view.set(data);
|
|
243
|
+
messageData = arrayBuffer;
|
|
244
|
+
}
|
|
245
|
+
const task = this._receiveData(messageData);
|
|
246
|
+
this._messageTasks.add(task);
|
|
247
|
+
task.finally(() => this._messageTasks.delete(task));
|
|
248
|
+
});
|
|
249
|
+
this._websocket.on('close', async (code, reason) => {
|
|
250
|
+
if (this._connectionTimeout) {
|
|
251
|
+
clearTimeout(this._connectionTimeout);
|
|
252
|
+
this._connectionTimeout = undefined;
|
|
253
|
+
}
|
|
254
|
+
this._connected = false;
|
|
255
|
+
const wasClean = code === 1000;
|
|
256
|
+
const reasonText = (reason ? reason.toString() : '') || (wasClean ? 'Connection closed normally' : 'Connection closed unexpectedly');
|
|
257
|
+
if (!promiseResolved) {
|
|
258
|
+
rejectOnce(new Error(`Connection failed: ${reasonText} (code: ${code})`));
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
await this._transportDisconnected(reasonText, !wasClean);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
this._websocket.on('error', async (error) => {
|
|
265
|
+
if (this._connectionTimeout) {
|
|
266
|
+
clearTimeout(this._connectionTimeout);
|
|
267
|
+
this._connectionTimeout = undefined;
|
|
268
|
+
}
|
|
269
|
+
this._connected = false;
|
|
270
|
+
this._debugMessage(`WebSocket error: ${error.message}`);
|
|
271
|
+
if (!promiseResolved) {
|
|
272
|
+
rejectOnce(new Error(`Failed to connect to ${this._uri}: ${error.message}`));
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
await this._transportDisconnected(`WebSocket error: ${error.message}`, true);
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
// Set connection timeout (works same in both environments)
|
|
280
|
+
this._connectionTimeout = setTimeout(() => {
|
|
281
|
+
if (this._connectionTimeout) {
|
|
282
|
+
clearTimeout(this._connectionTimeout);
|
|
283
|
+
this._connectionTimeout = undefined;
|
|
284
|
+
}
|
|
285
|
+
// Force close WebSocket if still connecting
|
|
286
|
+
if (this._websocket) {
|
|
287
|
+
if (isBrowser) {
|
|
288
|
+
this._websocket.close();
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
this._websocket.close();
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
rejectOnce(new Error(`Connection timeout after ${constants_1.CONST_SOCKET_TIMEOUT}s`));
|
|
295
|
+
}, constants_1.CONST_SOCKET_TIMEOUT * 1000);
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
if (this._connectionTimeout) {
|
|
299
|
+
clearTimeout(this._connectionTimeout);
|
|
300
|
+
this._connectionTimeout = undefined;
|
|
301
|
+
}
|
|
302
|
+
this._debugMessage(`Failed to connect to ${this._uri}: ${error}`);
|
|
303
|
+
rejectOnce(new Error(`Connection setup failed: ${error}`));
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Disconnect and close the WebSocket connection gracefully.
|
|
309
|
+
* Works in both browser and Node.js environments.
|
|
310
|
+
*/
|
|
311
|
+
async disconnect() {
|
|
312
|
+
// Clear any pending connection timeout
|
|
313
|
+
if (this._connectionTimeout) {
|
|
314
|
+
clearTimeout(this._connectionTimeout);
|
|
315
|
+
this._connectionTimeout = undefined;
|
|
316
|
+
}
|
|
317
|
+
if (!this._connected || !this._websocket) {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
let callbackCalled = false;
|
|
321
|
+
const isBrowser = typeof window !== 'undefined';
|
|
322
|
+
try {
|
|
323
|
+
this._debugMessage('Gracefully disconnecting WebSocket');
|
|
324
|
+
// Cancel pending message processing tasks
|
|
325
|
+
if (this._messageTasks.size > 0) {
|
|
326
|
+
this._debugMessage(`Waiting for ${this._messageTasks.size} pending message tasks`);
|
|
327
|
+
await Promise.allSettled(Array.from(this._messageTasks));
|
|
328
|
+
this._debugMessage('Message tasks completed');
|
|
329
|
+
}
|
|
330
|
+
// Close WebSocket and wait for complete closure
|
|
331
|
+
if (this._websocket) {
|
|
332
|
+
const ws = this._websocket;
|
|
333
|
+
if (isBrowser) {
|
|
334
|
+
// Browser WebSocket
|
|
335
|
+
const browserWs = ws;
|
|
336
|
+
const closePromise = new Promise((resolve) => {
|
|
337
|
+
if (browserWs.readyState === WebSocket.CLOSED) {
|
|
338
|
+
resolve();
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
let timeoutId;
|
|
342
|
+
let resolved = false;
|
|
343
|
+
const resolveOnce = () => {
|
|
344
|
+
if (!resolved) {
|
|
345
|
+
resolved = true;
|
|
346
|
+
if (timeoutId)
|
|
347
|
+
clearTimeout(timeoutId);
|
|
348
|
+
browserWs.onclose = null;
|
|
349
|
+
resolve();
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
browserWs.onclose = () => {
|
|
353
|
+
this._debugMessage('WebSocket close event received');
|
|
354
|
+
resolveOnce();
|
|
355
|
+
};
|
|
356
|
+
browserWs.close(1000, 'Disconnected by request');
|
|
357
|
+
timeoutId = setTimeout(() => {
|
|
358
|
+
this._debugMessage('WebSocket close timeout - forcing resolution');
|
|
359
|
+
resolveOnce();
|
|
360
|
+
}, 500);
|
|
361
|
+
});
|
|
362
|
+
await closePromise;
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
// Node.js WebSocket
|
|
366
|
+
ws.removeAllListeners();
|
|
367
|
+
const closePromise = new Promise((resolve) => {
|
|
368
|
+
if (ws.readyState === 3) { // CLOSED state
|
|
369
|
+
resolve();
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
let timeoutId;
|
|
373
|
+
let resolved = false;
|
|
374
|
+
const resolveOnce = () => {
|
|
375
|
+
if (!resolved) {
|
|
376
|
+
resolved = true;
|
|
377
|
+
if (timeoutId)
|
|
378
|
+
clearTimeout(timeoutId);
|
|
379
|
+
resolve();
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
const tempCloseHandler = () => {
|
|
383
|
+
this._debugMessage('WebSocket close event received');
|
|
384
|
+
resolveOnce();
|
|
385
|
+
};
|
|
386
|
+
ws.on('close', tempCloseHandler);
|
|
387
|
+
ws.close(1000, 'Disconnected by request');
|
|
388
|
+
timeoutId = setTimeout(() => {
|
|
389
|
+
ws.removeListener('close', tempCloseHandler);
|
|
390
|
+
this._debugMessage('WebSocket close timeout - forcing resolution');
|
|
391
|
+
resolveOnce();
|
|
392
|
+
}, 500);
|
|
393
|
+
});
|
|
394
|
+
await closePromise;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
this._debugMessage('WebSocket disconnected successfully');
|
|
398
|
+
// Notify about graceful disconnection
|
|
399
|
+
await this._transportDisconnected('Disconnected by request', false);
|
|
400
|
+
callbackCalled = true;
|
|
401
|
+
}
|
|
402
|
+
catch (error) {
|
|
403
|
+
this._debugMessage(`Error during disconnect: ${error}`);
|
|
404
|
+
if (!callbackCalled) {
|
|
405
|
+
await this._transportDisconnected(`Disconnect error: ${error}`, true);
|
|
406
|
+
callbackCalled = true;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
finally {
|
|
410
|
+
// Always clean up resources
|
|
411
|
+
this._connected = false;
|
|
412
|
+
this._websocket = undefined;
|
|
413
|
+
this._messageTasks.clear();
|
|
414
|
+
this._debugMessage('Disconnect cleanup completed');
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Send a DAP message with automatic format selection.
|
|
419
|
+
*
|
|
420
|
+
* Handles both standard JSON messages and DAP binary messages with
|
|
421
|
+
* data payloads. Automatically chooses appropriate WebSocket message
|
|
422
|
+
* format based on message content.
|
|
423
|
+
*
|
|
424
|
+
* Works in both browser and Node.js environments.
|
|
425
|
+
*/
|
|
426
|
+
async send(message) {
|
|
427
|
+
if (!this.isConnected()) {
|
|
428
|
+
throw new Error('WebSocket not connected. Call connect() first.');
|
|
429
|
+
}
|
|
430
|
+
if (!this._websocket) {
|
|
431
|
+
throw new Error('WebSocket connection lost before send');
|
|
432
|
+
}
|
|
433
|
+
let binaryData;
|
|
434
|
+
const args = message.arguments || {};
|
|
435
|
+
try {
|
|
436
|
+
if ('data' in args) {
|
|
437
|
+
// Binary message - use DAP binary format
|
|
438
|
+
if (typeof args.data === 'string') {
|
|
439
|
+
binaryData = new TextEncoder().encode(args.data);
|
|
440
|
+
}
|
|
441
|
+
else if (args.data instanceof Uint8Array) {
|
|
442
|
+
binaryData = args.data;
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
binaryData = new TextEncoder().encode(JSON.stringify(args.data));
|
|
446
|
+
}
|
|
447
|
+
// Create debug version for logging
|
|
448
|
+
const debugMessage = { ...message };
|
|
449
|
+
if (debugMessage.arguments) {
|
|
450
|
+
debugMessage.arguments = { ...debugMessage.arguments };
|
|
451
|
+
debugMessage.arguments.data = `<${binaryData.length} bytes>`;
|
|
452
|
+
}
|
|
453
|
+
this._debugProtocol(`SEND: ${JSON.stringify(debugMessage)}`);
|
|
454
|
+
// Remove data from message for header
|
|
455
|
+
const headerMessage = { ...message };
|
|
456
|
+
if (headerMessage.arguments) {
|
|
457
|
+
headerMessage.arguments = { ...headerMessage.arguments };
|
|
458
|
+
delete headerMessage.arguments.data;
|
|
459
|
+
}
|
|
460
|
+
// Create DAP binary message: JSON header + newline + binary data
|
|
461
|
+
const jsonHeader = new TextEncoder().encode(JSON.stringify(headerMessage));
|
|
462
|
+
const newline = new Uint8Array([10]); // ASCII newline
|
|
463
|
+
const combinedMessage = new Uint8Array(jsonHeader.length + 1 + binaryData.length);
|
|
464
|
+
combinedMessage.set(jsonHeader);
|
|
465
|
+
combinedMessage.set(newline, jsonHeader.length);
|
|
466
|
+
combinedMessage.set(binaryData, jsonHeader.length + 1);
|
|
467
|
+
// Send binary message
|
|
468
|
+
this._websocket.send(combinedMessage);
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
// Standard JSON message
|
|
472
|
+
this._debugProtocol(`SEND: ${JSON.stringify(message)}`);
|
|
473
|
+
this._websocket.send(JSON.stringify(message));
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
catch (error) {
|
|
477
|
+
if (error instanceof Error && error.name === 'NetworkError') {
|
|
478
|
+
// Connection errors should update state
|
|
479
|
+
this._connected = false;
|
|
480
|
+
this._debugMessage(`Connection lost during send: ${error.message}`);
|
|
481
|
+
throw new Error(`Connection lost during send: ${error.message}`);
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
// Log send failures for debugging
|
|
485
|
+
this._debugMessage(`Failed to send message: ${error}`);
|
|
486
|
+
throw error;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
exports.TransportWebSocket = TransportWebSocket;
|
|
492
|
+
//# sourceMappingURL=TransportWebSocket.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransportWebSocket.js","sourceRoot":"","sources":["../../../../aparavi-client/src/core/TransportWebSocket.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAEH,mDAAgD;AAEhD,4CAA2E;AAE3E,gEAAgE;AAChE,IAAI,aAA8C,CAAC;AACnD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACnC,8CAA8C;IAC9C,IAAI,CAAC;QACJ,aAAa,GAAG,OAAO,CAAC,IAAI,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