@dvmkit/sdk 0.1.2-rc.7 → 0.1.3-rc.7

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 (45) hide show
  1. package/README.md +14 -0
  2. package/dist/chunk-2K7E3N2D.js +1709 -0
  3. package/dist/{chunk-N4VTG3KH.js → chunk-3ZHMQCYP.js} +645 -3027
  4. package/dist/{chunk-TKA6ZP4M.js → chunk-4B56DEEV.js} +50 -426
  5. package/dist/chunk-BIFLRKMO.js +87 -0
  6. package/dist/chunk-BQ2NMWKE.js +160 -0
  7. package/dist/{chunk-LDTWX7JW.js → chunk-BTZY7VPH.js} +13 -1
  8. package/dist/{chunk-FJDCFHW5.js → chunk-C6JHBLMW.js} +3 -81
  9. package/dist/{chunk-EXHBXA4U.js → chunk-DBCLBYHP.js} +13 -1
  10. package/dist/chunk-EPNDZ5DH.js +1010 -0
  11. package/dist/{chunk-P4RUVDU7.js → chunk-H2MEFVH6.js} +12 -141
  12. package/dist/chunk-KXZUCCEY.js +142 -0
  13. package/dist/{chunk-6JZIX5WW.js → chunk-LLXV32HA.js} +82 -5
  14. package/dist/{chunk-LWUR4CGG.js → chunk-MLRCSJYX.js} +11 -3
  15. package/dist/{chunk-2ABMGUDS.js → chunk-NFRM5QYP.js} +83 -10
  16. package/dist/chunk-RW5LP57K.js +44 -0
  17. package/dist/chunk-YDIYXGYL.js +384 -0
  18. package/dist/{chunk-JGGI65I3.js → chunk-Z4BNLUZF.js} +1 -150
  19. package/dist/{credit-ledger-ED6JXKVD.js → credit-ledger-2DFQHNLB.js} +2 -2
  20. package/dist/{credit-menu-BM4qCD5U.d.ts → credit-menu-C7zAJElJ.d.ts} +1632 -1946
  21. package/dist/{fx-C-liI3oY.d.ts → fx-BF_SG2i0.d.ts} +1 -1
  22. package/dist/index.d.ts +7 -6
  23. package/dist/index.js +8 -4
  24. package/dist/internal/caller.d.ts +10429 -0
  25. package/dist/internal/caller.js +9957 -0
  26. package/dist/internal/index.d.ts +2 -10816
  27. package/dist/internal/index.js +2 -10130
  28. package/dist/internal/server.d.ts +404 -0
  29. package/dist/internal/server.js +202 -0
  30. package/dist/job-store-Bn23V3QU.d.ts +576 -0
  31. package/dist/lightning-backend-C04nH94l.d.ts +367 -0
  32. package/dist/{memory-credit-ledger-XJ5VQEVP.js → memory-credit-ledger-OP24Z2KO.js} +3 -3
  33. package/dist/{postgres-job-store-J5F4GUWU.js → postgres-job-store-TAONYLIF.js} +1 -1
  34. package/dist/{revenue-reporter-JIKUPXOK.js → revenue-reporter-XXSU5KVB.js} +1 -1
  35. package/dist/server/index.d.ts +27 -11
  36. package/dist/server/index.js +93 -69
  37. package/dist/{job-store-C53VQ5uu.d.ts → step-cache-3cT4Shk0.d.ts} +31 -585
  38. package/dist/{tempo-session-store-DALMRIWN.js → tempo-session-store-2JNOKJGX.js} +2 -2
  39. package/dist/testing/index.d.ts +16 -4
  40. package/dist/testing/index.js +7 -3
  41. package/dist/{usd-gLcJB1ps.d.ts → usd-BnuXoFl5.d.ts} +1 -1
  42. package/dist/wallet-CJC8lwxx.d.ts +29 -0
  43. package/dist/{x402-FTG2GRAQ.js → x402-T2C5MX3T.js} +6 -3
  44. package/package.json +6 -2
  45. package/dist/{chunk-RU7SXHLO.js → chunk-UP2F5RRT.js} +3 -3
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  PostgresTempoSessionStore,
3
3
  assertMonotonicTransition
4
- } from "./chunk-RU7SXHLO.js";
4
+ } from "./chunk-UP2F5RRT.js";
5
5
  import "./chunk-YG7G4DPZ.js";
6
- import "./chunk-C3MTFLC6.js";
7
6
  import "./chunk-S3XAHZQY.js";
