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

Function waitForSupervisedAttach

apps/desktop/src/main/index.ts:236–247  ·  view source on GitHub ↗
(
  timeoutMs: number,
  options: { readonly port?: number } = {},
)

Source from the content-addressed store, hash-verified

234
235/** Poll for a reachable supervised daemon until the deadline. */
236const waitForSupervisedAttach = async (
237 timeoutMs: number,
238 options: { readonly port?: number } = {},
239): Promise<SidecarConnection | null> => {
240 const deadline = Date.now() + timeoutMs;
241 for (;;) {
242 const attached = await attachToSupervisedDaemon();
243 if (attached && (options.port === undefined || attached.port === options.port)) return attached;
244 if (Date.now() >= deadline) return null;
245 await delay(300);
246 }
247};
248
249const confirmEnableBackgroundService = async (): Promise<boolean> => {
250 // EXECUTOR_TEST_AUTO_CONFIRM_BACKGROUND_SERVICE skips the modal, the same seam

Callers 6

installSupervisedAndWaitFunction · 0.85
startWithCurrentSettingsFunction · 0.85
restartSidecarAndReloadFunction · 0.85
registerIpcHandlersFunction · 0.85

Calls 2

attachToSupervisedDaemonFunction · 0.90
delayFunction · 0.70

Tested by

no test coverage detected