@dvmkit/dvm-cli 0.18.0 → 0.19.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/dist/{chunk-ESQ6DCS3.js → chunk-3NXAIRFF.js} +2 -2
  2. package/dist/{chunk-REIUNZQX.js → chunk-B5KW2TPR.js} +2 -2
  3. package/dist/{chunk-DGA5EFKU.js → chunk-DF2OWCRY.js} +6 -6
  4. package/dist/{chunk-RYFCHR6Z.js → chunk-DJDONOMG.js} +2 -2
  5. package/dist/{chunk-VSOIBYBF.js → chunk-J3HYNDMI.js} +270 -34
  6. package/dist/{chunk-OEWENVJ7.js → chunk-MM646MFM.js} +4 -4
  7. package/dist/{chunk-VLD7OKSH.js → chunk-NKD4NEUF.js} +3 -3
  8. package/dist/{chunk-ZGBCVQF2.js → chunk-OCVRCWBL.js} +3 -3
  9. package/dist/{chunk-IK7RI645.js → chunk-W4ADV3HW.js} +449 -5
  10. package/dist/{chunk-UFMAHF6T.js → chunk-WCX4PNEF.js} +127 -40
  11. package/dist/{chunk-THTPKBZX.js → chunk-X6BETQ7V.js} +1252 -737
  12. package/dist/{chunk-A2B7QDMS.js → chunk-ZZCYSYXR.js} +2 -2
  13. package/dist/{client-PVRLAMI3.js → client-S3FEXAWD.js} +6 -6
  14. package/dist/dvm.js +49 -33
  15. package/dist/{internal-L362ZUWL.js → internal-WAQ3LZN4.js} +10 -8
  16. package/dist/{lifecycle-BH4OA5I3.js → lifecycle-NOK3MKL4.js} +6 -6
  17. package/dist/{payout-reporter-F5LFV5W4-EJ7E5ALO.js → payout-reporter-5PH53T44-7IA4NGIN.js} +2 -2
  18. package/dist/{pocket-refill-6UL6CHD5.js → pocket-refill-KUBHM7MR.js} +10 -10
  19. package/dist/{revenue-reporter-2U55YH2I-EUB6PBRN.js → revenue-reporter-4XV3OO5O-RYHS3M34.js} +2 -2
  20. package/dist/{tempo-lifecycle-WGTX6MJR.js → tempo-lifecycle-QGJ4JEHN.js} +8 -8
  21. package/dist/{tempo-wallet-OTB2YSWE.js → tempo-wallet-GDDZZP5S.js} +7 -7
  22. package/dist/{wallet-73EJBUSO.js → wallet-2M3H75UP.js} +7 -7
  23. package/dist/{x402-G6C4N2BN-TAJEBQGU.js → x402-FHHB3V4V-CM6OMLHE.js} +2 -2
  24. package/package.json +2 -2
  25. package/skills/dvm/credit.md +4 -0
  26. package/skills/dvm/wallets.md +2 -0
@@ -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-32OYGCKJ.js
5
+ // node_modules/@dvmkit/sdk/dist/chunk-XY7PCMMS.js
6
6
  import { isIP } from "net";
