codebolt 1.12.10 → 1.12.11
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/dist/index.js +7 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -533997,7 +533997,7 @@ function hasClaim() {
|
|
|
533997
533997
|
* Forward an agent message as an ExecutionRequest to the claiming plugin.
|
|
533998
533998
|
* Returns a promise that resolves when the plugin sends a reply.
|
|
533999
533999
|
*/
|
|
534000
|
-
function forwardAsRequest(originalMessage, timeout =
|
|
534000
|
+
function forwardAsRequest(originalMessage, timeout = 0) {
|
|
534001
534001
|
if (!claimingPluginId) {
|
|
534002
534002
|
return Promise.reject(new Error('No plugin has claimed the ExecutionGateway'));
|
|
534003
534003
|
}
|
|
@@ -534008,10 +534008,12 @@ function forwardAsRequest(originalMessage, timeout = 30000) {
|
|
|
534008
534008
|
}
|
|
534009
534009
|
const requestId = (0, uuid_1.v4)();
|
|
534010
534010
|
return new Promise((resolve, reject) => {
|
|
534011
|
-
const timeoutHandle =
|
|
534012
|
-
|
|
534013
|
-
|
|
534014
|
-
|
|
534011
|
+
const timeoutHandle = timeout > 0
|
|
534012
|
+
? setTimeout(() => {
|
|
534013
|
+
pendingRequests.delete(requestId);
|
|
534014
|
+
reject(new Error(`ExecutionGateway request timed out after ${timeout}ms`));
|
|
534015
|
+
}, timeout)
|
|
534016
|
+
: null;
|
|
534015
534017
|
pendingRequests.set(requestId, { resolve, reject, timeoutHandle });
|
|
534016
534018
|
const request = {
|
|
534017
534019
|
type: 'executionGateway.request',
|