@naylence/agent-sdk 0.3.8 → 0.3.10

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.
@@ -15692,12 +15692,12 @@
15692
15692
  // --- END ENV SHIM ---
15693
15693
 
15694
15694
  // This file is auto-generated during build - do not edit manually
15695
- // Generated from package.json version: 0.3.9
15695
+ // Generated from package.json version: 0.3.11
15696
15696
  /**
15697
15697
  * The package version, injected at build time.
15698
15698
  * @internal
15699
15699
  */
15700
- const VERSION$1 = '0.3.9';
15700
+ const VERSION$1 = '0.3.11';
15701
15701
 
15702
15702
  /**
15703
15703
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -19210,13 +19210,18 @@
19210
19210
  this.sidFn = sidFn;
19211
19211
  }
19212
19212
  createEnvelope(options) {
19213
- const { frame, id, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
19213
+ const { frame, id, sid, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
19214
19214
  const optionsRecord = isPlainRecord$8(options)
19215
19215
  ? options
19216
19216
  : {};
19217
19217
  validateFrame(frame);
19218
19218
  const sidValue = this.sidFn();
19219
- const sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
19219
+ let sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
19220
+ const sidInput = pickAlias(sid ?? null, optionsRecord, 'sid', 'source_id');
19221
+ if ((!sanitizedSid || sanitizedSid.length === 0) &&
19222
+ typeof sidInput === 'string') {
19223
+ sanitizedSid = sidInput.trim();
19224
+ }
19220
19225
  const idInput = pickAlias(id ?? null, optionsRecord, 'envelope_id');
19221
19226
  const traceIdInput = pickAlias(traceId ?? null, optionsRecord, 'trace_id');
19222
19227
  const toInput = pickAlias(to ?? null, optionsRecord, 'to', 'recipient', 'target', 'address');
@@ -34606,7 +34611,8 @@
34606
34611
  throw new FameTransportClose('WebSocket object is null', 1006);
34607
34612
  }
34608
34613
  // Use a timeout to prevent hanging during shutdown scenarios
34609
- const receiveTimeout = 30000; // 30 seconds
34614
+ // Increased to 1 hour to match server-side keep-alive and prevent idle disconnects
34615
+ const receiveTimeout = 3600000; // 1 hour
34610
34616
  if (this._isFastApiLike && this._websocket.receive_bytes) {
34611
34617
  // FastAPI-style server WebSocket
34612
34618
  const receiveMethod = this._websocket.receive_bytes;
@@ -56112,7 +56118,9 @@
56112
56118
  if (rpcRequest.id != null) {
56113
56119
  envelopeOptions.corrId = String(rpcRequest.id);
56114
56120
  }
56115
- const envelopeResponse = createFameEnvelope(envelopeOptions);
56121
+ const envelopeResponse = this._node
56122
+ ? this._node.envelopeFactory.createEnvelope(envelopeOptions)
56123
+ : createFameEnvelope(envelopeOptions);
56116
56124
  yield createMessageResponse(envelopeResponse);
56117
56125
  }
56118
56126
  }.bind(this);
@@ -56168,7 +56176,9 @@
56168
56176
  if (rpcRequest.id != null) {
56169
56177
  envelopeOptions.corrId = String(rpcRequest.id);
56170
56178
  }
56171
- const envelope = createFameEnvelope(envelopeOptions);
56179
+ const envelope = this._node
56180
+ ? this._node.envelopeFactory.createEnvelope(envelopeOptions)
56181
+ : createFameEnvelope(envelopeOptions);
56172
56182
  const fabricToUse = this._fabric ?? FameFabric.current();
56173
56183
  await fabricToUse.send(envelope);
56174
56184
  }