@vm0/cli 9.97.1 → 9.98.0
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/{chunk-LSHAPITU.js → chunk-HNN3VAZK.js} +74 -78
- package/chunk-HNN3VAZK.js.map +1 -0
- package/index.js +10 -10
- package/package.json +1 -1
- package/zero.js +24 -3
- package/zero.js.map +1 -1
- package/chunk-LSHAPITU.js.map +0 -1
|
@@ -49,7 +49,7 @@ if (DSN) {
|
|
|
49
49
|
Sentry.init({
|
|
50
50
|
dsn: DSN,
|
|
51
51
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
52
|
-
release: "9.
|
|
52
|
+
release: "9.98.0",
|
|
53
53
|
sendDefaultPii: false,
|
|
54
54
|
tracesSampleRate: 0,
|
|
55
55
|
shutdownTimeout: 500,
|
|
@@ -68,7 +68,7 @@ if (DSN) {
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
Sentry.setContext("cli", {
|
|
71
|
-
version: "9.
|
|
71
|
+
version: "9.98.0",
|
|
72
72
|
command: process.argv.slice(2).join(" ")
|
|
73
73
|
});
|
|
74
74
|
Sentry.setContext("runtime", {
|
|
@@ -858,6 +858,7 @@ var logsListContract = c2.router({
|
|
|
858
858
|
search: z5.string().optional(),
|
|
859
859
|
agent: z5.string().optional(),
|
|
860
860
|
name: z5.string().optional(),
|
|
861
|
+
since: z5.coerce.number().optional(),
|
|
861
862
|
status: logStatusSchema.optional(),
|
|
862
863
|
triggerSource: triggerSourceSchema.optional(),
|
|
863
864
|
scheduleId: z5.string().uuid().optional()
|
|
@@ -29557,18 +29558,12 @@ var FEATURE_SWITCHES = {
|
|
|
29557
29558
|
enabled: false,
|
|
29558
29559
|
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
29559
29560
|
},
|
|
29560
|
-
["
|
|
29561
|
+
["activityLogList" /* ActivityLogList */]: {
|
|
29561
29562
|
maintainer: "ethan@vm0.ai",
|
|
29562
29563
|
enabled: false,
|
|
29563
|
-
enabledUserHashes: STAFF_USER_HASHES,
|
|
29564
|
-
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
29565
|
-
},
|
|
29566
|
-
["runNetwork" /* RunNetwork */]: {
|
|
29567
|
-
maintainer: "liangyou@vm0.ai",
|
|
29568
|
-
enabled: false,
|
|
29569
29564
|
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
29570
29565
|
},
|
|
29571
|
-
["
|
|
29566
|
+
["zeroDebug" /* ZeroDebug */]: {
|
|
29572
29567
|
maintainer: "ethan@vm0.ai",
|
|
29573
29568
|
enabled: false,
|
|
29574
29569
|
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
@@ -30668,6 +30663,7 @@ async function listZeroLogs(options) {
|
|
|
30668
30663
|
query: {
|
|
30669
30664
|
agent: options?.agent,
|
|
30670
30665
|
status: options?.status,
|
|
30666
|
+
since: options?.since,
|
|
30671
30667
|
limit: options?.limit,
|
|
30672
30668
|
cursor: options?.cursor
|
|
30673
30669
|
}
|
|
@@ -31389,73 +31385,6 @@ var EventRenderer = class _EventRenderer {
|
|
|
31389
31385
|
}
|
|
31390
31386
|
};
|
|
31391
31387
|
|
|
31392
|
-
// src/lib/utils/time-parser.ts
|
|
31393
|
-
function parseTime(timeStr) {
|
|
31394
|
-
const relativeMatch = timeStr.match(/^(\d+)([smhdw])$/);
|
|
31395
|
-
if (relativeMatch) {
|
|
31396
|
-
const value = parseInt(relativeMatch[1], 10);
|
|
31397
|
-
const unit = relativeMatch[2];
|
|
31398
|
-
return parseRelativeTime(value, unit);
|
|
31399
|
-
}
|
|
31400
|
-
if (/^\d+$/.test(timeStr)) {
|
|
31401
|
-
const timestamp = parseInt(timeStr, 10);
|
|
31402
|
-
if (timestamp < 1e10) {
|
|
31403
|
-
return timestamp * 1e3;
|
|
31404
|
-
}
|
|
31405
|
-
return timestamp;
|
|
31406
|
-
}
|
|
31407
|
-
const date = new Date(timeStr);
|
|
31408
|
-
if (!isNaN(date.getTime())) {
|
|
31409
|
-
return date.getTime();
|
|
31410
|
-
}
|
|
31411
|
-
throw new Error(
|
|
31412
|
-
`Invalid time format: "${timeStr}". Supported formats: relative (5m, 2h, 1d), ISO 8601 (2024-01-15T10:30:00Z), Unix timestamp`
|
|
31413
|
-
);
|
|
31414
|
-
}
|
|
31415
|
-
function parseRelativeTime(value, unit) {
|
|
31416
|
-
const now = Date.now();
|
|
31417
|
-
const multipliers = {
|
|
31418
|
-
s: 1e3,
|
|
31419
|
-
// seconds
|
|
31420
|
-
m: 60 * 1e3,
|
|
31421
|
-
// minutes
|
|
31422
|
-
h: 60 * 60 * 1e3,
|
|
31423
|
-
// hours
|
|
31424
|
-
d: 24 * 60 * 60 * 1e3,
|
|
31425
|
-
// days
|
|
31426
|
-
w: 7 * 24 * 60 * 60 * 1e3
|
|
31427
|
-
// weeks
|
|
31428
|
-
};
|
|
31429
|
-
const multiplier = multipliers[unit];
|
|
31430
|
-
if (!multiplier) {
|
|
31431
|
-
throw new Error(`Unknown time unit: ${unit}`);
|
|
31432
|
-
}
|
|
31433
|
-
return now - value * multiplier;
|
|
31434
|
-
}
|
|
31435
|
-
|
|
31436
|
-
// src/lib/utils/paginate.ts
|
|
31437
|
-
async function paginate(options) {
|
|
31438
|
-
const { fetchPage, getTimestamp, targetCount, initialSince } = options;
|
|
31439
|
-
const collected = [];
|
|
31440
|
-
let since = initialSince;
|
|
31441
|
-
let hasMore = true;
|
|
31442
|
-
while (hasMore) {
|
|
31443
|
-
const response = await fetchPage(since);
|
|
31444
|
-
collected.push(...response.items);
|
|
31445
|
-
hasMore = response.hasMore;
|
|
31446
|
-
if (targetCount !== "all" && collected.length >= targetCount) {
|
|
31447
|
-
return collected.slice(0, targetCount);
|
|
31448
|
-
}
|
|
31449
|
-
if (response.items.length > 0) {
|
|
31450
|
-
const lastItem = response.items[response.items.length - 1];
|
|
31451
|
-
since = getTimestamp(lastItem);
|
|
31452
|
-
} else {
|
|
31453
|
-
hasMore = false;
|
|
31454
|
-
}
|
|
31455
|
-
}
|
|
31456
|
-
return collected;
|
|
31457
|
-
}
|
|
31458
|
-
|
|
31459
31388
|
// src/commands/run/shared.ts
|
|
31460
31389
|
import chalk5 from "chalk";
|
|
31461
31390
|
import * as fs from "fs";
|
|
@@ -31653,6 +31582,73 @@ function showNextSteps(result) {
|
|
|
31653
31582
|
}
|
|
31654
31583
|
}
|
|
31655
31584
|
|
|
31585
|
+
// src/lib/utils/time-parser.ts
|
|
31586
|
+
function parseTime(timeStr) {
|
|
31587
|
+
const relativeMatch = timeStr.match(/^(\d+)([smhdw])$/);
|
|
31588
|
+
if (relativeMatch) {
|
|
31589
|
+
const value = parseInt(relativeMatch[1], 10);
|
|
31590
|
+
const unit = relativeMatch[2];
|
|
31591
|
+
return parseRelativeTime(value, unit);
|
|
31592
|
+
}
|
|
31593
|
+
if (/^\d+$/.test(timeStr)) {
|
|
31594
|
+
const timestamp = parseInt(timeStr, 10);
|
|
31595
|
+
if (timestamp < 1e10) {
|
|
31596
|
+
return timestamp * 1e3;
|
|
31597
|
+
}
|
|
31598
|
+
return timestamp;
|
|
31599
|
+
}
|
|
31600
|
+
const date = new Date(timeStr);
|
|
31601
|
+
if (!isNaN(date.getTime())) {
|
|
31602
|
+
return date.getTime();
|
|
31603
|
+
}
|
|
31604
|
+
throw new Error(
|
|
31605
|
+
`Invalid time format: "${timeStr}". Supported formats: relative (5m, 2h, 1d), ISO 8601 (2024-01-15T10:30:00Z), Unix timestamp`
|
|
31606
|
+
);
|
|
31607
|
+
}
|
|
31608
|
+
function parseRelativeTime(value, unit) {
|
|
31609
|
+
const now = Date.now();
|
|
31610
|
+
const multipliers = {
|
|
31611
|
+
s: 1e3,
|
|
31612
|
+
// seconds
|
|
31613
|
+
m: 60 * 1e3,
|
|
31614
|
+
// minutes
|
|
31615
|
+
h: 60 * 60 * 1e3,
|
|
31616
|
+
// hours
|
|
31617
|
+
d: 24 * 60 * 60 * 1e3,
|
|
31618
|
+
// days
|
|
31619
|
+
w: 7 * 24 * 60 * 60 * 1e3
|
|
31620
|
+
// weeks
|
|
31621
|
+
};
|
|
31622
|
+
const multiplier = multipliers[unit];
|
|
31623
|
+
if (!multiplier) {
|
|
31624
|
+
throw new Error(`Unknown time unit: ${unit}`);
|
|
31625
|
+
}
|
|
31626
|
+
return now - value * multiplier;
|
|
31627
|
+
}
|
|
31628
|
+
|
|
31629
|
+
// src/lib/utils/paginate.ts
|
|
31630
|
+
async function paginate(options) {
|
|
31631
|
+
const { fetchPage, getTimestamp, targetCount, initialSince } = options;
|
|
31632
|
+
const collected = [];
|
|
31633
|
+
let since = initialSince;
|
|
31634
|
+
let hasMore = true;
|
|
31635
|
+
while (hasMore) {
|
|
31636
|
+
const response = await fetchPage(since);
|
|
31637
|
+
collected.push(...response.items);
|
|
31638
|
+
hasMore = response.hasMore;
|
|
31639
|
+
if (targetCount !== "all" && collected.length >= targetCount) {
|
|
31640
|
+
return collected.slice(0, targetCount);
|
|
31641
|
+
}
|
|
31642
|
+
if (response.items.length > 0) {
|
|
31643
|
+
const lastItem = response.items[response.items.length - 1];
|
|
31644
|
+
since = getTimestamp(lastItem);
|
|
31645
|
+
} else {
|
|
31646
|
+
hasMore = false;
|
|
31647
|
+
}
|
|
31648
|
+
}
|
|
31649
|
+
return collected;
|
|
31650
|
+
}
|
|
31651
|
+
|
|
31656
31652
|
export {
|
|
31657
31653
|
configureGlobalProxyFromEnv,
|
|
31658
31654
|
decodeCliTokenPayload,
|
|
@@ -31805,4 +31801,4 @@ export {
|
|
|
31805
31801
|
parseTime,
|
|
31806
31802
|
paginate
|
|
31807
31803
|
};
|
|
31808
|
-
//# sourceMappingURL=chunk-
|
|
31804
|
+
//# sourceMappingURL=chunk-HNN3VAZK.js.map
|