snow-flow 1.3.2 → 1.3.3

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.
@@ -26,7 +26,7 @@ const ConfigSchema = zod_1.z.object({
26
26
  agents: zod_1.z.object({
27
27
  queen: zod_1.z.object({
28
28
  maxWorkerAgents: zod_1.z.number().min(1).max(50).default(10),
29
- spawnTimeout: zod_1.z.number().min(5000).default(parseInt(process.env.SNOW_FLOW_SPAWN_TIMEOUT || '30000')),
29
+ spawnTimeout: zod_1.z.number().min(5000).default(30000),
30
30
  coordinationInterval: zod_1.z.number().min(1000).default(5000),
31
31
  decisionThreshold: zod_1.z.number().min(0).max(1).default(0.7),
32
32
  retryAttempts: zod_1.z.number().min(1).max(10).default(3),
@@ -94,33 +94,33 @@ const ConfigSchema = zod_1.z.object({
94
94
  servers: zod_1.z.object({
95
95
  deployment: zod_1.z.object({
96
96
  enabled: zod_1.z.boolean().default(true),
97
- port: zod_1.z.number().min(3000).max(65535).default(parseInt(process.env.MCP_DEPLOYMENT_PORT || '3001')),
97
+ port: zod_1.z.number().min(3000).max(65535).default(3001),
98
98
  host: zod_1.z.string().default('localhost'),
99
99
  }),
100
100
  intelligent: zod_1.z.object({
101
101
  enabled: zod_1.z.boolean().default(true),
102
- port: zod_1.z.number().min(3000).max(65535).default(parseInt(process.env.MCP_INTELLIGENT_PORT || '3002')),
102
+ port: zod_1.z.number().min(3000).max(65535).default(3002),
103
103
  host: zod_1.z.string().default('localhost'),
104
104
  }),
105
105
  operations: zod_1.z.object({
106
106
  enabled: zod_1.z.boolean().default(true),
107
- port: zod_1.z.number().min(3000).max(65535).default(parseInt(process.env.MCP_OPERATIONS_PORT || '3003')),
107
+ port: zod_1.z.number().min(3000).max(65535).default(3003),
108
108
  host: zod_1.z.string().default('localhost'),
109
109
  }),
110
110
  flowComposer: zod_1.z.object({
111
111
  enabled: zod_1.z.boolean().default(true),
112
- port: zod_1.z.number().min(3000).max(65535).default(parseInt(process.env.MCP_FLOW_COMPOSER_PORT || '3004')),
112
+ port: zod_1.z.number().min(3000).max(65535).default(3004),
113
113
  host: zod_1.z.string().default('localhost'),
114
114
  }),
115
115
  platformDevelopment: zod_1.z.object({
116
116
  enabled: zod_1.z.boolean().default(true),
117
- port: zod_1.z.number().min(3000).max(65535).default(parseInt(process.env.MCP_PLATFORM_DEV_PORT || '3005')),
117
+ port: zod_1.z.number().min(3000).max(65535).default(3005),
118
118
  host: zod_1.z.string().default('localhost'),
119
119
  }),
120
120
  }),
121
121
  transport: zod_1.z.object({
122
122
  type: zod_1.z.enum(['stdio', 'http', 'websocket']).default('stdio'),
123
- timeout: zod_1.z.number().min(5000).default(parseInt(process.env.MCP_TIMEOUT || '30000')),
123
+ timeout: zod_1.z.number().min(5000).default(30000),
124
124
  retryAttempts: zod_1.z.number().min(1).max(10).default(3),
125
125
  retryDelay: zod_1.z.number().min(1000).default(5000),
126
126
  }),
@@ -151,7 +151,7 @@ const ConfigSchema = zod_1.z.object({
151
151
  }),
152
152
  oauth: zod_1.z.object({
153
153
  redirectHost: zod_1.z.string().default('localhost'),
154
- redirectPort: zod_1.z.number().min(3000).max(65535).default(parseInt(process.env.SNOW_REDIRECT_PORT || '3005')),
154
+ redirectPort: zod_1.z.number().min(3000).max(65535).default(3005),
155
155
  redirectPath: zod_1.z.string().default('/callback'),
156
156
  }),
157
157
  }),
@@ -342,17 +342,26 @@ class SnowFlowConfig {
342
342
  }
343
343
  if (process.env.SNOW_REQUEST_TIMEOUT) {
344
344
  env.servicenow = env.servicenow || {};
345
- env.servicenow.timeout = parseInt(process.env.SNOW_REQUEST_TIMEOUT);
345
+ const value = parseInt(process.env.SNOW_REQUEST_TIMEOUT);
346
+ if (!isNaN(value)) {
347
+ env.servicenow.timeout = value;
348
+ }
346
349
  }
347
350
  if (process.env.SNOW_MAX_RETRIES) {
348
351
  env.servicenow = env.servicenow || {};
349
352
  env.servicenow.retryConfig = env.servicenow.retryConfig || {};
350
- env.servicenow.retryConfig.maxRetries = parseInt(process.env.SNOW_MAX_RETRIES);
353
+ const value = parseInt(process.env.SNOW_MAX_RETRIES);
354
+ if (!isNaN(value)) {
355
+ env.servicenow.retryConfig.maxRetries = value;
356
+ }
351
357
  }
352
358
  if (process.env.SNOW_RETRY_DELAY) {
353
359
  env.servicenow = env.servicenow || {};
354
360
  env.servicenow.retryConfig = env.servicenow.retryConfig || {};
355
- env.servicenow.retryConfig.retryDelay = parseInt(process.env.SNOW_RETRY_DELAY);
361
+ const value = parseInt(process.env.SNOW_RETRY_DELAY);
362
+ if (!isNaN(value)) {
363
+ env.servicenow.retryConfig.retryDelay = value;
364
+ }
356
365
  }
357
366
  if (process.env.SNOW_REDIRECT_HOST) {
358
367
  env.servicenow = env.servicenow || {};
@@ -362,7 +371,10 @@ class SnowFlowConfig {
362
371
  if (process.env.SNOW_REDIRECT_PORT) {
363
372
  env.servicenow = env.servicenow || {};
364
373
  env.servicenow.oauth = env.servicenow.oauth || {};
365
- env.servicenow.oauth.redirectPort = parseInt(process.env.SNOW_REDIRECT_PORT);
374
+ const value = parseInt(process.env.SNOW_REDIRECT_PORT);
375
+ if (!isNaN(value)) {
376
+ env.servicenow.oauth.redirectPort = value;
377
+ }
366
378
  }
367
379
  if (process.env.SNOW_REDIRECT_PATH) {
368
380
  env.servicenow = env.servicenow || {};
@@ -384,83 +396,128 @@ class SnowFlowConfig {
384
396
  }
385
397
  if (process.env.SNOW_FLOW_MAX_CONCURRENT_OPS) {
386
398
  env.system = env.system || {};
387
- env.system.maxConcurrentOperations = parseInt(process.env.SNOW_FLOW_MAX_CONCURRENT_OPS);
399
+ const value = parseInt(process.env.SNOW_FLOW_MAX_CONCURRENT_OPS);
400
+ if (!isNaN(value)) {
401
+ env.system.maxConcurrentOperations = value;
402
+ }
388
403
  }
389
404
  if (process.env.SNOW_FLOW_SESSION_TIMEOUT) {
390
405
  env.system = env.system || {};
391
- env.system.sessionTimeout = parseInt(process.env.SNOW_FLOW_SESSION_TIMEOUT);
406
+ const value = parseInt(process.env.SNOW_FLOW_SESSION_TIMEOUT);
407
+ if (!isNaN(value)) {
408
+ env.system.sessionTimeout = value;
409
+ }
392
410
  }
393
411
  // Agent configuration
394
412
  if (process.env.SNOW_FLOW_MAX_WORKER_AGENTS) {
395
413
  env.agents = env.agents || {};
396
414
  env.agents.queen = env.agents.queen || {};
397
- env.agents.queen.maxWorkerAgents = parseInt(process.env.SNOW_FLOW_MAX_WORKER_AGENTS);
415
+ const value = parseInt(process.env.SNOW_FLOW_MAX_WORKER_AGENTS);
416
+ if (!isNaN(value)) {
417
+ env.agents.queen.maxWorkerAgents = value;
418
+ }
398
419
  }
399
420
  if (process.env.SNOW_FLOW_SPAWN_TIMEOUT) {
400
421
  env.agents = env.agents || {};
401
422
  env.agents.queen = env.agents.queen || {};
402
- env.agents.queen.spawnTimeout = parseInt(process.env.SNOW_FLOW_SPAWN_TIMEOUT);
423
+ const value = parseInt(process.env.SNOW_FLOW_SPAWN_TIMEOUT);
424
+ if (!isNaN(value)) {
425
+ env.agents.queen.spawnTimeout = value;
426
+ }
403
427
  }
404
428
  if (process.env.SNOW_FLOW_COORDINATION_INTERVAL) {
405
429
  env.agents = env.agents || {};
406
430
  env.agents.queen = env.agents.queen || {};
407
- env.agents.queen.coordinationInterval = parseInt(process.env.SNOW_FLOW_COORDINATION_INTERVAL);
431
+ const value = parseInt(process.env.SNOW_FLOW_COORDINATION_INTERVAL);
432
+ if (!isNaN(value)) {
433
+ env.agents.queen.coordinationInterval = value;
434
+ }
408
435
  }
409
436
  if (process.env.SNOW_FLOW_RETRY_ATTEMPTS) {
410
437
  env.agents = env.agents || {};
411
438
  env.agents.queen = env.agents.queen || {};
412
- env.agents.queen.retryAttempts = parseInt(process.env.SNOW_FLOW_RETRY_ATTEMPTS);
439
+ const value = parseInt(process.env.SNOW_FLOW_RETRY_ATTEMPTS);
440
+ if (!isNaN(value)) {
441
+ env.agents.queen.retryAttempts = value;
442
+ }
413
443
  }
414
444
  if (process.env.SNOW_FLOW_HEARTBEAT_INTERVAL) {
415
445
  env.agents = env.agents || {};
416
446
  env.agents.worker = env.agents.worker || {};
417
- env.agents.worker.heartbeatInterval = parseInt(process.env.SNOW_FLOW_HEARTBEAT_INTERVAL);
447
+ const value = parseInt(process.env.SNOW_FLOW_HEARTBEAT_INTERVAL);
448
+ if (!isNaN(value)) {
449
+ env.agents.worker.heartbeatInterval = value;
450
+ }
418
451
  }
419
452
  if (process.env.SNOW_FLOW_TASK_TIMEOUT) {
420
453
  env.agents = env.agents || {};
421
454
  env.agents.worker = env.agents.worker || {};
422
- env.agents.worker.taskTimeout = parseInt(process.env.SNOW_FLOW_TASK_TIMEOUT);
455
+ const value = parseInt(process.env.SNOW_FLOW_TASK_TIMEOUT);
456
+ if (!isNaN(value)) {
457
+ env.agents.worker.taskTimeout = value;
458
+ }
423
459
  }
424
460
  if (process.env.SNOW_FLOW_MAX_MEMORY_USAGE) {
425
461
  env.agents = env.agents || {};
426
462
  env.agents.worker = env.agents.worker || {};
427
- env.agents.worker.maxMemoryUsage = parseInt(process.env.SNOW_FLOW_MAX_MEMORY_USAGE);
463
+ const value = parseInt(process.env.SNOW_FLOW_MAX_MEMORY_USAGE);
464
+ if (!isNaN(value)) {
465
+ env.agents.worker.maxMemoryUsage = value;
466
+ }
428
467
  }
429
468
  if (process.env.SNOW_FLOW_AUTO_SHUTDOWN_IDLE) {
430
469
  env.agents = env.agents || {};
431
470
  env.agents.worker = env.agents.worker || {};
432
- env.agents.worker.autoShutdownIdle = parseInt(process.env.SNOW_FLOW_AUTO_SHUTDOWN_IDLE);
471
+ const value = parseInt(process.env.SNOW_FLOW_AUTO_SHUTDOWN_IDLE);
472
+ if (!isNaN(value)) {
473
+ env.agents.worker.autoShutdownIdle = value;
474
+ }
433
475
  }
434
476
  // MCP server configuration
435
477
  if (process.env.MCP_DEPLOYMENT_PORT) {
436
478
  env.mcp = env.mcp || {};
437
479
  env.mcp.servers = env.mcp.servers || {};
438
480
  env.mcp.servers.deployment = env.mcp.servers.deployment || {};
439
- env.mcp.servers.deployment.port = parseInt(process.env.MCP_DEPLOYMENT_PORT);
481
+ const value = parseInt(process.env.MCP_DEPLOYMENT_PORT);
482
+ if (!isNaN(value)) {
483
+ env.mcp.servers.deployment.port = value;
484
+ }
440
485
  }
441
486
  if (process.env.MCP_INTELLIGENT_PORT) {
442
487
  env.mcp = env.mcp || {};
443
488
  env.mcp.servers = env.mcp.servers || {};
444
489
  env.mcp.servers.intelligent = env.mcp.servers.intelligent || {};
445
- env.mcp.servers.intelligent.port = parseInt(process.env.MCP_INTELLIGENT_PORT);
490
+ const value = parseInt(process.env.MCP_INTELLIGENT_PORT);
491
+ if (!isNaN(value)) {
492
+ env.mcp.servers.intelligent.port = value;
493
+ }
446
494
  }
447
495
  if (process.env.MCP_OPERATIONS_PORT) {
448
496
  env.mcp = env.mcp || {};
449
497
  env.mcp.servers = env.mcp.servers || {};
450
498
  env.mcp.servers.operations = env.mcp.servers.operations || {};
451
- env.mcp.servers.operations.port = parseInt(process.env.MCP_OPERATIONS_PORT);
499
+ const value = parseInt(process.env.MCP_OPERATIONS_PORT);
500
+ if (!isNaN(value)) {
501
+ env.mcp.servers.operations.port = value;
502
+ }
452
503
  }
453
504
  if (process.env.MCP_FLOW_COMPOSER_PORT) {
454
505
  env.mcp = env.mcp || {};
455
506
  env.mcp.servers = env.mcp.servers || {};
456
507
  env.mcp.servers.flowComposer = env.mcp.servers.flowComposer || {};
457
- env.mcp.servers.flowComposer.port = parseInt(process.env.MCP_FLOW_COMPOSER_PORT);
508
+ const value = parseInt(process.env.MCP_FLOW_COMPOSER_PORT);
509
+ if (!isNaN(value)) {
510
+ env.mcp.servers.flowComposer.port = value;
511
+ }
458
512
  }
459
513
  if (process.env.MCP_PLATFORM_DEV_PORT) {
460
514
  env.mcp = env.mcp || {};
461
515
  env.mcp.servers = env.mcp.servers || {};
462
516
  env.mcp.servers.platformDevelopment = env.mcp.servers.platformDevelopment || {};
463
- env.mcp.servers.platformDevelopment.port = parseInt(process.env.MCP_PLATFORM_DEV_PORT);
517
+ const value = parseInt(process.env.MCP_PLATFORM_DEV_PORT);
518
+ if (!isNaN(value)) {
519
+ env.mcp.servers.platformDevelopment.port = value;
520
+ }
464
521
  }
465
522
  if (process.env.MCP_HOST) {
466
523
  env.mcp = env.mcp || {};
@@ -474,22 +531,34 @@ class SnowFlowConfig {
474
531
  if (process.env.MCP_TIMEOUT) {
475
532
  env.mcp = env.mcp || {};
476
533
  env.mcp.transport = env.mcp.transport || {};
477
- env.mcp.transport.timeout = parseInt(process.env.MCP_TIMEOUT);
534
+ const value = parseInt(process.env.MCP_TIMEOUT);
535
+ if (!isNaN(value)) {
536
+ env.mcp.transport.timeout = value;
537
+ }
478
538
  }
479
539
  if (process.env.MCP_RETRY_ATTEMPTS) {
480
540
  env.mcp = env.mcp || {};
481
541
  env.mcp.transport = env.mcp.transport || {};
482
- env.mcp.transport.retryAttempts = parseInt(process.env.MCP_RETRY_ATTEMPTS);
542
+ const value = parseInt(process.env.MCP_RETRY_ATTEMPTS);
543
+ if (!isNaN(value)) {
544
+ env.mcp.transport.retryAttempts = value;
545
+ }
483
546
  }
484
547
  if (process.env.MCP_RETRY_DELAY) {
485
548
  env.mcp = env.mcp || {};
486
549
  env.mcp.transport = env.mcp.transport || {};
487
- env.mcp.transport.retryDelay = parseInt(process.env.MCP_RETRY_DELAY);
550
+ const value = parseInt(process.env.MCP_RETRY_DELAY);
551
+ if (!isNaN(value)) {
552
+ env.mcp.transport.retryDelay = value;
553
+ }
488
554
  }
489
555
  if (process.env.MCP_AUTH_TOKEN_EXPIRY) {
490
556
  env.mcp = env.mcp || {};
491
557
  env.mcp.authentication = env.mcp.authentication || {};
492
- env.mcp.authentication.tokenExpiry = parseInt(process.env.MCP_AUTH_TOKEN_EXPIRY);
558
+ const value = parseInt(process.env.MCP_AUTH_TOKEN_EXPIRY);
559
+ if (!isNaN(value)) {
560
+ env.mcp.authentication.tokenExpiry = value;
561
+ }
493
562
  }
494
563
  // Memory system configuration
495
564
  if (process.env.SNOW_FLOW_DB_PATH) {
@@ -504,42 +573,66 @@ class SnowFlowConfig {
504
573
  if (process.env.SNOW_FLOW_CACHE_MAX_SIZE) {
505
574
  env.memory = env.memory || {};
506
575
  env.memory.cache = env.memory.cache || {};
507
- env.memory.cache.maxSize = parseInt(process.env.SNOW_FLOW_CACHE_MAX_SIZE);
576
+ const value = parseInt(process.env.SNOW_FLOW_CACHE_MAX_SIZE);
577
+ if (!isNaN(value)) {
578
+ env.memory.cache.maxSize = value;
579
+ }
508
580
  }
509
581
  if (process.env.SNOW_FLOW_CACHE_TTL) {
510
582
  env.memory = env.memory || {};
511
583
  env.memory.cache = env.memory.cache || {};
512
- env.memory.cache.ttl = parseInt(process.env.SNOW_FLOW_CACHE_TTL);
584
+ const value = parseInt(process.env.SNOW_FLOW_CACHE_TTL);
585
+ if (!isNaN(value)) {
586
+ env.memory.cache.ttl = value;
587
+ }
513
588
  }
514
589
  if (process.env.SNOW_FLOW_DEFAULT_TTL) {
515
590
  env.memory = env.memory || {};
516
591
  env.memory.ttl = env.memory.ttl || {};
517
- env.memory.ttl.default = parseInt(process.env.SNOW_FLOW_DEFAULT_TTL);
592
+ const value = parseInt(process.env.SNOW_FLOW_DEFAULT_TTL);
593
+ if (!isNaN(value)) {
594
+ env.memory.ttl.default = value;
595
+ }
518
596
  }
519
597
  if (process.env.SNOW_FLOW_SESSION_TTL) {
520
598
  env.memory = env.memory || {};
521
599
  env.memory.ttl = env.memory.ttl || {};
522
- env.memory.ttl.session = parseInt(process.env.SNOW_FLOW_SESSION_TTL);
600
+ const value = parseInt(process.env.SNOW_FLOW_SESSION_TTL);
601
+ if (!isNaN(value)) {
602
+ env.memory.ttl.session = value;
603
+ }
523
604
  }
524
605
  if (process.env.SNOW_FLOW_ARTIFACT_TTL) {
525
606
  env.memory = env.memory || {};
526
607
  env.memory.ttl = env.memory.ttl || {};
527
- env.memory.ttl.artifact = parseInt(process.env.SNOW_FLOW_ARTIFACT_TTL);
608
+ const value = parseInt(process.env.SNOW_FLOW_ARTIFACT_TTL);
609
+ if (!isNaN(value)) {
610
+ env.memory.ttl.artifact = value;
611
+ }
528
612
  }
529
613
  if (process.env.SNOW_FLOW_METRIC_TTL) {
530
614
  env.memory = env.memory || {};
531
615
  env.memory.ttl = env.memory.ttl || {};
532
- env.memory.ttl.metric = parseInt(process.env.SNOW_FLOW_METRIC_TTL);
616
+ const value = parseInt(process.env.SNOW_FLOW_METRIC_TTL);
617
+ if (!isNaN(value)) {
618
+ env.memory.ttl.metric = value;
619
+ }
533
620
  }
534
621
  if (process.env.SNOW_FLOW_CLEANUP_INTERVAL) {
535
622
  env.memory = env.memory || {};
536
623
  env.memory.cleanup = env.memory.cleanup || {};
537
- env.memory.cleanup.interval = parseInt(process.env.SNOW_FLOW_CLEANUP_INTERVAL);
624
+ const value = parseInt(process.env.SNOW_FLOW_CLEANUP_INTERVAL);
625
+ if (!isNaN(value)) {
626
+ env.memory.cleanup.interval = value;
627
+ }
538
628
  }
539
629
  if (process.env.SNOW_FLOW_RETENTION_DAYS) {
540
630
  env.memory = env.memory || {};
541
631
  env.memory.cleanup = env.memory.cleanup || {};
542
- env.memory.cleanup.retentionDays = parseInt(process.env.SNOW_FLOW_RETENTION_DAYS);
632
+ const value = parseInt(process.env.SNOW_FLOW_RETENTION_DAYS);
633
+ if (!isNaN(value)) {
634
+ env.memory.cleanup.retentionDays = value;
635
+ }
543
636
  }
544
637
  // Monitoring configuration
545
638
  if (process.env.SNOW_FLOW_PERFORMANCE_ENABLED) {
@@ -550,40 +643,61 @@ class SnowFlowConfig {
550
643
  if (process.env.SNOW_FLOW_SAMPLE_RATE) {
551
644
  env.monitoring = env.monitoring || {};
552
645
  env.monitoring.performance = env.monitoring.performance || {};
553
- env.monitoring.performance.sampleRate = parseFloat(process.env.SNOW_FLOW_SAMPLE_RATE);
646
+ const floatValue = parseFloat(process.env.SNOW_FLOW_SAMPLE_RATE);
647
+ if (!isNaN(floatValue)) {
648
+ env.monitoring.performance.sampleRate = floatValue;
649
+ }
554
650
  }
555
651
  if (process.env.SNOW_FLOW_METRICS_RETENTION) {
556
652
  env.monitoring = env.monitoring || {};
557
653
  env.monitoring.performance = env.monitoring.performance || {};
558
- env.monitoring.performance.metricsRetention = parseInt(process.env.SNOW_FLOW_METRICS_RETENTION);
654
+ const value = parseInt(process.env.SNOW_FLOW_METRICS_RETENTION);
655
+ if (!isNaN(value)) {
656
+ env.monitoring.performance.metricsRetention = value;
657
+ }
559
658
  }
560
659
  if (process.env.SNOW_FLOW_AGGREGATION_INTERVAL) {
561
660
  env.monitoring = env.monitoring || {};
562
661
  env.monitoring.performance = env.monitoring.performance || {};
563
- env.monitoring.performance.aggregationInterval = parseInt(process.env.SNOW_FLOW_AGGREGATION_INTERVAL);
662
+ const value = parseInt(process.env.SNOW_FLOW_AGGREGATION_INTERVAL);
663
+ if (!isNaN(value)) {
664
+ env.monitoring.performance.aggregationInterval = value;
665
+ }
564
666
  }
565
667
  if (process.env.SNOW_FLOW_HEALTH_CHECK_INTERVAL) {
566
668
  env.monitoring = env.monitoring || {};
567
669
  env.monitoring.health = env.monitoring.health || {};
568
- env.monitoring.health.checkInterval = parseInt(process.env.SNOW_FLOW_HEALTH_CHECK_INTERVAL);
670
+ const value = parseInt(process.env.SNOW_FLOW_HEALTH_CHECK_INTERVAL);
671
+ if (!isNaN(value)) {
672
+ env.monitoring.health.checkInterval = value;
673
+ }
569
674
  }
570
675
  if (process.env.SNOW_FLOW_MEMORY_THRESHOLD) {
571
676
  env.monitoring = env.monitoring || {};
572
677
  env.monitoring.health = env.monitoring.health || {};
573
678
  env.monitoring.health.thresholds = env.monitoring.health.thresholds || {};
574
- env.monitoring.health.thresholds.memoryUsage = parseFloat(process.env.SNOW_FLOW_MEMORY_THRESHOLD);
679
+ const floatValue = parseFloat(process.env.SNOW_FLOW_MEMORY_THRESHOLD);
680
+ if (!isNaN(floatValue)) {
681
+ env.monitoring.health.thresholds.memoryUsage = floatValue;
682
+ }
575
683
  }
576
684
  if (process.env.SNOW_FLOW_CPU_THRESHOLD) {
577
685
  env.monitoring = env.monitoring || {};
578
686
  env.monitoring.health = env.monitoring.health || {};
579
687
  env.monitoring.health.thresholds = env.monitoring.health.thresholds || {};
580
- env.monitoring.health.thresholds.cpuUsage = parseFloat(process.env.SNOW_FLOW_CPU_THRESHOLD);
688
+ const floatValue = parseFloat(process.env.SNOW_FLOW_CPU_THRESHOLD);
689
+ if (!isNaN(floatValue)) {
690
+ env.monitoring.health.thresholds.cpuUsage = floatValue;
691
+ }
581
692
  }
582
693
  if (process.env.SNOW_FLOW_ERROR_RATE_THRESHOLD) {
583
694
  env.monitoring = env.monitoring || {};
584
695
  env.monitoring.health = env.monitoring.health || {};
585
696
  env.monitoring.health.thresholds = env.monitoring.health.thresholds || {};
586
- env.monitoring.health.thresholds.errorRate = parseFloat(process.env.SNOW_FLOW_ERROR_RATE_THRESHOLD);
697
+ const floatValue = parseFloat(process.env.SNOW_FLOW_ERROR_RATE_THRESHOLD);
698
+ if (!isNaN(floatValue)) {
699
+ env.monitoring.health.thresholds.errorRate = floatValue;
700
+ }
587
701
  }
588
702
  if (process.env.SNOW_FLOW_WEBHOOK_URL) {
589
703
  env.monitoring = env.monitoring || {};
@@ -599,17 +713,26 @@ class SnowFlowConfig {
599
713
  if (process.env.SNOW_FLOW_RESPONSE_TIME_THRESHOLD) {
600
714
  env.health = env.health || {};
601
715
  env.health.thresholds = env.health.thresholds || {};
602
- env.health.thresholds.responseTime = parseInt(process.env.SNOW_FLOW_RESPONSE_TIME_THRESHOLD);
716
+ const value = parseInt(process.env.SNOW_FLOW_RESPONSE_TIME_THRESHOLD);
717
+ if (!isNaN(value)) {
718
+ env.health.thresholds.responseTime = value;
719
+ }
603
720
  }
604
721
  if (process.env.SNOW_FLOW_HEALTH_MEMORY_THRESHOLD) {
605
722
  env.health = env.health || {};
606
723
  env.health.thresholds = env.health.thresholds || {};
607
- env.health.thresholds.memoryUsage = parseInt(process.env.SNOW_FLOW_HEALTH_MEMORY_THRESHOLD);
724
+ const value = parseInt(process.env.SNOW_FLOW_HEALTH_MEMORY_THRESHOLD);
725
+ if (!isNaN(value)) {
726
+ env.health.thresholds.memoryUsage = value;
727
+ }
608
728
  }
609
729
  if (process.env.SNOW_FLOW_QUEUE_SIZE_THRESHOLD) {
610
730
  env.health = env.health || {};
611
731
  env.health.thresholds = env.health.thresholds || {};
612
- env.health.thresholds.queueSize = parseInt(process.env.SNOW_FLOW_QUEUE_SIZE_THRESHOLD);
732
+ const value = parseInt(process.env.SNOW_FLOW_QUEUE_SIZE_THRESHOLD);
733
+ if (!isNaN(value)) {
734
+ env.health.thresholds.queueSize = value;
735
+ }
613
736
  }
614
737
  // Feature flags
615
738
  if (process.env.SNOW_FLOW_AUTO_PERMISSIONS) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "ServiceNow Queen Agent - Hive-Mind Intelligence for ServiceNow Development inspired by claude-flow. Transform complex workflows into elegant one-command orchestration.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",