@dvmkit/dvm-cli 0.7.0-rc.3 → 0.8.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.
Files changed (26) hide show
  1. package/NOTICE +1 -1
  2. package/README.md +35 -37
  3. package/dist/{chunk-2I5XAIQ4.js → chunk-4U43FVT4.js} +3 -3
  4. package/dist/{chunk-IERBEO4C.js → chunk-7ICHLPOY.js} +3 -3
  5. package/dist/{chunk-LIITTIEN.js → chunk-AGGWYE3D.js} +288 -71
  6. package/dist/{chunk-BHJLMVO2.js → chunk-AX6COXU3.js} +8 -7
  7. package/dist/{chunk-ZM5QFHEY.js → chunk-DSNUC4J7.js} +32 -5
  8. package/dist/{chunk-5QO3MGMH.js → chunk-EDK4X4F3.js} +4 -4
  9. package/dist/{chunk-3PV36227.js → chunk-HY65VFLL.js} +2 -2
  10. package/dist/{chunk-5VOAE2CL.js → chunk-JZPSF4C6.js} +2 -2
  11. package/dist/{chunk-C5XIOTRP.js → chunk-MULGWPBV.js} +2 -2
  12. package/dist/{chunk-EQXNDN5I.js → chunk-PKZUEXMJ.js} +2 -2
  13. package/dist/{chunk-6JP6ZBWW.js → chunk-QPT5KD7H.js} +29 -27
  14. package/dist/{chunk-7OA2XUM4.js → chunk-YJQNDNYK.js} +2 -2
  15. package/dist/{client-PGOH2ION.js → client-65B5WQPC.js} +6 -6
  16. package/dist/dvm.js +148 -59
  17. package/dist/{internal-VIAWW5ED.js → internal-BT3U2FFW.js} +5 -5
  18. package/dist/{lifecycle-VHGTNHHE.js → lifecycle-2LISVEWB.js} +6 -6
  19. package/dist/{payout-reporter-3UVWPGMO-WWZWXWCG.js → payout-reporter-HQSIIBFL-XHOVIA5Q.js} +2 -2
  20. package/dist/{pocket-refill-BHNKMENF.js → pocket-refill-K24FKUXH.js} +10 -10
  21. package/dist/{revenue-reporter-E56J3NZK-NZ5H27ZI.js → revenue-reporter-X52GPZ5U-JQKBYUBQ.js} +2 -2
  22. package/dist/{tempo-lifecycle-NDBO3V3A.js → tempo-lifecycle-L5C55URR.js} +8 -8
  23. package/dist/{tempo-wallet-BAU7ASWF.js → tempo-wallet-XPXR3T3E.js} +7 -7
  24. package/dist/{wallet-RB2RPWIN.js → wallet-2XALZRFL.js} +7 -7
  25. package/dist/{x402-BN26TQZ6-4MWLNZGT.js → x402-Q4S36NHQ-KWEN7KSE.js} +2 -2
  26. package/package.json +18 -4
@@ -4,7 +4,7 @@ const require = __dvmCreateRequire(import.meta.url);
4
4
  import {
5
5
  loadX402Wallet,
6
6
  x402NetworkLabel
7
- } from "./chunk-2I5XAIQ4.js";
7
+ } from "./chunk-4U43FVT4.js";
8
8
  import {
9
9
  costAnchor,
10
10
  info,
@@ -12,14 +12,14 @@ import {
12
12
  resolveBtcUsdRate,
13
13
  tryResolveBtcUsdRate,
14
14
  tryX402Payment
15
- } from "./chunk-3PV36227.js";
15
+ } from "./chunk-HY65VFLL.js";
16
16
  import {
17
17
  connectedTempoAccount
18
- } from "./chunk-5QO3MGMH.js";
18
+ } from "./chunk-EDK4X4F3.js";
19
19
  import {
20
20
  isCreditPosture,
21
21
  loadConfig
22
- } from "./chunk-7OA2XUM4.js";
22
+ } from "./chunk-YJQNDNYK.js";
23
23
  import {
24
24
  BUDGET_FILE,
25
25
  JOBS_FILE,
@@ -156,7 +156,7 @@ import {
156
156
  x402PendingUnsettled,
157
157
  x402RequiredFromError,
158
158
  x402VoucherPendingState
159
- } from "./chunk-LIITTIEN.js";
159
+ } from "./chunk-AGGWYE3D.js";
160
160
  import {
161
161
  Challenge_exports,
162
162
  Credential_exports
@@ -173,7 +173,7 @@ import {
173
173
  redactUrlsInText,
174
174
  usdToMsats,
175
175
  x402NetworkToCaip2
176
- } from "./chunk-6JP6ZBWW.js";
176
+ } from "./chunk-QPT5KD7H.js";
177
177
  import {
178
178
  privateKeyToAccount
179
179
  } from "./chunk-EVQERRCP.js";
