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

Function acceptSupervisedConnection

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

Source from the content-addressed store, hash-verified

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