Skip to content

mimelator/wavelength-lore-prototype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Wavelength-Lore

The Lore Site for the Wavelength Canon

Status: Testing new pre-increment version deployment strategy ๐Ÿš€

๐Ÿ›ก๏ธ Package.json Protection System

โœ… AUTOMATED PROTECTION ACTIVE

Comprehensive protection against package.json corruption with:

  • Automated Backups: Timestamped backups before risky operations
  • Integrity Validation: Real-time corruption detection
  • Emergency Recovery: Automatic git and backup-based restoration
  • Safe Script Execution: Protected wrapper for all script operations

Quick Commands:

# Setup protection (one-time)
bash scripts/package-guard.sh auto-protect

# Daily usage
bash scripts/package-guard.sh backup          # Create backup
bash scripts/package-guard.sh safe-run <script>  # Run script safely
bash scripts/package-guard.sh status          # Check health

Full Guide: ๐Ÿ›ก๏ธ Package Protection System


๐Ÿ“š Documentation

All project documentation has been organized in the docs/ folder:

๐Ÿง  MCP Protocol - Understanding the Difference

โš ๏ธ CRITICAL: MCP is for AI Agents ONLY - NOT for developers!

๏ฟฝ SESSION WORKFLOW:

๐Ÿ‘จโ€๐Ÿ’ป Developer Initializes Session (One Time):

# Developer runs this once to set up the session environment
node start-wavelength-session.js

๐Ÿค– AI Agents Join Established Session:

// Agents join existing session (initialize: false)
await mcp.callTool("wavelength_server_status", {check: "full", initialize: false});

โœ… APPROPRIATE - AI Agents (After Joining Session):

// AI agents use MCP internally to communicate with tools
await mcp.callTool("wavelength_validate", {content: "character bio", type: "character"});
await mcp.callTool("firebase_query", {path: "/episodes", operation: "read"});

โŒ INAPPROPRIATE - Common Confusion:

  • โŒ Developers calling mcp.callTool() in application code
  • โŒ Using MCP syntax in Node.js scripts or terminal
  • โŒ Production applications containing MCP protocol calls
  • โŒ Mixing MCP with regular development workflows

๐ŸŽฏ Tool Usage by Role:

๐Ÿค– AI Agents - Use MCP Protocol:

// Agents use MCP protocol exclusively
await mcp.callTool("wavelength_validate", {content: "character data", type: "character"});
await mcp.callTool("firebase_query", {path: "/episodes", operation: "read"});
await mcp.callTool("wavelength_test_runner", {command: "validate", content: "character data"});

๐Ÿ‘จโ€๐Ÿ’ป Developers - Use Node.js Tools:

# Developers use Node.js tools directly
node scripts/unified/wavelength-validator.js --type character
node scripts/unified/firebase-manager.js --operation read --path /episodes
node scripts/unified/test-runner.js validate --content "character data"

Key Difference: MCP = AI agent communication protocol | Node.js tools = actual developer utilities

๐Ÿš€ Quick Start

  1. Setup: Follow the Security Enhancement Guide
  2. Backup: Configure Automated Backups
  3. Features: Explore Application Documentation

๐Ÿค– AI Chatbot Integration

The Wavelength-Lore ecosystem includes an advanced external AI chatbot service that provides VIP+ members with intelligent assistance about the Wavelength universe:

๐ŸŒŸ External Chatbot Service

  • โœ… Firebase Functions Backend: Serverless architecture at us-central1-wavelength-lore.cloudfunctions.net
  • โœ… SSO Integration: Seamless authentication with main website using JWT tokens
  • โœ… VIP+ Exclusive Access: Membership tier requirement for chatbot functionality
  • โœ… Vector Database Knowledge: Complete lore stored in Pinecone for accurate responses
  • โœ… OpenAI GPT Integration: Advanced AI responses about characters, stories, and universe details

๏ฟฝ Integration Architecture

  • Widget Integration: Embedded chat widget on main website (/chatbot/widget)
  • Authentication Flow: SSO token validation between main site and chatbot service
  • Session Management: Persistent conversation history and context awareness
  • Health Monitoring: Comprehensive testing suite validating all integration points

๐Ÿš€ Chatbot Features

  • Lore Expertise: Deep knowledge of Wavelength universe, characters, and storylines
  • Real-time Responses: Interactive conversation with context awareness
  • Security Controls: Rate limiting, input validation, and VIP+ access enforcement
  • Cross-Platform: Accessible through main website with responsive design

See ๐Ÿค– Chatbot Architecture Documentation for complete technical details and validation results.

๏ฟฝ๐Ÿ›ก๏ธ Security Features

  • โœ… Firebase security rules with script token authentication
  • โœ… Smart rate limiting with endpoint detection
  • โœ… Input sanitization with XSS protection
  • โœ… Automated encrypted backups to AWS S3
  • โœ… User authentication with Firebase ID tokens
  • โœ… Secure delete functionality with ownership verification
  • โœ… External Chatbot Security: VIP+ access control with SSO integration

