@dvmkit/sdk 0.8.1 → 0.10.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 (52) hide show
  1. package/dist/{chunk-ILBSZMJL.js → chunk-2XQLL6N6.js} +1 -1
  2. package/dist/{chunk-UVS7MRJX.js → chunk-3Q6FTZDB.js} +2 -2
  3. package/dist/{chunk-OP7VCGQR.js → chunk-3R7NQA3Z.js} +1 -1
  4. package/dist/{chunk-RSNC5T6C.js → chunk-AJ6UHXUA.js} +1 -1
  5. package/dist/{chunk-ALWVJ2RB.js → chunk-EWZFANHJ.js} +3 -3
  6. package/dist/{chunk-J5J63WDC.js → chunk-FFXXGCVG.js} +3 -3
  7. package/dist/{chunk-UDJNZ3UG.js → chunk-JNECYURT.js} +1 -1
  8. package/dist/{chunk-IHQUBATH.js → chunk-KFCEXCZM.js} +3 -3
  9. package/dist/{chunk-NA2KOR6G.js → chunk-LDIPVPKI.js} +3 -3
  10. package/dist/{chunk-IOQIXRGM.js → chunk-M3T5JYDJ.js} +15 -8
  11. package/dist/{chunk-UWGBI5WK.js → chunk-MB6R4XPZ.js} +3 -3
  12. package/dist/{chunk-7PM4R4GD.js → chunk-MMGSYMIC.js} +1 -1
  13. package/dist/{chunk-QKE5NDPF.js → chunk-MU3IE434.js} +348 -80
  14. package/dist/{chunk-BFGQG4WY.js → chunk-QGNXYVBO.js} +52 -12
  15. package/dist/{chunk-JIZ4ZIXX.js → chunk-QNKK7SPY.js} +652 -245
  16. package/dist/{chunk-FM6QAGJC.js → chunk-STJBBVNL.js} +24 -8
  17. package/dist/{chunk-NU5RWJ5B.js → chunk-VMHYGKWT.js} +3 -3
  18. package/dist/{chunk-AVV5SYGO.js → chunk-VTHYQCDB.js} +1 -1
  19. package/dist/{chunk-ZEPJF4JC.js → chunk-VUGEEMLT.js} +4 -4
  20. package/dist/{chunk-2U6LAASN.js → chunk-W3VGCNG6.js} +1 -1
  21. package/dist/{chunk-G3MPHW5I.js → chunk-Y6DO5WSO.js} +3 -3
  22. package/dist/{chunk-AGE5XZKE.js → chunk-YOSZIWC3.js} +17 -4
  23. package/dist/{content-retention-B7ddtJ2y.d.ts → content-retention-CrILCNxk.d.ts} +1 -1
  24. package/dist/{credit-ledger-KIQIE6I6.js → credit-ledger-4PZNAMDT.js} +4 -4
  25. package/dist/{credit-menu-BH3g9GQa.d.ts → credit-menu-VwX_6KM7.d.ts} +4 -4
  26. package/dist/{fx-DN26_J7o.d.ts → fx-BM5h4o5S.d.ts} +1 -1
  27. package/dist/index.d.ts +5 -5
  28. package/dist/index.js +4 -4
  29. package/dist/internal/caller.d.ts +7 -7
  30. package/dist/internal/caller.js +16 -16
  31. package/dist/internal/server.d.ts +7 -7
  32. package/dist/internal/server.js +26 -26
  33. package/dist/{job-store-Cq21JT37.d.ts → job-store-92v8e1LQ.d.ts} +1 -1
  34. package/dist/{lightning-backend-S8F8nf8q.d.ts → lightning-backend-9oky_wJi.d.ts} +1 -1
  35. package/dist/{memory-credit-ledger-ATYFAYBG.js → memory-credit-ledger-RP7DT5IY.js} +5 -5
  36. package/dist/{mpp-setup-ZTORW3VF.js → mpp-setup-FURD45LI.js} +5 -3
  37. package/dist/{payout-reporter-NN6K2IVQ.js → payout-reporter-HVJ6WUF3.js} +2 -2
  38. package/dist/{postgres-consumed-credential-store-XJTE5PCA.js → postgres-consumed-credential-store-WO6OCFXZ.js} +3 -3
  39. package/dist/{postgres-job-store-AR6ZJUQV.js → postgres-job-store-FSRUPYH2.js} +2 -2
  40. package/dist/{postgres-replay-store-33K33QV7.js → postgres-replay-store-XXJSA457.js} +2 -2
  41. package/dist/{pricing-G5IN5YJE.js → pricing-X4XU5HXY.js} +3 -3
  42. package/dist/{revenue-reporter-KDUZLD5F.js → revenue-reporter-EV3K5L6B.js} +2 -2
  43. package/dist/server/index.d.ts +78 -11
  44. package/dist/server/index.js +87 -45
  45. package/dist/{step-cache-CR12EZ1Q.d.ts → step-cache--7yA5Ihr.d.ts} +99 -12
  46. package/dist/{tempo-charge-store-XEGJYM3G.js → tempo-charge-store-5JOIYUIH.js} +2 -2
  47. package/dist/{tempo-session-store-3WTDOO7H.js → tempo-session-store-S6QMLQUA.js} +3 -3
  48. package/dist/testing/index.d.ts +3 -3
  49. package/dist/testing/index.js +7 -7
  50. package/dist/{usd-s_VZ_eS7.d.ts → usd-C7lvLvLk.d.ts} +1 -1
  51. package/dist/{x402-HQ5GRQZU.js → x402-EN5LSOVM.js} +4 -4
  52. package/package.json +1 -1
