@naylence/runtime 0.3.5-test.919 → 0.3.5-test.921
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/browser/index.cjs +20 -12
- package/dist/browser/index.mjs +20 -12
- package/dist/cjs/naylence/fame/util/logging.js +12 -5
- package/dist/cjs/naylence/fame/util/task-spawner.js +6 -5
- package/dist/cjs/version.js +2 -2
- package/dist/esm/naylence/fame/util/logging.js +12 -5
- package/dist/esm/naylence/fame/util/task-spawner.js +6 -5
- package/dist/esm/version.js +2 -2
- package/dist/node/index.cjs +20 -12
- package/dist/node/index.mjs +20 -12
- package/dist/node/node.cjs +20 -12
- package/dist/node/node.mjs +20 -12
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/browser/index.cjs
CHANGED
|
@@ -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.5-test.
|
|
101
|
+
// Generated from package.json version: 0.3.5-test.921
|
|
102
102
|
/**
|
|
103
103
|
* The package version, injected at build time.
|
|
104
104
|
* @internal
|
|
105
105
|
*/
|
|
106
|
-
const VERSION = '0.3.5-test.
|
|
106
|
+
const VERSION = '0.3.5-test.921';
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* Fame protocol specific error classes with WebSocket close codes and proper inheritance.
|
|
@@ -683,15 +683,22 @@ function getInitialLogLevel() {
|
|
|
683
683
|
return exports.LogLevel.OFF;
|
|
684
684
|
}
|
|
685
685
|
// Check FAME_LOG_LEVEL environment variable
|
|
686
|
-
|
|
686
|
+
let envLevel;
|
|
687
|
+
if (isNode && typeof process !== 'undefined') {
|
|
688
|
+
envLevel = process.env.FAME_LOG_LEVEL;
|
|
689
|
+
}
|
|
690
|
+
else if (typeof window !== 'undefined' && window.__ENV__) {
|
|
691
|
+
envLevel = window.__ENV__.FAME_LOG_LEVEL;
|
|
692
|
+
}
|
|
693
|
+
if (envLevel) {
|
|
687
694
|
try {
|
|
688
|
-
const
|
|
695
|
+
const normalized = envLevel.trim().toUpperCase();
|
|
689
696
|
// Direct enum name match (e.g., "DEBUG", "INFO")
|
|
690
|
-
if (
|
|
691
|
-
return exports.LogLevel[
|
|
697
|
+
if (normalized in exports.LogLevel) {
|
|
698
|
+
return exports.LogLevel[normalized];
|
|
692
699
|
}
|
|
693
700
|
// Try alternative mappings
|
|
694
|
-
if (
|
|
701
|
+
if (normalized === 'WARN')
|
|
695
702
|
return exports.LogLevel.WARNING;
|
|
696
703
|
}
|
|
697
704
|
catch {
|
|
@@ -1211,17 +1218,18 @@ class TaskSpawner {
|
|
|
1211
1218
|
grace_period_ms: gracePeriod,
|
|
1212
1219
|
});
|
|
1213
1220
|
const tasks = Array.from(this._tasks.values());
|
|
1214
|
-
// 1.
|
|
1221
|
+
// 1. Signal all tasks to stop immediately (abort signal)
|
|
1222
|
+
// This allows long-running loops to break out of waits/sleeps
|
|
1223
|
+
tasks.forEach((task) => task.cancel());
|
|
1224
|
+
// 2. Wait gracefully for tasks to complete their cleanup
|
|
1215
1225
|
const completed = await this._waitWithGracePeriod(tasks, gracePeriod);
|
|
1216
|
-
//
|
|
1226
|
+
// 3. Check for stragglers that didn't respond to cancellation
|
|
1217
1227
|
if (cancelHanging) {
|
|
1218
1228
|
const stillRunning = tasks.filter((task) => task.getState() === TaskState.RUNNING && !completed.has(task));
|
|
1219
1229
|
if (stillRunning.length > 0) {
|
|
1220
|
-
logger$1b.debug('
|
|
1230
|
+
logger$1b.debug('tasks_did_not_complete_within_grace_period', {
|
|
1221
1231
|
hanging_count: stillRunning.length,
|
|
1222
1232
|
});
|
|
1223
|
-
// Cancel all hanging tasks
|
|
1224
|
-
stillRunning.forEach((task) => task.cancel());
|
|
1225
1233
|
// Wait for them to finish with individual timeouts
|
|
1226
1234
|
await Promise.allSettled(stillRunning.map(async (task) => {
|
|
1227
1235
|
try {
|
package/dist/browser/index.mjs
CHANGED
|
@@ -96,12 +96,12 @@ installProcessEnvShim();
|
|
|
96
96
|
// --- END ENV SHIM ---
|
|
97
97
|
|
|
98
98
|
// This file is auto-generated during build - do not edit manually
|
|
99
|
-
// Generated from package.json version: 0.3.5-test.
|
|
99
|
+
// Generated from package.json version: 0.3.5-test.921
|
|
100
100
|
/**
|
|
101
101
|
* The package version, injected at build time.
|
|
102
102
|
* @internal
|
|
103
103
|
*/
|
|
104
|
-
const VERSION = '0.3.5-test.
|
|
104
|
+
const VERSION = '0.3.5-test.921';
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* Fame protocol specific error classes with WebSocket close codes and proper inheritance.
|
|
@@ -681,15 +681,22 @@ function getInitialLogLevel() {
|
|
|
681
681
|
return LogLevel.OFF;
|
|
682
682
|
}
|
|
683
683
|
// Check FAME_LOG_LEVEL environment variable
|
|
684
|
-
|
|
684
|
+
let envLevel;
|
|
685
|
+
if (isNode && typeof process !== 'undefined') {
|
|
686
|
+
envLevel = process.env.FAME_LOG_LEVEL;
|
|
687
|
+
}
|
|
688
|
+
else if (typeof window !== 'undefined' && window.__ENV__) {
|
|
689
|
+
envLevel = window.__ENV__.FAME_LOG_LEVEL;
|
|
690
|
+
}
|
|
691
|
+
if (envLevel) {
|
|
685
692
|
try {
|
|
686
|
-
const
|
|
693
|
+
const normalized = envLevel.trim().toUpperCase();
|
|
687
694
|
// Direct enum name match (e.g., "DEBUG", "INFO")
|
|
688
|
-
if (
|
|
689
|
-
return LogLevel[
|
|
695
|
+
if (normalized in LogLevel) {
|
|
696
|
+
return LogLevel[normalized];
|
|
690
697
|
}
|
|
691
698
|
// Try alternative mappings
|
|
692
|
-
if (
|
|
699
|
+
if (normalized === 'WARN')
|
|
693
700
|
return LogLevel.WARNING;
|
|
694
701
|
}
|
|
695
702
|
catch {
|
|
@@ -1209,17 +1216,18 @@ class TaskSpawner {
|
|
|
1209
1216
|
grace_period_ms: gracePeriod,
|
|
1210
1217
|
});
|
|
1211
1218
|
const tasks = Array.from(this._tasks.values());
|
|
1212
|
-
// 1.
|
|
1219
|
+
// 1. Signal all tasks to stop immediately (abort signal)
|
|
1220
|
+
// This allows long-running loops to break out of waits/sleeps
|
|
1221
|
+
tasks.forEach((task) => task.cancel());
|
|
1222
|
+
// 2. Wait gracefully for tasks to complete their cleanup
|
|
1213
1223
|
const completed = await this._waitWithGracePeriod(tasks, gracePeriod);
|
|
1214
|
-
//
|
|
1224
|
+
// 3. Check for stragglers that didn't respond to cancellation
|
|
1215
1225
|
if (cancelHanging) {
|
|
1216
1226
|
const stillRunning = tasks.filter((task) => task.getState() === TaskState.RUNNING && !completed.has(task));
|
|
1217
1227
|
if (stillRunning.length > 0) {
|
|
1218
|
-
logger$1b.debug('
|
|
1228
|
+
logger$1b.debug('tasks_did_not_complete_within_grace_period', {
|
|
1219
1229
|
hanging_count: stillRunning.length,
|
|
1220
1230
|
});
|
|
1221
|
-
// Cancel all hanging tasks
|
|
1222
|
-
stillRunning.forEach((task) => task.cancel());
|
|
1223
1231
|
// Wait for them to finish with individual timeouts
|
|
1224
1232
|
await Promise.allSettled(stillRunning.map(async (task) => {
|
|
1225
1233
|
try {
|
|
@@ -301,15 +301,22 @@ function getInitialLogLevel() {
|
|
|
301
301
|
return logging_types_js_1.LogLevel.OFF;
|
|
302
302
|
}
|
|
303
303
|
// Check FAME_LOG_LEVEL environment variable
|
|
304
|
-
|
|
304
|
+
let envLevel;
|
|
305
|
+
if (logging_types_js_1.isNode && typeof process !== 'undefined') {
|
|
306
|
+
envLevel = process.env.FAME_LOG_LEVEL;
|
|
307
|
+
}
|
|
308
|
+
else if (typeof window !== 'undefined' && window.__ENV__) {
|
|
309
|
+
envLevel = window.__ENV__.FAME_LOG_LEVEL;
|
|
310
|
+
}
|
|
311
|
+
if (envLevel) {
|
|
305
312
|
try {
|
|
306
|
-
const
|
|
313
|
+
const normalized = envLevel.trim().toUpperCase();
|
|
307
314
|
// Direct enum name match (e.g., "DEBUG", "INFO")
|
|
308
|
-
if (
|
|
309
|
-
return logging_types_js_1.LogLevel[
|
|
315
|
+
if (normalized in logging_types_js_1.LogLevel) {
|
|
316
|
+
return logging_types_js_1.LogLevel[normalized];
|
|
310
317
|
}
|
|
311
318
|
// Try alternative mappings
|
|
312
|
-
if (
|
|
319
|
+
if (normalized === 'WARN')
|
|
313
320
|
return logging_types_js_1.LogLevel.WARNING;
|
|
314
321
|
}
|
|
315
322
|
catch {
|
|
@@ -307,17 +307,18 @@ class TaskSpawner {
|
|
|
307
307
|
grace_period_ms: gracePeriod,
|
|
308
308
|
});
|
|
309
309
|
const tasks = Array.from(this._tasks.values());
|
|
310
|
-
// 1.
|
|
310
|
+
// 1. Signal all tasks to stop immediately (abort signal)
|
|
311
|
+
// This allows long-running loops to break out of waits/sleeps
|
|
312
|
+
tasks.forEach((task) => task.cancel());
|
|
313
|
+
// 2. Wait gracefully for tasks to complete their cleanup
|
|
311
314
|
const completed = await this._waitWithGracePeriod(tasks, gracePeriod);
|
|
312
|
-
//
|
|
315
|
+
// 3. Check for stragglers that didn't respond to cancellation
|
|
313
316
|
if (cancelHanging) {
|
|
314
317
|
const stillRunning = tasks.filter((task) => task.getState() === task_types_js_1.TaskState.RUNNING && !completed.has(task));
|
|
315
318
|
if (stillRunning.length > 0) {
|
|
316
|
-
logger.debug('
|
|
319
|
+
logger.debug('tasks_did_not_complete_within_grace_period', {
|
|
317
320
|
hanging_count: stillRunning.length,
|
|
318
321
|
});
|
|
319
|
-
// Cancel all hanging tasks
|
|
320
|
-
stillRunning.forEach((task) => task.cancel());
|
|
321
322
|
// Wait for them to finish with individual timeouts
|
|
322
323
|
await Promise.allSettled(stillRunning.map(async (task) => {
|
|
323
324
|
try {
|
package/dist/cjs/version.js
CHANGED
|
@@ -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.5-test.
|
|
3
|
+
// Generated from package.json version: 0.3.5-test.921
|
|
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.5-test.
|
|
10
|
+
exports.VERSION = '0.3.5-test.921';
|
|
@@ -287,15 +287,22 @@ function getInitialLogLevel() {
|
|
|
287
287
|
return LogLevel.OFF;
|
|
288
288
|
}
|
|
289
289
|
// Check FAME_LOG_LEVEL environment variable
|
|
290
|
-
|
|
290
|
+
let envLevel;
|
|
291
|
+
if (isNode && typeof process !== 'undefined') {
|
|
292
|
+
envLevel = process.env.FAME_LOG_LEVEL;
|
|
293
|
+
}
|
|
294
|
+
else if (typeof window !== 'undefined' && window.__ENV__) {
|
|
295
|
+
envLevel = window.__ENV__.FAME_LOG_LEVEL;
|
|
296
|
+
}
|
|
297
|
+
if (envLevel) {
|
|
291
298
|
try {
|
|
292
|
-
const
|
|
299
|
+
const normalized = envLevel.trim().toUpperCase();
|
|
293
300
|
// Direct enum name match (e.g., "DEBUG", "INFO")
|
|
294
|
-
if (
|
|
295
|
-
return LogLevel[
|
|
301
|
+
if (normalized in LogLevel) {
|
|
302
|
+
return LogLevel[normalized];
|
|
296
303
|
}
|
|
297
304
|
// Try alternative mappings
|
|
298
|
-
if (
|
|
305
|
+
if (normalized === 'WARN')
|
|
299
306
|
return LogLevel.WARNING;
|
|
300
307
|
}
|
|
301
308
|
catch {
|
|
@@ -304,17 +304,18 @@ export class TaskSpawner {
|
|
|
304
304
|
grace_period_ms: gracePeriod,
|
|
305
305
|
});
|
|
306
306
|
const tasks = Array.from(this._tasks.values());
|
|
307
|
-
// 1.
|
|
307
|
+
// 1. Signal all tasks to stop immediately (abort signal)
|
|
308
|
+
// This allows long-running loops to break out of waits/sleeps
|
|
309
|
+
tasks.forEach((task) => task.cancel());
|
|
310
|
+
// 2. Wait gracefully for tasks to complete their cleanup
|
|
308
311
|
const completed = await this._waitWithGracePeriod(tasks, gracePeriod);
|
|
309
|
-
//
|
|
312
|
+
// 3. Check for stragglers that didn't respond to cancellation
|
|
310
313
|
if (cancelHanging) {
|
|
311
314
|
const stillRunning = tasks.filter((task) => task.getState() === TaskState.RUNNING && !completed.has(task));
|
|
312
315
|
if (stillRunning.length > 0) {
|
|
313
|
-
logger.debug('
|
|
316
|
+
logger.debug('tasks_did_not_complete_within_grace_period', {
|
|
314
317
|
hanging_count: stillRunning.length,
|
|
315
318
|
});
|
|
316
|
-
// Cancel all hanging tasks
|
|
317
|
-
stillRunning.forEach((task) => task.cancel());
|
|
318
319
|
// Wait for them to finish with individual timeouts
|
|
319
320
|
await Promise.allSettled(stillRunning.map(async (task) => {
|
|
320
321
|
try {
|
package/dist/esm/version.js
CHANGED
|
@@ -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.5-test.
|
|
2
|
+
// Generated from package.json version: 0.3.5-test.921
|
|
3
3
|
/**
|
|
4
4
|
* The package version, injected at build time.
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export const VERSION = '0.3.5-test.
|
|
7
|
+
export const VERSION = '0.3.5-test.921';
|
package/dist/node/index.cjs
CHANGED
|
@@ -14,12 +14,12 @@ var websocketPlugin = require('@fastify/websocket');
|
|
|
14
14
|
var ed25519 = require('@noble/ed25519');
|
|
15
15
|
|
|
16
16
|
// This file is auto-generated during build - do not edit manually
|
|
17
|
-
// Generated from package.json version: 0.3.5-test.
|
|
17
|
+
// Generated from package.json version: 0.3.5-test.921
|
|
18
18
|
/**
|
|
19
19
|
* The package version, injected at build time.
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
22
|
-
const VERSION = '0.3.5-test.
|
|
22
|
+
const VERSION = '0.3.5-test.921';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Fame protocol specific error classes with WebSocket close codes and proper inheritance.
|
|
@@ -599,15 +599,22 @@ function getInitialLogLevel() {
|
|
|
599
599
|
return exports.LogLevel.OFF;
|
|
600
600
|
}
|
|
601
601
|
// Check FAME_LOG_LEVEL environment variable
|
|
602
|
-
|
|
602
|
+
let envLevel;
|
|
603
|
+
if (isNode && typeof process !== 'undefined') {
|
|
604
|
+
envLevel = process.env.FAME_LOG_LEVEL;
|
|
605
|
+
}
|
|
606
|
+
else if (typeof window !== 'undefined' && window.__ENV__) {
|
|
607
|
+
envLevel = window.__ENV__.FAME_LOG_LEVEL;
|
|
608
|
+
}
|
|
609
|
+
if (envLevel) {
|
|
603
610
|
try {
|
|
604
|
-
const
|
|
611
|
+
const normalized = envLevel.trim().toUpperCase();
|
|
605
612
|
// Direct enum name match (e.g., "DEBUG", "INFO")
|
|
606
|
-
if (
|
|
607
|
-
return exports.LogLevel[
|
|
613
|
+
if (normalized in exports.LogLevel) {
|
|
614
|
+
return exports.LogLevel[normalized];
|
|
608
615
|
}
|
|
609
616
|
// Try alternative mappings
|
|
610
|
-
if (
|
|
617
|
+
if (normalized === 'WARN')
|
|
611
618
|
return exports.LogLevel.WARNING;
|
|
612
619
|
}
|
|
613
620
|
catch {
|
|
@@ -1127,17 +1134,18 @@ class TaskSpawner {
|
|
|
1127
1134
|
grace_period_ms: gracePeriod,
|
|
1128
1135
|
});
|
|
1129
1136
|
const tasks = Array.from(this._tasks.values());
|
|
1130
|
-
// 1.
|
|
1137
|
+
// 1. Signal all tasks to stop immediately (abort signal)
|
|
1138
|
+
// This allows long-running loops to break out of waits/sleeps
|
|
1139
|
+
tasks.forEach((task) => task.cancel());
|
|
1140
|
+
// 2. Wait gracefully for tasks to complete their cleanup
|
|
1131
1141
|
const completed = await this._waitWithGracePeriod(tasks, gracePeriod);
|
|
1132
|
-
//
|
|
1142
|
+
// 3. Check for stragglers that didn't respond to cancellation
|
|
1133
1143
|
if (cancelHanging) {
|
|
1134
1144
|
const stillRunning = tasks.filter((task) => task.getState() === TaskState.RUNNING && !completed.has(task));
|
|
1135
1145
|
if (stillRunning.length > 0) {
|
|
1136
|
-
logger$1b.debug('
|
|
1146
|
+
logger$1b.debug('tasks_did_not_complete_within_grace_period', {
|
|
1137
1147
|
hanging_count: stillRunning.length,
|
|
1138
1148
|
});
|
|
1139
|
-
// Cancel all hanging tasks
|
|
1140
|
-
stillRunning.forEach((task) => task.cancel());
|
|
1141
1149
|
// Wait for them to finish with individual timeouts
|
|
1142
1150
|
await Promise.allSettled(stillRunning.map(async (task) => {
|
|
1143
1151
|
try {
|
package/dist/node/index.mjs
CHANGED
|
@@ -13,12 +13,12 @@ import websocketPlugin from '@fastify/websocket';
|
|
|
13
13
|
import { sign, hashes, verify } from '@noble/ed25519';
|
|
14
14
|
|
|
15
15
|
// This file is auto-generated during build - do not edit manually
|
|
16
|
-
// Generated from package.json version: 0.3.5-test.
|
|
16
|
+
// Generated from package.json version: 0.3.5-test.921
|
|
17
17
|
/**
|
|
18
18
|
* The package version, injected at build time.
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
|
-
const VERSION = '0.3.5-test.
|
|
21
|
+
const VERSION = '0.3.5-test.921';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Fame protocol specific error classes with WebSocket close codes and proper inheritance.
|
|
@@ -598,15 +598,22 @@ function getInitialLogLevel() {
|
|
|
598
598
|
return LogLevel.OFF;
|
|
599
599
|
}
|
|
600
600
|
// Check FAME_LOG_LEVEL environment variable
|
|
601
|
-
|
|
601
|
+
let envLevel;
|
|
602
|
+
if (isNode && typeof process !== 'undefined') {
|
|
603
|
+
envLevel = process.env.FAME_LOG_LEVEL;
|
|
604
|
+
}
|
|
605
|
+
else if (typeof window !== 'undefined' && window.__ENV__) {
|
|
606
|
+
envLevel = window.__ENV__.FAME_LOG_LEVEL;
|
|
607
|
+
}
|
|
608
|
+
if (envLevel) {
|
|
602
609
|
try {
|
|
603
|
-
const
|
|
610
|
+
const normalized = envLevel.trim().toUpperCase();
|
|
604
611
|
// Direct enum name match (e.g., "DEBUG", "INFO")
|
|
605
|
-
if (
|
|
606
|
-
return LogLevel[
|
|
612
|
+
if (normalized in LogLevel) {
|
|
613
|
+
return LogLevel[normalized];
|
|
607
614
|
}
|
|
608
615
|
// Try alternative mappings
|
|
609
|
-
if (
|
|
616
|
+
if (normalized === 'WARN')
|
|
610
617
|
return LogLevel.WARNING;
|
|
611
618
|
}
|
|
612
619
|
catch {
|
|
@@ -1126,17 +1133,18 @@ class TaskSpawner {
|
|
|
1126
1133
|
grace_period_ms: gracePeriod,
|
|
1127
1134
|
});
|
|
1128
1135
|
const tasks = Array.from(this._tasks.values());
|
|
1129
|
-
// 1.
|
|
1136
|
+
// 1. Signal all tasks to stop immediately (abort signal)
|
|
1137
|
+
// This allows long-running loops to break out of waits/sleeps
|
|
1138
|
+
tasks.forEach((task) => task.cancel());
|
|
1139
|
+
// 2. Wait gracefully for tasks to complete their cleanup
|
|
1130
1140
|
const completed = await this._waitWithGracePeriod(tasks, gracePeriod);
|
|
1131
|
-
//
|
|
1141
|
+
// 3. Check for stragglers that didn't respond to cancellation
|
|
1132
1142
|
if (cancelHanging) {
|
|
1133
1143
|
const stillRunning = tasks.filter((task) => task.getState() === TaskState.RUNNING && !completed.has(task));
|
|
1134
1144
|
if (stillRunning.length > 0) {
|
|
1135
|
-
logger$1b.debug('
|
|
1145
|
+
logger$1b.debug('tasks_did_not_complete_within_grace_period', {
|
|
1136
1146
|
hanging_count: stillRunning.length,
|
|
1137
1147
|
});
|
|
1138
|
-
// Cancel all hanging tasks
|
|
1139
|
-
stillRunning.forEach((task) => task.cancel());
|
|
1140
1148
|
// Wait for them to finish with individual timeouts
|
|
1141
1149
|
await Promise.allSettled(stillRunning.map(async (task) => {
|
|
1142
1150
|
try {
|
package/dist/node/node.cjs
CHANGED
|
@@ -487,15 +487,22 @@ function getInitialLogLevel() {
|
|
|
487
487
|
return exports.LogLevel.OFF;
|
|
488
488
|
}
|
|
489
489
|
// Check FAME_LOG_LEVEL environment variable
|
|
490
|
-
|
|
490
|
+
let envLevel;
|
|
491
|
+
if (isNode && typeof process !== 'undefined') {
|
|
492
|
+
envLevel = process.env.FAME_LOG_LEVEL;
|
|
493
|
+
}
|
|
494
|
+
else if (typeof window !== 'undefined' && window.__ENV__) {
|
|
495
|
+
envLevel = window.__ENV__.FAME_LOG_LEVEL;
|
|
496
|
+
}
|
|
497
|
+
if (envLevel) {
|
|
491
498
|
try {
|
|
492
|
-
const
|
|
499
|
+
const normalized = envLevel.trim().toUpperCase();
|
|
493
500
|
// Direct enum name match (e.g., "DEBUG", "INFO")
|
|
494
|
-
if (
|
|
495
|
-
return exports.LogLevel[
|
|
501
|
+
if (normalized in exports.LogLevel) {
|
|
502
|
+
return exports.LogLevel[normalized];
|
|
496
503
|
}
|
|
497
504
|
// Try alternative mappings
|
|
498
|
-
if (
|
|
505
|
+
if (normalized === 'WARN')
|
|
499
506
|
return exports.LogLevel.WARNING;
|
|
500
507
|
}
|
|
501
508
|
catch {
|
|
@@ -1015,17 +1022,18 @@ class TaskSpawner {
|
|
|
1015
1022
|
grace_period_ms: gracePeriod,
|
|
1016
1023
|
});
|
|
1017
1024
|
const tasks = Array.from(this._tasks.values());
|
|
1018
|
-
// 1.
|
|
1025
|
+
// 1. Signal all tasks to stop immediately (abort signal)
|
|
1026
|
+
// This allows long-running loops to break out of waits/sleeps
|
|
1027
|
+
tasks.forEach((task) => task.cancel());
|
|
1028
|
+
// 2. Wait gracefully for tasks to complete their cleanup
|
|
1019
1029
|
const completed = await this._waitWithGracePeriod(tasks, gracePeriod);
|
|
1020
|
-
//
|
|
1030
|
+
// 3. Check for stragglers that didn't respond to cancellation
|
|
1021
1031
|
if (cancelHanging) {
|
|
1022
1032
|
const stillRunning = tasks.filter((task) => task.getState() === TaskState.RUNNING && !completed.has(task));
|
|
1023
1033
|
if (stillRunning.length > 0) {
|
|
1024
|
-
logger$1g.debug('
|
|
1034
|
+
logger$1g.debug('tasks_did_not_complete_within_grace_period', {
|
|
1025
1035
|
hanging_count: stillRunning.length,
|
|
1026
1036
|
});
|
|
1027
|
-
// Cancel all hanging tasks
|
|
1028
|
-
stillRunning.forEach((task) => task.cancel());
|
|
1029
1037
|
// Wait for them to finish with individual timeouts
|
|
1030
1038
|
await Promise.allSettled(stillRunning.map(async (task) => {
|
|
1031
1039
|
try {
|
|
@@ -5364,12 +5372,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
|
|
|
5364
5372
|
}
|
|
5365
5373
|
|
|
5366
5374
|
// This file is auto-generated during build - do not edit manually
|
|
5367
|
-
// Generated from package.json version: 0.3.5-test.
|
|
5375
|
+
// Generated from package.json version: 0.3.5-test.921
|
|
5368
5376
|
/**
|
|
5369
5377
|
* The package version, injected at build time.
|
|
5370
5378
|
* @internal
|
|
5371
5379
|
*/
|
|
5372
|
-
const VERSION = '0.3.5-test.
|
|
5380
|
+
const VERSION = '0.3.5-test.921';
|
|
5373
5381
|
|
|
5374
5382
|
/**
|
|
5375
5383
|
* Fame errors module - Fame protocol specific error classes
|
package/dist/node/node.mjs
CHANGED
|
@@ -486,15 +486,22 @@ function getInitialLogLevel() {
|
|
|
486
486
|
return LogLevel.OFF;
|
|
487
487
|
}
|
|
488
488
|
// Check FAME_LOG_LEVEL environment variable
|
|
489
|
-
|
|
489
|
+
let envLevel;
|
|
490
|
+
if (isNode && typeof process !== 'undefined') {
|
|
491
|
+
envLevel = process.env.FAME_LOG_LEVEL;
|
|
492
|
+
}
|
|
493
|
+
else if (typeof window !== 'undefined' && window.__ENV__) {
|
|
494
|
+
envLevel = window.__ENV__.FAME_LOG_LEVEL;
|
|
495
|
+
}
|
|
496
|
+
if (envLevel) {
|
|
490
497
|
try {
|
|
491
|
-
const
|
|
498
|
+
const normalized = envLevel.trim().toUpperCase();
|
|
492
499
|
// Direct enum name match (e.g., "DEBUG", "INFO")
|
|
493
|
-
if (
|
|
494
|
-
return LogLevel[
|
|
500
|
+
if (normalized in LogLevel) {
|
|
501
|
+
return LogLevel[normalized];
|
|
495
502
|
}
|
|
496
503
|
// Try alternative mappings
|
|
497
|
-
if (
|
|
504
|
+
if (normalized === 'WARN')
|
|
498
505
|
return LogLevel.WARNING;
|
|
499
506
|
}
|
|
500
507
|
catch {
|
|
@@ -1014,17 +1021,18 @@ class TaskSpawner {
|
|
|
1014
1021
|
grace_period_ms: gracePeriod,
|
|
1015
1022
|
});
|
|
1016
1023
|
const tasks = Array.from(this._tasks.values());
|
|
1017
|
-
// 1.
|
|
1024
|
+
// 1. Signal all tasks to stop immediately (abort signal)
|
|
1025
|
+
// This allows long-running loops to break out of waits/sleeps
|
|
1026
|
+
tasks.forEach((task) => task.cancel());
|
|
1027
|
+
// 2. Wait gracefully for tasks to complete their cleanup
|
|
1018
1028
|
const completed = await this._waitWithGracePeriod(tasks, gracePeriod);
|
|
1019
|
-
//
|
|
1029
|
+
// 3. Check for stragglers that didn't respond to cancellation
|
|
1020
1030
|
if (cancelHanging) {
|
|
1021
1031
|
const stillRunning = tasks.filter((task) => task.getState() === TaskState.RUNNING && !completed.has(task));
|
|
1022
1032
|
if (stillRunning.length > 0) {
|
|
1023
|
-
logger$1g.debug('
|
|
1033
|
+
logger$1g.debug('tasks_did_not_complete_within_grace_period', {
|
|
1024
1034
|
hanging_count: stillRunning.length,
|
|
1025
1035
|
});
|
|
1026
|
-
// Cancel all hanging tasks
|
|
1027
|
-
stillRunning.forEach((task) => task.cancel());
|
|
1028
1036
|
// Wait for them to finish with individual timeouts
|
|
1029
1037
|
await Promise.allSettled(stillRunning.map(async (task) => {
|
|
1030
1038
|
try {
|
|
@@ -5363,12 +5371,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
|
|
|
5363
5371
|
}
|
|
5364
5372
|
|
|
5365
5373
|
// This file is auto-generated during build - do not edit manually
|
|
5366
|
-
// Generated from package.json version: 0.3.5-test.
|
|
5374
|
+
// Generated from package.json version: 0.3.5-test.921
|
|
5367
5375
|
/**
|
|
5368
5376
|
* The package version, injected at build time.
|
|
5369
5377
|
* @internal
|
|
5370
5378
|
*/
|
|
5371
|
-
const VERSION = '0.3.5-test.
|
|
5379
|
+
const VERSION = '0.3.5-test.921';
|
|
5372
5380
|
|
|
5373
5381
|
/**
|
|
5374
5382
|
* Fame errors module - Fame protocol specific error classes
|
package/dist/types/version.d.ts
CHANGED