snow-flow 3.4.39 → 3.5.0

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.
@@ -87,28 +87,25 @@
87
87
  <h2 class="text-center font-black" style="font-size: var(--font-3xl); color: var(--white); margin-bottom: var(--space-10);">Powerful Capabilities</h2>
88
88
  <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3" style="gap: var(--space-6);">
89
89
  <div class="code-block animate-fade-in-up stagger-1">
90
- <code>// Instant Deployment
91
- await snow_deploy({
92
- type: 'widget',
93
- coherence: true,
94
- rollback: true
95
- });</code>
90
+ <code># AI Chatbot Widget
91
+ snow-flow swarm "Create an intelligent chatbot widget
92
+ that helps users reset passwords, check incident
93
+ status, and request catalog items with NLU support" \
94
+ --strategy development --parallel --monitor</code>
96
95
  </div>
97
96
  <div class="code-block animate-fade-in-up stagger-2">
98
- <code>// Machine Learning
99
- await ml_train({
100
- model: 'lstm',
101
- epochs: 50,
102
- tensorflow: true
103
- });</code>
97
+ <code># Process Mining & Optimization
98
+ snow-flow swarm "Analyze our incident resolution
99
+ process, identify bottlenecks, and create automated
100
+ workflows to reduce MTTR by 40%" \
101
+ --strategy analysis --output html</code>
104
102
  </div>
105
103
  <div class="code-block animate-fade-in-up stagger-3">
106
- <code>// ES5 Validation
107
- await validate({
108
- syntax: 'es5',
109
- engine: 'rhino',
110
- strict: true
111
- });</code>
104
+ <code># Predictive ML Model
105
+ snow-flow swarm "Train an LSTM model to predict
106
+ incident priorities based on description, category
107
+ and historical patterns. Deploy as real-time API" \
108
+ --max-agents 8 --mode hierarchical</code>
112
109
  </div>
113
110
  </div>
114
111
  </div>
