@lazehq/cli 0.1.32 → 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 +22 -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,
|
|
@@ -83215,7 +83227,8 @@ function watchingRelease({
|
|
|
83215
83227
|
import { readFile as readFile32, rm as rm13 } from "node:fs/promises";
|
|
83216
83228
|
var WATCH_MS3 = 2e3;
|
|
83217
83229
|
var RETRY_MS2 = 3e4;
|
|
83218
|
-
async function guardRound(
|
|
83230
|
+
async function guardRound(guard) {
|
|
83231
|
+
const { context, client, name: name2, lock, claudePid, session, rush, launch } = guard;
|
|
83219
83232
|
const key = session ? sessionKeyOf({ session }) : void 0;
|
|
83220
83233
|
if (key && await liveElsewhere({ context, key, claudePid, asleepCounts: false })) return true;
|
|
83221
83234
|
const holder = await holderOf({ path: lock });
|
|
@@ -83228,7 +83241,7 @@ async function guardRound({ context, client, name: name2, lock, claudePid, sessi
|
|
|
83228
83241
|
if (messages.length === 0) return false;
|
|
83229
83242
|
await keepTaken({ context, profile: name2, messages });
|
|
83230
83243
|
const self2 = await currentNameOf({ context, client, profile: name2 });
|
|
83231
|
-
const env = { LAZE_WAKE_TEXT: hookContextOf({ messages, self: self2 }) };
|
|
83244
|
+
const env = { ...launch, LAZE_WAKE_TEXT: hookContextOf({ messages, self: self2 }) };
|
|
83232
83245
|
if (await context.runCommand({ command: rushSendCommand(rush), env }) !== 0) return false;
|
|
83233
83246
|
await turnStarted({ context, client, agent: name2, messages }).catch(() => void 0);
|
|
83234
83247
|
await dropFromSpool({ context, profile: name2, messageIds: messages.map((m) => m.messageId) });
|
|
@@ -83248,12 +83261,15 @@ async function rushWakeHook({ context, args }) {
|
|
|
83248
83261
|
while (context.processes.alive(claudePid)) await context.sleep(WATCH_MS3);
|
|
83249
83262
|
const { client, name: name2 } = await signedIn({ context, args });
|
|
83250
83263
|
const noted = statePathOf({ context, kind: "sessions", profile: String(claudePid) });
|
|
83251
|
-
const
|
|
83264
|
+
const note = await readFile32(noted, "utf8").then(
|
|
83252
83265
|
(text2) => JSON.parse(text2),
|
|
83253
83266
|
() => void 0
|
|
83254
83267
|
);
|
|
83268
|
+
const { launch = {}, ...session } = note ?? {};
|
|
83255
83269
|
const lock = statePathOf({ context, kind: "waiters", profile: name2 });
|
|
83256
|
-
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 };
|
|
83257
83273
|
const deadline = context.nowMs() + WAIT_HOOK_TIMEOUT_SECONDS * 1e3;
|
|
83258
83274
|
try {
|
|
83259
83275
|
while (context.nowMs() < deadline) {
|
package/package.json
CHANGED