MCPcopy Index your code
hub / github.com/callstack/agent-device / assertSessionSelectorMatches

Function assertSessionSelectorMatches

src/daemon/session-selector.ts:22–35  ·  view source on GitHub ↗
(session: SessionState, flags?: CommandFlags)

Source from the content-addressed store, hash-verified

20};
21
22export 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
37export function listSessionSelectorConflicts(
38 session: SessionState,

Callers 2

Calls 3

describeSessionDeviceFunction · 0.90
buildSessionRecoveryHintFunction · 0.90

Tested by

no test coverage detected