@naylence/runtime 0.3.9 → 0.3.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.
@@ -100,12 +100,12 @@ installProcessEnvShim();
100
100
  // --- END ENV SHIM ---
101
101
 
102
102
  // This file is auto-generated during build - do not edit manually
103
- // Generated from package.json version: 0.3.9
103
+ // Generated from package.json version: 0.3.11
104
104
  /**
105
105
  * The package version, injected at build time.
106
106
  * @internal
107
107
  */
108
- const VERSION = '0.3.9';
108
+ const VERSION = '0.3.11';
109
109
 
110
110
  /**
111
111
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -4538,13 +4538,18 @@ class NodeEnvelopeFactory {
4538
4538
  this.sidFn = sidFn;
4539
4539
  }
4540
4540
  createEnvelope(options) {
4541
- const { frame, id, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
4541
+ const { frame, id, sid, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
4542
4542
  const optionsRecord = isPlainRecord$8(options)
4543
4543
  ? options
4544
4544
  : {};
4545
4545
  validateFrame(frame);
4546
4546
  const sidValue = this.sidFn();
4547
- const sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
4547
+ let sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
4548
+ const sidInput = pickAlias(sid ?? null, optionsRecord, 'sid', 'source_id');
4549
+ if ((!sanitizedSid || sanitizedSid.length === 0) &&
4550
+ typeof sidInput === 'string') {
4551
+ sanitizedSid = sidInput.trim();
4552
+ }
4548
4553
  const idInput = pickAlias(id ?? null, optionsRecord, 'envelope_id');
4549
4554
  const traceIdInput = pickAlias(traceId ?? null, optionsRecord, 'trace_id');
4550
4555
  const toInput = pickAlias(to ?? null, optionsRecord, 'to', 'recipient', 'target', 'address');
@@ -20077,7 +20082,8 @@ class WebSocketConnector extends BaseAsyncConnector {
20077
20082
  throw new FameTransportClose('WebSocket object is null', 1006);
20078
20083
  }
20079
20084
  // Use a timeout to prevent hanging during shutdown scenarios
20080
- const receiveTimeout = 30000; // 30 seconds
20085
+ // Increased to 1 hour to match server-side keep-alive and prevent idle disconnects
20086
+ const receiveTimeout = 3600000; // 1 hour
20081
20087
  if (this._isFastApiLike && this._websocket.receive_bytes) {
20082
20088
  // FastAPI-style server WebSocket
20083
20089
  const receiveMethod = this._websocket.receive_bytes;
@@ -98,12 +98,12 @@ installProcessEnvShim();
98
98
  // --- END ENV SHIM ---
99
99
 
100
100
  // This file is auto-generated during build - do not edit manually
101
- // Generated from package.json version: 0.3.9
101
+ // Generated from package.json version: 0.3.11
102
102
  /**
103
103
  * The package version, injected at build time.
104
104
  * @internal
105
105
  */
106
- const VERSION = '0.3.9';
106
+ const VERSION = '0.3.11';
107
107
 
