@olane/o-node 0.7.12-alpha.52 → 0.7.12-alpha.54
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;AAEtE;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,CAAC,EAAE,MAAM;IAI3B;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAIhC;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAIjC;;OAEG;IACG,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAI7C;;;;;;OAMG;IACG,iBAAiB,CACrB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,mBAAwB,GAC/B,OAAO,CAAC,MAAM,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,m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,OAAO,CAAC,IAAI,CAAC;IA2ChB;;;;;;OAMG;YACW,oBAAoB;IAkBlC;;;;;;;;OAQG;IACG,oBAAoB,CACxB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,YAAY,EACrB,MAAM,GAAE,mBAAwB,GAC/B,OAAO,CAAC,SAAS,CAAC;IA6FrB;;;;;;;OAOG;IACG,cAAc,CAClB,OAAO,EAAE,cAAc,EACvB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,GAChD,OAAO,CAAC,IAAI,CAAC;CAyBjB"}
|
|
@@ -43,8 +43,13 @@ export class StreamHandler {
|
|
|
43
43
|
throw new oError(oErrorCodes.INVALID_STATE, 'Connection not open');
|
|
44
44
|
}
|
|
45
45
|
const reusePolicy = config.reusePolicy ?? 'none';
|
|
46
|
+
this.logger.debug('Reuse policy:', reusePolicy);
|
|
46
47
|
// Check for existing stream if reuse is enabled
|
|
47
48
|
if (reusePolicy === 'reuse') {
|
|
49
|
+
this.logger.debug('Reusing existing stream if we can find one. Stream insights:', JSON.stringify({
|
|
50
|
+
streamCount: connection.streams.length,
|
|
51
|
+
protocol: protocol,
|
|
52
|
+
}));
|
|
48
53
|
connection.streams.forEach((stream) => {
|
|
49
54
|
this.logger.debug('Stream re-use option:', stream.protocol, stream.status, stream.direction);
|
|
50
55
|
});
|
|
@@ -133,7 +138,7 @@ export class StreamHandler {
|
|
|
133
138
|
await this.handleRequestMessage(message, stream, toolExecutor);
|
|
134
139
|
}
|
|
135
140
|
else if (this.isResponse(message)) {
|
|
136
|
-
this.logger.warn('Received response message on server-side stream, ignoring');
|
|
141
|
+
this.logger.warn('Received response message on server-side stream, ignoring', message);
|
|
137
142
|
}
|
|
138
143
|
else {
|
|
139
144
|
this.logger.warn('Received unknown message type', message);
|
|
@@ -147,10 +152,10 @@ export class StreamHandler {
|
|
|
147
152
|
const closeHandler = () => {
|
|
148
153
|
this.logger.debug('Stream closed by remote peer');
|
|
149
154
|
stream.removeEventListener('message', messageHandler);
|
|
150
|
-
|
|
155
|
+
stream.removeEventListener('close', closeHandler);
|
|
151
156
|
};
|
|
152
157
|
stream.addEventListener('message', messageHandler);
|
|
153
|
-
|
|
158
|
+
stream.addEventListener('close', closeHandler);
|
|
154
159
|
}
|
|
155
160
|
/**
|
|
156
161
|
* Handles a request message by executing the tool and sending response
|
|
@@ -210,7 +215,7 @@ export class StreamHandler {
|
|
|
210
215
|
}
|
|
211
216
|
}
|
|
212
217
|
else if (this.isRequest(message)) {
|
|
213
|
-
this.logger.warn('Received request message on client-side stream, ignoring');
|
|
218
|
+
this.logger.warn('Received request message on client-side stream, ignoring', message);
|
|
214
219
|
}
|
|
215
220
|
else {
|
|
216
221
|
this.logger.warn('Received unknown message type', message);
|
|
@@ -245,13 +250,13 @@ export class StreamHandler {
|
|
|
245
250
|
};
|
|
246
251
|
const cleanup = () => {
|
|
247
252
|
stream.removeEventListener('message', messageHandler);
|
|
248
|
-
|
|
253
|
+
stream.removeEventListener('close', closeHandler);
|
|
249
254
|
if (config.signal) {
|
|
250
255
|
config.signal.removeEventListener('abort', abortHandler);
|
|
251
256
|
}
|
|
252
257
|
};
|
|
253
258
|
stream.addEventListener('message', messageHandler);
|
|
254
|
-
|
|
259
|
+
stream.addEventListener('close', closeHandler);
|
|
255
260
|
if (config.signal) {
|
|
256
261
|
config.signal.addEventListener('abort', abortHandler);
|
|
257
262
|
}
|
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.54",
|
|
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.54",
|
|
58
|
+
"@olane/o-core": "0.7.12-alpha.54",
|
|
59
|
+
"@olane/o-protocol": "0.7.12-alpha.54",
|
|
60
|
+
"@olane/o-tool": "0.7.12-alpha.54",
|
|
61
61
|
"debug": "^4.4.1",
|
|
62
62
|
"dotenv": "^16.5.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "f52e2ac9517796ae18497318cc72d6abdc91ac24"
|
|
65
65
|
}
|