(command: string, env: EnvMap)
| 497 | } |
| 498 | |
| 499 | function buildNonInteractiveLoginError(command: string, env: EnvMap): AppError { |
| 500 | const cloudBaseUrl = resolveCloudBaseUrl(env); |
| 501 | return new AppError( |
| 502 | 'UNAUTHORIZED', |
| 503 | `${command} cannot perform interactive login in CI or a non-interactive shell.`, |
| 504 | { |
| 505 | hint: |
| 506 | `Create a service/API token: ${new URL(API_KEYS_PATH, cloudBaseUrl).toString()} ` + |
| 507 | 'Then set AGENT_DEVICE_DAEMON_AUTH_TOKEN=adc_live_...', |
| 508 | }, |
| 509 | ); |
| 510 | } |
| 511 | |
| 512 | function resolveCloudBaseUrl(env: EnvMap, fallback?: string): string { |
| 513 | const raw = env.AGENT_DEVICE_CLOUD_BASE_URL ?? fallback ?? DEFAULT_CLOUD_BASE_URL; |
no test coverage detected