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

Function acceptSupervisedConnection

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

Source from the content-addressed store, hash-verified

267};
268
269const acceptSupervisedConnection = async (
270 attached: SidecarConnection,
271): Promise<SidecarConnection | null> => {
272 if (!shouldReplaceDaemonForDesktop(attached)) return attached;
273 const settings = getServerSettings();
274 return replaceSupervisedDaemonForDesktop(attached, {
275 install: () =>
276 installSupervisedService({
277 port: settings.port,
278 dataDir: DESKTOP_DATA_DIR,
279 }),
280 waitForAttach: () => waitForSupervisedAttach(30_000, { port: settings.port }),
281 attach: attachToSupervisedDaemon,
282 onInstallFailure: (error) => {
283 log.warn("Failed to replace older supervised daemon; re-checking before falling back", error);
284 },
285 });
286};
287
288const installSupervisedAndWait = async (reason: string): Promise<SidecarConnection | null> => {
289 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