vibelet 1.0.8 → 1.0.10

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.
package/bin/vibelet.mjs CHANGED
@@ -241,6 +241,8 @@ function createDarwinBackend() {
241
241
  if (process.env.VIBELET_RELAY_URL) envVars.VIBELET_RELAY_URL = process.env.VIBELET_RELAY_URL;
242
242
  if (process.env.VIBELET_CANONICAL_HOST) envVars.VIBELET_CANONICAL_HOST = process.env.VIBELET_CANONICAL_HOST;
243
243
  if (process.env.VIBELET_FALLBACK_HOSTS) envVars.VIBELET_FALLBACK_HOSTS = process.env.VIBELET_FALLBACK_HOSTS;
244
+ if (process.env.CODEX_PATH) envVars.CODEX_PATH = process.env.CODEX_PATH;
245
+ if (process.env.CLAUDE_PATH) envVars.CLAUDE_PATH = process.env.CLAUDE_PATH;
244
246
  const envSection = Object.keys(envVars).length > 0
245
247
  ? ` <key>EnvironmentVariables</key>
246
248
  <dict>
@@ -313,8 +315,15 @@ ${envSection}
313
315
  },
314
316
 
315
317
  stop() {
316
- if (this.isServiceInstalled()) {
317
- launchctl(['bootout', `${launchDomain}/${label}`]);
318
+ if (!this.isServiceInstalled()) return;
319
+ launchctl(['bootout', `${launchDomain}/${label}`]);
320
+ // bootout returns before launchd actually finishes unloading. Poll
321
+ // until the service is gone so a follow-up install() doesn't see a
322
+ // stale registration, skip bootstrap, and leave the daemon down.
323
+ const deadline = Date.now() + 5000;
324
+ const wait = new Int32Array(new SharedArrayBuffer(4));
325
+ while (Date.now() < deadline && this.isServiceInstalled()) {
326
+ Atomics.wait(wait, 0, 0, 100);
318
327
  }
319
328
  },
320
329