recappi 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.
package/dist/index.js CHANGED
@@ -20384,14 +20384,31 @@ function spawnLaunchServicesSidecar(opts) {
20384
20384
  return {
20385
20385
  client,
20386
20386
  kill: () => {
20387
+ requestLaunchServicesSidecarShutdown(input);
20387
20388
  client.close();
20388
20389
  input.end();
20389
20390
  output.destroy();
20390
- child.kill();
20391
+ const killTimer = setTimeout(() => child.kill(), 2e3);
20392
+ killTimer.unref?.();
20393
+ child.once("exit", () => clearTimeout(killTimer));
20391
20394
  cleanup();
20392
20395
  }
20393
20396
  };
20394
20397
  }
20398
+ function requestLaunchServicesSidecarShutdown(input) {
20399
+ try {
20400
+ input.write(
20401
+ `${JSON.stringify({
20402
+ jsonrpc: "2.0",
20403
+ id: "shutdown",
20404
+ method: "recappi.shutdown",
20405
+ params: {}
20406
+ })}
20407
+ `
20408
+ );
20409
+ } catch {
20410
+ }
20411
+ }
20395
20412
  function createFifo(path6) {
20396
20413
  const result = spawnSync("mkfifo", [path6], { encoding: "utf8" });
20397
20414
  if (result.status !== 0) {
@@ -20745,8 +20762,8 @@ function ensureStableDarwinHelperApp(sourceApp, opts = {}) {
20745
20762
  }
20746
20763
  }
20747
20764
  function stableDarwinHelperAppPath(opts = {}) {
20748
- const base = opts.env?.RECAPPI_HELPER_HOME?.trim() || join2(opts.homeDir ?? homedir(), "Library", "Application Support", "Recappi", "CLI Helper");
20749
- return join2(base, `${process.platform}-${process.arch}`, SIDECAR_APP_BUNDLE_NAME);
20765
+ const base = opts.env?.RECAPPI_HELPER_HOME?.trim() || join2(opts.homeDir ?? homedir(), "Library", "Application Support", "Recappi");
20766
+ return join2(base, SIDECAR_APP_BUNDLE_NAME);
20750
20767
  }
20751
20768
  function helperSourceSignature(sourceApp) {
20752
20769
  const executable = statSync(darwinAppExecutablePath(sourceApp));