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

Function acceptSupervisedConnection

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

Source from the content-addressed store, hash-verified

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