MCPcopy
hub / github.com/callstack/agent-device / resolveConnectProfile

Function resolveConnectProfile

src/cli/commands/connection.ts:89–119  ·  view source on GitHub ↗
(options: {
  provider?: ConnectProvider;
  flags: CliFlags;
  stateDir: string;
})

Source from the content-addressed store, hash-verified

87};
88
89async function resolveConnectProfile(options: {
90 provider?: ConnectProvider;
91 flags: CliFlags;
92 stateDir: string;
93}): Promise<{ flags: CliFlags; remoteConfigPath: string }> {
94 const { provider, flags, stateDir } = options;
95 if (flags.remoteConfig) return resolveRemoteConnectFlags(flags);
96 if (isDirectDeviceConnectProvider(provider)) {
97 return resolveCloudWebDriverConnectProfile({
98 provider,
99 flags,
100 stateDir,
101 cwd: process.cwd(),
102 env: process.env,
103 });
104 }
105 if (provider === 'proxy' || (!provider && shouldUseProxyConnectShortcut(flags))) {
106 return resolveProxyConnectProfile({
107 flags,
108 stateDir,
109 cwd: process.cwd(),
110 env: process.env,
111 });
112 }
113 return await resolveCloudConnectProfile({
114 flags,
115 stateDir,
116 cwd: process.cwd(),
117 env: process.env,
118 });
119}
120
121function assertConnectProviderUsage(provider: ConnectProvider | undefined, flags: CliFlags): void {
122 if (!provider || !flags.remoteConfig) return;

Callers 1

connectCommandFunction · 0.85

Tested by

no test coverage detected