7
+ import "./chunk-C3MTFLC6.js";
8
8
  export {
9
9
  PostgresTempoSessionStore,
10
10
  assertMonotonicTransition
@@ -1,13 +1,14 @@
1
- import { cj as StreamableJobStore, ck as ReceiptIssuingStore, J as JobRecord, cl as RequestIdClaim, cm as RequestIdClaimResult, _ as JobReceipt, aw as OutgoingMessage, cn as AppendOutgoingOptions, co as PaymentCreditDelta, cp as VerifyAndCreditResult, cq as JobCounters, a2 as Message, a3 as MessageType, K as KVStore, L as Logger, v as ResponseContent, P as PaymentContent, S as SDKJobContext } from '../job-store-C53VQ5uu.js';
2
- import '@cashu/cashu-ts';
1
+ import { X as JobReceipt, a0 as Message, a1 as MessageType, K as KVStore, L as Logger, u as ResponseContent, P as PaymentContent, S as SDKJobContext } from '../step-cache-3cT4Shk0.js';
2
+ import { c as StreamableJobStore, R as ReceiptIssuingStore, J as JobRecord, d as RequestIdClaim, e as RequestIdClaimResult, f as JobRetentionCursor, O as OutgoingMessage, A as AppendOutgoingOptions, P as PaymentCreditDelta, V as VerifyAndCreditResult, g as JobCounters } from '../job-store-Bn23V3QU.js';
3
+ import 'hono';
3
4
  import 'mppx';
4
5
  import '@x402/core/server';
5
6
  import '@x402/evm/batch-settlement/server';
6
- import 'hono';
7
7
  import 'viem';
8
8
  import 'pg';
9
- import '@x402/core/types';
10
9
  import 'zod';
10
+ import '@x402/core/types';
11
+ import '@cashu/cashu-ts';
11
12
 
12
13
  /**
13
14
  * In-memory JobStore implementing the transactional + streaming surface
@@ -34,6 +35,17 @@ declare class MemoryJobStore implements StreamableJobStore, ReceiptIssuingStore
34
35
  releaseRequestIdClaim(claim: RequestIdClaim): Promise<void>;
35
36
  save(record: JobRecord): Promise<void>;
36
37
  delete(id: string): Promise<void>;
38
+ listJobsForRetention(args: {
39
+ lastActivityBeforeMs: number;
40
+ limit: number;
41
+ capabilities: string[] | null;
42
+ after?: JobRetentionCursor;
43
+ }): Promise<JobRecord[]>;
44
+ redactJob(args: {
45
+ jobId: string;
46
+ expectedLastActivityAt: number;
47
+ redactedAt: number;
48
+ }): Promise<boolean>;
37
49
  claimReceiptSeq(jobId: string): Promise<number>;
38
50
  saveReceipt(jobId: string, receipt: JobReceipt): Promise<JobReceipt | undefined>;
39
51
  appendOutgoing(jobId: string, message: OutgoingMessage, opts?: AppendOutgoingOptions): Promise<number>;
@@ -1,10 +1,14 @@
1
+ import {
2
+ MemoryKVStore
3
+ } from "../chunk-RW5LP57K.js";
1
4
  import {
2
5
  JobCancelledError,
3
6
  MemoryJobStore,
4
- MemoryKVStore,
5
- createInstrumentedFetch,
7
+ createInstrumentedFetch
8
+ } from "../chunk-4B56DEEV.js";
9
+ import {
6
10
  createNoopLogger
7
- } from "../chunk-TKA6ZP4M.js";
11
+ } from "../chunk-YDIYXGYL.js";
8
12
  import "../chunk-66HGCPBU.js";
9
13
  import "../chunk-FUJ36YDV.js";
10
14
 
@@ -1,4 +1,4 @@
1
- import { C as Currency } from './job-store-C53VQ5uu.js';
1
+ import { C as Currency } from './step-cache-3cT4Shk0.js';
2
2
 
3
3
  /**
4
4
  * Thrown by `fiatToSatsCeil` / `satsToFiat` when the supplied `ratePerBtc` is
@@ -0,0 +1,29 @@
1
+ import { Wallet } from '@cashu/cashu-ts';
2
+
3
+ /**
4
+ * Get or create a cashu-ts Wallet for a mint, calling loadMint() once per
5
+ * session.
6
+ *
7
+ * When the agent has a mnemonic on disk at `~/.dvm/wallet.mnemonic` AND
8
+ * the wallet's `mnemonic_fingerprint` matches it (internal-review), NUT-13
9
+ * deterministic secrets are eligible: the constructor receives `bip39seed`
10
+ * derived via `mnemonicToSeedSync` and a {@link PersistentCounterSource}
11
+ * backed by `wallet.nut13_counters`.
12
+ *
13
+ * NUT-13 is resolved per mint. Deterministic derivation is unsafe over an
14
+ * selected V1 output keyset (`id` prefix `00`) — the 2026-01 keyset-ID-collision
15
+ * disclosure — so a wallet bound to V1 is degraded to random-secret mode for
16
+ * that mint alone, rather than refused. Retired V1 keysets remain published so
17
+ * their proofs can be verified and spent, but cannot produce new outputs; a
18
+ * V2-bound wallet (`id` prefix `01`) keeps NUT-13. The
19
+ * {@link assertNoKeysetCollision} guard only protects the derivation path, so
20
+ * it runs only for mints where NUT-13 stays active.
21
+ *
22
+ * When the agent wallet or its sibling mnemonic file is absent (e.g. on a
23
+ * DVM server, or a CLI process that only touches the builder-side
24
+ * cashu-proofs flow), NUT-13 stays inactive everywhere — `new Wallet(mintUrl)`
25
+ * with no options, random secrets.
26
+ */
27
+ declare function getWallet(mintUrl: string): Promise<Wallet>;
28
+
29
+ export { getWallet as g };
@@ -9,11 +9,14 @@ import {
9
9
  resolveX402Asset,
10
10
  saveX402Wallet,
11
11
  tryX402Payment,
12
- verifyX402Payment,
13
12
  x402WrongAssetHint
14
- } from "./chunk-FJDCFHW5.js";
13
+ } from "./chunk-C6JHBLMW.js";
15
14
  import "./chunk-KSQEFVFJ.js";