@@ -418,6 +418,7 @@ var diagnostic_catalogue_v1_default = {
418
418
  "tempo_session_advertised_refresh_failed",
419
419
  "tempo_session_close_attempts_exhausted",
420
420
  "tempo_session_close_challenge_failed",
421
+ "tempo_session_close_descriptor_refused",
421
422
  "tempo_session_close_exit_resolved",
422
423
  "tempo_session_close_failed",
423
424
  "tempo_session_close_failure_reconcile_failed",
@@ -425,9 +426,14 @@ var diagnostic_catalogue_v1_default = {
425
426
  "tempo_session_close_recovery_failed",
426
427
  "tempo_session_close_recovery_search_paused",
427
428
  "tempo_session_close_recovery_unmatched",
429
+ "tempo_session_close_report_reopened",
430
+ "tempo_session_close_report_written_off",
428
431
  "tempo_session_close_reservation_released",
429
432
  "tempo_session_close_settlement_callback_failed",
430
433
  "tempo_session_close_settlement_unreported",
434
+ "tempo_session_drain_finalized",
435
+ "tempo_session_drain_refund_unproven",
436
+ "tempo_session_drain_unbacked_resolved",
431
437
  "tempo_session_open_refused",
432
438
  "tempo_session_settled",
433
439
  "tempo_session_withheld",
@@ -547,9 +553,12 @@ var diagnostic_catalogue_v1_default = {
547
553
  "/admin/credit/reconcile-tempo-drain",
548
554
  "/admin/credit/reconcile-x402-exact-settlement",
549
555
  "/admin/credit/reconcile-x402-settlement",
556
+ "/admin/credit/retry-tempo-close-report",
557
+ "/admin/credit/tempo-close-reports",
550
558
  "/admin/credit/tempo-drains",
551
559
  "/admin/credit/tempo-losses",
552
560
  "/admin/credit/write-off-invoice",
561
+ "/admin/credit/write-off-tempo-close-report",
553
562
  "/admin/credit/write-off-tempo-drain",
554
563
  "/admin/credit/write-off-x402-settlement",
555
564
  "/admin/credit/x402-exact-settlements",
@@ -954,7 +963,8 @@ var diagnostic_catalogue_v1_default = {
954
963
  "storefront_probe",
955
964
  "success",
956
965
  "verified",
957
- "wallet_reported_budget"
966
+ "wallet_reported_budget",
967
+ "written_off"
958
968
  ],
959
969
  integerFields: [
960
970
  "ageMs",
@@ -995,6 +1005,9 @@ var diagnostic_catalogue_v1_default = {
995
1005
  "key_hash",
996
1006
  "prefix_hash"
997
1007
  ],
1008
+ transactionHashFields: [
1009
+ "transaction_hash"
1010
+ ],
998
1011
  urlFields: [
999
1012
  "url",
1000
1013
  "facilitator_url",
@@ -1096,6 +1109,10 @@ var diagnostic_catalogue_v1_default = {
1096
1109
  "builder_pause",
1097
1110
  "withdrawn",
1098
1111
  "operator"
1112
+ ],
1113
+ tempoCloseReportPriorStatuses: [
1114
+ "no_report",
1115
+ "unmatched"
1099
1116
  ]
1100
1117
  };
1101
1118
 
@@ -1128,10 +1145,12 @@ var RAILS = new Set(diagnostic_catalogue_v1_default.rails);
1128
1145
  var STAGES = new Set(diagnostic_catalogue_v1_default.stages);
1129
1146
  var HANDLERS = new Set(diagnostic_catalogue_v1_default.handlers);
1130
1147
  var CURRENCIES = new Set(diagnostic_catalogue_v1_default.currencyTokens);
1148
+ var TEMPO_CLOSE_REPORT_PRIOR_STATUSES = new Set(diagnostic_catalogue_v1_default.tempoCloseReportPriorStatuses);
1131
1149
  var BOOLEAN_FIELDS = new Set(diagnostic_catalogue_v1_default.booleanFields);
1132
1150
  var INTEGER_FIELDS = new Set(diagnostic_catalogue_v1_default.integerFields);
1133
1151
  var TOKEN_FIELDS = new Set(diagnostic_catalogue_v1_default.tokenFields);
1134
1152
  var HASH_FIELDS = new Set(diagnostic_catalogue_v1_default.hashFields);
1153
+ var TRANSACTION_HASH_FIELDS = new Set(diagnostic_catalogue_v1_default.transactionHashFields);
1135
1154
  var URL_FIELDS = new Set(diagnostic_catalogue_v1_default.urlFields);
1136
1155
  var IDENTITY_FIELDS = new Set(diagnostic_catalogue_v1_default.identityFields);
1137
1156
  var CAPABILITY_FIELDS = new Set(diagnostic_catalogue_v1_default.capabilityFields);
@@ -1232,13 +1251,13 @@ function projectSpanRow(input) {
1232
1251
  }
1233
1252
  const sampleRate = ownValue(input, "sample_rate");
1234
1253
  const pid = ownValue(input, "pid");
1235
- const rawName = ownValue(input, "name");
1254
+ const name = projectEventName(ownValue(input, "name"));
1236
1255
  const row = {
1237
1256
  span_id: spanId,
1238
1257
  trace_id: traceId,
1239
1258
  parent_span_id: parentSpanId,
1240
1259
  dataset,
1241
- name: typeof rawName === "string" && EVENTS.has(rawName) ? rawName : "diagnostic.unknown",
1260
+ name,
1242
1261
  level,
1243
1262
  status,
1244
1263
  started_at_ms: startedAtMs,
@@ -1253,13 +1272,15 @@ function projectSpanRow(input) {
1253
1272
  ownValue(input, "dimensions"),
1254
1273
  dataset,
1255
1274
  authority,
1256
- identityAuthority
1275
+ identityAuthority,
1276
+ name
1257
1277
  ),
1258
1278
  attributes: projectFields(
1259
1279
  ownValue(input, "attributes"),
1260
1280
  dataset,
1261
1281
  authority,
1262
- identityAuthority
1282
+ identityAuthority,
1283
+ name
1263
1284
  ),
1264
1285
  error_message: null,
1265
1286
  error_stack: null,
@@ -1275,7 +1296,7 @@ function projectSpanRow(input) {
1275
1296
  return { ok: false, code: "invalid_span" };
1276
1297
  }
1277
1298
  }
1278
- function projectDiagnosticFields(input, dataset, authority, identityAuthority) {
1299
+ function projectDiagnosticFields(input, dataset, authority, identityAuthority, eventName) {
1279
1300
  try {
1280
1301
  const inheritedAuthority = isObject(input) ? VALUE_AUTHORITIES.get(input) : void 0;
1281
1302
  const effectiveAuthority = validAuthority(authority) ?? inheritedAuthority;
@@ -1285,7 +1306,8 @@ function projectDiagnosticFields(input, dataset, authority, identityAuthority) {
1285
1306
  input,
1286
1307
  dataset,
1287
1308
  effectiveAuthority,
1288
- effectiveIdentityAuthority
1309
+ effectiveIdentityAuthority,
1310
+ eventName
1289
1311
  );
1290
1312
  bindDiagnosticCapabilityAuthority(output, effectiveAuthority);
1291
1313
  bindDiagnosticIdentityAuthority(output, effectiveIdentityAuthority);
@@ -1297,7 +1319,7 @@ function projectDiagnosticFields(input, dataset, authority, identityAuthority) {
1297
1319
  function projectEventName(input, fallback = "diagnostic.unknown") {
1298
1320
  return typeof input === "string" && EVENTS.has(input) ? input : fallback;
1299
1321
  }
1300
- function projectFields(input, dataset, authority, identityAuthority) {
1322
+ function projectFields(input, dataset, authority, identityAuthority, eventName) {
1301
1323
  if (!isObject(input)) return {};
1302
1324
  const output = {};
1303
1325
  for (const [key, value] of ownDataEntries(input, 64)) {
@@ -1307,22 +1329,39 @@ function projectFields(input, dataset, authority, identityAuthority) {
1307
1329
  value,
1308
1330
  dataset,
1309
1331
  authority,
1310
- identityAuthority
1332
+ identityAuthority,
1333
+ eventName
1311
1334
  );
1312
1335
  if (projected !== void 0) output[key] = projected;
1313
1336
  }
1314
1337
  return output;
1315
1338
  }
1316
- function projectField(key, value, dataset, authority, identityAuthority) {
1339
+ function projectField(key, value, dataset, authority, identityAuthority, eventName) {
1317
1340
  const closedEnum = Object.hasOwn(PAYMENT_ENUMS, key) ? PAYMENT_ENUMS[key] : Object.hasOwn(ROUTER_ENUMS, key) ? ROUTER_ENUMS[key] : void 0;
1318
1341
  if (closedEnum)
1319
1342
  return typeof value === "string" && closedEnum.has(value) ? value : void 0;
1343
+ if (dataset === "tempo") {
1344
+ if (key === "prior_status")
1345
+ return typeof value === "string" && TEMPO_CLOSE_REPORT_PRIOR_STATUSES.has(value) ? value : void 0;
1346
+ const closeReportEvent = eventName === "tempo_session_close_report_written_off" || eventName === "tempo_session_close_report_reopened";
1347
+ const payerExitEvent = eventName === "tempo_session_close_exit_resolved";
1348
+ if (closeReportEvent || payerExitEvent) {
1349
+ if (key === "obligation_id")
1350
+ return typeof value === "string" && UUID_RE.test(value) ? value : void 0;
1351
+ if (key === "channel_id")
1352
+ return typeof value === "string" && /^0x[0-9a-fA-F]{64}$/.test(value) ? value : void 0;
1353
+ if (closeReportEvent && (key === "amount_native" || key === "amount_forgone_native") || payerExitEvent && key === "amount_at_stake_native")
1354
+ return typeof value === "string" && DECIMAL_RE.test(value) ? value : void 0;
1355
+ }
1356
+ }
1320
1357
  if (BOOLEAN_FIELDS.has(key))
1321
1358
  return typeof value === "boolean" ? value : void 0;
1322
1359
  if (INTEGER_FIELDS.has(key))
1323
1360
  return isNonnegativeSafeInteger(value) ? value : void 0;
1324
1361
  if (HASH_FIELDS.has(key))
1325
1362
  return typeof value === "string" && HASH_RE.test(value) ? value : void 0;
1363
+ if (TRANSACTION_HASH_FIELDS.has(key))
1364
+ return typeof value === "string" && /^0x[0-9a-fA-F]{64}$/.test(value) ? value : void 0;
1326
1365
  if (URL_FIELDS.has(key)) return projectOrigin(value);
1327
1366
  if (IDENTITY_FIELDS.has(key)) return projectIdentity(key, identityAuthority);
1328
1367
  if (TOKEN_FIELDS.has(key)) return void 0;
@@ -1494,10 +1533,11 @@ function writeDiagnostic(sinkLevel, event, fields, dataset, severityOverride) {
1494
1533
  try {
1495
1534
  const defaultSeverity = sinkLevel === "debug" || sinkLevel === "log" ? "info" : sinkLevel;
1496
1535
  const severity = severityOverride === "info" || severityOverride === "warn" || severityOverride === "error" ? severityOverride : defaultSeverity;
1536
+ const eventName = projectEventName(event);
1497
1537
  const record = {
1498
- event: projectEventName(event),
1538
+ event: eventName,
1499
1539
  level: severity,
1500
- ...projectDiagnosticFields(fields, dataset)
1540
+ ...projectDiagnosticFields(fields, dataset, void 0, void 0, eventName)
1501
1541
  };
1502
1542
  const sink = sinkLevel === "log" ? console.log : console[sinkLevel];
1503
1543
  sink(JSON.stringify(record));