๐Ÿ”ง Asset Management & Validation

The site includes a comprehensive asset validation system to ensure all resources are working correctly:

๐Ÿš€ CDN & Storage Integration

  • โœ… CloudFront CDN: Optimized content delivery through AWS CloudFront
  • โœ… S3 Storage: Secure and scalable image storage with AWS S3
  • โœ… Gallery Feature: User image uploads stored in S3 and served via CloudFront
  • โœ… CORS Support: Cross-Origin Resource Sharing for external applications
  • โœ… Automated Testing: CDN integration tests verify functionality

See CDN Configuration Guide for setup details.

๐Ÿ“ Resource Validation Suite

  • โœ… Image Checker: Validates all images (img tags, backgrounds) with category analysis
  • โœ… Static Resource Checker: Tests CSS, JS, fonts, icons, and CDN resources
  • โœ… Route Link Checker: Scans EJS templates for broken internal links with database validation

๐Ÿš€ Production Validation

  • โœ… Production Suite: Unified validation system with Quick/Standard/Full modes
  • โœ… Environment Support: Automatic detection between local (localhost:3001) and production (wavelengthlore.com)
  • โœ… CI/CD Integration: Proper exit codes and timeout handling for automated pipelines
  • โœ… Smart Timeouts: Optimized timeouts for local (5-10s) vs production (15-30s) environments

๐Ÿ“Š Usage Examples

# Quick production health check (1-2 min)
./scripts/validate-production.sh quick

# Full comprehensive validation (5-10 min)  
./scripts/validate-production.sh full

# Individual component testing
node scripts/check_broken_images.js --prod
node scripts/check_static_resources.js --prod
node scripts/check_route_links.js --prod

See Resource Checker Documentation and Production Validation Guide for complete usage details.

๐ŸŽจ AI Image Generation

The site includes an advanced AI image generation system for creating custom artwork:

๐Ÿค– AI-Powered Content Creation

  • โœ… AI Image Generator: Generate images from text prompts using Google's Imagen API
  • โœ… Character Portraits: Automated character portrait generation with style presets
  • โœ… Location Scenes: Epic fantasy landscape and environment generation
  • โœ… Asset Integration: Automatic upload and optimization through enhanced asset manager
  • โœ… Multiple Variations: Generate multiple variations of concepts for selection

๐Ÿš€ Quick AI Generation

# Generate character portrait
./scripts/ai-image-generator.js character "Lucky" "mischievous leprechaun with green hat"

# Generate location scene  
./scripts/ai-image-generator.js location "Emerald Grove" "mystical forest with glowing trees"

# Generate and upload to assets automatically
./scripts/ai-image-generator.js workflow "magical crystal cave" "locations/crystal-cave"

๐Ÿ”ง AI Features

  • โœ… Smart Defaults: Optimized settings for different content types
  • โœ… Style Presets: Fantasy-art, photorealistic, anime, concept-art styles
  • โœ… Batch Generation: Create multiple variations with single command
  • โœ… Asset Pipeline: Seamless integration with asset management system
  • โœ… URL Flexibility: Relative, CDN, or absolute URL generation modes

See AI Image Generation Guide for complete usage and examples.

๏ฟฝ Forum Features

The Wavelength Lore site includes a comprehensive community forum with:

Core Functionality

  • โœ… Discussion Posts: Create and participate in community discussions
  • โœ… Reply System: Threaded replies with real-time updates
  • โœ… Search & Discovery: Advanced search with filters and category support
  • โœ… Community Guidelines: Comprehensive moderation policies and rules
  • โœ… Contact System: Direct moderator contact with configurable email

Content Management

  • โœ… Rich Text Support: Markdown formatting and media attachments
  • โœ… File Attachments: Secure S3 integration for images and documents
  • โœ… Content Categories: Organized discussion topics and filtering
  • โœ… User Profiles: Display user information and post history

Moderation & Safety

  • โœ… Authenticated Deletion: Secure post and reply removal with ownership verification
  • โœ… Admin Controls: Administrative override capabilities for content management
  • โœ… Cascade Deletion: Automatic cleanup of replies when posts are deleted
  • โœ… File Cleanup: Automatic S3 attachment removal for deleted content
  • โœ… Rate Limiting: Smart protection against spam and abuse

Navigation & Discovery

  • โœ… Unified Navigation: Consistent forum navigation across all pages
  • โœ… Search Integration: Real-time search with category and content filtering
  • โœ… Guidelines Integration: Easy access to community rules and policies
  • โœ… Help System: Comprehensive user guides and support resources

See Forum Delete Documentation and Security Enhancement Guide for implementation details.

See Security Enhancement Guide for complete details.

Pre-increment test completed successfully! Version incremented v1.0.175 โ†’ v1.0.176 before deployment.

About

The Lore Site for the Wavelength Canon

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •