@lazehq/cli 0.1.39 → 0.1.40

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 +32 -8
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -35708,7 +35708,7 @@ function flagText({
35708
35708
  }
35709
35709
 
35710
35710
  // src/rules/cli-version.rules.ts
35711
- var STAMPED = "0.1.39";
35711
+ var STAMPED = "0.1.40";
35712
35712
  function cliVersionOf({ stamped = STAMPED } = {}) {
35713
35713
  return stamped.startsWith("__") ? "dev" : stamped;
35714
35714
  }
@@ -67490,6 +67490,7 @@ async function claudeProjectOf({
67490
67490
  import { mkdir as mkdir2, readFile as readFile2, rename as rename2, writeFile as writeFile2 } from "node:fs/promises";
67491
67491
  import { dirname as dirname2, join as join2 } from "node:path";
67492
67492
  var PUSH_GRACE_MS = 3 * 6e4;
67493
+ var IN_FLIGHT_MS = 35e3;
67493
67494
  function fileNameOf({ profile }) {
67494
67495
  return profile.replace(/[^a-zA-Z0-9_-]/g, "_");
67495
67496
  }
@@ -67548,7 +67549,8 @@ async function dueFromSpool({
67548
67549
  context,
67549
67550
  profile,
67550
67551
  seen,
67551
- pushedToo
67552
+ pushedToo,
67553
+ settledOnly = false
67552
67554
  }) {
67553
67555
  const path = statePathOf({ context, kind: "spool", profile });
67554
67556
  const entries = await readSpool({ path });
@@ -67563,7 +67565,8 @@ async function dueFromSpool({
67563
67565
  messageIds: shown.map((entry) => entry.message.messageId)
67564
67566
  });
67565
67567
  const late = context.nowMs() - PUSH_GRACE_MS;
67566
- return entries.filter((entry) => !shown.includes(entry)).filter((entry) => entry.pushedAt === void 0 || pushedToo && entry.pushedAt <= late).map((entry) => entry.message);
67568
+ const settled2 = context.nowMs() - IN_FLIGHT_MS;
67569
+ return entries.filter((entry) => !shown.includes(entry)).filter((entry) => !settledOnly || entry.takenAt <= settled2).filter((entry) => entry.pushedAt === void 0 || pushedToo && entry.pushedAt <= late).map((entry) => entry.message);
67567
67570
  }
67568
67571
 
67569
67572
  // src/services/harness-session.service.ts
@@ -69706,7 +69709,7 @@ async function stopInstalled({
69706
69709
  installed
69707
69710
  }) {
69708
69711
  if (installed.manager === "systemd") {
69709
- await run({ context, command: ["systemctl", "--user", "stop", `${installed.name}.service`] });
69712
+ await quietly({ context, script: `systemctl --user stop '${installed.name}.service'` });
69710
69713
  } else if (installed.manager === "launchd") {
69711
69714
  await quietly({ context, script: `launchctl bootout gui/$(id -u)/${installed.name}` });
69712
69715
  } else if (installed.pid) {
@@ -69731,6 +69734,8 @@ async function installConnectService({ context }) {
69731
69734
  async function ensureConnectService({ context }) {
69732
69735
  const running = await runStateOf({ context });
69733
69736
  if (running && context.processes.alive(running.pid)) return false;
69737
+ const installed = await readJson({ path: installedPathOf({ context }) });
69738
+ if (installed && installed.manager !== "detached") return false;
69734
69739
  await installConnectService({ context });
69735
69740
  return true;
69736
69741
  }
@@ -69934,7 +69939,13 @@ async function takeRound2({
69934
69939
  async function roundOf({ context, client, name: name3, lock, claudePid, session, seen }) {
69935
69940
  if ((await holderOf({ path: lock }))?.pid !== context.processes.pid) return void 0;
69936
69941
  if (claudePid && !context.processes.alive(claudePid)) return void 0;
69937
- const due = await dueFromSpool({ context, profile: name3, seen, pushedToo: true });
69942
+ const due = await dueFromSpool({
69943
+ context,
69944
+ profile: name3,
69945
+ seen,
69946
+ pushedToo: true,
69947
+ settledOnly: true
69948
+ });
69938
69949
  if (due.length > 0) return due;
69939
69950
  if (await channelLive({ context, profile: name3 })) {
69940
69951
  await context.sleep(CHANNEL_CHECK_MS);
@@ -71213,7 +71224,8 @@ async function handOver({ context, args }) {
71213
71224
  context,
71214
71225
  profile: agent2,
71215
71226
  seen: () => input2.transcript_path ? readFile14(input2.transcript_path, "utf8") : Promise.resolve(""),
71216
- pushedToo: false
71227
+ pushedToo: false,
71228
+ settledOnly: true
71217
71229
  });
71218
71230
  const claim3 = forSession({ client, session });
71219
71231
  let fresh;
@@ -77881,7 +77893,13 @@ async function deliverOnce({
77881
77893
  }
77882
77894
  const named = { ...args, flags: { ...args.flags, profile } };
77883
77895
  const { client } = await signedIn({ context, args: named });
77884
- const due = await dueFromSpool({ context, profile, seen: async () => "", pushedToo: true });
77896
+ const due = await dueFromSpool({
77897
+ context,
77898
+ profile,
77899
+ seen: async () => "",
77900
+ pushedToo: true,
77901
+ settledOnly: true
77902
+ });
77885
77903
  const taken = due.length > 0 ? [] : await takeRound2({ context, client, claudePid, session });
77886
77904
  const messages = [...due, ...taken];
77887
77905
  if (messages.length === 0) {
@@ -84443,7 +84461,13 @@ async function guardRound(guard) {
84443
84461
  if (!await takeLock({ context, path: lock, claudePid, ...sessionIdOf({ session }) }))
84444
84462
  return true;
84445
84463
  }
84446
- const due = await dueFromSpool({ context, profile: name3, seen: async () => "", pushedToo: true });
84464
+ const due = await dueFromSpool({
84465
+ context,
84466
+ profile: name3,
84467
+ seen: async () => "",
84468
+ pushedToo: true,
84469
+ settledOnly: true
84470
+ });
84447
84471
  const messages = due.length > 0 ? due : await takeRound2({ context, client, claudePid: 0, session });
84448
84472
  if (messages.length === 0) return false;
84449
84473
  await keepTaken({ context, profile: name3, messages });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazehq/cli",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
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",