@theokit/sdk 3.1.0 → 3.1.1

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/a2a/index.js CHANGED
@@ -19198,15 +19198,20 @@ var MessageBus = class {
19198
19198
  // SE3 — provenance projection of the sender address (thin view over `from`).
19199
19199
  origin: { kind: "peer", from }
19200
19200
  };
19201
- return Promise.race([
19202
- Promise.resolve(handler(message)),
19203
- new Promise(
19204
- (_, reject) => setTimeout(
19205
- () => reject(new Error(`A2A request timeout: ${to} did not respond within ${timeoutMs}ms`)),
19206
- timeoutMs
19207
- )
19208
- )
19209
- ]);
19201
+ let timer;
19202
+ try {
19203
+ return await Promise.race([
19204
+ Promise.resolve(handler(message)),
19205
+ new Promise((_, reject) => {
19206
+ timer = setTimeout(
19207
+ () => reject(new Error(`A2A request timeout: ${to} did not respond within ${timeoutMs}ms`)),
19208
+ timeoutMs
19209
+ );
19210
+ })
19211
+ ]);
19212
+ } finally {
19213
+ if (timer !== void 0) clearTimeout(timer);
19214
+ }
19210
19215
  }
19211
19216
  has(agentId) {
19212
19217
  return this._handlers.has(agentId);