# Multi-Language Script Engine ## Overview The Multi-Language Script Engine provides a polyglot scripting platform for deployment hooks, health checks, smoke tests, and custom workflow steps. Scripts are stored as versioned files, executed via language-specific Docker runtime images, and mounted into containers at deploy time. The integrated Monaco-based editor provides full IDE features for C# (.NET 10), Python, Java, Go, and Bash. This is a best-in-class implementation that gives teams flexibility in their language of choice while maintaining security, versioning, and reusability through a centralized script library. --- ## Design Principles 1. **Polyglot by Design**: First-class support for C#, Python, Java, Go, and Bash 2. **File-Based Execution**: Scripts are files mounted into runtime containers 3. **IDE-Quality Editing**: Monaco editor with IntelliSense, linting, and formatting 4. **Library Management**: Versioned dependencies for each language 5. **Security Sandboxed**: Scripts run in isolated containers with resource limits 6. **Reusable Components**: Shared script library with organization-wide access --- ## Architecture ### Component Overview ``` ┌────────────────────────────────────────────────────────────────────────┐ │ Multi-Language Script Engine │ ├────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────────┐ ┌───────────────────┐ ┌─────────────────┐ │ │ │ ScriptRegistry │───▶│ MonacoEditorSvc │───▶│ LanguageServer │ │ │ │ │ │ │ │ Pool │ │ │ └──────────────────┘ └───────────────────┘ └─────────────────┘ │ │ │ │ │ │ │ ▼ ▼ ▼ │ │ ┌──────────────────┐ ┌───────────────────┐ ┌─────────────────┐ │ │ │ LibraryManager │ │ RuntimeImageMgr │ │ SampleLibrary │ │ │ │ │ │ │ │ │ │ │ └──────────────────┘ └───────────────────┘ └─────────────────┘ │ │ │ │ │ │ │ ▼ ▼ ▼ │ │ ┌──────────────────┐ ┌───────────────────┐ ┌─────────────────┐ │ │ │ ScriptExecutor │ │ MountGenerator │ │ OutputCollector │ │ │ │ │ │ │ │ │ │ │ └──────────────────┘ └───────────────────┘ └─────────────────┘ │ │ │ └────────────────────────────────────────────────────────────────────────┘ Execution Flow ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ Script │ │ Runtime │ │ Target │ │ File │─────▶│ Container │─────▶│ Container │ │ │ │ (mount /) │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ ``` ### Key Components #### 1. ScriptRegistry Central repository for all scripts: ```csharp public sealed class ScriptRegistry { public async Task