@olane/o-node 0.7.12-alpha.53 → 0.7.12-alpha.55
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-handler.d.ts","sourceRoot":"","sources":["../../../src/connection/stream-handler.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EACL,QAAQ,EACR,SAAS,EAIT,MAAM,EAEP,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"stream-handler.d.ts","sourceRoot":"","sources":["../../../src/connection/stream-handler.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EACL,QAAQ,EACR,SAAS,EAIT,MAAM,EAEP,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGtE;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,CAAC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protocol: protocol,
|
|
52
52
|
}));
|
|
53
53
|
connection.streams.forEach((stream) => {
|
|
54
|
-
this.logger.debug('Stream re-use option:', stream.protocol, stream.status, stream.direction);
|
|
54
|
+
this.logger.debug('Stream re-use option:', stream.protocol, stream.status, stream.direction, stream.remoteWriteStatus, stream.writeStatus, stream.remoteReadStatus, stream.readStatus);
|
|
55
55
|
});
|
|
56
|
-
const existingStream = connection.streams.find((stream) => stream.status === 'open' &&
|
|
56
|
+
const existingStream = connection.streams.find((stream) => stream.status === 'open' &&
|
|
57
|
+
stream.protocol?.length > 0 &&
|
|
58
|
+
stream.writeStatus === 'writable' &&
|
|
59
|
+
stream.remoteReadStatus === 'readable');
|
|
57
60
|
if (existingStream) {
|
|
58
|
-
this.logger.debug('Reusing existing stream');
|
|
61
|
+
this.logger.debug('Reusing existing stream', existingStream.id, existingStream.direction);
|
|
59
62
|
return existingStream;
|
|
60
63
|
}
|
|
61
64
|
}
|
|
@@ -138,7 +141,7 @@ export class StreamHandler {
|
|
|
138
141
|
await this.handleRequestMessage(message, stream, toolExecutor);
|
|
139
142
|
}
|
|
140
143
|
else if (this.isResponse(message)) {
|
|
141
|
-
this.logger.warn('Received response message on server-side stream, ignoring');
|
|
144
|
+
this.logger.warn('Received response message on server-side stream, ignoring', message);
|
|
142
145
|
}
|
|
143
146
|
else {
|
|
144
147
|
this.logger.warn('Received unknown message type', message);
|
|
@@ -152,10 +155,10 @@ export class StreamHandler {
|
|
|
152
155
|
const closeHandler = () => {
|
|
153
156
|
this.logger.debug('Stream closed by remote peer');
|
|
154
157
|
stream.removeEventListener('message', messageHandler);
|
|
155
|
-
|
|
158
|
+
stream.removeEventListener('close', closeHandler);
|
|
156
159
|
};
|
|
157
160
|
stream.addEventListener('message', messageHandler);
|
|
158
|
-
|
|
161
|
+
stream.addEventListener('close', closeHandler);
|
|
159
162
|
}
|
|
160
163
|
/**
|
|
161
164
|
* Handles a request message by executing the tool and sending response
|
|
@@ -215,7 +218,7 @@ export class StreamHandler {
|
|
|
215
218
|
}
|
|
216
219
|
}
|
|
217
220
|
else if (this.isRequest(message)) {
|
|
218
|
-
this.logger.warn('Received request message on client-side stream, ignoring');
|
|
221
|
+
this.logger.warn('Received request message on client-side stream, ignoring', message);
|
|
219
222
|
}
|
|
220
223
|
else {
|
|
221
224
|
this.logger.warn('Received unknown message type', message);
|
|
@@ -250,13 +253,13 @@ export class StreamHandler {
|
|
|
250
253
|
};
|
|
251
254
|
const cleanup = () => {
|
|
252
255
|
stream.removeEventListener('message', messageHandler);
|
|
253
|
-
|
|
256
|
+
stream.removeEventListener('close', closeHandler);
|
|
254
257
|
if (config.signal) {
|
|
255
258
|
config.signal.removeEventListener('abort', abortHandler);
|
|
256
259
|
}
|
|
257
260
|
};
|
|
258
261
|
stream.addEventListener('message', messageHandler);
|
|
259
|
-
|
|
262
|
+
stream.addEventListener('close', closeHandler);
|
|
260
263
|
if (config.signal) {
|
|
261
264
|
config.signal.addEventListener('abort', abortHandler);
|
|
262
265
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olane/o-node",
|
|
3
|
-
"version": "0.7.12-alpha.
|
|
3
|
+
"version": "0.7.12-alpha.55",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"typescript": "5.4.5"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@olane/o-config": "0.7.12-alpha.
|
|
58
|
-
"@olane/o-core": "0.7.12-alpha.
|
|
59
|
-
"@olane/o-protocol": "0.7.12-alpha.
|
|
60
|
-
"@olane/o-tool": "0.7.12-alpha.
|
|
57
|
+
"@olane/o-config": "0.7.12-alpha.55",
|
|
58
|
+
"@olane/o-core": "0.7.12-alpha.55",
|
|
59
|
+
"@olane/o-protocol": "0.7.12-alpha.55",
|
|
60
|
+
"@olane/o-tool": "0.7.12-alpha.55",
|
|
61
61
|
"debug": "^4.4.1",
|
|
62
62
|
"dotenv": "^16.5.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "f58cf248bdbe2c820ca7dd3f6c2b11eee389966b"
|
|
65
65
|
}
|