* Transform a mux workspace name to be Coder-compatible. * - Replace underscores with hyphens * - Remove leading/trailing hyphens * - Collapse multiple consecutive hyphens
(name: string)
| 54 | * - Collapse multiple consecutive hyphens |
| 55 | */ |
| 56 | function toCoderCompatibleName(name: string): string { |
| 57 | return name |
| 58 | .replace(/_/g, "-") // Replace underscores with hyphens |
| 59 | .replace(/^-+|-+$/g, "") // Remove leading/trailing hyphens |
| 60 | .replace(/-{2,}/g, "-"); // Collapse multiple hyphens |
| 61 | } |
| 62 | |
| 63 | const CODER_INACTIVITY_THRESHOLD_MS = 5 * 60 * 1000; |
| 64 | const CODER_ENSURE_READY_TIMEOUT_MS = 120_000; |