mindwire 0.1.30 → 0.1.32

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.30" ;
82
+ var SDK_VERSION = "0.1.32" ;
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;
@@ -751,6 +751,10 @@ var WorkspaceApi = class {
751
751
  snapshot(options = {}) {
752
752
  return this.mw.http.request("GET", "/workspace", { query: options });
753
753
  }
754
+ /** Read the saved icon, or preview a candidate relative path within the project. Requires projectIconsVersion >= 1. */
755
+ projectIcon(projectId, path2) {
756
+ return this.mw.http.request("GET", `/workspace/projects/${encodeURIComponent(projectId)}/icon`, { query: { path: path2 } });
757
+ }
754
758
  /** Start an operation owned by the daemon. The same ID/payload returns the existing operation. */
755
759
  createProject(request) {
756
760
  return this.mw.http.request("POST", "/workspace/projects", { body: request });
@@ -807,7 +811,7 @@ var GitAccessApi = class {
807
811
  run(projectId, operation, auth) {
808
812
  return this.mw.http.request("POST", `/workspace/projects/${encodeURIComponent(projectId)}/git/${operation}`, { body: { auth } });
809
813
  }
810
- /** Requires health.gitOperationsVersion >= 1 (>= 2 for branches, >= 4 for restore_commit). Acceptance persists before Git runs;
814
+ /** Requires health.gitOperationsVersion >= 1 (>= 2 for switch/create, >= 4 for restore_commit, >= 5 for rename/delete). Acceptance persists before Git runs;
811
815
  * disconnecting only detaches the client. The same ID/intent never runs twice.
812
816
  */
813
817
  start(projectId, request) {
@@ -817,7 +821,7 @@ var GitAccessApi = class {
817
821
  const result = await this.mw.http.request(
818
822
  "GET",
819
823
  `/workspace/projects/${encodeURIComponent(projectId)}/git/operations`,
820
- { query: { active: activeOnly, actionsVersion: 4 } }
824
+ { query: { active: activeOnly, actionsVersion: 5 } }
821
825
  );
822
826
  return result.operations;
823
827
  }
@@ -1955,9 +1959,11 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
1955
1959
  let launchFailure;
1956
1960
  const waitUntilReady = async () => {
1957
1961
  let phase;
1962
+ let lastState;
1958
1963
  for (let attempt = 0; attempt < 1200; attempt++) {
1959
1964
  options.signal?.throwIfAborted();
1960
1965
  const controller = await readJSON(path.join(directory, "computer-controller.json"));
1966
+ lastState = controller;
1961
1967
  if (launchFailure) throw launchFailure;
1962
1968
  if (launchedPID && controller?.pid !== launchedPID) {
1963
1969
  await setTimeout$1(250);
@@ -1971,7 +1977,9 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
1971
1977
  }
1972
1978
  await setTimeout$1(250);
1973
1979
  }
1974
- throw new Error(`Mindwire did not finish starting. Inspect ${path.join(directory, "computer.log")}.`);
1980
+ const lastStep = lastState?.errorCode === "dns" ? "Your DNS resolver still cannot find the tunnel address." : lastState?.error ?? phase ?? "The background service hasn't reported readiness.";
1981
+ const recovering = lastState?.recovering && await processStateAlive(lastState).catch(() => false);
1982
+ 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.`);
1975
1983
  };
1976
1984
  if (current) {
1977
1985
  if (Object.keys(patch).some((key) => JSON.stringify(config[key]) !== JSON.stringify(previous?.[key]))) {
@@ -2014,7 +2022,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
2014
2022
  let controller = await readJSON(path.join(directory, "computer-controller.json"));
2015
2023
  if (existing && controller && !compatible(controller) && await processStateAlive(controller)) {
2016
2024
  onProgress?.("Refreshing the background connection service\u2026");
2017
- const { handoffController } = await import('./controller-handoff-4GXF4ATR.js');
2025
+ const { handoffController } = await import('./controller-handoff-7S6SKFHX.js');
2018
2026
  await handoffController(directory, controller, config, await existing.computer.info());
2019
2027
  controller = void 0;
2020
2028
  }
@@ -2048,7 +2056,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
2048
2056
  }
2049
2057
  }
2050
2058
  async function superviseComputer(directory) {
2051
- const controller = await import('./controller-DIJKMWWU.js');
2059
+ const controller = await import('./controller-CHJ5MMZS.js');
2052
2060
  await controller.superviseComputer(directory);
2053
2061
  }
2054
2062
  async function stopComputer(directory, force = false) {
@@ -2073,5 +2081,5 @@ async function stopComputer(directory, force = false) {
2073
2081
  }
2074
2082
 
2075
2083
  export { CONTROLLER_PROTOCOL, SDK_VERSION, acquireProcessLock, adoptProcess, computerClient, computerPairingQRData, computerPairingURI, currentProcessIdentity, defaultStateDirectory, directRoutes, ensureComputer, ensureDaemonBinary, ownChild, processIdentity, processStateAlive, readJSON, stopComputer, superviseComputer, writeJSON };
2076
- //# sourceMappingURL=chunk-RN7ERVJ2.js.map
2077
- //# sourceMappingURL=chunk-RN7ERVJ2.js.map
2084
+ //# sourceMappingURL=chunk-5X5PAFM7.js.map
2085
+ //# sourceMappingURL=chunk-5X5PAFM7.js.map