@lazehq/cli 0.1.18 → 0.1.19
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 +27 -8
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -31497,7 +31497,8 @@ function runRedacted({
|
|
|
31497
31497
|
baseEnv,
|
|
31498
31498
|
stdout: stdout2,
|
|
31499
31499
|
stderr: stderr2,
|
|
31500
|
-
cwd
|
|
31500
|
+
cwd,
|
|
31501
|
+
signal
|
|
31501
31502
|
}) {
|
|
31502
31503
|
const values = Object.values(env);
|
|
31503
31504
|
return new Promise((resolve17, reject) => {
|
|
@@ -31505,8 +31506,12 @@ function runRedacted({
|
|
|
31505
31506
|
const child = spawn(file3, args, {
|
|
31506
31507
|
env: { ...baseEnv, ...env },
|
|
31507
31508
|
stdio: ["inherit", "pipe", "pipe"],
|
|
31508
|
-
...cwd ? { cwd } : {}
|
|
31509
|
+
...cwd ? { cwd } : {},
|
|
31510
|
+
...signal ? { detached: true } : {}
|
|
31509
31511
|
});
|
|
31512
|
+
const killGroup = () => killProcessGroup({ child });
|
|
31513
|
+
if (signal?.aborted) killGroup();
|
|
31514
|
+
signal?.addEventListener("abort", killGroup, { once: true });
|
|
31510
31515
|
const pipe2 = (stream, sink) => {
|
|
31511
31516
|
const decoder2 = new StringDecoder("utf8");
|
|
31512
31517
|
const redactor = createRedactor({ values });
|
|
@@ -31520,11 +31525,20 @@ function runRedacted({
|
|
|
31520
31525
|
};
|
|
31521
31526
|
const drained = Promise.all([pipe2(child.stdout, stdout2), pipe2(child.stderr, stderr2)]);
|
|
31522
31527
|
child.on("error", reject);
|
|
31523
|
-
child.on("close", (code,
|
|
31524
|
-
|
|
31528
|
+
child.on("close", (code, ended) => {
|
|
31529
|
+
signal?.removeEventListener("abort", killGroup);
|
|
31530
|
+
void drained.then(() => resolve17(code ?? (ended ? 128 + signalNumber(ended) : 1)));
|
|
31525
31531
|
});
|
|
31526
31532
|
});
|
|
31527
31533
|
}
|
|
31534
|
+
function killProcessGroup({ child }) {
|
|
31535
|
+
if (child.pid === void 0) return;
|
|
31536
|
+
try {
|
|
31537
|
+
process.kill(-child.pid, "SIGKILL");
|
|
31538
|
+
} catch {
|
|
31539
|
+
child.kill("SIGKILL");
|
|
31540
|
+
}
|
|
31541
|
+
}
|
|
31528
31542
|
function signalNumber(signal) {
|
|
31529
31543
|
const numbers = { SIGINT: 2, SIGKILL: 9, SIGTERM: 15 };
|
|
31530
31544
|
return numbers[signal] ?? 1;
|
|
@@ -35606,7 +35620,7 @@ function flagText({
|
|
|
35606
35620
|
}
|
|
35607
35621
|
|
|
35608
35622
|
// src/rules/cli-version.rules.ts
|
|
35609
|
-
var STAMPED = "0.1.
|
|
35623
|
+
var STAMPED = "0.1.19";
|
|
35610
35624
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
35611
35625
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
35612
35626
|
}
|
|
@@ -69352,11 +69366,14 @@ async function registerWithClaude({ context, folder }) {
|
|
|
69352
69366
|
`claude plugin marketplace update ${LAZE_PLUGIN} ${quiet}`,
|
|
69353
69367
|
`{ claude plugin install ${LAZE_PLUGIN}@${LAZE_PLUGIN} --scope user ${quiet} || claude plugin update ${LAZE_PLUGIN}@${LAZE_PLUGIN} ${quiet}; }`
|
|
69354
69368
|
].join("; ");
|
|
69355
|
-
const
|
|
69369
|
+
const stop3 = new AbortController();
|
|
69370
|
+
const command = ["sh", "-c", script];
|
|
69371
|
+
const run4 = context.runCommand({ command, env: {}, signal: stop3.signal }).catch(() => 1);
|
|
69356
69372
|
const done = new AbortController();
|
|
69357
69373
|
const gaveUp = context.sleep(REGISTER_LIMIT_MS, done.signal).then(() => -1);
|
|
69358
69374
|
const code = await Promise.race([run4, gaveUp]);
|
|
69359
69375
|
done.abort();
|
|
69376
|
+
stop3.abort();
|
|
69360
69377
|
return code === 0;
|
|
69361
69378
|
}
|
|
69362
69379
|
function registeredMarkOf({ context }) {
|
|
@@ -85312,7 +85329,8 @@ async function runCommand({
|
|
|
85312
85329
|
inherited,
|
|
85313
85330
|
env,
|
|
85314
85331
|
stdout: stdout2 = process.stdout,
|
|
85315
|
-
stderr: stderr2 = process.stderr
|
|
85332
|
+
stderr: stderr2 = process.stderr,
|
|
85333
|
+
signal
|
|
85316
85334
|
}) {
|
|
85317
85335
|
const [program = "", ...rest] = command;
|
|
85318
85336
|
try {
|
|
@@ -85321,7 +85339,8 @@ async function runCommand({
|
|
|
85321
85339
|
env,
|
|
85322
85340
|
baseEnv: inherited,
|
|
85323
85341
|
stdout: stdout2,
|
|
85324
|
-
stderr: stderr2
|
|
85342
|
+
stderr: stderr2,
|
|
85343
|
+
...signal ? { signal } : {}
|
|
85325
85344
|
});
|
|
85326
85345
|
} catch (error62) {
|
|
85327
85346
|
stderr2.write(`laze vault: ${error62 instanceof Error ? error62.message : String(error62)}
|
package/package.json
CHANGED