@vendian/cli 0.0.17 → 0.0.18
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/cli-wrapper.mjs +28 -5
- package/package.json +1 -1
package/cli-wrapper.mjs
CHANGED
|
@@ -36794,7 +36794,7 @@ import fs12 from "node:fs";
|
|
|
36794
36794
|
import readlinePromises from "node:readline/promises";
|
|
36795
36795
|
|
|
36796
36796
|
// src/version.js
|
|
36797
|
-
var CLI_VERSION = true ? "0.0.
|
|
36797
|
+
var CLI_VERSION = true ? "0.0.18" : process.env.npm_package_version || "0.0.0-dev";
|
|
36798
36798
|
|
|
36799
36799
|
// src/npm-update.js
|
|
36800
36800
|
var NPM_CHECK_INTERVAL_MS = 30 * 60 * 1e3;
|
|
@@ -37202,7 +37202,7 @@ function applyServeEvent(state, event) {
|
|
|
37202
37202
|
const environmentCount = Number(event.environmentCount || 0);
|
|
37203
37203
|
return {
|
|
37204
37204
|
...next,
|
|
37205
|
-
activity: `
|
|
37205
|
+
activity: `Analyzing ${agentCount} agent${agentCount === 1 ? "" : "s"}: ${environmentCount} dependency set${environmentCount === 1 ? "" : "s"}`
|
|
37206
37206
|
};
|
|
37207
37207
|
}
|
|
37208
37208
|
if (event.type === "agent_prepare_started") {
|
|
@@ -38363,12 +38363,24 @@ function Header({ env: env3, platform: platform2, serveState, screen }) {
|
|
|
38363
38363
|
serveState?.daemonId && h(StatusRow, {
|
|
38364
38364
|
status: serveState.connected ? "ok" : "warning",
|
|
38365
38365
|
label: "Daemon",
|
|
38366
|
-
value: serveState
|
|
38366
|
+
value: serveHeaderLabel(serveState),
|
|
38367
38367
|
width: inner
|
|
38368
38368
|
}),
|
|
38369
38369
|
h(Text2, { color: colors.muted }, `${fig.bottomLeft}${fig.horizontal.repeat(inner)}${fig.bottomRight}`)
|
|
38370
38370
|
);
|
|
38371
38371
|
}
|
|
38372
|
+
function serveHeaderSnapshot(state) {
|
|
38373
|
+
return {
|
|
38374
|
+
connected: Boolean(state?.connected),
|
|
38375
|
+
daemonId: String(state?.daemonId || ""),
|
|
38376
|
+
stopped: Boolean(state?.stopped)
|
|
38377
|
+
};
|
|
38378
|
+
}
|
|
38379
|
+
function serveHeaderLabel(state) {
|
|
38380
|
+
if (state?.stopped) return "Stopped";
|
|
38381
|
+
if (state?.connected) return "Running";
|
|
38382
|
+
return "Starting";
|
|
38383
|
+
}
|
|
38372
38384
|
function StatusRow({ status, label, value, width }) {
|
|
38373
38385
|
const dotColor = status === "ok" ? colors.success : status === "warning" ? colors.warning : colors.error;
|
|
38374
38386
|
const dot = status === "ok" ? fig.dot : status === "warning" ? fig.dot : fig.dot;
|
|
@@ -38550,8 +38562,15 @@ function ServeScreen({ env: env3, platform: platform2, input, onBack, onState, o
|
|
|
38550
38562
|
const [startupError, setStartupError] = useState5("");
|
|
38551
38563
|
const exitTimer = useRef2(null);
|
|
38552
38564
|
const lastInterruptAt = useRef2(0);
|
|
38565
|
+
const lastPublishedHeaderState = useRef2(null);
|
|
38553
38566
|
useEffect6(() => {
|
|
38554
|
-
|
|
38567
|
+
const snapshot = serveHeaderSnapshot(state);
|
|
38568
|
+
const previous = lastPublishedHeaderState.current;
|
|
38569
|
+
if (previous && previous.daemonId === snapshot.daemonId && previous.connected === snapshot.connected && previous.stopped === snapshot.stopped) {
|
|
38570
|
+
return;
|
|
38571
|
+
}
|
|
38572
|
+
lastPublishedHeaderState.current = snapshot;
|
|
38573
|
+
onState(snapshot.daemonId ? snapshot : null);
|
|
38555
38574
|
}, [state, onState]);
|
|
38556
38575
|
useEffect6(() => () => {
|
|
38557
38576
|
if (exitTimer.current) {
|
|
@@ -39379,6 +39398,7 @@ function attachServeChild(child, setState, setStartupError, onExit, logStore = n
|
|
|
39379
39398
|
buffer += chunk;
|
|
39380
39399
|
const lines = buffer.split(/\r?\n/);
|
|
39381
39400
|
buffer = lines.pop() || "";
|
|
39401
|
+
const events = [];
|
|
39382
39402
|
for (const line of lines) {
|
|
39383
39403
|
try {
|
|
39384
39404
|
const event = parseServeEventLine(line);
|
|
@@ -39387,12 +39407,15 @@ function attachServeChild(child, setState, setStartupError, onExit, logStore = n
|
|
|
39387
39407
|
logStore?.append(event);
|
|
39388
39408
|
} catch {
|
|
39389
39409
|
}
|
|
39390
|
-
|
|
39410
|
+
events.push(event);
|
|
39391
39411
|
}
|
|
39392
39412
|
} catch (error) {
|
|
39393
39413
|
setStartupError(`Invalid event stream payload: ${errorMessage2(error)}`);
|
|
39394
39414
|
}
|
|
39395
39415
|
}
|
|
39416
|
+
if (events.length > 0) {
|
|
39417
|
+
setState((current) => events.reduce((next, event) => applyServeEvent(next, event), current));
|
|
39418
|
+
}
|
|
39396
39419
|
});
|
|
39397
39420
|
child.stderr.setEncoding("utf8");
|
|
39398
39421
|
child.stderr.on("data", (chunk) => {
|