108
108
  /**
109
109
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -4536,13 +4536,18 @@ class NodeEnvelopeFactory {
4536
4536
  this.sidFn = sidFn;
4537
4537
  }
4538
4538
  createEnvelope(options) {
4539
- const { frame, id, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
4539
+ const { frame, id, sid, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
4540
4540
  const optionsRecord = isPlainRecord$8(options)
4541
4541
  ? options
4542
4542
  : {};
4543
4543
  validateFrame(frame);
4544
4544
  const sidValue = this.sidFn();
4545
- const sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
4545
+ let sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
4546
+ const sidInput = pickAlias(sid ?? null, optionsRecord, 'sid', 'source_id');
4547
+ if ((!sanitizedSid || sanitizedSid.length === 0) &&
4548
+ typeof sidInput === 'string') {
4549
+ sanitizedSid = sidInput.trim();
4550
+ }
4546
4551
  const idInput = pickAlias(id ?? null, optionsRecord, 'envelope_id');
4547
4552
  const traceIdInput = pickAlias(traceId ?? null, optionsRecord, 'trace_id');
4548
4553
  const toInput = pickAlias(to ?? null, optionsRecord, 'to', 'recipient', 'target', 'address');
@@ -20075,7 +20080,8 @@ class WebSocketConnector extends BaseAsyncConnector {
20075
20080
  throw new FameTransportClose('WebSocket object is null', 1006);
20076
20081
  }
20077
20082
  // Use a timeout to prevent hanging during shutdown scenarios
20078
- const receiveTimeout = 30000; // 30 seconds
20083
+ // Increased to 1 hour to match server-side keep-alive and prevent idle disconnects
20084
+ const receiveTimeout = 3600000; // 1 hour
20079
20085
  if (this._isFastApiLike && this._websocket.receive_bytes) {
20080
20086
  // FastAPI-style server WebSocket
20081
20087
  const receiveMethod = this._websocket.receive_bytes;
@@ -164,7 +164,8 @@ class WebSocketConnector extends base_async_connector_js_1.BaseAsyncConnector {
164
164
  throw new errors_js_1.FameTransportClose('WebSocket object is null', 1006);
165
165
  }
166
166
  // Use a timeout to prevent hanging during shutdown scenarios
167
- const receiveTimeout = 30000; // 30 seconds
167
+ // Increased to 1 hour to match server-side keep-alive and prevent idle disconnects
168
+ const receiveTimeout = 3600000; // 1 hour
168
169
  if (this._isFastApiLike && this._websocket.receive_bytes) {
169
170
  // FastAPI-style server WebSocket
170
171
  const receiveMethod = this._websocket.receive_bytes;
@@ -8,13 +8,18 @@ class NodeEnvelopeFactory {
8
8
  this.sidFn = sidFn;
9
9
  }
10
10
  createEnvelope(options) {
11
- const { frame, id, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
11
+ const { frame, id, sid, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
12
12
  const optionsRecord = isPlainRecord(options)
13
13
  ? options
14
14
  : {};
15
15
  validateFrame(frame);
16
16
  const sidValue = this.sidFn();
17
- const sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
17
+ let sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
18
+ const sidInput = pickAlias(sid ?? null, optionsRecord, 'sid', 'source_id');
19
+ if ((!sanitizedSid || sanitizedSid.length === 0) &&
20
+ typeof sidInput === 'string') {
21
+ sanitizedSid = sidInput.trim();
22
+ }
18
23
  const idInput = pickAlias(id ?? null, optionsRecord, 'envelope_id');
19
24
  const traceIdInput = pickAlias(traceId ?? null, optionsRecord, 'trace_id');
20
25
  const toInput = pickAlias(to ?? null, optionsRecord, 'to', 'recipient', 'target', 'address');
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  // This file is auto-generated during build - do not edit manually
3
- // Generated from package.json version: 0.3.9
3
+ // Generated from package.json version: 0.3.11
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.VERSION = void 0;
6
6
  /**
7
7
  * The package version, injected at build time.
8
8
  * @internal
9
9
  */
10
- exports.VERSION = '0.3.9';
10
+ exports.VERSION = '0.3.11';
@@ -161,7 +161,8 @@ export class WebSocketConnector extends BaseAsyncConnector {
161
161
  throw new FameTransportClose('WebSocket object is null', 1006);
162
162
  }
163
163
  // Use a timeout to prevent hanging during shutdown scenarios