@@ -388,7 +385,7 @@ await validate({
388
385
  <code style="font-size: var(--font-md); line-height: var(--leading-loose);">npm install -g snow-flow
389
386
  snow-flow init
390
387
  snow-flow auth login
391
- snow-flow start --ui</code>
388
+ snow-flow swarm "Create incident dashboard widget"</code>
392
389
  </div>
393
390
 
394
391
  <div class="text-center" style="margin-top: var(--space-10);">
@@ -397,33 +394,382 @@ snow-flow start --ui</code>
397
394
  </div>
398
395
  </section>
399
396
 
400
- <!-- Examples Section -->
401
- <section id="docs" class="section">
397
+ <!-- Comprehensive Documentation Section -->
398
+ <section id="docs" class="section" style="background: var(--white);">
402
399
  <div class="container">
403
- <h2 class="text-center font-black" style="font-size: var(--font-4xl); margin-bottom: var(--space-12);">Live Examples</h2>
400
+ <h2 class="text-center font-black" style="font-size: var(--font-4xl); margin-bottom: var(--space-16);">Complete Documentation</h2>
404
401
 
405
- <div class="grid grid-cols-1 lg:grid-cols-2" style="gap: var(--space-8);">
406
- <div class="code-block animate-slide-in-left">
407
- <code>// Deploy Widget with Coherence Check
402
+ <!-- Documentation Navigation Tabs -->
403
+ <div class="tabs-container" style="margin-bottom: var(--space-12);">
404
+ <div class="tabs-nav" style="display: flex; justify-content: center; gap: var(--space-4); flex-wrap: wrap;">
405
+ <button class="tab-btn active" data-tab="quickstart" style="padding: var(--space-3) var(--space-6); background: var(--black); color: var(--white); border: none; border-radius: var(--radius-lg); cursor: pointer;">Quick Start</button>
406
+ <button class="tab-btn" data-tab="installation" style="padding: var(--space-3) var(--space-6); background: var(--gray-200); color: var(--black); border: none; border-radius: var(--radius-lg); cursor: pointer;">Installation</button>
407
+ <button class="tab-btn" data-tab="claude-setup" style="padding: var(--space-3) var(--space-6); background: var(--gray-200); color: var(--black); border: none; border-radius: var(--radius-lg); cursor: pointer;">Claude Setup</button>
408
+ <button class="tab-btn" data-tab="mcp-tools" style="padding: var(--space-3) var(--space-6); background: var(--gray-200); color: var(--black); border: none; border-radius: var(--radius-lg); cursor: pointer;">MCP Tools</button>
409
+ <button class="tab-btn" data-tab="examples" style="padding: var(--space-3) var(--space-6); background: var(--gray-200); color: var(--black); border: none; border-radius: var(--radius-lg); cursor: pointer;">Examples</button>
410
+ <button class="tab-btn" data-tab="troubleshooting" style="padding: var(--space-3) var(--space-6); background: var(--gray-200); color: var(--black); border: none; border-radius: var(--radius-lg); cursor: pointer;">Troubleshooting</button>
411
+ </div>
412
+ </div>
413
+
414
+ <!-- Tab Content -->
415
+ <div class="tabs-content">
416
+
417
+ <!-- Quick Start Tab -->
418
+ <div id="quickstart" class="tab-content active">
419
+ <div class="grid grid-cols-1 lg:grid-cols-2" style="gap: var(--space-8);">
420
+ <div>
421
+ <h3 style="font-size: var(--font-2xl); font-weight: 700; margin-bottom: var(--space-6);">🚀 Get Started in 3 Minutes</h3>
422
+ <div class="step-list">
423
+ <div class="step" style="margin-bottom: var(--space-6); padding: var(--space-4); border-left: 4px solid var(--black);">
424
+ <h4 style="font-weight: 600; margin-bottom: var(--space-2);">1. Install Snow-Flow</h4>
425
+ <div class="code-block" style="margin: var(--space-2) 0;">
426
+ <code>npm install -g snow-flow</code>
427
+ </div>
428
+ </div>
429
+ <div class="step" style="margin-bottom: var(--space-6); padding: var(--space-4); border-left: 4px solid var(--black);">
430
+ <h4 style="font-weight: 600; margin-bottom: var(--space-2);">2. Initialize Project</h4>
431
+ <div class="code-block" style="margin: var(--space-2) 0;">
432
+ <code>snow-flow init</code>
433
+ </div>
434
+ <p style="color: var(--gray-600); font-size: var(--font-sm);">Creates .env, .claude/, and CLAUDE.md files</p>
435
+ </div>
436
+ <div class="step" style="margin-bottom: var(--space-6); padding: var(--space-4); border-left: 4px solid var(--black);">
437
+ <h4 style="font-weight: 600; margin-bottom: var(--space-2);">3. Authenticate</h4>
438
+ <div class="code-block" style="margin: var(--space-2) 0;">
439
+ <code>snow-flow auth login</code>
440
+ </div>
441
+ <p style="color: var(--gray-600); font-size: var(--font-sm);">Connect to your ServiceNow instance</p>
442
+ </div>
443
+ </div>
444
+ </div>
445
+ <div>
446
+ <h3 style="font-size: var(--font-2xl); font-weight: 700; margin-bottom: var(--space-6);">🎯 Your First Swarm</h3>
447
+ <div class="code-block" style="height: 300px; overflow-y: auto;">
448
+ <code># Create a complete incident dashboard
449
+ snow-flow swarm "Build an incident dashboard widget
450
+ that shows:
451
+ - Critical incidents by priority
452
+ - Assignment group workload
453
+ - SLA breach predictions
454
+ - Auto-refresh every 30 seconds
455
+ - Click-through to incident details"
456
+
457
+ # Result: Complete widget deployed to ServiceNow
458
+ ✅ Widget: incident_dashboard_v1
459
+ ✅ Client Script: Auto-refresh & click handlers
460
+ ✅ Server Script: GlideRecord queries (ES5)
461
+ ✅ CSS: Modern responsive design
462
+ ✅ Portal Page: Added to Service Portal</code>
463
+ </div>
464
+ </div>
465
+ </div>
466
+ </div>
467
+
468
+ <!-- Installation Tab -->
469
+ <div id="installation" class="tab-content">
470
+ <h3 style="font-size: var(--font-2xl); font-weight: 700; margin-bottom: var(--space-6);">📦 Installation Guide</h3>
471
+
472
+ <div class="grid grid-cols-1 lg:grid-cols-2" style="gap: var(--space-8);">
473
+ <div>
474
+ <h4 style="font-weight: 600; margin-bottom: var(--space-4);">Prerequisites</h4>
475
+ <ul style="list-style: disc; margin-left: var(--space-6); margin-bottom: var(--space-6);">
476
+ <li>Node.js 18+ (download from nodejs.org)</li>
477
+ <li>npm 9+ (comes with Node.js)</li>
478
+ <li>ServiceNow instance with admin access</li>
479
+ <li>Claude Code desktop app</li>
480
+ </ul>
481
+
482
+ <h4 style="font-weight: 600; margin-bottom: var(--space-4);">Global Installation</h4>
483
+ <div class="code-block">
484
+ <code># Install globally via NPM
485
+ npm install -g snow-flow
486
+
487
+ # Verify installation
488
+ snow-flow --version
489
+ # Expected: 3.4.39
490
+
491
+ # Check available commands
492
+ snow-flow --help</code>
493
+ </div>
494
+ </div>
495
+
496
+ <div>
497
+ <h4 style="font-weight: 600; margin-bottom: var(--space-4);">ServiceNow OAuth Setup</h4>
498
+ <div class="step-list">
499
+ <div style="margin-bottom: var(--space-4); padding: var(--space-3); background: var(--gray-50); border-radius: var(--radius-md);">
500
+ <strong>1. Navigate to System OAuth → Application Registry</strong>
501
+ </div>
502
+ <div style="margin-bottom: var(--space-4); padding: var(--space-3); background: var(--gray-50); border-radius: var(--radius-md);">
503
+ <strong>2. Create OAuth endpoint for external clients</strong>
504
+ </div>
505
+ <div style="margin-bottom: var(--space-4); padding: var(--space-3); background: var(--gray-50); border-radius: var(--radius-md);">
506
+ <strong>3. Copy Client ID & Secret to .env</strong>
507
+ </div>
508
+ <div style="margin-bottom: var(--space-4); padding: var(--space-3); background: var(--gray-50); border-radius: var(--radius-md);">
509
+ <strong>4. Set redirect URL: http://localhost:3000/callback</strong>
510
+ </div>
511
+ </div>
512
+ </div>
513
+ </div>
514
+ </div>
515
+
516
+ <!-- Claude Setup Tab -->
517
+ <div id="claude-setup" class="tab-content">
518
+ <h3 style="font-size: var(--font-2xl); font-weight: 700; margin-bottom: var(--space-6);">🤖 Claude Code Setup</h3>
519
+
520
+ <div class="alert" style="background: var(--yellow-100); border: 1px solid var(--yellow-400); padding: var(--space-4); border-radius: var(--radius-md); margin-bottom: var(--space-6);">
521
+ <strong>⚠️ CRITICAL:</strong> Must run <code>claude login</code> first to fix "dangerously skip permissions" errors!
522
+ </div>
523
+
524
+ <div class="grid grid-cols-1 lg:grid-cols-2" style="gap: var(--space-8);">
525
+ <div>
526
+ <h4 style="font-weight: 600; margin-bottom: var(--space-4);">Step-by-Step Setup</h4>
527
+ <div class="code-block">
528
+ <code># 1. Login to Claude (REQUIRED!)
529
+ claude login
530
+
531
+ # 2. Initialize Snow-Flow project
532
+ snow-flow init
533
+
534
+ # 3. When prompted, select Y to auto-start Claude
535
+ 🚀 Would you like to start Claude Code with MCP servers? (Y/n)
536
+
537
+ # 4. If manual setup needed:
538
+ claude --mcp-config .claude/claude_desktop_config.json</code>
539
+ </div>
540
+ </div>
541
+
542
+ <div>
543
+ <h4 style="font-weight: 600; margin-bottom: var(--space-4);">What Gets Configured</h4>
544
+ <ul style="list-style: disc; margin-left: var(--space-6); margin-bottom: var(--space-6);">
545
+ <li><strong>17 MCP Servers</strong> - All ServiceNow automation tools</li>
546
+ <li><strong>200+ Tools</strong> - Every function documented</li>
547
+ <li><strong>Auto-Approval</strong> - No manual permission steps</li>
548
+ <li><strong>Error Recovery</strong> - Automatic timeout handling</li>
549
+ <li><strong>ES5 Validation</strong> - Rhino engine compatibility</li>
550
+ </ul>
551
+
552
+ <div style="background: var(--green-100); border: 1px solid var(--green-400); padding: var(--space-4); border-radius: var(--radius-md);">
553
+ <strong>✅ Success Indicators:</strong><br>
554
+ • Claude Code shows 17 MCP servers<br>
555
+ • Tools like snow_deploy available<br>
556
+ • No permission error messages
557
+ </div>
558
+ </div>
559
+ </div>
560
+ </div>
561
+
562
+ <!-- MCP Tools Tab -->
563
+ <div id="mcp-tools" class="tab-content">
564
+ <h3 style="font-size: var(--font-2xl); font-weight: 700; margin-bottom: var(--space-6);">🛠️ 200+ MCP Tools Reference</h3>
565
+
566
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3" style="gap: var(--space-6); margin-bottom: var(--space-8);">
567
+ <div class="tool-category" style="background: var(--gray-50); padding: var(--space-4); border-radius: var(--radius-lg);">
568
+ <h4 style="font-weight: 600; margin-bottom: var(--space-3);">🚀 Deployment (10 tools)</h4>
569
+ <div class="code-block" style="font-size: var(--font-xs);">
570
+ <code>snow_deploy - Create artifacts
571
+ snow_update - Update existing
572
+ snow_delete - Remove artifacts
573
+ snow_validate_deployment
574
+ snow_rollback_deployment
575
+ snow_preview_widget
576
+ snow_widget_test
577
+ snow_batch_deploy</code>
578
+ </div>
579
+ </div>
580
+
581
+ <div class="tool-category" style="background: var(--gray-50); padding: var(--space-4); border-radius: var(--radius-lg);">
582
+ <h4 style="font-weight: 600; margin-bottom: var(--space-3);">🤖 Automation (27 tools)</h4>
583
+ <div class="code-block" style="font-size: var(--font-xs);">
584
+ <code>snow_execute_background_script
585
+ snow_execute_script_with_output
586
+ snow_execute_script_sync
587
+ snow_create_scheduled_job
588
+ snow_create_atf_test
589
+ snow_execute_atf_test
590
+ + 21 more automation tools</code>
591
+ </div>
592
+ </div>
593
+
594
+ <div class="tool-category" style="background: var(--gray-50); padding: var(--space-4); border-radius: var(--radius-lg);">
595
+ <h4 style="font-weight: 600; margin-bottom: var(--space-3);">🧠 Machine Learning (6 tools)</h4>
596
+ <div class="code-block" style="font-size: var(--font-xs);">
597
+ <code>ml_train_incident_classifier
598
+ ml_predict_change_risk
599
+ ml_detect_anomalies
600
+ ml_forecast_incidents
601
+ ml_performance_analytics
602
+ ml_hybrid_recommendation</code>
603
+ </div>
604
+ </div>
605
+ </div>
606
+
607
+ <h4 style="font-weight: 600; margin-bottom: var(--space-4);">Most Used Tools</h4>
608
+ <div class="grid grid-cols-1 lg:grid-cols-2" style="gap: var(--space-6);">
609
+ <div class="code-block">
610
+ <code># Widget Deployment with Coherence Check
408
611
  await snow_deploy({
409
612
  type: 'widget',
410
- name: 'incident_dashboard',
411
- template: htmlTemplate,
412
- script: serverScript,
413
- client_script: clientScript,
414
- coherence_check: true
613
+ config: {
614
+ name: 'my_dashboard',
615
+ title: 'My Dashboard',
616
+ template: '&lt;div&gt;{{data.message}}&lt;/div&gt;',
617
+ script: 'data.message = "Hello World";',
618
+ client_script: 'function($scope) { var c = this; }'
619
+ }
620
+ });
621
+
622
+ # Background Script (ES5 ONLY!)
623
+ await snow_execute_script_with_output({
624
+ script: `
625
+ var gr = new GlideRecord('incident');
626
+ gr.addQuery('active', true);
627
+ gr.query();
628
+ gs.info('Found: ' + gr.getRowCount());
629
+ `
415
630
  });</code>
631
+ </div>
632
+
633
+ <div class="code-block">
634
+ <code># Query ServiceNow Tables
635
+ await snow_query_table({
636
+ table: 'incident',
637
+ query: 'active=true^priority=1',
638
+ fields: ['number', 'short_description'],
639
+ limit: 10
640
+ });
641
+
642
+ # Machine Learning Training
643
+ await ml_train_incident_classifier({
644
+ dataset_size: 1000,
645
+ model_type: 'lstm',
646
+ epochs: 50,
647
+ validation_split: 0.2,
648
+ use_tensorflow: true
649
+ });</code>
650
+ </div>
651
+ </div>
416
652
  </div>
417
-
418
- <div class="code-block animate-slide-in-right">
419
- <code>// Multi-Agent Swarm
420
- snow-flow swarm "Build complete
421
- incident management system" \
422
- --strategy development \
423
- --mode hierarchical \
424
- --max-agents 8 \
425
- --monitor</code>
653
+
654
+ <!-- Examples Tab -->
655
+ <div id="examples" class="tab-content">
656
+ <h3 style="font-size: var(--font-2xl); font-weight: 700; margin-bottom: var(--space-6);">💡 Real-World Examples</h3>
657
+
658
+ <div class="grid grid-cols-1 lg:grid-cols-2" style="gap: var(--space-8);">
659
+ <div class="code-block animate-slide-in-left">
660
+ <h4 style="color: var(--white); margin-bottom: var(--space-3);">Complete ServiceNow Application</h4>
661
+ <code>snow-flow swarm "Build a complete employee onboarding
662
+ application with approval workflows, automated account
663
+ provisioning, equipment requests, and dashboards for
664
+ HR managers to track onboarding progress"
665
+
666
+ ✨ Creates: Portal, Workflows, Catalog Items, Reports</code>
667
+ </div>
668
+
669
+ <div class="code-block animate-slide-in-right">
670
+ <h4 style="color: var(--white); margin-bottom: var(--space-3);">Real-Time Incident Analysis</h4>
671
+ <code>snow-flow swarm "Create a real-time incident analyzer
672
+ that uses ML to detect patterns, suggests resolutions
673
+ based on historical data, and auto-assigns to the
674
+ right team using CMDB relationships"
675
+
676
+ 🤖 Uses: TensorFlow.js, CMDB API, ML Models</code>
677
+ </div>
678
+ </div>
679
+
680
+ <div style="margin-top: var(--space-8);">
681
+ <h4 style="font-weight: 600; margin-bottom: var(--space-4);">More Examples</h4>
682
+ <div class="grid grid-cols-1 md:grid-cols-3" style="gap: var(--space-4);">
683
+ <div class="code-block" style="height: 200px;">
684
+ <code># AI Chatbot Widget
685
+ snow-flow swarm "Create an intelligent
686
+ chatbot widget that helps users reset
687
+ passwords, check incident status, and
688
+ request catalog items with NLU support"</code>
689
+ </div>
690
+ <div class="code-block" style="height: 200px;">
691
+ <code># Process Mining
692
+ snow-flow swarm "Analyze our incident
693
+ resolution process, identify bottlenecks,
694
+ and create automated workflows to reduce
695
+ MTTR by 40%"</code>
696
+ </div>
697
+ <div class="code-block" style="height: 200px;">
698
+ <code># Predictive ML Model
699
+ snow-flow swarm "Train an LSTM model to
700
+ predict incident priorities based on
701
+ description, category and historical
702
+ patterns. Deploy as real-time API"</code>
703
+ </div>
704
+ </div>
705
+ </div>
426
706
  </div>
707
+
708
+ <!-- Troubleshooting Tab -->
709
+ <div id="troubleshooting" class="tab-content">
710
+ <h3 style="font-size: var(--font-2xl); font-weight: 700; margin-bottom: var(--space-6);">🔧 Troubleshooting Guide</h3>
711
+
712
+ <div class="grid grid-cols-1 lg:grid-cols-2" style="gap: var(--space-8);">
713
+ <div>
714
+ <h4 style="font-weight: 600; margin-bottom: var(--space-4);">Common Issues</h4>
715
+
716
+ <div class="issue" style="margin-bottom: var(--space-6); padding: var(--space-4); border: 1px solid var(--red-300); border-radius: var(--radius-md);">
717
+ <h5 style="color: var(--red-600); font-weight: 600; margin-bottom: var(--space-2);">❌ Permission Errors in Claude Code</h5>
718
+ <p style="margin-bottom: var(--space-3); font-size: var(--font-sm);">"dangerously skip permissions" error</p>
719
+ <div class="code-block" style="font-size: var(--font-xs);">
720
+ <code># SOLUTION: Login first!
721
+ claude login
722
+ claude --mcp-config .claude/claude_desktop_config.json</code>
723
+ </div>
724
+ </div>
725
+
726
+ <div class="issue" style="margin-bottom: var(--space-6); padding: var(--space-4); border: 1px solid var(--red-300); border-radius: var(--radius-md);">
727
+ <h5 style="color: var(--red-600); font-weight: 600; margin-bottom: var(--space-2);">❌ ES5 Syntax Errors</h5>
728
+ <p style="margin-bottom: var(--space-3); font-size: var(--font-sm);">ServiceNow uses Rhino engine - ES6+ fails</p>
729
+ <div class="code-block" style="font-size: var(--font-xs);">
730
+ <code># ❌ WRONG: Modern JavaScript
731
+ const users = data.filter(u => u.active);
732
+
733
+ # ✅ CORRECT: ES5 Only
734
+ var users = [];
735
+ for (var i = 0; i < data.length; i++) {
736
+ if (data[i].active) users.push(data[i]);
737
+ }</code>
738
+ </div>
739
+ </div>
740
+ </div>
741
+
742
+ <div>
743
+ <h4 style="font-weight: 600; margin-bottom: var(--space-4);">Debug Commands</h4>
744
+ <div class="code-block">
745
+ <code># Test ServiceNow connection
746
+ snow-flow auth login
747
+
748
+ # Verify authentication status
749
+ snow-flow auth status
750
+
751
+ # Re-initialize if needed
752
+ snow-flow init
753
+
754
+ # Check version and help
755
+ snow-flow --version
756
+ snow-flow --help
757
+
758
+ # Enable verbose logging
759
+ export DEBUG=snow-flow:*</code>
760
+ </div>
761
+
762
+ <h4 style="font-weight: 600; margin-bottom: var(--space-4); margin-top: var(--space-6);">Quick Fixes</h4>
763
+ <ul style="list-style: disc; margin-left: var(--space-6);">
764
+ <li><strong>MCP not responding:</strong> Re-run <code>snow-flow init</code> and restart Claude Code</li>
765
+ <li><strong>Auth failed:</strong> Run <code>snow-flow auth login</code> again</li>
766
+ <li><strong>Widget deployment failed:</strong> Check ES5 syntax and field names</li>
767
+ <li><strong>Claude permission errors:</strong> Always run <code>claude login</code> first</li>
768
+ </ul>
769
+ </div>
770
+ </div>
771
+ </div>
772
+
427
773
  </div>
428
774
  </div>
429
775
  </section>
@@ -224,7 +224,7 @@ document.addEventListener('DOMContentLoaded', function() {
224
224
  });
225
225
 
226
226
  /* =========================================
227
- 8. TAB FUNCTIONALITY
227
+ 8. DOCUMENTATION TAB FUNCTIONALITY
228
228
  ========================================= */
229
229
  const tabBtns = document.querySelectorAll('.tab-btn');
230
230
  const tabContents = document.querySelectorAll('.tab-content');
@@ -244,9 +244,34 @@ document.addEventListener('DOMContentLoaded', function() {
244
244
  activeContent.classList.add('active');
245
245
  activeContent.classList.add('animate-fade-in-up');
246
246
  }
247
+
248
+ // Smooth scroll to docs section if not visible
249
+ const docsSection = document.getElementById('docs');
250
+ if (docsSection) {
251
+ const rect = docsSection.getBoundingClientRect();
252
+ if (rect.top < 0 || rect.bottom > window.innerHeight) {
253
+ docsSection.scrollIntoView({
254
+ behavior: 'smooth',
255
+ block: 'start'
256
+ });
257
+ }
258
+ }
247
259
  });
248
260
  });
