$ErrorActionPreference = 'Stop' $root = Split-Path $PSScriptRoot -Parent function Write-TextFile($rel, $content) { $path = Join-Path $root $rel $dir = Split-Path $path -Parent if ($dir -and -not (Test-Path $dir)) { New-Item -ItemType Directory -Force -Path $dir | Out-Null } Set-Content -Path $path -Value $content -NoNewline -Encoding utf8 Write-Host "wrote $rel" } # Minimal bootstrap — full sources live in repo after commit Write-TextFile 'server/internal/builder/launch_template_handler.go' @' package builder import ( "encoding/json" "net/http" ) func (h *Handler) ServeLaunchTemplate(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost { http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) return } var req LaunchTemplateRequest if err := json.NewDecoder(r.Body).Decode(&req); err != nil { writeJSON(w, http.StatusBadRequest, LaunchTemplateResponse{Success: false, Error: "invalid JSON"}) return } resp, err := BuildLaunchTemplateArtifacts(req) if err != nil { writeJSON(w, http.StatusBadRequest, resp) return } writeJSON(w, http.StatusOK, resp) } '@ Write-Host 'Run full implementation via agent commit'