svg2unicode 0.1.5
Convert SVG files to Unicode block characters for terminal display
License: MIT
Requires Python: >=3.7
Keywords: svg, unicode, terminal, graphics, conversion

# 🧠 SView - SVG Viewer & PWA Launcher

**XQR Integration Enabled** | **Universal File System** | **Cross-Platform**

![SView Version](https://img.shields.io/badge/SView-1.0.0-blue?style=for-the-badge&logo=svg)
![XQR Integration](https://img.shields.io/badge/XQR-Enhanced-purple?style=for-the-badge)
![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20Windows%20%7C%20macOS-green?style=for-the-badge)
![License](https://img.shields.io/badge/License-MIT-orange?style=for-the-badge)

SView is an advanced tool for managing, viewing, and launching SVG files as Progressive Web Apps (PWAs) with XQR memory system integration. The project combines the speed of native Rust applications with the capabilities of modern web technologies.

## 🚀 Key Features

### 📂 SVG File Management
- **Fast Scanning** - Efficient disk scanning using parallel processing
- **Smart Thumbnails** - Automatic UTF-8 icon generation based on SVG content
- **System Integration** - Native integration with Linux/Windows/macOS
- **XQR Support** - Recognition and handling of SVG files with XQR extensions

### 🧠 XQR Memory System
- **Factual Memory** - Long-term storage of preferences and settings
- **Episodic Memory** - History of file and application interactions
- **Semantic Memory** - Semantic relationships between files
- **Working Memory** - Temporary session memory

### 🌐 PWA Launching
- **App Mode** - Launch SVGs as full-fledged PWAs
- **Offline Support** - Functionality without internet connection
- **Responsive Interface** - Automatic adaptation to different screen sizes
- **Native Look & Feel** - Interface that resembles native applications

### ⚡ Programming Language Support
- **JavaScript/Node.js** - Direct JS code execution
- **Python** - Python script execution
- **Rust** - Rust code compilation and execution
- **Go, Ruby, PHP** - Additional language support

## 🛠️ Installation

### Prerequisites
- Rust 1.70+ (for building from source)
- Cargo (Rust's package manager)
- Git (for cloning the repository)

### Building from Source

```bash
# Clone the repository
git clone https://github.com/veridock/sview.git
cd sview

# Build in release mode
cargo build --release

# The binary will be available at ./target/release/sview
```

### Quick Start

```bash
# Make the binary executable
chmod +x target/release/sview

# Add to PATH (temporary for current session)
export PATH="$PWD/target/release:$PATH"

# Verify installation
sview --version
```

### System Installation (Optional)

```bash
# Install system-wide (requires root)
sudo cp target/release/sview /usr/local/bin/

# Create configuration directory
mkdir -p ~/.sview/{cache,config,logs}
```

## 🖥️ Usage

### Viewing SVGs

#### Basic Viewing
```bash
# View an SVG file with default size (40x20 characters)
sview view example.svg

# View with custom dimensions
sview view example.svg --width 80 --height 30

# Open SVG in default web browser
sview view example.svg --browser
```

#### Directory Operations
```bash
# List SVG files in a directory
sview list /path/to/svgs

# Detailed listing with file information
sview list /path/to/svgs --long

# Recursively search for SVGs
sview list /path/to/search --recursive
```

### Advanced Features

#### Search and Filter
```bash
# Search for SVGs by name
sview search "icon" /path/to/search

# Filter by size
sview list /path/to/svgs --min-size 1M --max-size 10M

# Find recently modified files
sview list /path/to/svgs --modified-within 7d
```

#### Batch Processing
```bash
# Convert multiple SVGs to ASCII art
for svg in *.svg; do
    echo "Rendering $svg"
    sview view "$svg" --width 60 --no-color > "${svg%.svg}.txt"
done
```

### Integration with Other Tools

#### fzf Integration
```bash
# Interactive file selection with preview
export FZF_DEFAULT_OPTS='--preview "sview view {} --width 40 --height 15 --no-color 2>/dev/null || echo \"Not an SVG file\""'
selected=$(find . -type f | fzf)
[ -n "$selected" ] && sview view "$selected"
```

#### File Manager Integration
Add this to your `~/.bashrc` or `~/.zshrc` to use with `ranger` file manager:
```bash
# Ranger integration
export VISUAL="sview view"
alias ranger='ranger --choosedir=$HOME/.rangerdir; LASTDIR=`cat $HOME/.rangerdir`; cd "$LASTDIR"'
```

### Rendering Options

| Option | Description | Default |
|--------|-------------|---------|
| `--width <N>` | Set output width in characters | 40 |
| `--height <N>` | Set output height in characters | 20 |
| `--mini` | Show single-character representation | false |
| `--browser` | Open in default web browser | false |
| `--no-color` | Disable color output | false |
| `--invert` | Invert colors | false |
| `--format <fmt>` | Output format (text, json, yaml) | text |

### Configuration

SView can be configured using a configuration file located at `~/.config/sview/config.toml`:

```toml
[rendering]
width = 60
height = 30
character_set = " .,:;+*?%S#@"
color = true

[directories]
# Add custom search paths
search_paths = [
    "~/.local/share/icons",
    "/usr/share/icons"
]

[memory]
enabled = true
cache_size = "1GB"
```

## 📦 Installation Methods

### Prerequisites
- Rust 1.70 or later
- Cargo (Rust's package manager)
- Git (for source installation)
- Build essentials for your platform

### Quick Installation

#### Using Cargo (Recommended)
```bash
# Install or update
cargo install sview-cli --locked
```

#### From Source
```bash
# Clone the repository
git clone https://github.com/veridock/sview.git
cd sview

# Build in release mode
cargo build --release

# Install system-wide (requires root)
sudo cp target/release/sview /usr/local/bin/
```

### Package Manager Installation

#### Linux
```bash
# Arch Linux (AUR)
yay -S sview

# Debian/Ubuntu (coming soon)
# sudo apt install sview

# Fedora (coming soon)
# sudo dnf install sview
```

#### macOS
```bash
# Using Homebrew
brew tap veridock/sview
brew install sview
```

#### Windows
```bash
# Using Chocolatey (coming soon)
# choco install sview

# Using Scoop
scoop bucket add sview https://github.com/veridock/sview.git
scoop install sview
```

### Post-Installation

#### Set Up Configuration
```bash
# Create config directory
mkdir -p ~/.config/sview

# Generate default config
sview config generate > ~/.config/sview/config.toml

# Verify installation
sview --version
```

#### Shell Completions
```bash
# Generate completions for your shell
# Bash
sview completions bash > /etc/bash_completion.d/sview

# Zsh
sview completions zsh > "${fpath[1]}/_sview"

# Fish
sview completions fish > ~/.config/fish/completions/sview.fish
```

### Development Installation

For developers who want to contribute or modify SView:

```bash
# Clone the repository
git clone https://github.com/veridock/sview.git
cd sview

# Install development dependencies
rustup component add rustfmt clippy

# Build in development mode
cargo build

# Run tests
cargo test

# Run with logging
RUST_LOG=debug cargo run -- --help
```

### Updating

To update an existing installation:

```bash
# If installed via Cargo
cargo install sview-cli --force

# If installed from source
cd /path/to/sview
git pull
cargo build --release
sudo cp target/release/sview /usr/local/bin/
```

### Uninstallation

```bash
# Remove binary
sudo rm /usr/local/bin/sview

# Remove configuration files (optional)
rm -rf ~/.config/sview
rm -rf ~/.cache/sview
rm -rf ~/.local/share/sview
```

## 🎯 Usage Examples

### Basic Commands

#### Viewing SVGs
```bash
# View a single SVG file
sview view image.svg

# View with custom dimensions
sview view image.svg --width 80 --height 40

# Open in default web browser
sview view image.svg --browser
```

#### File Management
```bash
# List all SVG files in current directory
sview list

# Detailed listing with file information
sview list --long

# List files in a specific directory
sview list /path/to/svgs

# Recursive search in subdirectories
sview list --recursive

# Filter by file size
sview list --min-size 1M --max-size 10M

# Show recently modified files
sview list --modified-within 7d
```

### Advanced Usage

#### Searching and Filtering
```bash
# Search by filename
sview search "icon"

# Search in specific directory
sview search "icon" /path/to/search

# Case-insensitive search
sview search -i "logo"

# Search with regular expressions
sview search --regex "icon-.*"
```

#### Batch Processing
```bash
# Convert multiple SVGs to text
for file in *.svg; do
    sview view "$file" --width 60 > "${file%.svg}.txt"
done

# Create thumbnails for all SVGs in a directory
mkdir -p thumbnails
sview list --recursive /path/to/svgs | xargs -I{} sview view "{}" --width 20 --height 10 > thumbnails/{}_thumb.txt
```

#### Integration with Other Tools

##### fzf Integration
```bash
# Interactive file selection with preview
export FZF_DEFAULT_OPTS='--preview "sview view {} --width 60 --height 20"'
selected=$(sview list --recursive | fzf)
[ -n "$selected" ] && sview view "$selected"
```

##### Ranger File Manager
Add to `~/.config/ranger/rc.conf`:
```
map sv shell sview view %s
map sV shell -p sview view %s
```

### Common Use Cases

#### Quick Preview in Terminal
```bash
# Quick preview of an SVG
sview view file.svg

# Preview with custom character set
sview view file.svg --chars " .:-=+*#%@"

# Invert colors for light backgrounds
sview view file.svg --invert
```

#### File Operations
```bash
# Find and view the largest SVG file
sview list --sort size -r | head -n 1 | xargs sview view

# Find duplicate SVG files
sview list --checksum | sort | uniq -w 32 -d

# Clean up temporary files
sview clean --older-than 30d
```

### Help and Documentation

```bash
# Show general help
sview --help

# Show help for specific command
sview list --help
sview view --help
sview search --help

# Show version information
sview --version

# Generate shell completions
sview completions bash  # or zsh, fish, etc.
```

## ⚙️ Configuration

SView can be configured using a TOML configuration file, environment variables, or command-line arguments. Settings are applied in this order of precedence:
1. Command-line arguments
2. Environment variables
3. Configuration file
4. Default values

### Configuration File

By default, SView looks for a configuration file at `~/.config/sview/config.toml`. You can generate a default configuration:

```bash
mkdir -p ~/.config/sview
sview config generate > ~/.config/sview/config.toml
```

#### Example Configuration

```toml
[rendering]
# Character set for ASCII/UTF-8 rendering (dark to light)
character_set = " .,:;+*?%S#@"

# Default dimensions for terminal output
width = 40
height = 20

# Enable/disable colored output
color = true

# Invert colors (for light backgrounds)
invert = false

[directories]
# Additional directories to search for SVGs
search_paths = [
    "~/.local/share/icons",
    "/usr/share/icons",
    "/path/to/your/svgs"
]

# Maximum recursion depth when searching directories
max_depth = 10

[memory]
# Enable/disable memory system
enabled = true

# Maximum cache size (e.g., 1GB, 500MB)
cache_size = "1GB"

# Path to memory database
# database_path = "~/.local/share/sview/memory.db"

[plugins]
# Enable/disable plugins
enabled = true

# List of plugins to load
# active_plugins = ["git", "metadata", "preview"]
```

### Environment Variables

You can override any setting using environment variables:

```bash
# Set default dimensions
export SVIEW_WIDTH=80
export SVIEW_HEIGHT=30

# Custom character set
export SVIEW_CHARS=" .:-=+*#%@"

# Enable/disable features
export SVIEW_COLOR=1
export SVIEW_INVERT=0

# Memory settings
export SVIEW_MEMORY_ENABLED=1
export SVIEW_CACHE_SIZE="2GB"
```

## 🔧 Advanced Usage

### Memory System

SView includes a powerful memory system for storing and recalling information:

```bash
# Store a fact
sview memory --store "user_preference" "dark_theme"

# Recall a fact
sview memory --recall "user_preference"

# List all memories
sview memory --list

# Export memories to JSON
sview memory --export > memories.json

# Import memories from JSON
sview memory --import memories.json
```

### Plugins

Extend SView's functionality with plugins:

```bash
# List available plugins
sview plugins list

# Enable a plugin
sview plugins enable git

# Disable a plugin
sview plugins disable git

# Get plugin information
sview plugins info git
```

### API Integration

SView can be used as a library in your Rust projects:

```rust
use sview::{SvgViewer, RenderOptions};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let svg_content = std::fs::read_to_string("example.svg")?;
    let options = RenderOptions {
        width: 80,
        height: 30,
        color: true,
        ..Default::default()
    };
    
    let output = SvgViewer::new()
        .with_options(options)
        .render(&svg_content)?;
        
    println!("{}", output);
    Ok(())
}
```

## 🚀 Performance Tips

1. **Use the latest version** - Performance improvements are regularly added
2. **Enable caching** - Reduces redundant processing
3. **Optimize your SVGs** - Use tools like SVGO to clean up SVGs
4. **Use appropriate dimensions** - Larger dimensions require more processing
5. **Consider using `--no-color`** for faster rendering in scripts

## 📚 Additional Resources

- [SVG Specification](https://www.w3.org/TR/SVG2/)
- [Rust SVG Parser](https://crates.io/crates/svg)
- [Performance Tuning Guide](https://github.com/veridock/sview/wiki/Performance-Tuning)
- [Plugin Development](https://github.com/veridock/sview/wiki/Plugin-Development)

## 🤝 Contributing

Contributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## 🔍 Viewing File Details

```bash
# Show detailed file information
sview view -l  # or --long
```

## 🔍 Advanced File Operations

### Sorting and Filtering

```bash
# Sort by size (smallest first)
sview view --sort=size

# Sort by modification time (newest first)
sview view --sort=modified -r

# Limit search depth
sview view --depth=2
```

### Integration with Other Tools

```bash
# Find and display SVGs using find
find ~/ -name "*.svg" -type f -exec sview view {} \;

# Count SVG files in a directory
sview view /directory | wc -l

# Search and display specific files
sview view /directory | grep pattern
```

### Advanced Scripting

```bash
# Display only icons (without paths)
sview view /directory | awk '{print $1}'

# Generate an HTML file with SVG previews
echo "<html><body>" > previews.html
sview view /directory --long >> previews.html
echo "</body></html>" >> previews.html

# Process SVGs in a script
for svg in $(find . -name "*.svg"); do
    echo -n "$svg: "
    sview view "$svg"
done
```

### Supported File Types

SView automatically detects SVG file types and displays appropriate icons:

- `📊` - Charts and diagrams
- `⭕` - Circular elements (buttons, icons)
- `📁` - Directories
- `📄` - Documents
- `🖼️` - Images
- `🔍` - Search
- `⚙️` - Settings
- `📥` - Downloads/Uploads

### Browser Preview

```bash
# Open SVG in default browser
sview view example.svg --browser

# Set custom preview size in browser
sview view example.svg --browser --width 1024 --height 768
```

### Getting Help

```bash
# Show help for view command
sview view --help
```

**Note:** By default, `sview view` displays a UTF-8 icon representing the SVG content. To open the file in a browser, use the `--browser` flag.

## 💾 Memory Management

```bash
# List all memory entries
sview memory list

# Add a new memory entry
sview memory add --key user.preferences.theme --value dark

# Retrieve a value from memory
sview memory get --key user.preferences.theme

# Remove a memory entry
sview memory remove --key user.preferences.theme

# Show memory command help
sview memory --help
```

**Note:** The SView memory system stores user preferences and settings. Keys should be organized hierarchically using dots as separators (e.g., `user.preferences.theme`).

## 🔍 System Diagnostics

### Interactive Shell and Diagnostics

```bash
# Start interactive shell
sview shell

# Display system information
sview system info

# Check system requirements
sview system check

# Clean temporary files
sview system clean

# Show system command help
sview system --help
```

### Diagnostic Examples

```bash
# Verify system meets requirements
sview system check

# Clean temporary files and cache
sview system clean

# Get detailed system information
sview system info
```

## 🔎 File Search with `sview list`

The `sview list` command allows you to display SVG files with various sorting and formatting options.

### Basic Usage

```bash
# List all SVG files in current directory
sview list

# List files in a specific directory
sview list /path/to/directory

# Show detailed information
sview list -l
sview list --long

# Sort results
sview list -s name     # by name (default)
sview list -s size     # by file size
sview list -s modified # by modification time

# Reverse sort order
sview list -r
sview list --reverse

# Filter by file type
sview list -f svg    # SVG files only (default)
sview list -f xml     # XML files
```

### Practical Examples

```bash
# List files sorted by size (largest first)
sview list -s size -r

# Show detailed information about XML files
sview list -f xml -l

# List files in user's home directory
sview list ~

# Export thumbnails to directory
sview list --export-thumbnails=output_directory/

# Find SVG files with syntax errors
sview list --check-validity

# Search for SVGs with specific dominant color
sview list --dominant-color="#FF5733" --tolerance=10
```

### File System Integration

```bash
# Advanced search using find
find . -type f -name "*.svg" -exec sview list -l {} \; | sort -k5 -n

# Interactive search with fzf
sview list | fzf --preview 'sview view {}'

# Search file contents with ripgrep
sview list | xargs rg -l "@import"

# Create a terminal preview
sview list --preview | less -R
```

### Tool Integration

```bash
# Search within SVG files
sview list | xargs grep -l "keyword"

# Remove temporary files older than 30 days
sview list --format=tmp --min-age=30 | xargs rm -f

# Calculate total size of SVG files
sview list -l | awk '{sum += $1} END {print sum}'
```

## 🆘 Help
```bash
sview --help
sview --version
```

## ⚙️ Advanced Options

```bash
# Scan with depth limit
sview ls --depth 5

# Export file list
sview ls --export json > files.json
sview ls --export csv > files.csv

# Filter by type
sview ls --sview-only          # sView-enhanced files only
sview ls --interactive         # Interactive SVGs only
sview ls --pwa-capable         # PWA-capable SVGs only

# Run code in different languages
sview exec javascript "console.log('Hello from JS!')"
sview exec python "print('Hello from Python!')"
sview exec rust "fn main() { println!(\"Hello from Rust!\"); }"

# Work with sView memory
sview memory --store "user_preference" "dark_theme"
sview memory --recall "user_preference"
sview memory --export json > my_memory.json

# Watch for changes
sview watch ~/projects/
```

### Working with sView Files

```bash
# Create a new sView file
sview create --template dashboard --name "my-dashboard"

# Convert SVG to sView format
sview convert input.svg --output enhanced.sview

# Validate sView file
sview validate my-file.sview

# Optimize files
sview optimize --compress --encrypt my-file.sview
```

## 🎨 Graphical Interface

SView offers both command-line and graphical interfaces:

### GUI Features
- **Grid/List View** - Toggle between grid and list layouts
- **Live Preview** - Real-time thumbnail generation
- **Search** - Filter files by name and path
- **Statistics** - File count, size, and type information
- **Drag & Drop** - Easy file import via drag and drop
- **Batch Operations** - Perform actions on multiple files at once

### Launching the GUI

```bash
# Electron-based GUI
sview-gui

# Web-based interface
sview serve --port 8080
# Then open http://localhost:8080 in your browser

# System tray mode (Linux/Windows)
sview --tray
```

## 🔧 Configuration

### Main Configuration File (`~/.sview/config/config.toml`)

```toml
[general]
version = "1.0.0"
scan_depth = 10              # Maximum scan depth
cache_thumbnails = true      # Cache thumbnails
auto_update = true          # Enable automatic updates

[browser]
command = "chromium"        # Browser command
flags = [                   # Launch flags
    "--app",
    "--new-window", 
    "--disable-web-security",
    "--allow-file-access-from-files"
]

[performance]
parallel_scan = true        # Enable parallel scanning
max_threads = 0            # 0 = auto-detect
memory_limit = "512MB"     # Memory limit
cache_size = "100MB"       # Cache size

[sview]
enabled = true             # Enable sView support
memory_encryption = true   # Enable memory encryption
auto_enhance = false       # Auto-enhance SVGs
compression = "gzip"       # Compression algorithm

[security]
encryption_algorithm = "AES-256-GCM"
key_derivation = "Argon2id"
audit_trail = true         # Enable audit logging
data_classification = "internal"

[languages]
supported = [
    "javascript", "python", "rust", 
    "go", "ruby", "php", "bash"
]

[ui]
default_columns = 4        # Default number of columns
default_view = "grid"      # "grid" or "list"
theme = "auto"             # "light", "dark", or "auto"
animations = true          # Enable UI animations

[paths]
scan_paths = [             # Paths to scan
    "~/Documents",
    "~/Projects", 
    "~/Desktop"
]
exclude_paths = [          # Excluded directories
    "node_modules",
    ".git",
    "target"
]
```

### Environment Variables

```bash
export SVIEW_CONFIG_DIR="~/.sview"
export SVIEW_CACHE_DIR="~/.sview/cache"
export SVIEW_LOG_LEVEL="info"
export SVIEW_BROWSER="firefox"
export SVIEW_PARALLEL_THREADS="8"
```

## 📊 Usage Examples

### 1. Simple Chart SVG

```xml
<!-- simple-chart.svg -->
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="300">
  <rect width="400" height="300" fill="#f8f9fa"/>
  <text x="200" y="30" text-anchor="middle" font-family="Arial" font-size="18">
    Sales Chart
  </text>
  
  <!-- Data bars -->
  <rect x="50" y="200" width="40" height="80" fill="#4CAF50"/>
  <rect x="120" y="150" width="40" height="130" fill="#2196F3"/>
  <rect x="190" y="100" width="40" height="180" fill="#FF9800"/>
  <rect x="260" y="170" width="40" height="110" fill="#E91E63"/>
</svg>
```

Run with:
```bash
sview simple-chart.svg
```

### 2. sView Enhanced Dashboard

```xml
<!-- dashboard.svg -->
<svg xmlns="http://www.w3.org/2000/svg" 
     xmlns:sview="http://sview.veridock.com/schema/v1"
     sview:enhanced="true" width="800" height="600">
  
  <metadata>
    <sview:memory>
      <sview:factual>{"user": "demo", "preferences": {"theme": "dark"}}</sview:factual>
      <sview:working>{"currentView": "dashboard"}</sview:working>
    </sview:memory>
    
    <sview:config>
      {
        "version": "1.0",
        "interactive": true,
        "pwa_capable": true,
        "memory_enabled": true
      }
    </sview:config>
  </metadata>
  
  <!-- Interactive content -->
  <g sview:interactive="true" sview:data-binding="sales_data">
    <!-- Dashboard widgets -->
  </g>
  
  <script type="application/javascript">
    // sView Enhanced functionality
    window.sviewMemory = {
      factual: { user: "demo", preferences: { theme: "dark" } },
      working: { currentView: "dashboard" },
      episodic: [],
      semantic: []
    };
    
    console.log('🧠 sView Enhanced Dashboard initialized');
  </script>
</svg>
```

### 3. Interactive Game

```xml
<!-- pong-game.svg -->
<svg xmlns="http://www.w3.org/2000/svg" 
     xmlns:sview="http://sview.veridock.com/schema/v1"
     sview:enhanced="true" width="600" height="400">
  
  <metadata>
    <sview:memory>
      <sview:factual>{"highScore": 0, "player": "guest"}</sview:factual>
      <sview:working>{"gameState": "ready", "score": 0}</sview:working>
    </sview:memory>
  </metadata>
  
  <!-- Game elements -->
  <rect width="600" height="400" fill="#1a1a1a"/>
  <rect id="leftPaddle" x="20" y="150" width="10" height="100" fill="white"/>
  <rect id="rightPaddle" x="570" y="150" width="10" height="100" fill="white"/>
  <circle id="ball" cx="300" cy="200" r="8" fill="white"/>
  
  <script type="application/javascript">
    // Simple Pong game implementation
    // ... (game logic)
  </script>
</svg>
```

## 🧠 sView Memory System

### Memory Types

1. **Factual Memory** - Long-term factual knowledge
   - User preferences
   - Application settings
   - Configuration data

2. **Episodic Memory** - Event history over time
   - File access history
   - User interactions
   - Session context

3. **Semantic Memory** - Semantic relationships
   - Vector embeddings
   - File relationships
   - Categories and tags

4. **Working Memory** - Session working memory
   - Current application state
   - Temporary data
   - Task context

### Memory API

```bash
# Store in memory
sview memory store factual "user_theme" "dark"
sview memory store episodic "file_opened" "dashboard.svg"

# Search memory
sview memory recall "user_theme"
sview memory search "dashboard" --type semantic

# Export/import memory
sview memory export --format json > memory_backup.json
sview memory import memory_backup.json

# Memory analysis
sview memory analyze --stats
sview memory compress --threshold 0.8
```

## 🛡️ Security

### Data Encryption

SView uses modern encryption algorithms:

- **AES-256-GCM** - Symmetric encryption
- **Argon2id** - Key derivation
- **Ed25519** - Digital signatures
- **X25519** - Key exchange

### Security Configuration

```toml
[security]
encryption_algorithm = "AES-256-GCM"
key_derivation = "Argon2id"
key_rotation = true
hardware_security = true    # HSM/TEE when available

[privacy]
data_classification = "internal"
retention_policy = "1_year"
anonymization = true
audit_trail = true

[compliance]
gdpr = true
hipaa = false
sox = false
```

### Security Audit

```bash
# Security check (requires cargo-audit)
cargo audit

# Check GUI dependencies (in GUI directory)
cd gui && npm audit

# Integrity check
sview security verify --all

# Security report
sview security report > security_report.json
```

## 🚀 Performance

### Optimizations

- **Parallel processing** - Multi-threaded disk scanning
- **Lazy loading** - On-demand loading
- **Caching** - Intelligent result caching
- **Memory mapping** - Efficient memory management
- **SIMD optimizations** - Vector optimizations

### Benchmarks

| Operation | Time | Notes |
|-----------|------|-------|
| Scan 1000 files | < 100ms | SSD, parallel |
| Thumbnail generation | < 5ms | Cache miss |
| PWA launch | < 200ms | Cold start |
| Semantic search | < 50ms | 1000 embeddings |

### Performance Monitoring

```bash
# Performance statistics
sview perf stats

# Profiling
sview perf profile --duration 30s

# Benchmark
sview perf benchmark --iterations 100

# Resource monitoring
sview perf monitor --live
```

## 🔌 Extensions and Plugins

### Available Plugins

1. **Cloud Sync** - Cloud synchronization
2. **AI Integration** - AI model integration
3. **Version Control** - File versioning
4. **Collaboration** - Real-time collaboration
5. **Export Formats** - Additional export formats

### Plugin Installation

```bash
# Install from repository
sview plugin install cloud-sync
sview plugin install ai-integration

# Install locally
sview plugin install ./my-plugin.spx

# List plugins
sview plugin list

# Configuration
sview plugin config cloud-sync --provider aws
```

### Creating Custom Plugins

```rust
// Plugin API
use sview_plugin::{Plugin, PluginResult, PluginCapability};

#[derive(Debug)]
pub struct MyPlugin;

impl Plugin for MyPlugin {
    fn name(&self) -> &str { "my-plugin" }
    fn version(&self) -> &str { "1.0.0" }
    
    fn capabilities(&self) -> Vec<PluginCapability> {
        vec![
            PluginCapability::FileFormatSupport,
            PluginCapability::MemoryProvider,
        ]
    }
    
    fn execute(&self, command: PluginCommand) -> PluginResult {
        // Plugin logic
        Ok(PluginResponse::Success)
    }
}
```

## 📚 API Reference

### CLI API

```bash
sview [OPTIONS] [FILE] [SUBCOMMAND]

OPTIONS:
    -h, --help       Show help
    -V, --version    Show version
    -v, --verbose    Verbose mode
    -q, --quiet      Quiet mode
    --config <FILE>  Configuration file

SUBCOMMANDS:
    ls              List SVG files
    exec            Execute code
    memory          Memory operations
    config          Configuration
    plugin          Plugin management
    server          Start web server
    watch           Monitor for changes
```

### REST API (Server Mode)

```bash
# Start server
sview serve --port 8080 --api

# API Endpoints
GET    /api/files           # List files
POST   /api/files/:id/run   # Run file
GET    /api/memory          # Memory data
POST   /api/memory          # Save to memory
GET    /api/stats           # Statistics
```

### JavaScript API (PWA)

```javascript
// sView Memory API
const memory = window.sviewMemory;

// Store in memory
memory.store('factual', 'user_preference', { theme: 'dark' });

// Retrieve from memory
const preference = memory.recall('factual', 'user_preference');

// History
memory.episodic.push({
  timestamp: new Date().toISOString(),
  event: 'user_action',
  data: { action: 'button_click', target: 'save' }
});

// Semantic search
const results = await memory.semanticSearch('dashboard', 0.8);
```

## 🔄 CI/CD and Development

### Project Structure

```
sview/
├── src/                    # Rust source code
│   ├── main.rs            # Main CLI file
│   ├── scanner.rs         # Scanning module
│   ├── launcher.rs        # PWA launcher module
│   ├── memory/            # sView memory system
│   └── gui.rs             # Graphical interface
├── gui/                   # React frontend
│   ├── src/
│   ├── public/
│   └── package.json
├── plugins/               # Plugins
├── examples/              # Example files
├── tests/                 # Tests
├── docs/                  # Documentation
├── scripts/               # Utility scripts
├── Cargo.toml            # Rust configuration
├── package.json          # Node.js configuration
└── README.md
```

### Development Setup

```bash
# Clone the repository
git clone https://github.com/veridock/sview.git
cd sview

# Install dependencies
cargo build
npm install

# Run in development mode
cargo run -- ls
npm run dev  # for GUI

# Run tests
cargo test
npm test

# Code formatting
cargo fmt
npm run format

# Linting
cargo clippy
npm run lint
```

### GitHub Actions

```yaml
# .github/workflows/ci.yml
name: CI/CD Pipeline

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
      - run: cargo test --all-features
      
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
    steps:
      - uses: actions/checkout@v3
      - run: cargo build --release
      
  release:
    if: startsWith(github.ref, 'refs/tags/')
    needs: [test, build]
    runs-on: ubuntu-latest
    steps:
      - run: cargo publish
```

## 🤝 Contributing

### How to Help

1. **Report Bugs** - Use GitHub Issues
2. **Feature Requests** - Suggest new features
3. **Code** - Submit pull requests
4. **Documentation** - Improve documentation
5. **Tests** - Add automated tests
6. **Translations** - Help with localization

### Guidelines

- Use conventional commits
- Write tests for new code
- Update documentation
- Follow code style (rustfmt)
- Run clippy before PR

### Roadmap

**v1.1 (Q3 2025)**
- [ ] AI Models Integration (OpenAI, Anthropic)
- [ ] Cloud synchronization
- [ ] Mobile app (React Native)
- [ ] Plugin marketplace

**v1.2 (Q4 2025)**
- [ ] Real-time collaboration
- [ ] Version control integration
- [ ] Advanced analytics
- [ ] Enterprise features

**v2.0 (2026)**
- [ ] Distributed memory system
- [ ] Blockchain integration
- [ ] VR/AR support
- [ ] Quantum-ready encryption

## 📄 License

Apache License - see [LICENSE](LICENSE) for details.

## 🙏 Acknowledgments

- **sView Team** - Core architecture and specification
- **Rust Community** - Technical support
- **SVG Working Group** - SVG standards
- **PWA Community** - Best practices

## 📞 Contact

- **Website**: https://sview.sview.veridock.com
- **Documentation**: https://docs.sview.sview.veridock.com
- **GitHub**: https://github.com/veridock/sview
- **Discord**: https://discord.gg/sview-sview
- **Email**: info@softreck.dev

---

**SView** - Where SVG meets PWA meets AI 🚀🧠✨