@@ -1770,13 +1770,14 @@ async function correctPendingFundAmount(args) {
1770
1770
  const data = s.context.submit_body.data;
1771
1771
  const fund = data?.fund;
1772
1772
  if (!fund) return s;
1773
+ const { request_id: _requestId, ...rest } = data ?? {};
1773
1774
  return {
1774
1775
  ...s,
1775
1776
  context: {
1776
1777
  ...s.context,
1777
1778
  submit_body: {
1778
1779
  ...s.context.submit_body,
1779
- data: { ...data, fund: { ...fund, amount_micro: args.amountMicro } }
1780
+ data: { ...rest, fund: { ...fund, amount_micro: args.amountMicro } }
1780
1781
  }
1781
1782
  }
1782
1783
  };
@@ -2,7 +2,7 @@
2
2
  import { createRequire as __dvmCreateRequire } from "node:module";
3
3
  const require = __dvmCreateRequire(import.meta.url);
4
4
 
5
- // node_modules/@dvmkit/sdk/dist/chunk-FXDQMJQ2.js
5
+ // node_modules/@dvmkit/sdk/dist/chunk-DZQYQN2X.js
6
6
  import { isIP } from "net";
7
7
  var diagnostic_catalogue_v1_default = {
8
8
  version: 1,
@@ -414,6 +414,7 @@ var diagnostic_catalogue_v1_default = {
414
414
  "tempo_observer_health_unavailable",
415
415
  "tempo_observer_scan_failed",
416
416
  "tempo_refund_amount_unreported",
417
+ "tempo_replay_mark_failed",
417
418
  "tempo_routine_sweep",
418
419
  "tempo_routine_sweep_failed",
419
420
  "tempo_session_advertised_refresh_failed",
@@ -421,6 +422,7 @@ var diagnostic_catalogue_v1_default = {
421
422
  "tempo_session_close_failed",
422
423
  "tempo_session_close_failure_reconcile_failed",
423
424
  "tempo_session_close_recovery_failed",
425
+ "tempo_session_close_recovery_unmatched",
424
426
  "tempo_session_open_refused",
425
427
  "tempo_session_settled",
426
428
  "tempo_session_withheld",
@@ -781,6 +783,7 @@ var diagnostic_catalogue_v1_default = {
781
783
  "hardened",
782
784
  "head_status",
783
785
  "hint",
786
+ "hosting_identity_revoke_failed",
784
787
  "ingest_concurrency",
785
788
  "ingest_global_concurrency",
786
789
  "ingest_ip_concurrency",
@@ -1069,6 +1072,25 @@ var diagnostic_catalogue_v1_default = {
1069
1072
  "UA-14",
1070
1073
  "UA-40",
1071
1074
  "UA-43"
1075
+ ],
1076
+ submitIdentitySources: [
1077
+ "header",
1078
+ "header_absent",
1079
+ "header_invalid",
1080
+ "not_extracted"
1081
+ ],
1082
+ fundedRuntimeReclaims: [
1083
+ "closed"
1084
+ ],
1085
+ suspensionReasons: [
1086
+ "request_limit",
1087
+ "dvm_limit",
1088
+ "behaviour",
1089
+ "free_tier_idle",
1090
+ "admin_org_suspend",
1091
+ "builder_pause",
1092
+ "withdrawn",
1093
+ "operator"
1072
1094
  ]
1073
1095
  };
1074
1096
  var DIAGNOSTIC_CATALOGUE_VERSION = diagnostic_catalogue_v1_default.version;
@@ -1080,6 +1102,12 @@ var PAYMENT_ENUMS = {
1080
1102
  failure_stage: new Set(diagnostic_catalogue_v1_default.paymentFailureStages),
1081
1103
  phase: new Set(diagnostic_catalogue_v1_default.paymentPhases)
1082
1104
  };
1105
+ var ROUTER_ENUMS = {
1106
+ submit_identity_source: new Set(diagnostic_catalogue_v1_default.submitIdentitySources),
1107
+ funded_runtime_reclaim: new Set(diagnostic_catalogue_v1_default.fundedRuntimeReclaims),
1108
+ suspended_reclaim: new Set(diagnostic_catalogue_v1_default.suspensionReasons),
1109
+ suspended_admin: new Set(diagnostic_catalogue_v1_default.suspensionReasons)
1110
+ };
1083
1111
  var EVENTS = new Set(diagnostic_catalogue_v1_default.events);
1084
1112
  var ROUTE_TEMPLATES = [...diagnostic_catalogue_v1_default.routeTemplates].sort(
1085
1113
  compareRouteTemplates
@@ -1120,7 +1148,6 @@ var REDACTED_SEGMENT_RE = /^:(?:uuid|hex|n|b58|token)$/;
1120
1148
  var SERVICE_NAMES = /* @__PURE__ */ new Set([
1121
1149
  "platform-api",
1122
1150
  "router",
1123
- "dvmadmin",
1124
1151
  "admin",
1125
1152
  "unknown"
1126
1153
  ]);
@@ -1280,9 +1307,9 @@ function projectFields(input, dataset, authority, identityAuthority) {
1280
1307
  return output;
1281
1308
  }
1282
1309
  function projectField(key, value, dataset, authority, identityAuthority) {
1283
- const paymentEnum = Object.hasOwn(PAYMENT_ENUMS, key) ? PAYMENT_ENUMS[key] : void 0;
1284
- if (paymentEnum)
1285
- return typeof value === "string" && paymentEnum.has(value) ? value : void 0;
1310
+ const closedEnum = Object.hasOwn(PAYMENT_ENUMS, key) ? PAYMENT_ENUMS[key] : Object.hasOwn(ROUTER_ENUMS, key) ? ROUTER_ENUMS[key] : void 0;
1311
+ if (closedEnum)
1312
+ return typeof value === "string" && closedEnum.has(value) ? value : void 0;
1286
1313
  if (BOOLEAN_FIELDS.has(key))
1287
1314
  return typeof value === "boolean" ? value : void 0;
1288
1315
  if (INTEGER_FIELDS.has(key))
@@ -4,14 +4,14 @@ const require = __dvmCreateRequire(import.meta.url);
4
4
  import {
5
5
  loadConfig,
6
6
  updateConfig
7
- } from "./chunk-7OA2XUM4.js";
7
+ } from "./chunk-YJQNDNYK.js";
8
8
  import {
9
9
  tempoAccountFromConfig,
10
10
  tryResolveTempoAsset
11
- } from "./chunk-LIITTIEN.js";
11
+ } from "./chunk-AGGWYE3D.js";
12
12
  import {
13
13
  DvmError
14
- } from "./chunk-6JP6ZBWW.js";
14
+ } from "./chunk-QPT5KD7H.js";
15
15
 
16
16
  // src/lib/payment-rails/tempo-wallet.ts
17
17
  function tempoBalanceCheckHint(token) {
@@ -46,7 +46,7 @@ async function generateTempoKey(opts = {}) {
46
46
  );
47
47
  }
48
48
  if (existing && opts.force) {
49
- const { assertTempoWalletIdle } = await import("./tempo-lifecycle-NDBO3V3A.js");
49
+ const { assertTempoWalletIdle } = await import("./tempo-lifecycle-L5C55URR.js");
50
50
  await assertTempoWalletIdle("replace");
51
51
  }
52
52
  const { privateKeyToAccount, generatePrivateKey } = await import("./accounts-2WZE4N5F.js");
@@ -12,7 +12,7 @@ import {
12
12
  isSignableExactRequirement,
13
13
  maxAdvertisedMicro,
14
14
  withinAdvertisedTolerance
15
- } from "./chunk-LIITTIEN.js";
15
+ } from "./chunk-AGGWYE3D.js";
16
16
  import {
17
17
  DvmError,
18
18
  X402_V1_VERSION,
@@ -30,7 +30,7 @@ import {
30
30
  usdcToMsats,
31
31
  x402NetworkByCaip2,
32
32
  x402NetworkToCaip2
33
- } from "./chunk-6JP6ZBWW.js";
33
+ } from "./chunk-QPT5KD7H.js";
34
34
 
35
35
  // src/lib/x402/client.ts
36
36
  import { randomBytes } from "crypto";
@@ -5,10 +5,10 @@ import {
5
5
  formatUsdcMicrounits,
6
6
  listX402Channels,
7
7
  readX402ChannelGuardFacts
8
- } from "./chunk-LIITTIEN.js";
8
+ } from "./chunk-AGGWYE3D.js";
9
9
  import {
10
10
  DvmError
11
- } from "./chunk-6JP6ZBWW.js";
11
+ } from "./chunk-QPT5KD7H.js";
12
12
 
