| 42 | }; |
| 43 | |
| 44 | function renderAuthStatus(status: ReturnType<typeof summarizeCliSession>): string { |
| 45 | if (!status.authenticated) return 'Not authenticated.'; |
| 46 | const lines = [ |
| 47 | 'Authenticated with cloud CLI session.', |
| 48 | `cloud=${status.cloudBaseUrl}`, |
| 49 | `session=${status.sessionId}`, |
| 50 | status.workspaceId ? `workspace=${status.workspaceId}` : null, |
| 51 | status.accountId ? `account=${status.accountId}` : null, |
| 52 | status.expiresAt ? `expiresAt=${status.expiresAt}` : null, |
| 53 | status.expired ? 'status=expired' : null, |
| 54 | ]; |
| 55 | return lines.filter((line): line is string => Boolean(line)).join('\n'); |
| 56 | } |