164
- const receiveTimeout = 30000; // 30 seconds
164
+ // Increased to 1 hour to match server-side keep-alive and prevent idle disconnects
165
+ const receiveTimeout = 3600000; // 1 hour
165
166
  if (this._isFastApiLike && this._websocket.receive_bytes) {
166
167
  // FastAPI-style server WebSocket
167
168
  const receiveMethod = this._websocket.receive_bytes;
@@ -5,13 +5,18 @@ export class NodeEnvelopeFactory {
5
5
  this.sidFn = sidFn;
6
6
  }
7
7
  createEnvelope(options) {
8
- const { frame, id, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
8
+ const { frame, id, sid, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
9
9
  const optionsRecord = isPlainRecord(options)
10
10
  ? options
11
11
  : {};
12
12
  validateFrame(frame);
13
13
  const sidValue = this.sidFn();
14
- const sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
14
+ let sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
15
+ const sidInput = pickAlias(sid ?? null, optionsRecord, 'sid', 'source_id');
16
+ if ((!sanitizedSid || sanitizedSid.length === 0) &&
17
+ typeof sidInput === 'string') {
18
+ sanitizedSid = sidInput.trim();
19
+ }
15
20
  const idInput = pickAlias(id ?? null, optionsRecord, 'envelope_id');
16
21
  const traceIdInput = pickAlias(traceId ?? null, optionsRecord, 'trace_id');
17
22
  const toInput = pickAlias(to ?? null, optionsRecord, 'to', 'recipient', 'target', 'address');
@@ -1,7 +1,7 @@
1
1
  // This file is auto-generated during build - do not edit manually
2
- // Generated from package.json version: 0.3.9
2
+ // Generated from package.json version: 0.3.11
3
3
  /**
4
4
  * The package version, injected at build time.
5
5
  * @internal
6
6
  */
7
- export const VERSION = '0.3.9';
7
+ export const VERSION = '0.3.11';
@@ -14,12 +14,12 @@ var fastify = require('fastify');
14
14
  var websocketPlugin = require('@fastify/websocket');
15
15
 
16
16
  // This file is auto-generated during build - do not edit manually
17
- // Generated from package.json version: 0.3.9
17
+ // Generated from package.json version: 0.3.11
18
18
  /**
19
19
  * The package version, injected at build time.
20
20
  * @internal
21
21
  */
22
- const VERSION = '0.3.9';
22
+ const VERSION = '0.3.11';
23
23
 
24
24
  /**
25
25
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -4452,13 +4452,18 @@ class NodeEnvelopeFactory {
4452
4452
  this.sidFn = sidFn;
4453
4453
  }
4454
4454
  createEnvelope(options) {
4455
- const { frame, id, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
4455
+ const { frame, id, sid, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
4456
4456
  const optionsRecord = isPlainRecord$8(options)
4457
4457
  ? options
4458
4458
  : {};
4459
4459
  validateFrame(frame);
4460
4460
  const sidValue = this.sidFn();
4461
- const sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
4461
+ let sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
4462
+ const sidInput = pickAlias(sid ?? null, optionsRecord, 'sid', 'source_id');
4463
+ if ((!sanitizedSid || sanitizedSid.length === 0) &&
4464
+ typeof sidInput === 'string') {
4465
+ sanitizedSid = sidInput.trim();
4466
+ }
4462
4467
  const idInput = pickAlias(id ?? null, optionsRecord, 'envelope_id');
4463
4468
  const traceIdInput = pickAlias(traceId ?? null, optionsRecord, 'trace_id');
4464
4469
  const toInput = pickAlias(to ?? null, optionsRecord, 'to', 'recipient', 'target', 'address');
@@ -19991,7 +19996,8 @@ class WebSocketConnector extends BaseAsyncConnector {
19991
19996
  throw new FameTransportClose('WebSocket object is null', 1006);
19992
19997
  }
19993
19998
  // Use a timeout to prevent hanging during shutdown scenarios
19994
- const receiveTimeout = 30000; // 30 seconds
19999
+ // Increased to 1 hour to match server-side keep-alive and prevent idle disconnects
20000
+ const receiveTimeout = 3600000; // 1 hour
19995
20001
  if (this._isFastApiLike && this._websocket.receive_bytes) {
19996
20002
  // FastAPI-style server WebSocket
19997
20003
  const receiveMethod = this._websocket.receive_bytes;
@@ -13,12 +13,12 @@ import fastify from 'fastify';
13
13
  import websocketPlugin from '@fastify/websocket';
14
14
 
15
15
  // This file is auto-generated during build - do not edit manually
16
- // Generated from package.json version: 0.3.9
16
+ // Generated from package.json version: 0.3.11
17
17
  /**
18
18
  * The package version, injected at build time.
19
19
  * @internal
20
20
  */
21
- const VERSION = '0.3.9';
21
+ const VERSION = '0.3.11';
22
22
 
23
23
  /**
24
24
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -4451,13 +4451,18 @@ class NodeEnvelopeFactory {
4451
4451
  this.sidFn = sidFn;
4452
4452
  }
4453
4453
  createEnvelope(options) {
4454
- const { frame, id, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
4454
+ const { frame, id, sid, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
4455
4455
  const optionsRecord = isPlainRecord$8(options)
4456
4456
  ? options
4457
4457
  : {};
4458
4458
  validateFrame(frame);
4459
4459
  const sidValue = this.sidFn();
4460
- const sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
4460
+ let sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
4461
+ const sidInput = pickAlias(sid ?? null, optionsRecord, 'sid', 'source_id');
4462
+ if ((!sanitizedSid || sanitizedSid.length === 0) &&
4463
+ typeof sidInput === 'string') {
4464
+ sanitizedSid = sidInput.trim();
4465
+ }
4461
4466
  const idInput = pickAlias(id ?? null, optionsRecord, 'envelope_id');
4462
4467
  const traceIdInput = pickAlias(traceId ?? null, optionsRecord, 'trace_id');
4463
4468
  const toInput = pickAlias(to ?? null, optionsRecord, 'to', 'recipient', 'target', 'address');
@@ -19990,7 +19995,8 @@ class WebSocketConnector extends BaseAsyncConnector {
19990
19995
  throw new FameTransportClose('WebSocket object is null', 1006);
19991
19996
  }
19992
19997
  // Use a timeout to prevent hanging during shutdown scenarios
19993
- const receiveTimeout = 30000; // 30 seconds
19998
+ // Increased to 1 hour to match server-side keep-alive and prevent idle disconnects
19999
+ const receiveTimeout = 3600000; // 1 hour
19994
20000
  if (this._isFastApiLike && this._websocket.receive_bytes) {
19995
20001
  // FastAPI-style server WebSocket
19996
20002
  const receiveMethod = this._websocket.receive_bytes;
@@ -2848,7 +2848,8 @@ class WebSocketConnector extends BaseAsyncConnector {
2848
2848
  throw new FameTransportClose('WebSocket object is null', 1006);
2849
2849
  }
2850
2850
  // Use a timeout to prevent hanging during shutdown scenarios
2851
- const receiveTimeout = 30000; // 30 seconds
2851
+ // Increased to 1 hour to match server-side keep-alive and prevent idle disconnects
2852
+ const receiveTimeout = 3600000; // 1 hour
2852
2853
  if (this._isFastApiLike && this._websocket.receive_bytes) {
2853
2854
  // FastAPI-style server WebSocket
2854
2855
  const receiveMethod = this._websocket.receive_bytes;
@@ -5563,12 +5564,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
5563
5564
  }
5564
5565
 
5565
5566
  // This file is auto-generated during build - do not edit manually
5566
- // Generated from package.json version: 0.3.9
5567
+ // Generated from package.json version: 0.3.11
5567
5568
  /**
5568
5569
  * The package version, injected at build time.
5569
5570
  * @internal
5570
5571
  */
5571
- const VERSION = '0.3.9';
5572
+ const VERSION = '0.3.11';
5572
5573
 
5573
5574
  /**
5574
5575
  * Fame errors module - Fame protocol specific error classes
@@ -7088,13 +7089,18 @@ class NodeEnvelopeFactory {
7088
7089
  this.sidFn = sidFn;
7089
7090
  }
7090
7091
  createEnvelope(options) {
7091
- const { frame, id, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
7092
+ const { frame, id, sid, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
7092
7093
  const optionsRecord = isPlainRecord$8(options)
7093
7094
  ? options
7094
7095
  : {};
7095
7096
  validateFrame(frame);
7096
7097
  const sidValue = this.sidFn();
7097
- const sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
7098
+ let sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
7099
+ const sidInput = pickAlias(sid ?? null, optionsRecord, 'sid', 'source_id');
7100
+ if ((!sanitizedSid || sanitizedSid.length === 0) &&
7101
+ typeof sidInput === 'string') {
7102
+ sanitizedSid = sidInput.trim();
7103
+ }
7098
7104
  const idInput = pickAlias(id ?? null, optionsRecord, 'envelope_id');
7099
7105
  const traceIdInput = pickAlias(traceId ?? null, optionsRecord, 'trace_id');
7100
7106
  const toInput = pickAlias(to ?? null, optionsRecord, 'to', 'recipient', 'target', 'address');
@@ -2847,7 +2847,8 @@ class WebSocketConnector extends BaseAsyncConnector {
2847
2847
  throw new FameTransportClose('WebSocket object is null', 1006);
2848
2848
  }
2849
2849
  // Use a timeout to prevent hanging during shutdown scenarios
2850
- const receiveTimeout = 30000; // 30 seconds
2850
+ // Increased to 1 hour to match server-side keep-alive and prevent idle disconnects
2851
+ const receiveTimeout = 3600000; // 1 hour
2851
2852
  if (this._isFastApiLike && this._websocket.receive_bytes) {
2852
2853
  // FastAPI-style server WebSocket
2853
2854
  const receiveMethod = this._websocket.receive_bytes;
@@ -5562,12 +5563,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
5562
5563
  }
5563
5564
 
5564
5565
  // This file is auto-generated during build - do not edit manually
5565
- // Generated from package.json version: 0.3.9
5566
+ // Generated from package.json version: 0.3.11
5566
5567
  /**
5567
5568
  * The package version, injected at build time.
5568
5569
  * @internal
5569
5570
  */
5570
- const VERSION = '0.3.9';
5571
+ const VERSION = '0.3.11';
5571
5572
 
5572
5573
  /**
5573
5574
  * Fame errors module - Fame protocol specific error classes
@@ -7087,13 +7088,18 @@ class NodeEnvelopeFactory {
7087
7088
  this.sidFn = sidFn;
7088
7089
  }
7089
7090
  createEnvelope(options) {
7090
- const { frame, id, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
7091
+ const { frame, id, sid, traceId, to, capabilities, replyTo, flowId, windowId, flags, timestamp, corrId, responseType, } = options;
7091
7092
  const optionsRecord = isPlainRecord$8(options)
7092
7093
  ? options
7093
7094
  : {};
7094
7095
  validateFrame(frame);
7095
7096
  const sidValue = this.sidFn();
7096
- const sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
7097
+ let sanitizedSid = typeof sidValue === 'string' ? sidValue.trim() : sidValue;
7098
+ const sidInput = pickAlias(sid ?? null, optionsRecord, 'sid', 'source_id');
7099
+ if ((!sanitizedSid || sanitizedSid.length === 0) &&
7100
+ typeof sidInput === 'string') {
7101
+ sanitizedSid = sidInput.trim();
7102
+ }
7097
7103
  const idInput = pickAlias(id ?? null, optionsRecord, 'envelope_id');
7098
7104
  const traceIdInput = pickAlias(traceId ?? null, optionsRecord, 'trace_id');
7099
7105
  const toInput = pickAlias(to ?? null, optionsRecord, 'to', 'recipient', 'target', 'address');
@@ -6,6 +6,7 @@ export declare class NodeEnvelopeFactory implements EnvelopeFactory {
6
6
  createEnvelope(options: {
7
7
  frame: AllFramesUnion;
8
8
  id?: string;
9
+ sid?: string | null;
9
10
  traceId?: string;
10
11
  to?: FameEnvelope['to'] | string | null;
11
12
  capabilities?: string[] | null;
@@ -2,4 +2,4 @@
2
2
  * The package version, injected at build time.
3
3
  * @internal
4
4
  */
5
- export declare const VERSION = "0.3.9";
5
+ export declare const VERSION = "0.3.11";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naylence/runtime",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "type": "module",
5
5
  "description": "Naylence Runtime - Complete TypeScript runtime",
6
6
  "author": "Naylence Dev <naylencedev@gmail.com>",