(info: Info)
| 120 | } |
| 121 | |
| 122 | export function suggestConnectionName(info: Info): string | undefined { |
| 123 | if (info.type === "codex" && info.email) { |
| 124 | const domain = info.email.split("@")[1] |
| 125 | if (domain) { |
| 126 | const name = domain.split(".")[0] |
| 127 | return name |
| 128 | } |
| 129 | } |
| 130 | if (info.type === "oauth" && "email" in info && typeof info.email === "string") { |
| 131 | const domain = info.email.split("@")[1] |
| 132 | if (domain) { |
| 133 | const name = domain.split(".")[0] |
| 134 | return name |
| 135 | } |
| 136 | } |
| 137 | return undefined |
| 138 | } |
| 139 | |
| 140 | async function readLocalAuth(): Promise<Record<string, Info>> { |
| 141 | const file = Bun.file(filepath) |
nothing calls this directly
no outgoing calls
no test coverage detected