13
13
  // src/lib/x402/lifecycle.ts
14
14
  async function assertX402WalletIdle(wallet, intent) {
@@ -6,9 +6,9 @@ import {
6
6
  } from "./chunk-R2DSAZBO.js";
7
7
  import {
8
8
  diagnosticConsole
9
- } from "./chunk-ZM5QFHEY.js";
9
+ } from "./chunk-DSNUC4J7.js";
10
10
 
11
- // node_modules/@dvmkit/sdk/dist/chunk-3VFEX2Y3.js
11
+ // node_modules/@dvmkit/sdk/dist/chunk-X3JEME6P.js
12
12
  import { createHash, randomUUID } from "crypto";
13
13
  async function x402EarnedCeiling(channel, earnedNative) {
14
14
  let earned;
@@ -6,9 +6,9 @@ import {
6
6
  } from "./chunk-R2DSAZBO.js";
7
7
  import {
8
8
  diagnosticConsole
9
- } from "./chunk-ZM5QFHEY.js";
9
+ } from "./chunk-DSNUC4J7.js";
10
10
 
11
- // node_modules/@dvmkit/sdk/dist/chunk-YK54BJ2L.js
11
+ // node_modules/@dvmkit/sdk/dist/chunk-PRSKC7AD.js
12
12
  import { randomUUID } from "crypto";