7
7
  var diagnostic_catalogue_v1_default = {
8
8
  version: 1,
@@ -29,6 +29,7 @@ var diagnostic_catalogue_v1_default = {
29
29
  "admin.set_operator",
30
30
  "admin.set_plan",
31
31
  "admin.suspend",
32
+ "admin.withdrawal_finalize",
32
33
  "admin_cashu_nonce_store_in_memory",
33
34
  "admin_lock_state_unavailable",
34
35
  "admin_lock_table_init_failed",
@@ -214,6 +215,7 @@ var diagnostic_catalogue_v1_default = {
214
215
  "step_persist_failed",
215
216
  "job_messages_listen_connect_failed",
216
217
  "job_messages_listen_lost",
218
+ "job_messages_listen_restored",
217
219
  "job_retention_alert_failed",
218
220
  "job_retention_candidate_failed",
219
221
  "job_retention_recovery_alert_failed",
@@ -324,6 +326,8 @@ var diagnostic_catalogue_v1_default = {
324
326
  "platform_db_health_endpoint_failed",
325
327
  "platform_db_health_recovery_failed",
326
328
  "platform_hosted_test_mint_allowed",
329
+ "postgres_client_error",
330
+ "postgres_pool_error",
327
331
  "postgres_transport_recovery",
328
332
  "queued",
329
333
  "receipt_issue_failed",
@@ -493,6 +497,7 @@ var diagnostic_catalogue_v1_default = {
493
497
  "x402_claim_ceiling_unbound",
494
498
  "x402_claim_ceiling_unresolved",
495
499
  "x402_credential_rejected",
500
+ "x402_env_ignored",
496
501
  "x402_facilitator_capability_degraded",
497
502
  "x402_facilitator_extension_response",
498
503
  "x402_facilitator_extension_responses_truncated",
@@ -501,6 +506,7 @@ var diagnostic_catalogue_v1_default = {
501
506
  "x402_facilitator_staleness_ceiling",
502
507
  "x402_facilitator_unavailable",
503
508
  "x402_network_unsupported",
509
+ "x402_rail_missing",
504
510
  "x402_refund_amount_unreported",
505
511
  "x402_repair_channel_state_stale",
506
512
  "x402_repair_write_off_restore_failed",
@@ -523,6 +529,11 @@ var diagnostic_catalogue_v1_default = {
523
529
  "x402_settlement_reconciliation_facilitator_unavailable",
524
530
  "x402_settlement_submission_failed",
525
531
  "x402_settlement_written_off",
532
+ "x402_shutdown_claim_incomplete",
533
+ "card_checkout_dispute_lost",
534
+ "card_checkout_recovery_deferred",
535
+ "card_checkout_session_permission_denied",
536
+ "card_checkout_session_missing",
526
537
  "card_charge_journal_failed",
527
538
  "card_charge_stranded_refunded",
528
539
  "card_charge_unsettled",
@@ -800,7 +811,40 @@ var diagnostic_catalogue_v1_default = {
800
811
  "/v1/job/:id/messages",
801
812
  "/v1/quote",
802
813
  "/v1/request-result/:requestId",
803
- "/v1/request-resume/:requestId"
814
+ "/v1/request-resume/:requestId",
815
+ "/v1/x402/:capability"
816
+ ],
817
+ postgresErrorCodes: [
818
+ "08000",
819
+ "08001",
820
+ "08003",
821
+ "08004",
822
+ "08006",
823
+ "08007",
824
+ "08P01",
825
+ "28000",
826
+ "28P01",
827
+ "53300",
828
+ "53400",
829
+ "57P01",
830
+ "57P02",
831
+ "57P03",
832
+ "57P04",
833
+ "57P05",
834
+ "58000",
835
+ "58030",
836
+ "EADDRNOTAVAIL",
837
+ "EAI_AGAIN",
838
+ "ECONNABORTED",
839
+ "ECONNREFUSED",
840
+ "ECONNRESET",
841
+ "EHOSTUNREACH",
842
+ "ENETDOWN",
843
+ "ENETRESET",
844
+ "ENETUNREACH",
845
+ "ENOTFOUND",
846
+ "EPIPE",
847
+ "ETIMEDOUT"
804
848
  ],
805
849
  errorCodes: [
806
850
  "amount_too_large",
@@ -918,6 +962,7 @@ var diagnostic_catalogue_v1_default = {
918
962
  "retry_hardened",
919
963
  "retry_with_bounded_wait",
920
964
  "retry_with_content_selector",
965
+ "screenshot_unavailable",
921
966
  "seconds_cap",
922
967
  "selector",
923
968
  "server_error",
@@ -951,7 +996,8 @@ var diagnostic_catalogue_v1_default = {
951
996
  "use_alternative_source",
952
997
  "wait_for_selector",
953
998
  "wait_too_long",
954
- "wrong_content_type"
999
+ "wrong_content_type",
1000
+ "x402_not_offered"
955
1001
  ],
956
1002
  datasets: [
957
1003
  "platform",
@@ -1199,50 +1245,59 @@ var diagnostic_catalogue_v1_default = {
1199
1245
  "unmatched"
1200
1246
  ]
1201
1247
  };
1202
- var DIAGNOSTIC_CATALOGUE_VERSION = diagnostic_catalogue_v1_default.version;
1248
+ var DIAGNOSTIC_CATALOGUE = deepFreeze(diagnostic_catalogue_v1_default);
1249
+ var catalogue = DIAGNOSTIC_CATALOGUE;
1250
+ var DIAGNOSTIC_CATALOGUE_VERSION = catalogue.version;
1203
1251
  var PAYMENT_ENUMS = {
1204
- reason: new Set(diagnostic_catalogue_v1_default.paymentSkipReasons),
1205
- cause: new Set(diagnostic_catalogue_v1_default.denominationCauses),
1206
- source_failure: new Set(diagnostic_catalogue_v1_default.fxSourceFailures),
1207
- failure_category: new Set(diagnostic_catalogue_v1_default.paymentFailureCategories),
1208
- failure_stage: new Set(diagnostic_catalogue_v1_default.paymentFailureStages),
1209
- phase: new Set(diagnostic_catalogue_v1_default.paymentPhases)
1252
+ reason: new Set(catalogue.paymentSkipReasons),
1253
+ cause: new Set(catalogue.denominationCauses),
1254
+ source_failure: new Set(catalogue.fxSourceFailures),
1255
+ failure_category: new Set(catalogue.paymentFailureCategories),
1256
+ failure_stage: new Set(catalogue.paymentFailureStages),
1257
+ phase: new Set(catalogue.paymentPhases)
1210
1258
  };
1211
1259
  var ROUTER_ENUMS = {
1212
- submit_identity_source: new Set(diagnostic_catalogue_v1_default.submitIdentitySources),
1213
- funded_runtime_reclaim: new Set(diagnostic_catalogue_v1_default.fundedRuntimeReclaims),
1214
- suspended_reclaim: new Set(diagnostic_catalogue_v1_default.suspensionReasons),
1215
- suspended_admin: new Set(diagnostic_catalogue_v1_default.suspensionReasons)
1260
+ submit_identity_source: new Set(catalogue.submitIdentitySources),
1261
+ funded_runtime_reclaim: new Set(catalogue.fundedRuntimeReclaims),
1262
+ suspended_reclaim: new Set(catalogue.suspensionReasons),
1263
+ suspended_admin: new Set(catalogue.suspensionReasons)
1216
1264
  };
1217
- var EVENTS = new Set(diagnostic_catalogue_v1_default.events);
1218
- var ROUTE_TEMPLATES = [...diagnostic_catalogue_v1_default.routeTemplates].sort(
1265
+ var EVENTS = new Set(catalogue.events);
1266
+ var ROUTE_TEMPLATES = [...catalogue.routeTemplates].sort(
1219
1267
  compareRouteTemplates
1220
1268
  );
1221
- var ERROR_CODES = new Set(diagnostic_catalogue_v1_default.errorCodes);
1222
- var DATASETS = new Set(diagnostic_catalogue_v1_default.datasets);
1223
- var LEVELS = new Set(diagnostic_catalogue_v1_default.levels);
1224
- var STATUSES = new Set(diagnostic_catalogue_v1_default.statuses);
1225
- var METHODS = new Set(diagnostic_catalogue_v1_default.methods);
1226
- var NWC_EXCESS_METHODS = new Set(diagnostic_catalogue_v1_default.nwcExcessMethods);
1227
- var RAILS = new Set(diagnostic_catalogue_v1_default.rails);
1228
- var STAGES = new Set(diagnostic_catalogue_v1_default.stages);
1229
- var HANDLERS = new Set(diagnostic_catalogue_v1_default.handlers);
1230
- var CURRENCIES = new Set(diagnostic_catalogue_v1_default.currencyTokens);
1231
- var TEMPO_CLOSE_REPORT_PRIOR_STATUSES = new Set(diagnostic_catalogue_v1_default.tempoCloseReportPriorStatuses);
1232
- var BOOLEAN_FIELDS = new Set(diagnostic_catalogue_v1_default.booleanFields);
1233
- var INTEGER_FIELDS = new Set(diagnostic_catalogue_v1_default.integerFields);
1234
- var TOKEN_FIELDS = new Set(diagnostic_catalogue_v1_default.tokenFields);
1235
- var HASH_FIELDS = new Set(diagnostic_catalogue_v1_default.hashFields);
1236
- var TRANSACTION_HASH_FIELDS = new Set(diagnostic_catalogue_v1_default.transactionHashFields);
1237
- var URL_FIELDS = new Set(diagnostic_catalogue_v1_default.urlFields);
1238
- var IDENTITY_FIELDS = new Set(diagnostic_catalogue_v1_default.identityFields);
1239
- var CAPABILITY_FIELDS = new Set(diagnostic_catalogue_v1_default.capabilityFields);
1240
- var CAPABILITY_CHANNELS = new Set(diagnostic_catalogue_v1_default.capabilityChannels);
1269
+ var ERROR_CODES = new Set(catalogue.errorCodes);
1270
+ var POSTGRES_ERROR_CODES = new Set(catalogue.postgresErrorCodes);
1271
+ var POSTGRES_ERROR_EVENTS = /* @__PURE__ */ new Set([
1272
+ "job_messages_listen_lost",
1273
+ "job_messages_listen_connect_failed",
1274
+ "postgres_pool_error",
1275
+ "postgres_client_error"
1276
+ ]);
1277
+ var DATASETS = new Set(catalogue.datasets);
1278
+ var LEVELS = new Set(catalogue.levels);
1279
+ var STATUSES = new Set(catalogue.statuses);
1280
+ var METHODS = new Set(catalogue.methods);
1281
+ var NWC_EXCESS_METHODS = new Set(catalogue.nwcExcessMethods);
1282
+ var RAILS = new Set(catalogue.rails);
1283
+ var STAGES = new Set(catalogue.stages);
1284
+ var HANDLERS = new Set(catalogue.handlers);
1285
+ var CURRENCIES = new Set(catalogue.currencyTokens);
1286
+ var TEMPO_CLOSE_REPORT_PRIOR_STATUSES = new Set(catalogue.tempoCloseReportPriorStatuses);
1287
+ var BOOLEAN_FIELDS = new Set(catalogue.booleanFields);
1288
+ var INTEGER_FIELDS = new Set(catalogue.integerFields);
1289
+ var TOKEN_FIELDS = new Set(catalogue.tokenFields);
1290
+ var HASH_FIELDS = new Set(catalogue.hashFields);
1291
+ var TRANSACTION_HASH_FIELDS = new Set(catalogue.transactionHashFields);
1292
+ var URL_FIELDS = new Set(catalogue.urlFields);
1293
+ var IDENTITY_FIELDS = new Set(catalogue.identityFields);
1294
+ var CAPABILITY_FIELDS = new Set(catalogue.capabilityFields);
1295
+ var CAPABILITY_CHANNELS = new Set(catalogue.capabilityChannels);
1241
1296
  var CLIENT_PROTOCOL_VERSIONS = new Set(
1242
- diagnostic_catalogue_v1_default.clientProtocolVersions
1297
+ catalogue.clientProtocolVersions
1243
1298
  );
1244
- var CLIENT_VERSION_FIELDS = new Set(diagnostic_catalogue_v1_default.clientVersionFields);
1245
- var SANCTIONS_REGIONS = new Set(diagnostic_catalogue_v1_default.sanctionsRegions);
1299
+ var CLIENT_VERSION_FIELDS = new Set(catalogue.clientVersionFields);
1300
+ var SANCTIONS_REGIONS = new Set(catalogue.sanctionsRegions);
1246
1301
  var SPAN_ID_RE = /^(?!0{16}$)[0-9a-f]{16}$/;
1247
1302
  var TRACE_ID_RE = /^(?!0{32}$)[0-9a-f]{32}$/;
1248
1303
  var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
@@ -1253,6 +1308,12 @@ var CAPABILITY_RE = /^[a-z][a-z0-9_-]{0,47}$/;
1253
1308
  var CLIENT_VERSION_RE = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-rc\.(?:0|[1-9]\d*))?$/;
1254
1309
  var HASH_RE = /^(?:[0-9a-f]{16}|[0-9a-f]{64})$/i;
1255
1310
  var DECIMAL_RE = /^(?:0|[1-9]\d{0,77})$/;
1311
+ var CARD_CHECKOUT_EVENTS = /* @__PURE__ */ new Set([
1312
+ "card_checkout_dispute_lost",
1313
+ "card_checkout_recovery_deferred",
1314
+ "card_checkout_session_permission_denied",
1315
+ "card_checkout_session_missing"
1316
+ ]);
1256
1317
  var CARD_REFUND_EVENTS = /* @__PURE__ */ new Set([
1257
1318
  "card_charge_stranded_refunded",
1258
1319
  "card_charge_unsettled",
@@ -1434,6 +1495,11 @@ function projectFields(input, dataset, authority, identityAuthority, eventName)
1434
1495
  return output;
1435
1496
  }
1436
1497
  function projectField(key, value, dataset, authority, identityAuthority, eventName) {
1498
+ if (eventName === "x402_shutdown_claim_incomplete") {
1499
+ if (key === "unclaimed_channels") return value === null || isNonnegativeSafeInteger(value) ? value : void 0;
1500
+ if (key === "unclaimed_amount_native") return value === null || typeof value === "string" && DECIMAL_RE.test(value) ? value : void 0;
1501
+ if (key === "reason") return value === "timeout" || value === "failed" || value === "lock_unavailable" ? value : void 0;
1502
+ }
1437
1503
  const closedEnum = Object.hasOwn(PAYMENT_ENUMS, key) ? PAYMENT_ENUMS[key] : Object.hasOwn(ROUTER_ENUMS, key) ? ROUTER_ENUMS[key] : void 0;
1438
1504
  if (closedEnum)
1439
1505
  return typeof value === "string" && closedEnum.has(value) ? value : void 0;
@@ -1446,6 +1512,19 @@ function projectField(key, value, dataset, authority, identityAuthority, eventNa
1446
1512
  ))];
1447
1513
  }
1448
1514
  }
1515
+ if (eventName === "x402_rail_missing" && key === "capabilities" && Array.isArray(value)) {
1516
+ return ownDataEntries(value, 64).filter(([key2]) => /^(?:0|[1-9]\d*)$/.test(key2)).flatMap(([, name]) => projectCapability(name, authority) ?? []);
1517
+ }
1518
+ if (eventName === "x402_env_ignored" && key === "variables" && Array.isArray(value)) {
1519
+ return ownDataEntries(value, 64).filter(([key2]) => /^(?:0|[1-9]\d*)$/.test(key2)).flatMap(([, name]) => typeof name === "string" && /^DVMKIT_X402_[A-Z0-9_]{1,64}$/.test(name) ? [name] : []);
1520
+ }
1521
+ if (eventName !== void 0 && CARD_CHECKOUT_EVENTS.has(eventName)) {
1522
+ if (key === "session_id")
1523
+ return typeof value === "string" && /^cs_(?:test_|live_)?[A-Za-z0-9]{1,128}$/.test(value) ? value : void 0;
1524
+ if (key === "payment_intent")
1525
+ return typeof value === "string" && /^pi_[A-Za-z0-9_]{1,128}$/.test(value) ? value : void 0;
1526
+ if (key === "retry_after_ms") return isNonnegativeSafeInteger(value) ? value : void 0;
1527
+ }
1449
1528
  if (eventName !== void 0 && CARD_REFUND_EVENTS.has(eventName)) {
1450
1529
  const projected = projectCardRefundField(key, value);
1451
1530
  if (projected !== void 0) return projected;
@@ -1517,7 +1596,7 @@ function projectField(key, value, dataset, authority, identityAuthority, eventNa
1517
1596
  return typeof value === "string" && DATASETS.has(value) ? value : void 0;
1518
1597
  if (key === "error.code" || key === "error_code" || key === "code") {
1519
1598
  if (typeof value !== "string") return void 0;
1520
- return ERROR_CODES.has(value) ? value : key === "error.code" || key === "error_code" ? "unknown_error" : void 0;
1599
+ return ERROR_CODES.has(value) || eventName !== void 0 && POSTGRES_ERROR_EVENTS.has(eventName) && POSTGRES_ERROR_CODES.has(value) ? value : key === "error.code" || key === "error_code" ? "unknown_error" : void 0;
1521
1600
  }
1522
1601
  if (key === "currency" || key === "ask_currency" || key === "asked_topup_currency") {
1523
1602
  return typeof value === "string" && CURRENCIES.has(value) ? value : void 0;
@@ -1670,6 +1749,13 @@ function ownDataEntries(input, limit) {
1670
1749
  }
1671
1750
  return entries;
1672
1751
  }
1752
+ function deepFreeze(value) {
1753
+ if (typeof value === "object" && value !== null && !Object.isFrozen(value)) {
1754
+ for (const child of Object.values(value)) deepFreeze(child);
1755
+ Object.freeze(value);
1756
+ }
1757
+ return value;
1758
+ }
1673
1759
  var diagnosticConsole = {
1674
1760
  debug: (...values) => emit("debug", values),
1675
1761
  info: (...values) => emit("info", values),
@@ -1733,6 +1819,7 @@ function ownValue2(input, key) {
1733
1819
  }
1734
1820
 
1735
1821
  export {
1822
+ DIAGNOSTIC_CATALOGUE,
1736
1823
  DIAGNOSTIC_CATALOGUE_VERSION,
1737
1824
  createDiagnosticCapabilityAuthority,
1738
1825
  bindDiagnosticCapabilityAuthority,