16
15
  import "./chunk-TSWKITGR.js";
16
+ import {
17
+ verifyX402Payment
18
+ } from "./chunk-BIFLRKMO.js";
19
+ import "./chunk-BQ2NMWKE.js";
17
20
  import {
18
21
  X402_DEFAULT_FACILITATOR,
19
22
  X402_DEFAULT_NETWORK,
@@ -38,7 +41,7 @@ import {
38
41
  x402NetworkListForCopy,
39
42
  x402NetworkToCaip2,
40
43
  x402SupportedNetworksHint
41
- } from "./chunk-JGGI65I3.js";
44
+ } from "./chunk-Z4BNLUZF.js";
42
45
  import "./chunk-5URG56JJ.js";
43
46
  import "./chunk-MKI6OVW4.js";
44
47
  import "./chunk-66HGCPBU.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvmkit/sdk",
3
- "version": "0.1.2-rc.7",
3
+ "version": "0.1.3-rc.7",
4
4
  "description": "SDK for building accountless, pay-per-use Digital Vending Machines",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -14,6 +14,7 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
+ "sideEffects": false,
17
18
  "type": "module",
18
19
  "exports": {
19
20
  ".": {
@@ -41,13 +42,15 @@
41
42
  "node": ">=22"
42
43
  },
43
44
  "scripts": {
44
- "build": "NODE_OPTIONS=--max-old-space-size=6144 tsup --config tsup.config.ts && node scripts/prune-sdk-dist.mjs",
45
+ "build": "NODE_OPTIONS=--max-old-space-size=6144 tsup --config tsup.config.ts && node scripts/write-internal-entry.mjs && node scripts/prune-sdk-dist.mjs",
45
46
  "check:api": "node scripts/check-api-surface.mjs",
46
47
  "check:consumer": "node scripts/consumer-smoke.mjs",
48
+ "install-published-release": "node scripts/install-published-release.mjs",
47
49
  "check:package": "node scripts/package-smoke.mjs",
48
50
  "check:public-safety": "node scripts/public-safety.mjs",
49
51
  "check:release": "node scripts/check-release.mjs",
50
52
  "check:toolchain": "node scripts/check-toolchain.mjs",
53
+ "check:tree-shaking": "node scripts/check-internal-tree-shaking.mjs",
51
54
  "clean-install-smoke": "node scripts/clean-install-smoke.mjs",
52
55
  "lint": "eslint . --max-warnings 0",
53
56
  "release:tag": "node scripts/release-tag.mjs",
@@ -86,6 +89,7 @@
86
89
  "@types/pg": "8.18.0",
87
90
  "@types/proper-lockfile": "4.1.4",
88
91
  "@types/ws": "8.18.1",
92
+ "esbuild": "0.27.7",
89
93
  "eslint": "10.9.1",
90
94
  "globals": "17.11.0",
91
95
  "tsup": "8.5.1",
@@ -2,12 +2,12 @@ import {
2
2
  parseStoreValue,
3
3
  stringifyStoreValue
4
4
  } from "./chunk-YG7G4DPZ.js";
5
- import {
6
- withPostgresTransactionRecovery
7
- } from "./chunk-C3MTFLC6.js";
8
5
  import {
9
6
  withSdkInitLock
10
7
  } from "./chunk-S3XAHZQY.js";
8
+ import {
9
+ withPostgresTransactionRecovery
10
+ } from "./chunk-C3MTFLC6.js";
11
11
 
12
12
  // src/sdk/server/tempo-session-store.ts
13
13
  import { AsyncLocalStorage } from "async_hooks";