13
13
  var ENDPOINTS = {
14
14
  job_terminal: "/_internal/job-terminal",
@@ -3,7 +3,7 @@ import { createRequire as __dvmCreateRequire } from "node:module";
3
3
  const require = __dvmCreateRequire(import.meta.url);
4
4
  import {
5
5
  diagnosticConsole
6
- } from "./chunk-ZM5QFHEY.js";
6
+ } from "./chunk-DSNUC4J7.js";
7
7
  import {
8
8
  __export
9
9
  } from "./chunk-IYHTITNZ.js";
@@ -411,7 +411,7 @@ function resolveRpcHttpTransportOptions(source, envValue) {
411
411
  return { fetchOptions: { headers } };
412
412
  }
413
413
 
414
- // node_modules/@dvmkit/sdk/dist/chunk-KXWROQGK.js
414
+ // node_modules/@dvmkit/sdk/dist/chunk-FUJ36YDV.js
415
415
  var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
416
416
  var LONG_HEX_RE = /^[0-9a-f]{16,}$/i;
417
417
  var NUMERIC_RE = /^\d{4,}$/;
@@ -457,25 +457,6 @@ function isOpaqueToken(segment) {
457
457
  }
458
458
  return false;
459
459
  }
460
- var callerLoggers = buildNoopLoggers();
461
- function initCallerLoggers(nextLoggers) {
462
- callerLoggers = nextLoggers;
463
- }
464
- function buildNoopLoggers() {
465
- const noopLogger = {
466
- // eslint-disable-next-line @typescript-eslint/no-empty-function -- standalone caller has no exporter
467
- info() {
468
- },
469
- async span(_name, _attrs, fn) {
470
- return fn();
471
- }
472
- };
473
- return {
474
- cashu: noopLogger,
475
- lightning: noopLogger,
476
- x402: noopLogger
477
- };
478
- }
479
460
 
480
461
  // node_modules/@noble/hashes/utils.js
481
462
  function isBytes(a) {
@@ -3011,7 +2992,7 @@ var schnorr = /* @__PURE__ */ (() => {
3011
2992
  };
3012
2993
  })();
3013
2994
 
3014
- // node_modules/@dvmkit/sdk/dist/chunk-OFSOLHRX.js
2995
+ // node_modules/@dvmkit/sdk/dist/chunk-WMGXJQI3.js
3015
2996
  function resolveX402Asset(network = X402_DEFAULT_NETWORK) {
3016
2997
  const spec = x402NetworkByCaip2(network);
3017
2998
  if (!spec) return null;
@@ -3103,7 +3084,28 @@ async function getX402Balance(wallet) {
3103
3084
  }
3104
3085
  }
3105
3086
 
3106
- // node_modules/@dvmkit/sdk/dist/chunk-XEOTTFLH.js
3087
+ // node_modules/@dvmkit/sdk/dist/chunk-66HGCPBU.js
3088
+ var callerLoggers = buildNoopLoggers();
3089
+ function initCallerLoggers(nextLoggers) {
3090
+ callerLoggers = nextLoggers;
3091
+ }
3092
+ function buildNoopLoggers() {
3093
+ const noopLogger = {
3094
+ // eslint-disable-next-line @typescript-eslint/no-empty-function -- standalone caller has no exporter
3095
+ info() {
3096
+ },
3097
+ async span(_name, _attrs, fn) {
3098
+ return fn();
3099
+ }
3100
+ };
3101
+ return {
3102
+ cashu: noopLogger,
3103
+ lightning: noopLogger,
3104
+ x402: noopLogger
3105
+ };
3106
+ }
3107
+
3108
+ // node_modules/@dvmkit/sdk/dist/chunk-ATXDKX6F.js
3107
3109
  import { AsyncLocalStorage } from "async_hooks";
