@lazehq/cli 0.1.22 → 0.1.23

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/laze.mjs +21 -7
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -35620,7 +35620,7 @@ function flagText({
35620
35620
  }
35621
35621
 
35622
35622
  // src/rules/cli-version.rules.ts
35623
- var STAMPED = "0.1.22";
35623
+ var STAMPED = "0.1.23";
35624
35624
  function cliVersionOf({ stamped = STAMPED } = {}) {
35625
35625
  return stamped.startsWith("__") ? "dev" : stamped;
35626
35626
  }
@@ -67520,17 +67520,30 @@ async function startRushGuard({
67520
67520
  rush
67521
67521
  }) {
67522
67522
  const path = guardPathOf({ context, claudePid });
67523
- const holder = await readFile6(path, "utf8").then(
67524
- (text2) => JSON.parse(text2),
67525
- () => void 0
67526
- );
67523
+ const holder = await guardHolderOf({ path });
67527
67524
  if (holder && context.processes.alive(holder.pid)) return;
67528
67525
  const flags2 = ["--profile", profile, "--claude-pid", String(claudePid), "--rush-id", rush.id];
67529
67526
  const argv = [...context.program, "hook", "rush-wake", ...flags2, "--rush-program", rush.program];
67530
67527
  const logPath = join6(dirname5(context.environment.configPath), "rush-guards", "guard.log");
67531
- const pid = context.processes.spawnDetached({ argv, logPath });
67528
+ context.processes.spawnDetached({ argv: ["sh", "-c", '"$@" &', "sh", ...argv], logPath });
67529
+ }
67530
+ async function claimRushGuard({
67531
+ context,
67532
+ claudePid
67533
+ }) {
67534
+ const path = guardPathOf({ context, claudePid });
67535
+ const holder = await guardHolderOf({ path });
67536
+ const self2 = context.processes.pid;
67537
+ if (holder && holder.pid !== self2 && context.processes.alive(holder.pid)) return false;
67532
67538
  await mkdir5(dirname5(path), { recursive: true, mode: 448 });
67533
- await writeFile5(path, JSON.stringify({ pid, claudePid }), { mode: 384 });
67539
+ await writeFile5(path, JSON.stringify({ pid: self2, claudePid }), { mode: 384 });
67540
+ return true;
67541
+ }
67542
+ function guardHolderOf({ path }) {
67543
+ return readFile6(path, "utf8").then(
67544
+ (text2) => JSON.parse(text2),
67545
+ () => void 0
67546
+ );
67534
67547
  }
67535
67548
 
67536
67549
  // src/services/claude-wait.service.ts
@@ -82404,6 +82417,7 @@ async function rushWakeHook({ context, args }) {
82404
82417
  const id = flagText({ args, name: "rush-id" });
82405
82418
  const program = flagText({ args, name: "rush-program" }) || "rush";
82406
82419
  if (!claudePid || !id) return 1;
82420
+ if (!await claimRushGuard({ context, claudePid })) return 0;
82407
82421
  const path = guardPathOf({ context, claudePid });
82408
82422
  try {
82409
82423
  while (context.processes.alive(claudePid)) await context.sleep(WATCH_MS3);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazehq/cli",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "The Laze command line: sign in, read and post in chat, and connect your own Claude Code or Codex session as an agent.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",