@vm0/cli 9.97.2 → 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.
@@ -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.97.2",
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.97.2",
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()
@@ -30662,6 +30663,7 @@ async function listZeroLogs(options) {
30662
30663
  query: {
30663
30664
  agent: options?.agent,
30664
30665
  status: options?.status,
30666
+ since: options?.since,
30665
30667
  limit: options?.limit,
30666
30668
  cursor: options?.cursor
30667
30669
  }
@@ -31383,73 +31385,6 @@ var EventRenderer = class _EventRenderer {
31383
31385
  }
31384
31386
  };
31385
31387
 
31386
- // src/lib/utils/time-parser.ts
31387
- function parseTime(timeStr) {
31388
- const relativeMatch = timeStr.match(/^(\d+)([smhdw])$/);
31389
- if (relativeMatch) {
31390
- const value = parseInt(relativeMatch[1], 10);
31391
- const unit = relativeMatch[2];
31392
- return parseRelativeTime(value, unit);
31393
- }
31394
- if (/^\d+$/.test(timeStr)) {
31395
- const timestamp = parseInt(timeStr, 10);
31396
- if (timestamp < 1e10) {
31397
- return timestamp * 1e3;
31398
- }
31399
- return timestamp;
31400
- }
31401
- const date = new Date(timeStr);
31402
- if (!isNaN(date.getTime())) {
31403
- return date.getTime();
31404
- }
31405
- throw new Error(
31406
- `Invalid time format: "${timeStr}". Supported formats: relative (5m, 2h, 1d), ISO 8601 (2024-01-15T10:30:00Z), Unix timestamp`
31407
- );
31408
- }
31409
- function parseRelativeTime(value, unit) {
31410
- const now = Date.now();
31411
- const multipliers = {
31412
- s: 1e3,
31413
- // seconds
31414
- m: 60 * 1e3,
31415
- // minutes
31416
- h: 60 * 60 * 1e3,
31417
- // hours
31418
- d: 24 * 60 * 60 * 1e3,
31419
- // days
31420
- w: 7 * 24 * 60 * 60 * 1e3
31421
- // weeks
31422
- };
31423
- const multiplier = multipliers[unit];
31424
- if (!multiplier) {
31425
- throw new Error(`Unknown time unit: ${unit}`);
31426
- }
31427
- return now - value * multiplier;
31428
- }
31429
-
31430
- // src/lib/utils/paginate.ts
31431
- async function paginate(options) {
31432
- const { fetchPage, getTimestamp, targetCount, initialSince } = options;
31433
- const collected = [];
31434
- let since = initialSince;
31435
- let hasMore = true;
31436
- while (hasMore) {
31437
- const response = await fetchPage(since);
31438
- collected.push(...response.items);
31439
- hasMore = response.hasMore;
31440
- if (targetCount !== "all" && collected.length >= targetCount) {
31441
- return collected.slice(0, targetCount);
31442
- }
31443
- if (response.items.length > 0) {
31444
- const lastItem = response.items[response.items.length - 1];
31445
- since = getTimestamp(lastItem);
31446
- } else {
31447
- hasMore = false;
31448
- }
31449
- }
31450
- return collected;
31451
- }
31452
-
31453
31388
  // src/commands/run/shared.ts
31454
31389
  import chalk5 from "chalk";
31455
31390
  import * as fs from "fs";
@@ -31647,6 +31582,73 @@ function showNextSteps(result) {
31647
31582
  }
31648
31583
  }
31649
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
+
31650
31652
  export {
31651
31653
  configureGlobalProxyFromEnv,
31652
31654
  decodeCliTokenPayload,
@@ -31799,4 +31801,4 @@ export {
31799
31801
  parseTime,
31800
31802
  paginate
31801
31803
  };
31802
- //# sourceMappingURL=chunk-YB5IZS2M.js.map
31804
+ //# sourceMappingURL=chunk-HNN3VAZK.js.map