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

Function assertCompatibleConnectionOrForce

src/cli/commands/connection.ts:184–195  ·  view source on GitHub ↗
(
  previous: RemoteConnectionState | null,
  options: Parameters<typeof isCompatibleConnection>[1],
)

Source from the content-addressed store, hash-verified

182}
183
184function assertCompatibleConnectionOrForce(
185 previous: RemoteConnectionState | null,
186 options: Parameters<typeof isCompatibleConnection>[1],
187): void {
188 if (!previous || isCompatibleConnection(previous, options)) return;
189 if (options.flags.force) return;
190 throw new AppError(
191 'INVALID_ARGS',
192 'A different remote connection is already active for this session. Re-run connect with --force to replace it.',
193 { session: options.session, remoteConfig: previous.remoteConfigPath },
194 );
195}
196
197function buildConnectedState(options: {
198 flags: CliFlags;

Callers 1

connectCommandFunction · 0.85

Calls 1

isCompatibleConnectionFunction · 0.85

Tested by

no test coverage detected