249
261
 
262
+ // Initialize first tab as active
263
+ if (tabBtns.length > 0 && tabContents.length > 0) {
264
+ const firstTab = tabBtns[0];
265
+ const firstContent = document.getElementById(firstTab.getAttribute('data-tab'));
266
+
267
+ if (!firstTab.classList.contains('active')) {
268
+ firstTab.classList.add('active');
269
+ }
270
+ if (firstContent && !firstContent.classList.contains('active')) {
271
+ firstContent.classList.add('active');
272
+ }
273
+ }
274
+
250
275
  /* =========================================
251
276
  9. SEARCH FUNCTIONALITY
252
277
  ========================================= */
@@ -0,0 +1,116 @@
1
+ # Snow-Flow Website - Nginx Configuration
2
+ user nginx;
3
+ worker_processes auto;
4
+ error_log /var/log/nginx/error.log warn;
5
+ pid /var/run/nginx.pid;
6
+
7
+ events {
8
+ worker_connections 1024;
9
+ use epoll;
10
+ multi_accept on;
11
+ }
12
+
13
+ http {
14
+ include /etc/nginx/mime.types;
15
+ default_type application/octet-stream;
16
+
17
+ # Logging
18
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
19
+ '$status $body_bytes_sent "$http_referer" '
20
+ '"$http_user_agent" "$http_x_forwarded_for"';
21
+ access_log /var/log/nginx/access.log main;
22
+
23
+ # Performance
24
+ sendfile on;
25
+ tcp_nopush on;
26
+ tcp_nodelay on;
27
+ keepalive_timeout 65;
28
+ types_hash_max_size 2048;
29
+ client_max_body_size 16M;
30
+
31
+ # Gzip compression
32
+ gzip on;
33
+ gzip_vary on;
34
+ gzip_min_length 1024;
35
+ gzip_proxied any;
36
+ gzip_comp_level 6;
37
+ gzip_types
38
+ text/plain
39
+ text/css
40
+ text/xml
41
+ text/javascript
42
+ application/javascript
43
+ application/xml+rss
44
+ application/json
45
+ image/svg+xml;
46
+
47
+ # Security headers
48
+ add_header X-Frame-Options "SAMEORIGIN" always;
49
+ add_header X-XSS-Protection "1; mode=block" always;
50
+ add_header X-Content-Type-Options "nosniff" always;
51
+ add_header Referrer-Policy "no-referrer-when-downgrade" always;
52
+ add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;
53
+
54
+ server {
55
+ listen 80;
56
+ server_name _;
57
+ root /usr/share/nginx/html;
58
+ index index.html index.htm;
59
+
60
+ # Security
61
+ server_tokens off;
62
+
63
+ # Static file caching
64
+ location ~* \.(css|js|ico|png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)$ {
65
+ expires 1y;
66
+ add_header Cache-Control "public, immutable";
67
+ access_log off;
68
+ }
69
+
70
+ # HTML files - short cache
71
+ location ~* \.(html|htm)$ {
72
+ expires 1h;
73
+ add_header Cache-Control "public";
74
+ }
75
+
76
+ # Main page
77
+ location / {
78
+ try_files $uri $uri/ /index.html;
79
+
80
+ # Add security headers for HTML pages
81
+ add_header X-Frame-Options "SAMEORIGIN" always;
82
+ add_header X-XSS-Protection "1; mode=block" always;
83
+ add_header X-Content-Type-Options "nosniff" always;
84
+ }
85
+
86
+ # Health check endpoint
87
+ location /health {
88
+ access_log off;
89
+ return 200 "healthy\n";
90
+ add_header Content-Type text/plain;
91
+ }
92
+
93
+ # Robots.txt
94
+ location = /robots.txt {
95
+ log_not_found off;
96
+ access_log off;
97
+ }
98
+
99
+ # Favicon
100
+ location = /favicon.ico {
101
+ log_not_found off;
102
+ access_log off;
103
+ }
104
+
105
+ # Deny access to hidden files
106
+ location ~ /\. {
107
+ deny all;
108
+ access_log off;
109
+ log_not_found off;
110
+ }
111
+
112
+ # Error pages
113
+ error_page 404 /index.html;
114
+ error_page 500 502 503 504 /index.html;
115
+ }
116
+ }