@dvmkit/dvm-cli 0.14.0 → 0.15.1

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.
@@ -42,13 +42,25 @@ var warnings = new AsyncLocalStorage();
42
42
  function withOutputWarnings(run) {
43
43
  return warnings.run([], run);
44
44
  }
45
+ function sameWarning(prior, entry) {
46
+ if (prior.code === "auto_pay_bound_exceeded" && entry.code === "auto_pay_bound_exceeded") {
47
+ return prior.auto_pay_below === entry.auto_pay_below && prior.source === entry.source;
48
+ }
49
+ if (prior.code === "draw_funding_unverified" && entry.code === "draw_funding_unverified") {
50
+ return prior.job_id === entry.job_id && prior.reason === entry.reason && prior.display === entry.display;
51
+ }
52
+ return false;
53
+ }
45
54
  function addOutputWarnings(entries, human) {
46
55
  const pending = warnings.getStore();
56
+ const added = [];
47
57
  for (const entry of entries) {
48
- if (pending?.some((prior) => prior.auto_pay_below === entry.auto_pay_below && prior.source === entry.source)) continue;
58
+ if (pending?.some((prior) => sameWarning(prior, entry))) continue;
49
59
  pending?.push(entry);
60
+ added.push(entry);
50
61
  if (human) info(`Warning: ${entry.display}`);
51
62
  }
63
+ return added;
52
64
  }
53
65
  var _traceId = null;
54
66
  function setOutputTraceId(id) {
@@ -415,6 +427,9 @@ export {
415
427
  info,
416
428
  raw,
417
429
  progress,
430
+ resolveBtcUsdRate,
431
+ tryResolveBtcUsdRate,
432
+ staleRateNotice,
418
433
  formatSats,
419
434
  formatAmount,
420
435
  formatPaymentAmount,
@@ -423,8 +438,5 @@ export {
423
438
  parseBudget,
424
439
  assertValidBudget,
425
440
  formatAmountBestEffort,
426
- resolveBtcUsdRate,
427
- tryResolveBtcUsdRate,
428
- staleRateNotice,
429
441
  tryX402Payment
430
442
  };