* Sanitizing wrapper around handleCommandInternalImpl. ALL callers (single-command * HTTP, batch loop, scoped-token dispatch) go through this so the lone-surrogate * sanitization happens once at the architectural choke point, not per-leaf. * Do not bypass this by calling handleCommandInternalImpl
(
body: { command: string; args?: string[]; tabId?: number },
tokenInfo?: TokenInfo | null,
opts?: { skipRateCheck?: boolean; skipActivity?: boolean; chainDepth?: number },
)
| 1307 | * Do not bypass this by calling handleCommandInternalImpl directly. |
| 1308 | */ |
| 1309 | async function handleCommandInternal( |
| 1310 | body: { command: string; args?: string[]; tabId?: number }, |
| 1311 | tokenInfo?: TokenInfo | null, |
| 1312 | opts?: { skipRateCheck?: boolean; skipActivity?: boolean; chainDepth?: number }, |
| 1313 | ): Promise<CommandResult> { |
| 1314 | const cr = await handleCommandInternalImpl(body, tokenInfo, opts); |
| 1315 | return { ...cr, result: sanitizeLoneSurrogates(cr.result) }; |
| 1316 | } |
| 1317 | |
| 1318 | /** |
| 1319 | * Build the HTTP response from a CommandResult. Pure function so it can be |
no test coverage detected