( agentName: string | undefined, agentColor: string | undefined, )
| 173 | * Returns undefined if no name/color is set on the session. |
| 174 | */ |
| 175 | export function computeStandaloneAgentContext( |
| 176 | agentName: string | undefined, |
| 177 | agentColor: string | undefined, |
| 178 | ): AppState['standaloneAgentContext'] | undefined { |
| 179 | if (!agentName && !agentColor) { |
| 180 | return undefined |
| 181 | } |
| 182 | return { |
| 183 | name: agentName ?? '', |
| 184 | color: (agentColor === 'default' ? undefined : agentColor) as |
| 185 | | AgentColorName |
| 186 | | undefined, |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * Restore agent setting from a resumed session. |
no outgoing calls
no test coverage detected