@lazehq/cli 0.1.31 → 0.1.33
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/laze.mjs +26 -6
- 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.
|
|
35711
|
+
var STAMPED = "0.1.33";
|
|
35712
35712
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
35713
35713
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
35714
35714
|
}
|
|
@@ -66874,6 +66874,17 @@ function rushStandingOf({ one }) {
|
|
|
66874
66874
|
if (!one || one.state === "stopped") return "stopped";
|
|
66875
66875
|
return one.alive === false ? "asleep" : "awake";
|
|
66876
66876
|
}
|
|
66877
|
+
var LAUNCH_NAMES = ["IS_SANDBOX", "CLAUDE_CONFIG_DIR", "HOME", "PATH"];
|
|
66878
|
+
function launchEnvOf({
|
|
66879
|
+
inherited
|
|
66880
|
+
}) {
|
|
66881
|
+
const picked = {};
|
|
66882
|
+
for (const name2 of LAUNCH_NAMES) {
|
|
66883
|
+
const value = inherited[name2];
|
|
66884
|
+
if (value !== void 0) picked[name2] = value;
|
|
66885
|
+
}
|
|
66886
|
+
return picked;
|
|
66887
|
+
}
|
|
66877
66888
|
|
|
66878
66889
|
// src/services/claude-project.service.ts
|
|
66879
66890
|
import { basename as basename2, isAbsolute, relative as relative2, resolve as resolve2 } from "node:path";
|
|
@@ -67024,7 +67035,8 @@ async function rememberSession({
|
|
|
67024
67035
|
if (!session || !claudePid) return;
|
|
67025
67036
|
const path = statePathOf({ context, kind: "sessions", profile: String(claudePid) });
|
|
67026
67037
|
await mkdir3(dirname3(path), { recursive: true, mode: 448 });
|
|
67027
|
-
|
|
67038
|
+
const launch = launchEnvOf({ inherited: context.environment.inherited });
|
|
67039
|
+
await writeFile3(path, JSON.stringify({ ...session, launch }), { mode: 384 });
|
|
67028
67040
|
}
|
|
67029
67041
|
async function currentSessionOf({
|
|
67030
67042
|
context,
|
|
@@ -67871,6 +67883,8 @@ function systemdUnitOf({
|
|
|
67871
67883
|
...environment,
|
|
67872
67884
|
"Restart=on-failure",
|
|
67873
67885
|
"RestartSec=5",
|
|
67886
|
+
// The rush guards it starts outlive a restart, such as the one after a CLI update.
|
|
67887
|
+
"KillMode=process",
|
|
67874
67888
|
"",
|
|
67875
67889
|
"[Install]",
|
|
67876
67890
|
"WantedBy=default.target",
|
|
@@ -67910,6 +67924,8 @@ function launchAgentOf({
|
|
|
67910
67924
|
" <true/>",
|
|
67911
67925
|
" <key>KeepAlive</key>",
|
|
67912
67926
|
" <true/>",
|
|
67927
|
+
" <key>AbandonProcessGroup</key>",
|
|
67928
|
+
" <true/>",
|
|
67913
67929
|
" <key>StandardOutPath</key>",
|
|
67914
67930
|
` <string>${xmlOf(logPath)}</string>`,
|
|
67915
67931
|
" <key>StandardErrorPath</key>",
|
|
@@ -83211,7 +83227,8 @@ function watchingRelease({
|
|
|
83211
83227
|
import { readFile as readFile32, rm as rm13 } from "node:fs/promises";
|
|
83212
83228
|
var WATCH_MS3 = 2e3;
|
|
83213
83229
|
var RETRY_MS2 = 3e4;
|
|
83214
|
-
async function guardRound(
|
|
83230
|
+
async function guardRound(guard) {
|
|
83231
|
+
const { context, client, name: name2, lock, claudePid, session, rush, launch } = guard;
|
|
83215
83232
|
const key = session ? sessionKeyOf({ session }) : void 0;
|
|
83216
83233
|
if (key && await liveElsewhere({ context, key, claudePid, asleepCounts: false })) return true;
|
|
83217
83234
|
const holder = await holderOf({ path: lock });
|
|
@@ -83224,7 +83241,7 @@ async function guardRound({ context, client, name: name2, lock, claudePid, sessi
|
|
|
83224
83241
|
if (messages.length === 0) return false;
|
|
83225
83242
|
await keepTaken({ context, profile: name2, messages });
|
|
83226
83243
|
const self2 = await currentNameOf({ context, client, profile: name2 });
|
|
83227
|
-
const env = { LAZE_WAKE_TEXT: hookContextOf({ messages, self: self2 }) };
|
|
83244
|
+
const env = { ...launch, LAZE_WAKE_TEXT: hookContextOf({ messages, self: self2 }) };
|
|
83228
83245
|
if (await context.runCommand({ command: rushSendCommand(rush), env }) !== 0) return false;
|
|
83229
83246
|
await turnStarted({ context, client, agent: name2, messages }).catch(() => void 0);
|
|
83230
83247
|
await dropFromSpool({ context, profile: name2, messageIds: messages.map((m) => m.messageId) });
|
|
@@ -83244,12 +83261,15 @@ async function rushWakeHook({ context, args }) {
|
|
|
83244
83261
|
while (context.processes.alive(claudePid)) await context.sleep(WATCH_MS3);
|
|
83245
83262
|
const { client, name: name2 } = await signedIn({ context, args });
|
|
83246
83263
|
const noted = statePathOf({ context, kind: "sessions", profile: String(claudePid) });
|
|
83247
|
-
const
|
|
83264
|
+
const note = await readFile32(noted, "utf8").then(
|
|
83248
83265
|
(text2) => JSON.parse(text2),
|
|
83249
83266
|
() => void 0
|
|
83250
83267
|
);
|
|
83268
|
+
const { launch = {}, ...session } = note ?? {};
|
|
83251
83269
|
const lock = statePathOf({ context, kind: "waiters", profile: name2 });
|
|
83252
|
-
const
|
|
83270
|
+
const rush = { id, program };
|
|
83271
|
+
const known = note ? session : void 0;
|
|
83272
|
+
const guard = { context, client, name: name2, lock, claudePid, session: known, rush, launch };
|
|
83253
83273
|
const deadline = context.nowMs() + WAIT_HOOK_TIMEOUT_SECONDS * 1e3;
|
|
83254
83274
|
try {
|
|
83255
83275
|
while (context.nowMs() < deadline) {
|
package/package.json
CHANGED