(value: unknown)
| 67 | * empty/missing values as undefined. |
| 68 | */ |
| 69 | export function toOptionalBoolean(value: unknown): boolean | undefined { |
| 70 | if (value === undefined || value === null || value === '') return undefined |
| 71 | if (typeof value === 'boolean') return value |
| 72 | const normalized = String(value).trim().toLowerCase() |
| 73 | if (normalized === 'true') return true |
| 74 | if (normalized === 'false') return false |
| 75 | return undefined |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Maps a raw Daytona sandbox object to the normalized summary shape. |