@vm0/cli 5.0.1 → 5.0.2
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/index.js +46 -20
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -12750,12 +12750,19 @@ var agentEventsResponseSchema = external_exports.object({
|
|
|
12750
12750
|
});
|
|
12751
12751
|
var networkLogEntrySchema = external_exports.object({
|
|
12752
12752
|
timestamp: external_exports.string(),
|
|
12753
|
-
|
|
12754
|
-
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
|
|
12758
|
-
|
|
12753
|
+
// Common fields (all modes)
|
|
12754
|
+
mode: external_exports.enum(["mitm", "sni"]).optional(),
|
|
12755
|
+
action: external_exports.enum(["ALLOW", "DENY"]).optional(),
|
|
12756
|
+
host: external_exports.string().optional(),
|
|
12757
|
+
port: external_exports.number().optional(),
|
|
12758
|
+
rule_matched: external_exports.string().nullable().optional(),
|
|
12759
|
+
// MITM-only fields (optional)
|
|
12760
|
+
method: external_exports.string().optional(),
|
|
12761
|
+
url: external_exports.string().optional(),
|
|
12762
|
+
status: external_exports.number().optional(),
|
|
12763
|
+
latency_ms: external_exports.number().optional(),
|
|
12764
|
+
request_size: external_exports.number().optional(),
|
|
12765
|
+
response_size: external_exports.number().optional()
|
|
12759
12766
|
});
|
|
12760
12767
|
var networkLogsResponseSchema = external_exports.object({
|
|
12761
12768
|
networkLogs: external_exports.array(networkLogEntrySchema),
|
|
@@ -13287,12 +13294,19 @@ var metricDataSchema = external_exports.object({
|
|
|
13287
13294
|
});
|
|
13288
13295
|
var networkLogSchema = external_exports.object({
|
|
13289
13296
|
timestamp: external_exports.string(),
|
|
13290
|
-
|
|
13291
|
-
|
|
13292
|
-
|
|
13293
|
-
|
|
13294
|
-
|
|
13295
|
-
|
|
13297
|
+
// Common fields (all modes)
|
|
13298
|
+
mode: external_exports.enum(["mitm", "sni"]).optional(),
|
|
13299
|
+
action: external_exports.enum(["ALLOW", "DENY"]).optional(),
|
|
13300
|
+
host: external_exports.string().optional(),
|
|
13301
|
+
port: external_exports.number().optional(),
|
|
13302
|
+
rule_matched: external_exports.string().nullable().optional(),
|
|
13303
|
+
// MITM-only fields (optional)
|
|
13304
|
+
method: external_exports.string().optional(),
|
|
13305
|
+
url: external_exports.string().optional(),
|
|
13306
|
+
status: external_exports.number().optional(),
|
|
13307
|
+
latency_ms: external_exports.number().optional(),
|
|
13308
|
+
request_size: external_exports.number().optional(),
|
|
13309
|
+
response_size: external_exports.number().optional()
|
|
13296
13310
|
});
|
|
13297
13311
|
var webhookTelemetryContract = c5.router({
|
|
13298
13312
|
/**
|
|
@@ -18574,7 +18588,7 @@ async function autoPullArtifact(runOutput, artifactDir) {
|
|
|
18574
18588
|
}
|
|
18575
18589
|
var cookCmd = new Command17().name("cook").description("One-click agent preparation and execution from vm0.yaml");
|
|
18576
18590
|
cookCmd.argument("[prompt]", "Prompt for the agent").option("-y, --yes", "Skip confirmation prompts").action(async (prompt, options) => {
|
|
18577
|
-
const shouldExit = await checkAndUpgrade("5.0.
|
|
18591
|
+
const shouldExit = await checkAndUpgrade("5.0.2", prompt);
|
|
18578
18592
|
if (shouldExit) {
|
|
18579
18593
|
process.exit(0);
|
|
18580
18594
|
}
|
|
@@ -18920,25 +18934,37 @@ function formatMetric(metric) {
|
|
|
18920
18934
|
return `[${metric.ts}] CPU: ${metric.cpu.toFixed(1)}% | Mem: ${formatBytes8(metric.mem_used)}/${formatBytes8(metric.mem_total)} (${memPercent}%) | Disk: ${formatBytes8(metric.disk_used)}/${formatBytes8(metric.disk_total)} (${diskPercent}%)`;
|
|
18921
18935
|
}
|
|
18922
18936
|
function formatNetworkLog(entry) {
|
|
18937
|
+
if (entry.mode === "sni" || !entry.method) {
|
|
18938
|
+
const actionColor = entry.action === "ALLOW" ? chalk22.green : chalk22.red;
|
|
18939
|
+
const host = entry.host || "unknown";
|
|
18940
|
+
const port = entry.port || 443;
|
|
18941
|
+
return `[${entry.timestamp}] ${chalk22.cyan("SNI")} ${actionColor(entry.action || "ALLOW")} ${host}:${port} ${chalk22.dim(entry.rule_matched || "")}`;
|
|
18942
|
+
}
|
|
18923
18943
|
let statusColor;
|
|
18924
|
-
|
|
18944
|
+
const status = entry.status || 0;
|
|
18945
|
+
if (status >= 200 && status < 300) {
|
|
18925
18946
|
statusColor = chalk22.green;
|
|
18926
|
-
} else if (
|
|
18947
|
+
} else if (status >= 300 && status < 400) {
|
|
18927
18948
|
statusColor = chalk22.yellow;
|
|
18928
|
-
} else if (
|
|
18949
|
+
} else if (status >= 400) {
|
|
18929
18950
|
statusColor = chalk22.red;
|
|
18930
18951
|
} else {
|
|
18931
18952
|
statusColor = chalk22.gray;
|
|
18932
18953
|
}
|
|
18933
18954
|
let latencyColor;
|
|
18934
|
-
|
|
18955
|
+
const latencyMs = entry.latency_ms || 0;
|
|
18956
|
+
if (latencyMs < 500) {
|
|
18935
18957
|
latencyColor = chalk22.green;
|
|
18936
|
-
} else if (
|
|
18958
|
+
} else if (latencyMs < 2e3) {
|
|
18937
18959
|
latencyColor = chalk22.yellow;
|
|
18938
18960
|
} else {
|
|
18939
18961
|
latencyColor = chalk22.red;
|
|
18940
18962
|
}
|
|
18941
|
-
|
|
18963
|
+
const method = entry.method || "???";
|
|
18964
|
+
const requestSize = entry.request_size || 0;
|
|
18965
|
+
const responseSize = entry.response_size || 0;
|
|
18966
|
+
const url2 = entry.url || entry.host || "unknown";
|
|
18967
|
+
return `[${entry.timestamp}] ${method.padEnd(6)} ${statusColor(status)} ${latencyColor(latencyMs + "ms")} ${formatBytes8(requestSize)}/${formatBytes8(responseSize)} ${chalk22.dim(url2)}`;
|
|
18942
18968
|
}
|
|
18943
18969
|
function renderAgentEvent(event, provider) {
|
|
18944
18970
|
const eventData = event.eventData;
|
|
@@ -20125,7 +20151,7 @@ var setupGithubCommand = new Command26().name("setup-github").description("Initi
|
|
|
20125
20151
|
|
|
20126
20152
|
// src/index.ts
|
|
20127
20153
|
var program = new Command27();
|
|
20128
|
-
program.name("vm0").description("VM0 CLI - A modern build tool").version("5.0.
|
|
20154
|
+
program.name("vm0").description("VM0 CLI - A modern build tool").version("5.0.2");
|
|
20129
20155
|
program.command("info").description("Display environment information").action(async () => {
|
|
20130
20156
|
console.log(chalk29.bold("System Information:"));
|
|
20131
20157
|
console.log(`Node Version: ${process.version}`);
|