MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / acceptSupervisedConnection

Function acceptSupervisedConnection

apps/desktop/src/main/index.ts:230–247  ·  view source on GitHub ↗
(
  attached: SidecarConnection,
)

Source from the content-addressed store, hash-verified

228};
229
230const acceptSupervisedConnection = async (
231 attached: SidecarConnection,
232): Promise<SidecarConnection | null> => {
233 if (!shouldReplaceDaemonForDesktop(attached)) return attached;
234 const settings = getServerSettings();
235 return replaceSupervisedDaemonForDesktop(attached, {
236 install: () =>
237 installSupervisedService({
238 port: settings.port,
239 dataDir: DESKTOP_DATA_DIR,
240 }),
241 waitForAttach: () => waitForSupervisedAttach(30_000, { port: settings.port }),
242 attach: attachToSupervisedDaemon,
243 onInstallFailure: (error) => {
244 log.warn("Failed to replace older supervised daemon; re-checking before falling back", error);
245 },
246 });
247};
248
249const installSupervisedAndWait = async (reason: string): Promise<SidecarConnection | null> => {
250 const settings = getServerSettings();

Callers 1

Calls 6

getServerSettingsFunction · 0.90
installSupervisedServiceFunction · 0.90
waitForSupervisedAttachFunction · 0.85
warnMethod · 0.80

Tested by

no test coverage detected