@zixt/host 0.0.127 → 0.0.128

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import { homedir as homedir4 } from "node:os";
28
28
  // package.json
29
29
  var package_default = {
30
30
  name: "@zixt/host",
31
- version: "0.0.127",
31
+ version: "0.0.128",
32
32
  type: "module",
33
33
  exports: {
34
34
  ".": "./src/client.ts",
@@ -42638,6 +42638,7 @@ import { homedir as homedir12, userInfo as userInfo2 } from "node:os";
42638
42638
  import { basename as basename5, dirname as dirname12, join as join23, relative as relative10, resolve as resolve14, sep as sep7 } from "node:path";
42639
42639
  var LAUNCH_AGENT_LABEL = "ai.zixt.host";
42640
42640
  var SERVICE_STABILITY_DELAY_MS2 = 2e3;
42641
+ var STATUS_WAIT_MS = 2e4;
42641
42642
  var COMMAND_TIMEOUT_MS2 = 7e4;
42642
42643
  var COMMAND_OUTPUT_LIMIT2 = 64 * 1024;
42643
42644
  function oneLine2(value, name) {
@@ -42851,13 +42852,18 @@ async function installMacosService(options) {
42851
42852
  const observe = async () => {
42852
42853
  const result = await run3(launchctl, ["print", target]);
42853
42854
  if (result.code !== 0) throw commandFailure2("Checking Zixt startup", result);
42854
- const status = parseLaunchdStatus(result.stdout);
42855
- if (!status) throw new Error("Zixt started but did not reach a running process state.");
42856
- return status;
42855
+ return parseLaunchdStatus(result.stdout);
42857
42856
  };
42858
- const first = await observe();
42857
+ const deadline = Date.now() + (options.statusWaitMs ?? STATUS_WAIT_MS);
42858
+ let first = await observe();
42859
+ while (!first && Date.now() < deadline) {
42860
+ await delay4(250);
42861
+ first = await observe();
42862
+ }
42863
+ if (!first) throw new Error("Zixt started but did not reach a running process state.");
42859
42864
  await delay4(options.serviceStabilityDelayMs ?? SERVICE_STABILITY_DELAY_MS2);
42860
42865
  const second = await observe();
42866
+ if (!second) throw new Error("Zixt started but did not reach a running process state.");
42861
42867
  if (first.pid !== second.pid || first.runs !== second.runs) {
42862
42868
  throw new Error("Zixt started but restarted during its readiness check.");
42863
42869
  }
@@ -42881,7 +42887,7 @@ import { basename as basename6, dirname as dirname13, isAbsolute as isAbsolute18
42881
42887
  var TASK_NAME = "Zixt Host";
42882
42888
  var COMMAND_TIMEOUT_MS3 = 7e4;
42883
42889
  var SERVICE_STABILITY_DELAY_MS3 = 2e3;
42884
- var STATUS_WAIT_MS = 2e4;
42890
+ var STATUS_WAIT_MS2 = 2e4;
42885
42891
  var SAFE_SID = /^S-1-(?:\d+-){1,14}\d+$/;
42886
42892
  function oneLine3(value, name) {
42887
42893
  if (!value || /[\0\r\n]/.test(value)) throw new Error(`${name} is not a valid one-line value`);
@@ -43217,7 +43223,7 @@ async function installWindowsService(options) {
43217
43223
  if (create.code !== 0) throw commandFailure3("Installing Zixt at sign-in", create);
43218
43224
  const start = await run3(schtasks, ["/Run", "/TN", TASK_NAME]);
43219
43225
  if (start.code !== 0) throw commandFailure3("Starting Zixt", start);
43220
- const deadline = Date.now() + (options.statusWaitMs ?? STATUS_WAIT_MS);
43226
+ const deadline = Date.now() + (options.statusWaitMs ?? STATUS_WAIT_MS2);
43221
43227
  let first = null;
43222
43228
  do {
43223
43229
  first = await observe(statusPath, generation);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zixt/host",
3
- "version": "0.0.127",
3
+ "version": "0.0.128",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/client.ts",