@dvmkit/dvm-cli 0.1.4 → 0.2.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 (60) hide show
  1. package/README.md +14 -0
  2. package/dist/{_esm-M2HUAA3B.js → _esm-MN4BUYV6.js} +56 -54
  3. package/dist/{accounts-S747UW3A.js → accounts-2WZE4N5F.js} +5 -5
  4. package/dist/actions-LR65XILR.js +244 -0
  5. package/dist/{ccip-XZ5F5J6R.js → ccip-JXYJSXTW.js} +3 -3
  6. package/dist/{chains-PINFXYUE.js → chains-LJ7XK6H3.js} +8 -8
  7. package/dist/{chunk-YZUBKHHA.js → chunk-2VVVWBQA.js} +471 -471
  8. package/dist/chunk-3SWX5BQP.js +66 -0
  9. package/dist/chunk-4JXFXP4Y.js +757 -0
  10. package/dist/{chunk-GIDSTROG.js → chunk-4NWEJTAW.js} +160 -158
  11. package/dist/{chunk-UXQCP26E.js → chunk-65EY7CT4.js} +2 -2
  12. package/dist/{chunk-6UGZAFIR.js → chunk-6CC6JGEU.js} +348 -18
  13. package/dist/{chunk-PHZHPRQE.js → chunk-6O27TEXD.js} +173 -173
  14. package/dist/{chunk-HPRIQEJS.js → chunk-7OK7MBT6.js} +19 -19
  15. package/dist/{chunk-7UPZZGC5.js → chunk-BECPI5H5.js} +193 -193
  16. package/dist/chunk-CJTE5TS3.js +1298 -0
  17. package/dist/{chunk-RWBYCM47.js → chunk-ECEM3ZAS.js} +10 -10
  18. package/dist/{chunk-ACNNU5RY.js → chunk-ECK465AY.js} +694 -565
  19. package/dist/{chunk-XGABM4H5.js → chunk-EGY4KDBW.js} +3822 -2012
  20. package/dist/{chunk-SLDVIXCS.js → chunk-EVQERRCP.js} +12 -12
  21. package/dist/{chunk-4AQ4G7L5.js → chunk-EZHT2RLJ.js} +383 -383
  22. package/dist/{chunk-IC6OXFYW.js → chunk-F55NNH2F.js} +63 -63
  23. package/dist/chunk-G5C6E6PJ.js +9063 -0
  24. package/dist/{chunk-6AJ7H2VX.js → chunk-GZWKCIYN.js} +213 -1281
  25. package/dist/{chunk-ZGXCK43G.js → chunk-LH3QPVN6.js} +8499 -8498
  26. package/dist/{chunk-MMJR6N3J.js → chunk-MLDUKBU3.js} +1368 -1368
  27. package/dist/chunk-N3UJT2NJ.js +3 -0
  28. package/dist/chunk-N7MGIK2U.js +61408 -0
  29. package/dist/{chunk-BZNZWRBB.js → chunk-OWJZYYMG.js} +11 -15
  30. package/dist/chunk-ZJYO7OLO.js +514 -0
  31. package/dist/{client-D3XFLWOK.js → client-OWIOFBKS.js} +18 -16
  32. package/dist/{dist-7MMV3EZA.js → dist-2G3QBGID.js} +11 -10
  33. package/dist/dvm.js +27046 -4414
  34. package/dist/esm-RQLHAH2K.js +5183 -0
  35. package/dist/internal-JDG52DJH.js +1230 -0
  36. package/dist/payout-reporter-3UB5WRCV-XTVZFIAO.js +17 -0
  37. package/dist/{pocket-refill-GDYSTECR.js → pocket-refill-QJMMD6QN.js} +29 -30
  38. package/dist/revenue-reporter-JIKUPXOK-TYUBTF4P.js +11 -0
  39. package/dist/{secp256k1-4YWQEMGF.js → secp256k1-JLZEQ2H7.js} +2 -2
  40. package/dist/tempo-lifecycle-SQL3KLEZ-AATA2SKI.js +28 -0
  41. package/dist/{tempo-wallet-5FEOI4CF.js → tempo-wallet-QOLEIPCV-SWCXRBDS.js} +2 -4
  42. package/dist/{x402-VNFA3DBY.js → x402-FTG2GRAQ-UGAUMUL6.js} +13 -24
  43. package/package.json +2 -10
  44. package/skills/dvm/SKILL.md +2 -1
  45. package/dist/channel-store-GOV7TEDN.js +0 -62
  46. package/dist/chunk-3PPOU55E.js +0 -312
  47. package/dist/chunk-3TBULV3F.js +0 -551
  48. package/dist/chunk-5BUV73FO.js +0 -2351
  49. package/dist/chunk-EY5K4BM3.js +0 -1780
  50. package/dist/chunk-G3RLVJF5.js +0 -19
  51. package/dist/chunk-KC4UPK44.js +0 -113
  52. package/dist/chunk-MTBCEXJ6.js +0 -4602
  53. package/dist/chunk-ONQMRWY3.js +0 -83
  54. package/dist/chunk-TO47XRK7.js +0 -24890
  55. package/dist/chunk-U5TNSUYW.js +0 -1757
  56. package/dist/chunk-UU6QMSTQ.js +0 -171
  57. package/dist/chunk-ZELLQI7F.js +0 -248
  58. package/dist/lifecycle-5RLM5JMN.js +0 -29
  59. package/dist/tempo-lifecycle-DHZPQTSB.js +0 -31
  60. package/dist/wallet-G3VOUCL4.js +0 -30
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __dvmCreateRequire } from "node:module";
3
+ const require = __dvmCreateRequire(import.meta.url);
4
+
5
+ // node_modules/@dvmkit/sdk/dist/chunk-S3XAHZQY.js
6
+ var SDK_INIT_ADVISORY_LOCK = 17320927;
7
+ async function withSdkInitLock(db, fn) {
8
+ assertPoolFitsLock(db);
9
+ let holder = holders.get(db);
10
+ if (holder) {
11
+ holder.refs += 1;
12
+ } else {
13
+ holder = { refs: 1, acquired: acquire(db) };
14
+ holders.set(db, holder);
15
+ }
16
+ let guardedFailed = false;
17
+ try {
18
+ await holder.acquired;
19
+ return await fn();
20
+ } catch (err) {
21
+ guardedFailed = true;
22
+ throw err;
23
+ } finally {
24
+ await releaseHolder(db, holder, guardedFailed);
25
+ }
26
+ }
27
+ var holders = /* @__PURE__ */ new WeakMap();
28
+ function assertPoolFitsLock(db) {
29
+ const max = db.options?.max;
30
+ if (max === void 0 || max >= 2) return;
31
+ throw new Error(
32
+ `withSdkInitLock: the SDK boot lock needs a pool that allows at least 2 connections (got max=${max}). The lock is held on one pinned client while the guarded DDL runs on another, so boot would hang forever.`
33
+ );
34
+ }
35
+ async function acquire(db) {
36
+ const client = await db.connect();
37
+ try {
38
+ await client.query(`SELECT pg_advisory_lock(${SDK_INIT_ADVISORY_LOCK})`);
39
+ } catch (err) {
40
+ client.release();
41
+ throw err;
42
+ }
43
+ return client;
44
+ }
45
+ async function releaseHolder(db, holder, guardedFailed) {
46
+ holder.refs -= 1;
47
+ if (holder.refs > 0) return;
48
+ holders.delete(db);
49
+ let client;
50
+ try {
51
+ client = await holder.acquired;
52
+ } catch {
53
+ return;
54
+ }
55
+ try {
56
+ await client.query(`SELECT pg_advisory_unlock(${SDK_INIT_ADVISORY_LOCK})`);
57
+ client.release();
58
+ } catch (err) {
59
+ client.release(err instanceof Error ? err : new Error(String(err)));
60
+ if (!guardedFailed) throw err;
61
+ }
62
+ }
63
+
64
+ export {
65
+ withSdkInitLock
66
+ };