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

Function resolveConnectContext

src/cli/commands/connection.ts:164–182  ·  view source on GitHub ↗
(options: {
  stateDir: string;
  flags: CliFlags;
  remoteConfigPath: string;
})

Source from the content-addressed store, hash-verified

162};
163
164function resolveConnectContext(options: {
165 stateDir: string;
166 flags: CliFlags;
167 remoteConfigPath: string;
168}): ConnectContext {
169 const { stateDir, flags, remoteConfigPath } = options;
170 const activeState = flags.session ? null : readActiveConnectionState({ stateDir });
171 const session = flags.session ?? activeState?.session ?? createRemoteSessionName(stateDir);
172 const previous =
173 activeState?.session === session
174 ? activeState
175 : readRemoteConnectionState({ stateDir, session });
176 return {
177 session,
178 previous,
179 remoteConfigHash: hashRemoteConfigFile(remoteConfigPath),
180 daemon: buildDaemonState(flags),
181 };
182}
183
184function assertCompatibleConnectionOrForce(
185 previous: RemoteConnectionState | null,

Callers 1

connectCommandFunction · 0.85

Calls 5

hashRemoteConfigFileFunction · 0.90
createRemoteSessionNameFunction · 0.85
buildDaemonStateFunction · 0.85

Tested by

no test coverage detected