@vendian/cli 0.0.17 → 0.0.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/cli-wrapper.mjs +41 -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.19" : 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;
|
|
@@ -37197,12 +37197,25 @@ function applyServeEvent(state, event) {
|
|
|
37197
37197
|
activity: "Daemon registered"
|
|
37198
37198
|
};
|
|
37199
37199
|
}
|
|
37200
|
+
if (event.type === "agent_discovery_started") {
|
|
37201
|
+
return {
|
|
37202
|
+
...next,
|
|
37203
|
+
activity: "Scanning local agents"
|
|
37204
|
+
};
|
|
37205
|
+
}
|
|
37206
|
+
if (event.type === "agent_discovery_completed") {
|
|
37207
|
+
const agentCount = Number(event.agentCount || 0);
|
|
37208
|
+
return {
|
|
37209
|
+
...next,
|
|
37210
|
+
activity: `Discovered ${agentCount} agent${agentCount === 1 ? "" : "s"}`
|
|
37211
|
+
};
|
|
37212
|
+
}
|
|
37200
37213
|
if (event.type === "agent_prepare_plan") {
|
|
37201
37214
|
const agentCount = Number(event.agentCount || 0);
|
|
37202
37215
|
const environmentCount = Number(event.environmentCount || 0);
|
|
37203
37216
|
return {
|
|
37204
37217
|
...next,
|
|
37205
|
-
activity: `
|
|
37218
|
+
activity: `Analyzing ${agentCount} agent${agentCount === 1 ? "" : "s"}: ${environmentCount} dependency set${environmentCount === 1 ? "" : "s"}`
|
|
37206
37219
|
};
|
|
37207
37220
|
}
|
|
37208
37221
|
if (event.type === "agent_prepare_started") {
|
|
@@ -38363,12 +38376,24 @@ function Header({ env: env3, platform: platform2, serveState, screen }) {
|
|
|
38363
38376
|
serveState?.daemonId && h(StatusRow, {
|
|
38364
38377
|
status: serveState.connected ? "ok" : "warning",
|
|
38365
38378
|
label: "Daemon",
|
|
38366
|
-
value: serveState
|
|
38379
|
+
value: serveHeaderLabel(serveState),
|
|
38367
38380
|
width: inner
|
|
38368
38381
|
}),
|
|
38369
38382
|
h(Text2, { color: colors.muted }, `${fig.bottomLeft}${fig.horizontal.repeat(inner)}${fig.bottomRight}`)
|
|
38370
38383
|
);
|
|
38371
38384
|
}
|
|
38385
|
+
function serveHeaderSnapshot(state) {
|
|
38386
|
+
return {
|
|
38387
|
+
connected: Boolean(state?.connected),
|
|
38388
|
+
daemonId: String(state?.daemonId || ""),
|
|
38389
|
+
stopped: Boolean(state?.stopped)
|
|
38390
|
+
};
|
|
38391
|
+
}
|
|
38392
|
+
function serveHeaderLabel(state) {
|
|
38393
|
+
if (state?.stopped) return "Stopped";
|
|
38394
|
+
if (state?.connected) return "Running";
|
|
38395
|
+
return "Starting";
|
|
38396
|
+
}
|
|
38372
38397
|
function StatusRow({ status, label, value, width }) {
|
|
38373
38398
|
const dotColor = status === "ok" ? colors.success : status === "warning" ? colors.warning : colors.error;
|
|
38374
38399
|
const dot = status === "ok" ? fig.dot : status === "warning" ? fig.dot : fig.dot;
|
|
@@ -38550,8 +38575,15 @@ function ServeScreen({ env: env3, platform: platform2, input, onBack, onState, o
|
|
|
38550
38575
|
const [startupError, setStartupError] = useState5("");
|
|
38551
38576
|
const exitTimer = useRef2(null);
|
|
38552
38577
|
const lastInterruptAt = useRef2(0);
|
|
38578
|
+
const lastPublishedHeaderState = useRef2(null);
|
|
38553
38579
|
useEffect6(() => {
|
|
38554
|
-
|
|
38580
|
+
const snapshot = serveHeaderSnapshot(state);
|
|
38581
|
+
const previous = lastPublishedHeaderState.current;
|
|
38582
|
+
if (previous && previous.daemonId === snapshot.daemonId && previous.connected === snapshot.connected && previous.stopped === snapshot.stopped) {
|
|
38583
|
+
return;
|
|
38584
|
+
}
|
|
38585
|
+
lastPublishedHeaderState.current = snapshot;
|
|
38586
|
+
onState(snapshot.daemonId ? snapshot : null);
|
|
38555
38587
|
}, [state, onState]);
|
|
38556
38588
|
useEffect6(() => () => {
|
|
38557
38589
|
if (exitTimer.current) {
|
|
@@ -39379,6 +39411,7 @@ function attachServeChild(child, setState, setStartupError, onExit, logStore = n
|
|
|
39379
39411
|
buffer += chunk;
|
|
39380
39412
|
const lines = buffer.split(/\r?\n/);
|
|
39381
39413
|
buffer = lines.pop() || "";
|
|
39414
|
+
const events = [];
|
|
39382
39415
|
for (const line of lines) {
|
|
39383
39416
|
try {
|
|
39384
39417
|
const event = parseServeEventLine(line);
|
|
@@ -39387,12 +39420,15 @@ function attachServeChild(child, setState, setStartupError, onExit, logStore = n
|
|
|
39387
39420
|
logStore?.append(event);
|
|
39388
39421
|
} catch {
|
|
39389
39422
|
}
|
|
39390
|
-
|
|
39423
|
+
events.push(event);
|
|
39391
39424
|
}
|
|
39392
39425
|
} catch (error) {
|
|
39393
39426
|
setStartupError(`Invalid event stream payload: ${errorMessage2(error)}`);
|
|
39394
39427
|
}
|
|
39395
39428
|
}
|
|
39429
|
+
if (events.length > 0) {
|
|
39430
|
+
setState((current) => events.reduce((next, event) => applyServeEvent(next, event), current));
|
|
39431
|
+
}
|
|
39396
39432
|
});
|
|
39397
39433
|
child.stderr.setEncoding("utf8");
|
|
39398
39434
|
child.stderr.on("data", (chunk) => {
|