3108
3110
  import { createPrivateKey, randomBytes as randomBytes2 } from "crypto";
3109
3111
 
@@ -10595,7 +10597,7 @@ var SignJWT = class {
10595
10597
  }
10596
10598
  };
10597
10599
 
10598
- // node_modules/@dvmkit/sdk/dist/chunk-XEOTTFLH.js
10600
+ // node_modules/@dvmkit/sdk/dist/chunk-ATXDKX6F.js
10599
10601
  var scopes = new AsyncLocalStorage();
10600
10602
  function withPaymentDiagnostics(fn) {
10601
10603
  return scopes.run({}, fn);
@@ -10770,7 +10772,7 @@ function logRejected(stage) {
10770
10772
  });
10771
10773
  }
10772
10774
 
10773
- // node_modules/@dvmkit/sdk/dist/chunk-BIZR5ORK.js
10775
+ // node_modules/@dvmkit/sdk/dist/chunk-YPSJU3OH.js
10774
10776
  async function verifyX402Payment(paymentHeader, config, requiredUsdcMicro, resource, btcUsdRate, exactVersions = { v1: true, v2: true }) {
10775
10777
  return callerLoggers.x402.span(
10776
10778
  "x402.verify_payment",
@@ -10891,8 +10893,6 @@ export {
10891
10893
  resolveRpcHttpTransportOptions,
10892
10894
  redactUrl,
10893
10895
  redactUrlsInText,
10894
- callerLoggers,
10895
- initCallerLoggers,
10896
10896
  anumber,
10897
10897
  abytes,
10898
10898
  ahash,
@@ -10914,6 +10914,8 @@ export {
10914
10914
  ensureAddress,
10915
10915
  generateX402PrivateKey,
10916
10916
  getX402Balance,
10917
+ callerLoggers,
10918
+ initCallerLoggers,
10917
10919
  x402Version,
10918
10920
  numberToDecimalString,
10919
10921
  parseMoneyString,
@@ -8,10 +8,10 @@ import {
8
8
  CONFIG_PINNED_FILE,
9
9
  ensureConfigDir,
10
10
  require_proper_lockfile
11
- } from "./chunk-LIITTIEN.js";
11
+ } from "./chunk-AGGWYE3D.js";
12
12
  import {
13
13
  DvmError
14
- } from "./chunk-6JP6ZBWW.js";
14
+ } from "./chunk-QPT5KD7H.js";
15
15
  import {
16
16
  __toESM
17
17
  } from "./chunk-IYHTITNZ.js";
@@ -3,8 +3,8 @@ import { createRequire as __dvmCreateRequire } from "node:module";
3
3
  const require = __dvmCreateRequire(import.meta.url);
4
4
  import {
5
5
  tryX402Payment
6
- } from "./chunk-3PV36227.js";
7
- import "./chunk-LIITTIEN.js";
6
+ } from "./chunk-HY65VFLL.js";
7
+ import "./chunk-AGGWYE3D.js";
8
8
  import "./chunk-JBU7RKQ3.js";
9
9
  import "./chunk-KDNFUDOG.js";
10
10
  import "./chunk-IUTVV6N5.js";
@@ -13,11 +13,11 @@ import "./chunk-6LP4EGKA.js";
13
13
  import "./chunk-N3UJT2NJ.js";
14
14
  import "./chunk-SYFKO6BA.js";
15
15
  import "./chunk-PUOXBKY2.js";
16
- import "./chunk-6JP6ZBWW.js";
17
- import "./chunk-EQXNDN5I.js";
18
- import "./chunk-C5XIOTRP.js";
16
+ import "./chunk-QPT5KD7H.js";
17
+ import "./chunk-PKZUEXMJ.js";
18
+ import "./chunk-MULGWPBV.js";
19
19
  import "./chunk-R2DSAZBO.js";
20
- import "./chunk-ZM5QFHEY.js";
20
+ import "./chunk-DSNUC4J7.js";
21
21
  import "./chunk-EVQERRCP.js";
22
22
  import "./chunk-RA24J4QM.js";
23
23
  import "./chunk-B4WHUMZM.js";