@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.
- package/dist/{chunk-ESQ6DCS3.js → chunk-3NXAIRFF.js} +2 -2
- package/dist/{chunk-REIUNZQX.js → chunk-B5KW2TPR.js} +2 -2
- package/dist/{chunk-DGA5EFKU.js → chunk-DF2OWCRY.js} +6 -6
- package/dist/{chunk-RYFCHR6Z.js → chunk-DJDONOMG.js} +2 -2
- package/dist/{chunk-VSOIBYBF.js → chunk-J3HYNDMI.js} +270 -34
- package/dist/{chunk-OEWENVJ7.js → chunk-MM646MFM.js} +4 -4
- package/dist/{chunk-VLD7OKSH.js → chunk-NKD4NEUF.js} +3 -3
- package/dist/{chunk-ZGBCVQF2.js → chunk-OCVRCWBL.js} +3 -3
- package/dist/{chunk-IK7RI645.js → chunk-W4ADV3HW.js} +449 -5
- package/dist/{chunk-UFMAHF6T.js → chunk-WCX4PNEF.js} +127 -40
- package/dist/{chunk-THTPKBZX.js → chunk-X6BETQ7V.js} +1252 -737
- package/dist/{chunk-A2B7QDMS.js → chunk-ZZCYSYXR.js} +2 -2
- package/dist/{client-PVRLAMI3.js → client-S3FEXAWD.js} +6 -6
- package/dist/dvm.js +49 -33
- package/dist/{internal-L362ZUWL.js → internal-WAQ3LZN4.js} +10 -8
- package/dist/{lifecycle-BH4OA5I3.js → lifecycle-NOK3MKL4.js} +6 -6
- package/dist/{payout-reporter-F5LFV5W4-EJ7E5ALO.js → payout-reporter-5PH53T44-7IA4NGIN.js} +2 -2
- package/dist/{pocket-refill-6UL6CHD5.js → pocket-refill-KUBHM7MR.js} +10 -10
- package/dist/{revenue-reporter-2U55YH2I-EUB6PBRN.js → revenue-reporter-4XV3OO5O-RYHS3M34.js} +2 -2
- package/dist/{tempo-lifecycle-WGTX6MJR.js → tempo-lifecycle-QGJ4JEHN.js} +8 -8
- package/dist/{tempo-wallet-OTB2YSWE.js → tempo-wallet-GDDZZP5S.js} +7 -7
- package/dist/{wallet-73EJBUSO.js → wallet-2M3H75UP.js} +7 -7
- package/dist/{x402-G6C4N2BN-TAJEBQGU.js → x402-FHHB3V4V-CM6OMLHE.js} +2 -2
- package/package.json +2 -2
- package/skills/dvm/credit.md +4 -0
- package/skills/dvm/wallets.md +2 -0
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
} from "./chunk-R2DSAZBO.js";
|
|
7
7
|
import {
|
|
8
8
|
diagnosticConsole
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WCX4PNEF.js";
|
|
10
10
|
|
|
11
|
-
// node_modules/@dvmkit/sdk/dist/chunk-
|
|
11
|
+
// node_modules/@dvmkit/sdk/dist/chunk-DLTNGB46.js
|
|
12
12
|
import { randomUUID } from "crypto";
|
|
13
13
|
var ENDPOINTS = {
|
|
14
14
|
job_terminal: "/_internal/job-terminal",
|
|
@@ -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-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-DJDONOMG.js";
|
|
7
|
+
import "./chunk-X6BETQ7V.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-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-DF2OWCRY.js";
|
|
17
|
+
import "./chunk-ZZCYSYXR.js";
|
|
18
|
+
import "./chunk-W4ADV3HW.js";
|
|
19
19
|
import "./chunk-R2DSAZBO.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-WCX4PNEF.js";
|
|
21
21
|
import "./chunk-EVQERRCP.js";
|
|
22
22
|
import "./chunk-RA24J4QM.js";
|
|
23
23
|
import "./chunk-B4WHUMZM.js";
|
package/dist/dvm.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
assertTempoWalletIdle,
|
|
6
6
|
findSigningIdentityByPubkey,
|
|
7
7
|
resolveSigningIdentity
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OCVRCWBL.js";
|
|
9
9
|
import {
|
|
10
10
|
CARD_MIN_MICRO,
|
|
11
11
|
DEFAULT_CREDIT_POSTURE,
|
|
@@ -213,13 +213,13 @@ import {
|
|
|
213
213
|
withIdentityRecovery,
|
|
214
214
|
withJobTokenRedaction,
|
|
215
215
|
withRequestResultRecovery
|
|
216
|
-
} from "./chunk-
|
|
216
|
+
} from "./chunk-J3HYNDMI.js";
|
|
217
217
|
import {
|
|
218
218
|
connectedTempoAccount,
|
|
219
219
|
generateTempoKey,
|
|
220
220
|
tempoBalanceCheckHint,
|
|
221
221
|
tempoWrongAssetHint
|
|
222
|
-
} from "./chunk-
|
|
222
|
+
} from "./chunk-MM646MFM.js";
|
|
223
223
|
import {
|
|
224
224
|
assertSupportedX402Network,
|
|
225
225
|
connectedX402Payer,
|
|
@@ -228,7 +228,7 @@ import {
|
|
|
228
228
|
repinX402WalletNetwork,
|
|
229
229
|
saveX402Wallet,
|
|
230
230
|
x402NetworkLabel
|
|
231
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-NKD4NEUF.js";
|
|
232
232
|
import {
|
|
233
233
|
CREDIT_POSTURES,
|
|
234
234
|
FEEDBACK_POSTURES,
|
|
@@ -245,7 +245,7 @@ import {
|
|
|
245
245
|
retireConfigBackup,
|
|
246
246
|
rollbackConfig,
|
|
247
247
|
updateConfig
|
|
248
|
-
} from "./chunk-
|
|
248
|
+
} from "./chunk-3NXAIRFF.js";
|
|
249
249
|
import {
|
|
250
250
|
addOutputWarnings,
|
|
251
251
|
assertValidBudget,
|
|
@@ -267,10 +267,10 @@ import {
|
|
|
267
267
|
tryResolveBtcUsdRate,
|
|
268
268
|
tryX402Payment,
|
|
269
269
|
withOutputWarnings
|
|
270
|
-
} from "./chunk-
|
|
270
|
+
} from "./chunk-DJDONOMG.js";
|
|
271
271
|
import {
|
|
272
272
|
assertX402WalletIdle
|
|
273
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-B5KW2TPR.js";
|
|
274
274
|
import {
|
|
275
275
|
A,
|
|
276
276
|
AGENT_MNEMONIC_FILE,
|
|
@@ -510,7 +510,7 @@ import {
|
|
|
510
510
|
x402PendingUnsettled,
|
|
511
511
|
x402RequiredFromError,
|
|
512
512
|
x402ReservationRelease
|
|
513
|
-
} from "./chunk-
|
|
513
|
+
} from "./chunk-X6BETQ7V.js";
|
|
514
514
|
import "./chunk-JBU7RKQ3.js";
|
|
515
515
|
import "./chunk-KDNFUDOG.js";
|
|
516
516
|
import "./chunk-IUTVV6N5.js";
|
|
@@ -796,11 +796,11 @@ import {
|
|
|
796
796
|
usdToMsats,
|
|
797
797
|
usdcToMsats,
|
|
798
798
|
x402NetworkByCaip2
|
|
799
|
-
} from "./chunk-
|
|
800
|
-
import "./chunk-
|
|
801
|
-
import "./chunk-
|
|
799
|
+
} from "./chunk-DF2OWCRY.js";
|
|
800
|
+
import "./chunk-ZZCYSYXR.js";
|
|
801
|
+
import "./chunk-W4ADV3HW.js";
|
|
802
802
|
import "./chunk-R2DSAZBO.js";
|
|
803
|
-
import "./chunk-
|
|
803
|
+
import "./chunk-WCX4PNEF.js";
|
|
804
804
|
import {
|
|
805
805
|
privateKeyToAccount
|
|
806
806
|
} from "./chunk-EVQERRCP.js";
|
|
@@ -11881,8 +11881,8 @@ async function handleLockedPaymentRequest(jobId, request2, policy, transport, pr
|
|
|
11881
11881
|
}
|
|
11882
11882
|
}
|
|
11883
11883
|
if ((opts?.rail === void 0 || opts.rail === "x402") && request2.x402) {
|
|
11884
|
-
const { loadX402Wallet: loadX402Wallet2 } = await import("./wallet-
|
|
11885
|
-
const { tryX402Payment: tryX402Payment2 } = await import("./client-
|
|
11884
|
+
const { loadX402Wallet: loadX402Wallet2 } = await import("./wallet-2M3H75UP.js");
|
|
11885
|
+
const { tryX402Payment: tryX402Payment2 } = await import("./client-S3FEXAWD.js");
|
|
11886
11886
|
const wallet = loadX402Wallet2();
|
|
11887
11887
|
if (wallet) {
|
|
11888
11888
|
let proof;
|
|
@@ -14028,10 +14028,12 @@ function withCreditErrorContext(err, body) {
|
|
|
14028
14028
|
}
|
|
14029
14029
|
const menu = parseCreditMenu(body.credit);
|
|
14030
14030
|
if (menu) extra.credit = menu;
|
|
14031
|
+
if (Number.isSafeInteger(body.stripe_status)) extra.stripe_status = body.stripe_status;
|
|
14031
14032
|
const lightning = parseLightningOffer(body.lightning);
|
|
14032
14033
|
if (lightning) extra.lightning = lightning;
|
|
14033
14034
|
for (const key of [
|
|
14034
14035
|
"reason",
|
|
14036
|
+
"cause",
|
|
14035
14037
|
"stripe_error_code",
|
|
14036
14038
|
"decline_code",
|
|
14037
14039
|
"blocking_drain_id",
|
|
@@ -14709,7 +14711,7 @@ async function settleCreditAfterJob(args) {
|
|
|
14709
14711
|
}
|
|
14710
14712
|
}
|
|
14711
14713
|
if (args.allowTopup !== false) {
|
|
14712
|
-
const refill = args.refillPocket ?? (await import("./pocket-refill-
|
|
14714
|
+
const refill = args.refillPocket ?? (await import("./pocket-refill-KUBHM7MR.js")).refillPocketIfLow;
|
|
14713
14715
|
await refill({ human: args.human }).catch(() => void 0);
|
|
14714
14716
|
}
|
|
14715
14717
|
}
|
|
@@ -15490,14 +15492,14 @@ async function confirmRollback(stored, preview, opts) {
|
|
|
15490
15492
|
async function withStrandingChecked(removing, commit) {
|
|
15491
15493
|
const leaving = new Set(removing.map((target) => target.split(".")[0]));
|
|
15492
15494
|
if (leaving.has("tempo")) {
|
|
15493
|
-
const { assertTempoWalletIdle: assertTempoWalletIdle2 } = await import("./tempo-lifecycle-
|
|
15495
|
+
const { assertTempoWalletIdle: assertTempoWalletIdle2 } = await import("./tempo-lifecycle-QGJ4JEHN.js");
|
|
15494
15496
|
await assertTempoWalletIdle2("disconnect");
|
|
15495
15497
|
}
|
|
15496
15498
|
if (!leaving.has("x402")) return commit();
|
|
15497
|
-
const { withX402ChannelLock: withX402ChannelLock2, listPendingX402Fundings: listPendingX402Fundings2, x402PendingUnsettled: x402PendingUnsettled2 } = await import("./internal-
|
|
15498
|
-
const { assertX402WalletIdle: assertX402WalletIdle2 } = await import("./lifecycle-
|
|
15499
|
-
const { ensureAddress: ensureAddress2 } = await import("./internal-
|
|
15500
|
-
const { loadX402Wallet: loadX402Wallet2 } = await import("./wallet-
|
|
15499
|
+
const { withX402ChannelLock: withX402ChannelLock2, listPendingX402Fundings: listPendingX402Fundings2, x402PendingUnsettled: x402PendingUnsettled2 } = await import("./internal-WAQ3LZN4.js");
|
|
15500
|
+
const { assertX402WalletIdle: assertX402WalletIdle2 } = await import("./lifecycle-NOK3MKL4.js");
|
|
15501
|
+
const { ensureAddress: ensureAddress2 } = await import("./internal-WAQ3LZN4.js");
|
|
15502
|
+
const { loadX402Wallet: loadX402Wallet2 } = await import("./wallet-2M3H75UP.js");
|
|
15501
15503
|
return withX402ChannelLock2(async () => {
|
|
15502
15504
|
const unsettled = listPendingX402Fundings2().filter((entry) => x402PendingUnsettled2(entry));
|
|
15503
15505
|
if (unsettled.length > 0) {
|
|
@@ -20211,6 +20213,7 @@ function capitalise(s) {
|
|
|
20211
20213
|
|
|
20212
20214
|
// src/lib/credit/funding.ts
|
|
20213
20215
|
async function runCreditFund(dvm, opts) {
|
|
20216
|
+
const invocationStartedAt = Date.now();
|
|
20214
20217
|
const endpoint = resolveCreditEndpoint(dvm);
|
|
20215
20218
|
const config2 = loadConfig();
|
|
20216
20219
|
const signer = resolveSigningIdentity({ as: opts.as, config: config2 });
|
|
@@ -20309,7 +20312,7 @@ async function runCreditFund(dvm, opts) {
|
|
|
20309
20312
|
}
|
|
20310
20313
|
const transport = createDvmTransport();
|
|
20311
20314
|
try {
|
|
20312
|
-
const menu = stored?.menu ?? (pending4 ?? signedPending ? void 0 : await discoverCreditMenu(transport, endpoint, signer));
|
|
20315
|
+
const menu = (stored?.menu && rail === "stripe" && cardSpt === void 0 && !pending4 && !signedPending ? await discoverCreditMenu(transport, endpoint, signer) : void 0) ?? stored?.menu ?? (pending4 ?? signedPending ? void 0 : await discoverCreditMenu(transport, endpoint, signer));
|
|
20313
20316
|
let sizing;
|
|
20314
20317
|
if (targetJobs !== void 0 && !pending4 && !signedPending) {
|
|
20315
20318
|
sizing = await sizeForTargetJobs({ endpoint, targetJobs, stored, menu, providerInfo });
|
|
@@ -20333,7 +20336,7 @@ async function runCreditFund(dvm, opts) {
|
|
|
20333
20336
|
transport,
|
|
20334
20337
|
ref: { endpoint },
|
|
20335
20338
|
signing: signer,
|
|
20336
|
-
creditId: pending4?.creditId ?? opts.creditId ?? (canRefillStoredCredit(stored) ? stored.creditId :
|
|
20339
|
+
creditId: pending4?.creditId ?? opts.creditId ?? signedPending?.creditId ?? (canRefillStoredCredit(stored) ? stored.creditId : randomUUID3()),
|
|
20337
20340
|
amountMicro: fundMicro,
|
|
20338
20341
|
human: opts.human,
|
|
20339
20342
|
providerInfo,
|
|
@@ -20346,7 +20349,15 @@ async function runCreditFund(dvm, opts) {
|
|
|
20346
20349
|
...maxCashuPrincipalSats !== void 0 ? { maxCashuPrincipalSats } : {},
|
|
20347
20350
|
...maxCashuFeeSats !== void 0 ? { maxCashuFeeSats } : {},
|
|
20348
20351
|
...cardSpt !== void 0 ? { cardSpt } : {},
|
|
20349
|
-
cardApprovalSteps: true
|
|
20352
|
+
cardApprovalSteps: true,
|
|
20353
|
+
cardWait: opts.wait !== false,
|
|
20354
|
+
cardCreditIdExplicit: opts.creditId !== void 0,
|
|
20355
|
+
cardInvocationStartedAt: invocationStartedAt,
|
|
20356
|
+
...signer.source.kind !== "env" ? { cardIdentity: signer.source.name } : {},
|
|
20357
|
+
cardCheckoutProgress: (handoff) => {
|
|
20358
|
+
if (opts.human) info(String(handoff.display));
|
|
20359
|
+
else json({ op: "fund", endpoint, ...handoff });
|
|
20360
|
+
}
|
|
20350
20361
|
});
|
|
20351
20362
|
if (outcome.status === "refused" || outcome.status === "unavailable") {
|
|
20352
20363
|
const err = outcome.error;
|
|
@@ -20407,6 +20418,7 @@ async function runCreditFund(dvm, opts) {
|
|
|
20407
20418
|
op: "fund",
|
|
20408
20419
|
endpoint,
|
|
20409
20420
|
status: outcome.status,
|
|
20421
|
+
...outcome.checkoutHandoff ?? {},
|
|
20410
20422
|
credit_id: outcome.creditId,
|
|
20411
20423
|
fund_id: outcome.fundId,
|
|
20412
20424
|
...resumedNote ? { resumed: resumedNote } : {},
|
|
@@ -20452,7 +20464,10 @@ async function runCreditFund(dvm, opts) {
|
|
|
20452
20464
|
}
|
|
20453
20465
|
}
|
|
20454
20466
|
function pendingSignedResume(args) {
|
|
20455
|
-
if (args.
|
|
20467
|
+
if (args.journalled) return void 0;
|
|
20468
|
+
const card = listPendingCardFundings({ endpoint: args.endpoint, callerPubkey: args.signer.pubkey }).find((entry) => !args.opts.creditId || entry.creditId === args.opts.creditId);
|
|
20469
|
+
if (card?.v === 2) return card;
|
|
20470
|
+
if (args.opts.creditId || canRefillStoredCredit(args.stored)) return void 0;
|
|
20456
20471
|
const scope = { endpoint: args.endpoint, callerPubkey: args.signer.pubkey };
|
|
20457
20472
|
return [
|
|
20458
20473
|
...listResumableX402Fundings(scope),
|
|
@@ -20712,14 +20727,15 @@ async function enforceTrustTier(args) {
|
|
|
20712
20727
|
...walletInvoiceFundingAdvice(args.amountMicro),
|
|
20713
20728
|
minimumUsd: `$${formatUsd(lightningMinimum / 1e6)}`
|
|
20714
20729
|
} : void 0;
|
|
20715
|
-
const
|
|
20730
|
+
const cardGuidance = args.menu?.stripe?.checkout ? `Pay by card: dvm credit fund ${shellQuoteArg(args.endpoint)} --rail stripe --amount ${shellQuoteArg(`$${formatUsd(args.amountMicro / 1e6)}`)}. ` : "";
|
|
20731
|
+
const walletGuidance = walletFunding ? `${cardGuidance}Lightning top-ups here start at ${walletFunding.minimumUsd}, above the ${capUsd} this caller can load at the current trust tier. ${walletFunding.text} ` : "";
|
|
20716
20732
|
throw withHeadroom(
|
|
20717
20733
|
new DvmError(
|
|
20718
20734
|
"amount_exceeds_trust_tier",
|
|
20719
20735
|
`Funding ${amountUsd} at ${args.endpoint} would exceed this DVM's ${capUsd} trust-tier cap.`,
|
|
20720
|
-
walletFunding ? `No money moved. ${walletGuidance}Re-run with --over-trust to fund credit over Lightning anyway, or pre-grant every DVM signed by this builder with 'dvm credit trust ${args.endpoint} <builder-max|$amount>'.` : `Nothing moved. Re-run with --over-trust to fund it anyway, or pre-grant every DVM signed by this builder with 'dvm credit trust ${args.endpoint} <builder-max|$amount>'. Or fund ${capUsd} or less.`,
|
|
20736
|
+
walletFunding ? `No money moved. ${walletGuidance}Re-run with --over-trust to fund credit over Lightning anyway, or pre-grant every DVM signed by this builder with 'dvm credit trust ${args.endpoint} <builder-max|$amount>'.` : `Nothing moved. ${cardGuidance}Re-run with --over-trust to fund it anyway, or pre-grant every DVM signed by this builder with 'dvm credit trust ${args.endpoint} <builder-max|$amount>'. Or fund ${capUsd} or less.`,
|
|
20721
20737
|
{
|
|
20722
|
-
display: `This agent has only earned ${capUsd} of credit at ${args.endpoint} so far, and ${amountUsd} was asked for.${heldClause} No money moved. ` + walletGuidance + `Loading more than the earned amount is allowed, but it has to be asked for explicitly \u2014 re-run with --over-trust, or pre-grant every DVM signed by this builder with 'dvm credit trust ${args.endpoint} <builder-max|$amount>'.`,
|
|
20738
|
+
display: `This agent has only earned ${capUsd} of credit at ${args.endpoint} so far, and ${amountUsd} was asked for.${heldClause} No money moved. ` + (walletGuidance || cardGuidance) + `Loading more than the earned amount is allowed, but it has to be asked for explicitly \u2014 re-run with --over-trust, or pre-grant every DVM signed by this builder with 'dvm credit trust ${args.endpoint} <builder-max|$amount>'.`,
|
|
20723
20739
|
endpoint: args.endpoint,
|
|
20724
20740
|
amount_micro: args.amountMicro,
|
|
20725
20741
|
exposure_micro: exposureMicro,
|
|
@@ -22204,8 +22220,8 @@ async function probeX402(x402, timeoutMs) {
|
|
|
22204
22220
|
let network;
|
|
22205
22221
|
let address;
|
|
22206
22222
|
try {
|
|
22207
|
-
const { loadX402Wallet: loadX402Wallet2 } = await import("./wallet-
|
|
22208
|
-
const { getX402Balance, ensureAddress: ensureAddress2, usdcContractByCaip2 } = await import("./internal-
|
|
22223
|
+
const { loadX402Wallet: loadX402Wallet2 } = await import("./wallet-2M3H75UP.js");
|
|
22224
|
+
const { getX402Balance, ensureAddress: ensureAddress2, usdcContractByCaip2 } = await import("./internal-WAQ3LZN4.js");
|
|
22209
22225
|
const wallet = loadX402Wallet2();
|
|
22210
22226
|
if (!wallet) {
|
|
22211
22227
|
const storedKey = x402.privateKey;
|
|
@@ -22257,8 +22273,8 @@ async function probeMpp(mpp, timeoutMs) {
|
|
|
22257
22273
|
if (!mpp) return null;
|
|
22258
22274
|
if (mpp.method === "tempo") {
|
|
22259
22275
|
try {
|
|
22260
|
-
const { connectedTempoAccount: connectedTempoAccount2 } = await import("./tempo-wallet-
|
|
22261
|
-
const { getTempoUsdcBalance: getTempoUsdcBalance3, resolveTempoNetwork: resolveTempoNetwork2 } = await import("./internal-
|
|
22276
|
+
const { connectedTempoAccount: connectedTempoAccount2 } = await import("./tempo-wallet-GDDZZP5S.js");
|
|
22277
|
+
const { getTempoUsdcBalance: getTempoUsdcBalance3, resolveTempoNetwork: resolveTempoNetwork2 } = await import("./internal-WAQ3LZN4.js");
|
|
22262
22278
|
const account = await connectedTempoAccount2();
|
|
22263
22279
|
if (!account) {
|
|
22264
22280
|
return {
|
|
@@ -40396,8 +40412,8 @@ function buildProgram() {
|
|
|
40396
40412
|
`Choose reusable channel collateral or, only when the DVM explicitly allows its manual refund obligation, a one-shot stablecoin payment: ${creditFundingModes}. Stablecoin rails only`
|
|
40397
40413
|
).option(
|
|
40398
40414
|
"--spt <token>",
|
|
40399
|
-
"Pay by card: the shared payment token (spt_\u2026) your human approved in Stripe Link, or '-' to read it from stdin. Implies --rail stripe; without it, --rail stripe
|
|
40400
|
-
).option("--credit-id <id>", "Fund a specific credit id instead of the tracked one").option("--as <name>", "Caller signing identity to sign the funding as").option("--human", "Human-readable output instead of JSON").action((dvm, opts) => {
|
|
40415
|
+
"Pay by card: the shared payment token (spt_\u2026) your human approved in Stripe Link, or '-' to read it from stdin. Implies --rail stripe; without it, --rail stripe offers a card checkout link when supported, otherwise the link-cli approval steps"
|
|
40416
|
+
).option("--no-wait", "Print the card checkout link and exit; re-run to resume and confirm payment").option("--credit-id <id>", "Fund a specific credit id instead of the tracked one").option("--as <name>", "Caller signing identity to sign the funding as").option("--human", "Human-readable output instead of JSON").action((dvm, opts) => {
|
|
40401
40417
|
return catchErrors(() => creditFund(dvm, opts), opts.human);
|
|
40402
40418
|
});
|
|
40403
40419
|
credit.command("drain <dvm>").description(
|
|
@@ -95,7 +95,6 @@ import {
|
|
|
95
95
|
applyImplicitReceiptCredit,
|
|
96
96
|
applyPaymentInfoToJob,
|
|
97
97
|
applyReceiptCredit,
|
|
98
|
-
applyRetryToPool,
|
|
99
98
|
asProviderText,
|
|
100
99
|
asProviderTextOpt,
|
|
101
100
|
assertAgentMnemonicReplaceable,
|
|
@@ -436,7 +435,6 @@ import {
|
|
|
436
435
|
windowEnd,
|
|
437
436
|
windowStart,
|
|
438
437
|
withIdentitiesLock,
|
|
439
|
-
withInitRetry,
|
|
440
438
|
withNwcPool,
|
|
441
439
|
withTempoChannelLock,
|
|
442
440
|
withTraceContext,
|
|
@@ -469,7 +467,7 @@ import {
|
|
|
469
467
|
x402SettledShare,
|
|
470
468
|
x402VoucherPendingState,
|
|
471
469
|
x402WalletFromConfig
|
|
472
|
-
} from "./chunk-
|
|
470
|
+
} from "./chunk-X6BETQ7V.js";
|
|
473
471
|
import "./chunk-JBU7RKQ3.js";
|
|
474
472
|
import "./chunk-KDNFUDOG.js";
|
|
475
473
|
import "./chunk-IUTVV6N5.js";
|
|
@@ -531,15 +529,18 @@ import {
|
|
|
531
529
|
x402NetworkListForCopy,
|
|
532
530
|
x402NetworkToCaip2,
|
|
533
531
|
x402SupportedNetworksHint
|
|
534
|
-
} from "./chunk-
|
|
532
|
+
} from "./chunk-DF2OWCRY.js";
|
|
535
533
|
import {
|
|
536
534
|
RevenueReporter
|
|
537
|
-
} from "./chunk-
|
|
535
|
+
} from "./chunk-ZZCYSYXR.js";
|
|
538
536
|
import {
|
|
539
|
-
PayoutReporter
|
|
540
|
-
|
|
537
|
+
PayoutReporter,
|
|
538
|
+
applyRetryToPool,
|
|
539
|
+
withInitRetry
|
|
540
|
+
} from "./chunk-W4ADV3HW.js";
|
|
541
541
|
import "./chunk-R2DSAZBO.js";
|
|
542
542
|
import {
|
|
543
|
+
DIAGNOSTIC_CATALOGUE,
|
|
543
544
|
DIAGNOSTIC_CATALOGUE_VERSION,
|
|
544
545
|
bindDiagnosticCapabilityAuthority,
|
|
545
546
|
bindDiagnosticIdentityAuthority,
|
|
@@ -548,7 +549,7 @@ import {
|
|
|
548
549
|
projectDiagnosticFields,
|
|
549
550
|
projectEventName,
|
|
550
551
|
projectSpanRow
|
|
551
|
-
} from "./chunk-
|
|
552
|
+
} from "./chunk-WCX4PNEF.js";
|
|
552
553
|
import "./chunk-EVQERRCP.js";
|
|
553
554
|
import "./chunk-RA24J4QM.js";
|
|
554
555
|
import "./chunk-B4WHUMZM.js";
|
|
@@ -580,6 +581,7 @@ export {
|
|
|
580
581
|
CREDIT_FUND_RAILS,
|
|
581
582
|
DEFAULT_AGENT_MINT_URL,
|
|
582
583
|
DEFAULT_LOCK_PUBKEY_GRACE_SECONDS,
|
|
584
|
+
DIAGNOSTIC_CATALOGUE,
|
|
583
585
|
DIAGNOSTIC_CATALOGUE_VERSION,
|
|
584
586
|
DbTransport,
|
|
585
587
|
DvmError,
|
|
@@ -3,8 +3,8 @@ import { createRequire as __dvmCreateRequire } from "node:module";
|
|
|
3
3
|
const require = __dvmCreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
assertX402WalletIdle
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-B5KW2TPR.js";
|
|
7
|
+
import "./chunk-X6BETQ7V.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-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-DF2OWCRY.js";
|
|
17
|
+
import "./chunk-ZZCYSYXR.js";
|
|
18
|
+
import "./chunk-W4ADV3HW.js";
|
|
19
19
|
import "./chunk-R2DSAZBO.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-WCX4PNEF.js";
|
|
21
21
|
import "./chunk-EVQERRCP.js";
|
|
22
22
|
import "./chunk-RA24J4QM.js";
|
|
23
23
|
import "./chunk-B4WHUMZM.js";
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
PayoutReporter,
|
|
8
8
|
PostgresX402BatchStore,
|
|
9
9
|
x402EarnedCeiling
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-W4ADV3HW.js";
|
|
11
11
|
import "./chunk-R2DSAZBO.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-WCX4PNEF.js";
|
|
13
13
|
import "./chunk-IYHTITNZ.js";
|
|
14
14
|
export {
|
|
15
15
|
MemoryX402BatchStore,
|
|
@@ -13,22 +13,22 @@ import {
|
|
|
13
13
|
recordFloatSpend,
|
|
14
14
|
resolveFundMint,
|
|
15
15
|
sweepPendingMints
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-J3HYNDMI.js";
|
|
17
|
+
import "./chunk-MM646MFM.js";
|
|
18
|
+
import "./chunk-NKD4NEUF.js";
|
|
19
19
|
import {
|
|
20
20
|
loadConfig
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-3NXAIRFF.js";
|
|
22
22
|
import {
|
|
23
23
|
info,
|
|
24
24
|
tryResolveBtcUsdRate
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-DJDONOMG.js";
|
|
26
26
|
import {
|
|
27
27
|
effectiveFundingMint,
|
|
28
28
|
effectiveMints,
|
|
29
29
|
formatUsd,
|
|
30
30
|
loadAgentWallet
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-X6BETQ7V.js";
|
|
32
32
|
import "./chunk-JBU7RKQ3.js";
|
|
33
33
|
import "./chunk-KDNFUDOG.js";
|
|
34
34
|
import "./chunk-IUTVV6N5.js";
|
|
@@ -40,11 +40,11 @@ import "./chunk-PUOXBKY2.js";
|
|
|
40
40
|
import {
|
|
41
41
|
microToSats,
|
|
42
42
|
msatsToMicro
|
|
43
|
-
} from "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
43
|
+
} from "./chunk-DF2OWCRY.js";
|
|
44
|
+
import "./chunk-ZZCYSYXR.js";
|
|
45
|
+
import "./chunk-W4ADV3HW.js";
|
|
46
46
|
import "./chunk-R2DSAZBO.js";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-WCX4PNEF.js";
|
|
48
48
|
import "./chunk-EVQERRCP.js";
|
|
49
49
|
import "./chunk-RA24J4QM.js";
|
|
50
50
|
import "./chunk-B4WHUMZM.js";
|
package/dist/{revenue-reporter-2U55YH2I-EUB6PBRN.js → revenue-reporter-4XV3OO5O-RYHS3M34.js}
RENAMED
|
@@ -3,9 +3,9 @@ import { createRequire as __dvmCreateRequire } from "node:module";
|
|
|
3
3
|
const require = __dvmCreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
RevenueReporter
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZZCYSYXR.js";
|
|
7
7
|
import "./chunk-R2DSAZBO.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-WCX4PNEF.js";
|
|
9
9
|
import "./chunk-IYHTITNZ.js";
|
|
10
10
|
export {
|
|
11
11
|
RevenueReporter
|
|
@@ -3,10 +3,10 @@ import { createRequire as __dvmCreateRequire } from "node:module";
|
|
|
3
3
|
const require = __dvmCreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
assertTempoWalletIdle
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-OCVRCWBL.js";
|
|
7
|
+
import "./chunk-MM646MFM.js";
|
|
8
|
+
import "./chunk-3NXAIRFF.js";
|
|
9
|
+
import "./chunk-X6BETQ7V.js";
|
|
10
10
|
import "./chunk-JBU7RKQ3.js";
|
|
11
11
|
import "./chunk-KDNFUDOG.js";
|
|
12
12
|
import "./chunk-IUTVV6N5.js";
|
|
@@ -15,11 +15,11 @@ import "./chunk-6LP4EGKA.js";
|
|
|
15
15
|
import "./chunk-N3UJT2NJ.js";
|
|
16
16
|
import "./chunk-SYFKO6BA.js";
|
|
17
17
|
import "./chunk-PUOXBKY2.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-DF2OWCRY.js";
|
|
19
|
+
import "./chunk-ZZCYSYXR.js";
|
|
20
|
+
import "./chunk-W4ADV3HW.js";
|
|
21
21
|
import "./chunk-R2DSAZBO.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-WCX4PNEF.js";
|
|
23
23
|
import "./chunk-EVQERRCP.js";
|
|
24
24
|
import "./chunk-RA24J4QM.js";
|
|
25
25
|
import "./chunk-B4WHUMZM.js";
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
generateTempoKey,
|
|
7
7
|
tempoBalanceCheckHint,
|
|
8
8
|
tempoWrongAssetHint
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-MM646MFM.js";
|
|
10
|
+
import "./chunk-3NXAIRFF.js";
|
|
11
|
+
import "./chunk-X6BETQ7V.js";
|
|
12
12
|
import "./chunk-JBU7RKQ3.js";
|
|
13
13
|
import "./chunk-KDNFUDOG.js";
|
|
14
14
|
import "./chunk-IUTVV6N5.js";
|
|
@@ -17,11 +17,11 @@ import "./chunk-6LP4EGKA.js";
|
|
|
17
17
|
import "./chunk-N3UJT2NJ.js";
|
|
18
18
|
import "./chunk-SYFKO6BA.js";
|
|
19
19
|
import "./chunk-PUOXBKY2.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-DF2OWCRY.js";
|
|
21
|
+
import "./chunk-ZZCYSYXR.js";
|
|
22
|
+
import "./chunk-W4ADV3HW.js";
|
|
23
23
|
import "./chunk-R2DSAZBO.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-WCX4PNEF.js";
|
|
25
25
|
import "./chunk-EVQERRCP.js";
|
|
26
26
|
import "./chunk-RA24J4QM.js";
|
|
27
27
|
import "./chunk-B4WHUMZM.js";
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
removeX402Wallet,
|
|
8
8
|
repinX402WalletNetwork,
|
|
9
9
|
saveX402Wallet
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-NKD4NEUF.js";
|
|
11
|
+
import "./chunk-3NXAIRFF.js";
|
|
12
|
+
import "./chunk-X6BETQ7V.js";
|
|
13
13
|
import "./chunk-JBU7RKQ3.js";
|
|
14
14
|
import "./chunk-KDNFUDOG.js";
|
|
15
15
|
import "./chunk-IUTVV6N5.js";
|
|
@@ -18,11 +18,11 @@ import "./chunk-6LP4EGKA.js";
|
|
|
18
18
|
import "./chunk-N3UJT2NJ.js";
|
|
19
19
|
import "./chunk-SYFKO6BA.js";
|
|
20
20
|
import "./chunk-PUOXBKY2.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-DF2OWCRY.js";
|
|
22
|
+
import "./chunk-ZZCYSYXR.js";
|
|
23
|
+
import "./chunk-W4ADV3HW.js";
|
|
24
24
|
import "./chunk-R2DSAZBO.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-WCX4PNEF.js";
|
|
26
26
|
import "./chunk-EVQERRCP.js";
|
|
27
27
|
import "./chunk-RA24J4QM.js";
|
|
28
28
|
import "./chunk-B4WHUMZM.js";
|
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
x402NetworkListForCopy,
|
|
31
31
|
x402NetworkToCaip2,
|
|
32
32
|
x402SupportedNetworksHint
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-DF2OWCRY.js";
|
|
34
|
+
import "./chunk-WCX4PNEF.js";
|
|
35
35
|
import "./chunk-IYHTITNZ.js";
|
|
36
36
|
export {
|
|
37
37
|
X402_DEFAULT_FACILITATOR,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dvmkit/dvm-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Command-line client and agent skill for Digital Vending Machines: pay-per-use HTTPS services AI agents can find, pay, and call with no account or API key",
|
|
5
5
|
"author": "DVM Technologies Ltd",
|
|
6
6
|
"keywords": [
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@cashu/cashu-ts": "4.10.2",
|
|
72
|
-
"@dvmkit/sdk": "0.
|
|
72
|
+
"@dvmkit/sdk": "0.36.0",
|
|
73
73
|
"@scure/base": "2.0.0",
|
|
74
74
|
"@x402/evm": "2.21.0",
|
|
75
75
|
"commander": "14.0.3",
|
package/skills/dvm/credit.md
CHANGED
|
@@ -22,6 +22,10 @@ When `credit_funding_skipped` reports unavailable BTC/USD pricing, relay its `di
|
|
|
22
22
|
|
|
23
23
|
Link connects agents only in some regions (the US and Canada as of November 2026). If Link says your region isn't supported, fund over another rail with `--rail`.
|
|
24
24
|
|
|
25
|
+
When a human asks to pay by card, run `dvm credit fund <dvm> --rail stripe --amount '$X' --no-wait`. When the DVM offers hosted checkout, this returns the checkout link, amount, expiry, and a `next_step` that resumes the same top-up. Open the link in your own browser and pay with the saved card or wallet the human approves. Stripe asks for an email address: ask the human which address to give. The DVM owner's Stripe account receives that email, plus the cardholder name and country. If you have no browser, hand the link to the human. Then run `next_step` and `dvm credit balance <dvm>` to confirm the booked credit; a link or a completed browser page is never proof of payment. Without `--no-wait`, the command prints the link and polls until booking or expiry. Re-running resumes the pending session, including a paid session after the link expires. A requested amount below the DVM's card minimum is raised with a clear message; check the amount before paying. Unspent credit refunds to the card less its share of Stripe's processing fee.
|
|
26
|
+
|
|
27
|
+
For providers without hosted checkout, the existing Stripe Link approval flow applies:
|
|
28
|
+
|
|
25
29
|
Some providers take card payments for prepaid credit (`stripe` in their funding rails). A card top-up always needs the human's approval in Stripe Link, so the CLI never makes one by itself: an automatic refill of a card-funded credit stops with `credit_refill_card_approval_required` and the `fund_command` to run. Run `dvm credit fund <dvm> --rail stripe --amount '$X'` first: it charges nothing and returns `card_approval_required` with the exact `link_cli.create` and `link_cli.retrieve` commands, the amount in cents, and the provider's `network_id`. Tell the human it is a card charge that can be refunded later, less a share of Stripe's processing fee, then run the create command and wait for their approval (up to 30 minutes). Take `shared_payment_token.id` (an `spt_…` value) from the retrieve command's JSON and pipe it into `next_command` (`--spt -`); the card is charged when that command runs, not when the human approves. Never pay it with `link-cli mpp pay`, and never print, log or store the token: it is a bearer approval for a card charge. Card top-ups are whole cents, from $0.50 up to $500 (Link's limit per approval). The trust-tier cap on a first funding at a DVM does not apply to card, because the human approves the exact amount in Link first, so `--over-trust` is never needed for `--rail stripe`; every other rail keeps the cap.
|
|
26
30
|
|
|
27
31
|
If the fund result carries `card_charge: "unknown"` (its display says the card may or may not have been charged), re-run the same command with the same `--spt` inside the window it names: the resend books the earlier charge or makes it once, never twice. Do not ask the human for a new approval until the CLI says the earlier top-up is closed. With `retryable: true`, re-running is the next step; if the DVM keeps refusing, the hint names `--credit-id <new id>` to fund a separate credit. With `retryable: false` (the top-up's five-minute window has passed and no credit came of it), do not re-run: follow the hint, which is to check `dvm credit balance` and the card statement before asking for a new approval. If the charge happened and was never booked, a provider that keeps its ledger in Postgres refunds it to the card after its stranded-charge sweep (about 30 minutes); otherwise the provider's operator can find and refund it from the fund id. A decline or an unusable approval says so in `display`; relay it and ask for a new approval.
|
package/skills/dvm/wallets.md
CHANGED
|
@@ -39,3 +39,5 @@ Success means the intended wallet is connected on the intended network and its o
|
|
|
39
39
|
## Audit local history
|
|
40
40
|
|
|
41
41
|
Use `dvm wallet history` for durable spending, completed refunds/losses, and active recovery. `total_usd` is the displayed page's budget valuation, including funding once; draws, refunds, losses, and recovery do not add another outflow. A BTC-equivalent valuation does not establish the native payment rail. Preserve unknown currency and fee fields. Continue with `next_cursor` and the same filters; a stale continuation requires restarting, while `--offset` assumes unchanged records. History reads scan the retained archive even when the output page is short.
|
|
42
|
+
|
|
43
|
+
For a human who wants to pay a DVM by card, run `dvm credit fund <dvm> --rail stripe --amount '$X' --no-wait`. Open the returned checkout link in your own browser and use the saved card or wallet the human approves; without a browser, hand the link to the human. Ask which email address to enter on Stripe's page: the DVM owner's Stripe account receives it, plus the cardholder name and country. Run the returned `next_step`, then `dvm credit balance <dvm>` to confirm payment. Never treat the link as proof of payment. See [credit.md](credit.md) for session recovery and the Stripe Link fallback when hosted checkout is unavailable.
|