(session: SessionState, flags?: CommandFlags)
| 20 | }; |
| 21 | |
| 22 | export function assertSessionSelectorMatches(session: SessionState, flags?: CommandFlags): void { |
| 23 | const mismatches = listSessionSelectorConflicts(session, flags); |
| 24 | if (mismatches.length === 0) return; |
| 25 | |
| 26 | throw new AppError( |
| 27 | 'INVALID_ARGS', |
| 28 | `Session "${session.name}" is already bound to ${describeSessionDevice(session)}, but this request selected ${mismatches.map(formatSessionSelectorConflict).join(', ')}.`, |
| 29 | { |
| 30 | session: session.name, |
| 31 | conflicts: mismatches.map(formatSessionSelectorConflict), |
| 32 | hint: buildSessionRecoveryHint(session, 'selector-conflict'), |
| 33 | }, |
| 34 | ); |
| 35 | } |
| 36 | |
| 37 | export function listSessionSelectorConflicts( |
| 38 | session: SessionState, |
no test coverage detected