mindwire 0.1.33 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,7 +79,7 @@ function computerPairingURI(invitation) {
79
79
  }
80
80
 
81
81
  // src/version.ts
82
- var SDK_VERSION = "0.1.33" ;
82
+ var SDK_VERSION = "0.1.34" ;
83
83
  function versionAtLeast(actual, desired) {
84
84
  if (actual === desired) return true;
85
85
  if (!actual || !/^\d+\.\d+\.\d+$/.test(actual) || !/^\d+\.\d+\.\d+$/.test(desired)) return false;
@@ -2127,13 +2127,14 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
2127
2127
  const waitUntilReady = async () => {
2128
2128
  let phase;
2129
2129
  let lastState;
2130
- for (let attempt = 0; attempt < 1200; attempt++) {
2130
+ const deadline = Date.now() + (options.timeoutMs ?? 12e4);
2131
+ while (Date.now() < deadline) {
2131
2132
  options.signal?.throwIfAborted();
2132
2133
  const controller = await readJSON(path.join(directory, "computer-controller.json"));
2133
2134
  lastState = controller;
2134
2135
  if (launchFailure) throw launchFailure;
2135
2136
  if (launchedPID && controller?.pid !== launchedPID) {
2136
- await setTimeout$1(250);
2137
+ await setTimeout$1(250, void 0, { signal: options.signal });
2137
2138
  continue;
2138
2139
  }
2139
2140
  if (controller?.error && !controller.recovering) throw new Error(controller.error);
@@ -2142,11 +2143,11 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
2142
2143
  phase = controller.phase;
2143
2144
  onProgress?.(phase);
2144
2145
  }
2145
- await setTimeout$1(250);
2146
+ await setTimeout$1(250, void 0, { signal: options.signal });
2146
2147
  }
2147
- const lastStep = lastState?.errorCode === "dns" ? "Your DNS resolver still cannot find the tunnel address." : lastState?.error ?? phase ?? "The background service hasn't reported readiness.";
2148
+ const lastStep = lastState?.errorCode === "dns" ? "The internet address still cannot be resolved." : lastState?.error ?? phase ?? "The background service hasn't reported readiness.";
2148
2149
  const recovering = lastState?.recovering && await processStateAlive(lastState).catch(() => false);
2149
- throw new Error(`Mindwire's connection is not ready. ${lastStep}${recovering ? " Background recovery continues." : ""} Run mindwire status for the current state, then mindwire connect to retry.`);
2150
+ throw new Error(`Mindwire's connection is not ready. ${lastStep}${recovering ? " Background recovery continues." : ""} Run mindwire reconnect to retry, or mindwire status for details.`);
2150
2151
  };
2151
2152
  if (current) {
2152
2153
  if (Object.keys(patch).some((key) => JSON.stringify(config[key]) !== JSON.stringify(previous?.[key]))) {
@@ -2189,7 +2190,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
2189
2190
  let controller = await readJSON(path.join(directory, "computer-controller.json"));
2190
2191
  if (existing && controller && !compatible(controller) && await processStateAlive(controller)) {
2191
2192
  onProgress?.("Refreshing the background connection service\u2026");
2192
- const { handoffController } = await import('./controller-handoff-NFDOLPJL.js');
2193
+ const { handoffController } = await import('./controller-handoff-3LAYBJUL.js');
2193
2194
  await handoffController(directory, controller, config, await existing.computer.info());
2194
2195
  controller = void 0;
2195
2196
  }
@@ -2223,7 +2224,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
2223
2224
  }
2224
2225
  }
2225
2226
  async function superviseComputer(directory) {
2226
- const controller = await import('./controller-QBC6L7AT.js');
2227
+ const controller = await import('./controller-AGT6MCJG.js');
2227
2228
  await controller.superviseComputer(directory);
2228
2229
  }
2229
2230
  async function stopComputer(directory, force = false) {
@@ -2248,5 +2249,5 @@ async function stopComputer(directory, force = false) {
2248
2249
  }
2249
2250
 
2250
2251
  export { CONTROLLER_PROTOCOL, SDK_VERSION, acquireProcessLock, adoptProcess, computerClient, computerPairingQRData, computerPairingURI, currentProcessIdentity, defaultStateDirectory, directRoutes, ensureComputer, ensureDaemonBinary, ownChild, processIdentity, processStateAlive, readJSON, stopComputer, superviseComputer, writeJSON };
2251
- //# sourceMappingURL=chunk-H2I3VRBS.js.map
2252
- //# sourceMappingURL=chunk-H2I3VRBS.js.map
2252
+ //# sourceMappingURL=chunk-3QFDSYKC.js.map
2253
+ //# sourceMappingURL=chunk-3QFDSYKC.js.map