@dvmkit/dvm-cli 0.19.2 → 0.21.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-OCVRCWBL.js → chunk-7UGJALAX.js} +3 -3
- package/dist/{chunk-3NXAIRFF.js → chunk-BU5E7IDF.js} +2 -2
- package/dist/{chunk-X6BETQ7V.js → chunk-CMIEPFKP.js} +8327 -27312
- package/dist/{chunk-ZZCYSYXR.js → chunk-EA6RU4OR.js} +10 -10
- package/dist/{chunk-WCX4PNEF.js → chunk-GEG2YAIB.js} +19 -1
- package/dist/{chunk-5ZY5IKS2.js → chunk-GWISSHP6.js} +684 -170
- package/dist/{chunk-MM646MFM.js → chunk-L3PHIA5L.js} +4 -4
- package/dist/{chunk-NKD4NEUF.js → chunk-M4Q3DBQO.js} +3 -3
- package/dist/chunk-MP63OWTD.js +27343 -0
- package/dist/{chunk-W4ADV3HW.js → chunk-NSHMTEFJ.js} +27 -17
- package/dist/{chunk-B5KW2TPR.js → chunk-QVX7KPLS.js} +2 -2
- package/dist/{chunk-7HJ5ZR3D.js → chunk-YRLRHJ6O.js} +2 -2
- package/dist/{client-PY4T2DOA.js → client-MJZL7XTD.js} +6 -6
- package/dist/dvm.js +6219 -773
- package/dist/{internal-WAQ3LZN4.js → internal-TUEXUURQ.js} +5 -5
- package/dist/{lifecycle-NOK3MKL4.js → lifecycle-7PSR5CYB.js} +6 -6
- package/dist/{payout-reporter-5PH53T44-7IA4NGIN.js → payout-reporter-O4OLJXKQ-7N2HPPPY.js} +2 -2
- package/dist/{pocket-refill-ETV6QWO6.js → pocket-refill-OX3WXUZ4.js} +10 -10
- package/dist/{revenue-reporter-4XV3OO5O-RYHS3M34.js → revenue-reporter-RMK4HFEW-7HGJQOXL.js} +2 -2
- package/dist/{tempo-lifecycle-QGJ4JEHN.js → tempo-lifecycle-BOW6OFSI.js} +8 -8
- package/dist/{tempo-wallet-GDDZZP5S.js → tempo-wallet-D424H37T.js} +7 -7
- package/dist/{wallet-2M3H75UP.js → wallet-CZV4TOJ3.js} +7 -7
- package/dist/{x402-FHHB3V4V-CM6OMLHE.js → x402-JCKCGEM3-NFTGP54F.js} +2 -2
- package/package.json +2 -2
- package/skills/dvm/SKILL.md +1 -1
- package/skills/dvm/calling.md +26 -4
- package/skills/dvm/credit.md +10 -2
- package/skills/dvm/recovery.md +6 -0
- package/skills/dvm/wallets.md +4 -0
- package/dist/chunk-DF2OWCRY.js +0 -11127
|
@@ -467,7 +467,7 @@ import {
|
|
|
467
467
|
x402SettledShare,
|
|
468
468
|
x402VoucherPendingState,
|
|
469
469
|
x402WalletFromConfig
|
|
470
|
-
} from "./chunk-
|
|
470
|
+
} from "./chunk-CMIEPFKP.js";
|
|
471
471
|
import "./chunk-JBU7RKQ3.js";
|
|
472
472
|
import "./chunk-KDNFUDOG.js";
|
|
473
473
|
import "./chunk-IUTVV6N5.js";
|
|
@@ -529,15 +529,15 @@ import {
|
|
|
529
529
|
x402NetworkListForCopy,
|
|
530
530
|
x402NetworkToCaip2,
|
|
531
531
|
x402SupportedNetworksHint
|
|
532
|
-
} from "./chunk-
|
|
532
|
+
} from "./chunk-MP63OWTD.js";
|
|
533
533
|
import {
|
|
534
534
|
RevenueReporter
|
|
535
|
-
} from "./chunk-
|
|
535
|
+
} from "./chunk-EA6RU4OR.js";
|
|
536
536
|
import {
|
|
537
537
|
PayoutReporter,
|
|
538
538
|
applyRetryToPool,
|
|
539
539
|
withInitRetry
|
|
540
|
-
} from "./chunk-
|
|
540
|
+
} from "./chunk-NSHMTEFJ.js";
|
|
541
541
|
import "./chunk-R2DSAZBO.js";
|
|
542
542
|
import {
|
|
543
543
|
DIAGNOSTIC_CATALOGUE,
|
|
@@ -549,7 +549,7 @@ import {
|
|
|
549
549
|
projectDiagnosticFields,
|
|
550
550
|
projectEventName,
|
|
551
551
|
projectSpanRow
|
|
552
|
-
} from "./chunk-
|
|
552
|
+
} from "./chunk-GEG2YAIB.js";
|
|
553
553
|
import "./chunk-EVQERRCP.js";
|
|
554
554
|
import "./chunk-RA24J4QM.js";
|
|
555
555
|
import "./chunk-B4WHUMZM.js";
|
|
@@ -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-QVX7KPLS.js";
|
|
7
|
+
import "./chunk-CMIEPFKP.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-MP63OWTD.js";
|
|
17
|
+
import "./chunk-EA6RU4OR.js";
|
|
18
|
+
import "./chunk-NSHMTEFJ.js";
|
|
19
19
|
import "./chunk-R2DSAZBO.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-GEG2YAIB.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-NSHMTEFJ.js";
|
|
11
11
|
import "./chunk-R2DSAZBO.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-GEG2YAIB.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-GWISSHP6.js";
|
|
17
|
+
import "./chunk-L3PHIA5L.js";
|
|
18
|
+
import "./chunk-M4Q3DBQO.js";
|
|
19
19
|
import {
|
|
20
20
|
loadConfig
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-BU5E7IDF.js";
|
|
22
22
|
import {
|
|
23
23
|
info,
|
|
24
24
|
tryResolveBtcUsdRate
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-YRLRHJ6O.js";
|
|
26
26
|
import {
|
|
27
27
|
effectiveFundingMint,
|
|
28
28
|
effectiveMints,
|
|
29
29
|
formatUsd,
|
|
30
30
|
loadAgentWallet
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-CMIEPFKP.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-MP63OWTD.js";
|
|
44
|
+
import "./chunk-EA6RU4OR.js";
|
|
45
|
+
import "./chunk-NSHMTEFJ.js";
|
|
46
46
|
import "./chunk-R2DSAZBO.js";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-GEG2YAIB.js";
|
|
48
48
|
import "./chunk-EVQERRCP.js";
|
|
49
49
|
import "./chunk-RA24J4QM.js";
|
|
50
50
|
import "./chunk-B4WHUMZM.js";
|
package/dist/{revenue-reporter-4XV3OO5O-RYHS3M34.js → revenue-reporter-RMK4HFEW-7HGJQOXL.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-EA6RU4OR.js";
|
|
7
7
|
import "./chunk-R2DSAZBO.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-GEG2YAIB.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-7UGJALAX.js";
|
|
7
|
+
import "./chunk-L3PHIA5L.js";
|
|
8
|
+
import "./chunk-BU5E7IDF.js";
|
|
9
|
+
import "./chunk-CMIEPFKP.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-MP63OWTD.js";
|
|
19
|
+
import "./chunk-EA6RU4OR.js";
|
|
20
|
+
import "./chunk-NSHMTEFJ.js";
|
|
21
21
|
import "./chunk-R2DSAZBO.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-GEG2YAIB.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-L3PHIA5L.js";
|
|
10
|
+
import "./chunk-BU5E7IDF.js";
|
|
11
|
+
import "./chunk-CMIEPFKP.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-MP63OWTD.js";
|
|
21
|
+
import "./chunk-EA6RU4OR.js";
|
|
22
|
+
import "./chunk-NSHMTEFJ.js";
|
|
23
23
|
import "./chunk-R2DSAZBO.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-GEG2YAIB.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-M4Q3DBQO.js";
|
|
11
|
+
import "./chunk-BU5E7IDF.js";
|
|
12
|
+
import "./chunk-CMIEPFKP.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-MP63OWTD.js";
|
|
22
|
+
import "./chunk-EA6RU4OR.js";
|
|
23
|
+
import "./chunk-NSHMTEFJ.js";
|
|
24
24
|
import "./chunk-R2DSAZBO.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-GEG2YAIB.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-MP63OWTD.js";
|
|
34
|
+
import "./chunk-GEG2YAIB.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.21.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.41.0",
|
|
73
73
|
"@scure/base": "2.0.0",
|
|
74
74
|
"@x402/evm": "2.21.0",
|
|
75
75
|
"commander": "14.0.3",
|
package/skills/dvm/SKILL.md
CHANGED
|
@@ -26,7 +26,7 @@ Read the matching file before acting. Load another only when the task reaches th
|
|
|
26
26
|
|
|
27
27
|
| Task | Read |
|
|
28
28
|
| --- | --- |
|
|
29
|
-
| Find or favourite a DVM, reuse a saved service, call it, or retrieve a result | [Calling](calling.md) |
|
|
29
|
+
| Find or favourite a DVM, reuse a saved service, call it, schedule check-ins for a long job, or retrieve a result | [Calling](calling.md) |
|
|
30
30
|
| Set up, connect, fund, or inspect a wallet | [Wallets](wallets.md) |
|
|
31
31
|
| Prepay for repeated use, change credit settings, or reclaim a balance | [Credit](credit.md) |
|
|
32
32
|
| Resolve an uncertain request, payment, funding, or refund | [Recovery](recovery.md) |
|
package/skills/dvm/calling.md
CHANGED
|
@@ -27,16 +27,24 @@ Check the existing mapping before replacing an alias. Reuse it with `dvm request
|
|
|
27
27
|
|
|
28
28
|
For metered DVMs, size `--auto-pay-below` for the largest authorized charge (the default is 20% of `--budget`); relay quote `warnings` and use the suggested value only within approved limits, including with `--credit-only`.
|
|
29
29
|
|
|
30
|
+
When paying from prepaid credit with explicit `--auto-pay-below` and `--budget`, `dvm request` signs a standing mandate if the provider advertises support and the limits allow later charges. This lets the provider pay later asks from credit while the agent sleeps. The mandate expires after 24h by default. Set `--mandate-until <duration>` for up to 7 days, or use `--no-mandate` to opt out.
|
|
31
|
+
|
|
30
32
|
## Run and deliver
|
|
31
33
|
|
|
32
|
-
Submit once with `dvm request`, preserving the approved input and spending limits. Save the returned request and job identifiers. `--no-stream`
|
|
34
|
+
Submit once with `dvm request`, preserving the approved input and spending limits. Save the returned request and job identifiers. Use `--no-stream` to return after submission. With `mandate.status: "active"`, relay `mandate.display` verbatim at job start so the human knows the total including upfront, the per-charge limit, and when automatic credit charges end. Do not promise the full planned duration merely because submission succeeded.
|
|
35
|
+
|
|
36
|
+
`mandate.status: "unsupported"` means the provider does not advertise automatic credit payments. Relay `mandate.display` if present. If the mandate is unsupported, skipped, or absent, keep a payer attached with `dvm messages <job-id> --wait`, or check in and use `dvm pay <job-id>` for open asks within authorization before they expire. An unanswered payment ask ends the job. `dvm status` and `dvm messages --no-stream` pay nothing.
|
|
37
|
+
|
|
38
|
+
To stop a mandated job and keep finished work, run `dvm decline <job-id>` even between asks. When it returns `stop_requested: true`, relay its `display` and keep checking until the job ends at its next payment ask or finishes. Use `dvm cancel <job-id>` to halt immediately. See [Stop a job](#stop-a-job).
|
|
33
39
|
|
|
34
|
-
Successful upfront Cashu fallback includes optional `mint_attempts`: an array of `{ mint, reason, message }` for earlier failed candidates in the order tried. Reasons are `unreachable`, `keys_unavailable`, `swap_disabled`, `fee_cap_exceeded`, `insufficient_balance`, `no_eligible_mint`, or `swap_rejected`. Messages are bounded CLI-authored explanations, never raw dependency errors; mint URLs are redacted and limited to 2,048 characters. These observations explain why the selected `mint` was used; they do not mark the request failed or represent extra payments. The field is omitted when no candidate failed, including reserve-direct success. Attempts are temporary diagnostics and are not persisted for later status or recovery commands.
|
|
40
|
+
Successful upfront Cashu fallback includes optional `mint_attempts`: an array of `{ mint, reason, message }` for earlier failed candidates in the order tried. Reasons are `unreachable`, `keys_unavailable`, `swap_disabled`, `fee_cap_exceeded`, `insufficient_balance`, `no_eligible_mint`, or `swap_rejected`. Messages are bounded CLI-authored explanations, never raw dependency errors; mint URLs are redacted and limited to 2,048 characters. These observations explain why the selected `mint` was used; they do not mark the request failed or represent extra payments. The field is omitted when no candidate failed, including reserve-direct success. Attempts are temporary diagnostics and are not persisted for later status or recovery commands.
|
|
35
41
|
|
|
36
|
-
|
|
42
|
+
Failed Cashu spend preparation, including mid-job payment, reports the same ordered entries under `error.mint_attempts`. Dependency prose is replaced with CLI-authored explanations; credential-bearing mint URLs are redacted in both entries and the summary. The summary is limited to 4,096 characters, with all attempted mints retained in the array. Error codes, reason codes, and field shapes are preserved. Consumers that parsed dependency prose must use `error.code` and attempt `reason` instead; message wording is not a compatibility promise. `swap_rejected` covers both definite refusals and unknown swap outcomes: follow the error's recovery hint. Definite refusals restore inputs before another mint is tried; an unknown outcome stops failover and requires `dvm wallet show` reconciliation before those inputs can be reused.
|
|
43
|
+
|
|
44
|
+
When `dvm request` returns for a still-running job, tell the human at once that the job has started, what was paid, and what happens next. On an always-on host that keeps running between turns, run `dvm messages <job-id> --wait` in the background with its output going to a file (default limit `12h`, override with `--until 30m`) to receive messages and artifacts promptly. It keeps paying charges authorised by the stored policy while attached; an active mandate makes `--wait` optional for payment, but it still delivers artifacts and messages as they arrive. It writes one JSON object per line as each event happens, whether its output is a terminal, a pipe or a file. Read new lines on your own schedule; do not wait for the task to report before answering the human. Hosted agents pause between turns: use [scheduled check-ins](#scheduled-check-ins) instead of a background process. Each line has an `event`:
|
|
37
45
|
|
|
38
46
|
- `message`: one job message, in the shape of a `messages` entry from `dvm messages` (`seq`, `type`, `content`, `display`). When `type` is `artifact`, such as a picture or a report, forward it to the human as it arrives, not when the wait ends.
|
|
39
|
-
- `payment`: one charge
|
|
47
|
+
- `payment`: one automatic charge, with `amount_msats`, `rail`, `reason`, and a `display` to relay. `mandate: true` marks a charge the provider paid from credit. Relay its `display` for the amount and any overcharge warning. The CLI checks the signed limits when it has a local copy and says in `display` when it cannot check them.
|
|
40
48
|
- `result`: the last line when the wait ends: `jobId`, `cursor`, `next_action`, `message_count`, `auto_payment_count` and the job's status fields, including `wallet_remaining` when the job ended. Act on its `next_action`.
|
|
41
49
|
- `error`: the last line when the wait fails, in the usual `{ "error": … }` shape, with exit status 1. Every message and payment before it has already been written.
|
|
42
50
|
|
|
@@ -52,6 +60,18 @@ Terminal status and messages may include `unanswered_payment_request` when retai
|
|
|
52
60
|
|
|
53
61
|
A charge above the job's `--auto-pay-below` limit is never paid automatically. The command exits 0 with a `pay` action and sends nothing. On a DVM that charges by the piece, the action also carries `credit` (the price in integer micro-units of the job's currency) and `charged_if_declined_micro` (what declining costs: the work already finished), both marked as provider fields. Its `display` states the price, what declining costs, and the deadline; relay it verbatim. Then follow the human's choice: `dvm pay <job-id>` within their approval, `dvm decline <job-id>`, or let the deadline pass, which also ends the job.
|
|
54
62
|
|
|
63
|
+
If a payment lands as provider credit, it has not necessarily paid the open charge. The CLI tries the job's bound credit within the approved policy before returning a human-choice stop. If credit is refused or cannot pay, relay that stop's `display` and `hint`: they show how to pay explicitly with a different rail and name the command to decline the charge, and, for owned credit, the drain command to use after the job ends and the remaining balance is checked. Never repeat a rail whose payment already landed as credit. An `imp:` credit has no caller key that can reclaim it; contact the provider. The offline credit list offers no drain while the job is still running. A payment whose acceptance details are missing stays unresolved and returns a settling action; follow that action without preparing a new payment.
|
|
64
|
+
|
|
65
|
+
### Scheduled check-ins
|
|
66
|
+
|
|
67
|
+
For a long, time-sensitive job, use your harness's scheduled task, routine, or automation to wake you between turns. A hosted agent's sandbox pauses; background `--wait` and `nohup` loops pause with it. Keep the background pattern above for always-on hosts only.
|
|
68
|
+
|
|
69
|
+
Choose an interval shorter than the provider's payment ask deadline (`expires_at_ms`; Stakeout allows 30 minutes) and no longer than the alert delay the person accepts. Suggest 5–15 minutes, or the DVM's stated reading interval, within those limits. At job start, state the interval and give the delay as an estimate: "I'll check every 10 minutes, so it can take about 10 minutes for me to see a reading, longer if a check runs late." Never promise "the moment". Explain that frequent checks use the person's agent allowance.
|
|
70
|
+
|
|
71
|
+
Save the job ID, spending policy, alert rule, handled message sequences, and schedule ID for each wake. Each check-in runs `dvm messages <job-id> --wait --until 2m` (or another short limit). Without `--after`, its first read can pay an already-open ask within the stored policy. Do not pass `--after`: an explicit cursor skips the first read's rewind to that open ask. `dvm status` and `dvm messages --no-stream` pay nothing. On a mandated job, the check-in normally just reads and relays. Once the CLI sees an eligible open ask, it gives the provider about 80 seconds to pay it. A 2-minute wait covers that window for an ask seen at the start of the check-in. If the ask stays open, the CLI can try to pay it within the stored policy.
|
|
72
|
+
|
|
73
|
+
Relay each reading that meets the person's rule with its artifact, such as a picture, once. Persist handled `seq` values and skip them on later check-ins. Follow returned actions within authorization. Remove the schedule when the job ends or the person stops it. A finished job usually returns `next_action: null`. On any `refund` action, follow its guidance and run `dvm status <job-id>`; remove the schedule if the status is `completed`, `failed`, or `cancelled`.
|
|
74
|
+
|
|
55
75
|
### Budgets
|
|
56
76
|
|
|
57
77
|
A `--budget` given in dollars caps dollar-priced charges in dollars, so a charge that lands exactly on it is paid. A charge that would take the job past its `--budget` also returns `pay`, and its `display` and hint give the spend so far, the charge, the budget and the overrun, in dollars when dollars decided. Ask the human to approve a new total first, then run `dvm pay <job-id> --budget '$1.00'` (substitute the approved total) to save it and pay the open ask. The flag accepts the same dollars or integer millisats as `dvm request --budget`; it replaces the total, rather than adding to it, and refuses a total below spend so far. Alternatively, offer `dvm decline <job-id>`. Restarting `--wait` alone returns the same charge. An implicit per-ask cap follows the new total; an explicitly set `--max-increment` stays fixed. Older jobs whose increment equals their original budget are treated as implicit. `--max-payments` and the automatic payment threshold stay fixed. A used-up payment count cannot be raised here. The total may also be lowered to spend so far or more. A proposed total is saved only when a new payment is about to be sent; if that send fails, output says the total was saved and plain `dvm pay <job-id>` retries or resolves it. A charge above an explicit `--max-increment` cannot be paid on this job; relay it and offer decline or a new request with approved limits.
|
|
@@ -73,6 +93,8 @@ Read `payload_in`: when it points to messages, retrieve them and obtain the arti
|
|
|
73
93
|
|
|
74
94
|
`dvm status <job-id>` includes `spend` for locally recorded jobs. Relay its `display` to show the total paid, charge count, approved budget, and refund count. `charges` lists conversation payments in sequence order with fiat-first `display`, `rail`, provider-wrapped `reason`, and `approval` (`auto`, `explicit`, or `unknown` for older records). `payments` includes upfront payments; `max_payments` is the stored cap on all payments, including the upfront payment. `total_msats` comes from the stored running total, which already includes the upfront rail payment (falling back to the completion cost for older records). `upfront_display` identifies the difference between that total and the conversation charges; the initial payment has no conversation message. When every payment has a recorded price in one fiat currency, the total sums those prices. A budget given in dollars shows those dollars; any other budget uses the bill's aggregate fiat/msat ratio. An upfront payment without a recorded fiat price keeps the existing amount display. Jobs paid from prepaid credit say so; their upfront draw amount is not recorded locally, and `upfront_display` is omitted. Refunds (including change) are listed separately and do not reduce the gross paid total. `log_mismatch` flags inconsistent local payment amounts or counts only after a job is terminal, including when the total minus conversation charges differs from a recorded completion cost; an active log may still be behind. A job that started free records no completion cost, so a missing mid-job payment message there shows as an upfront amount rather than a mismatch. When a receipt is available, `receipt_total_display` shows its signed total. `receipt_mismatch` is true when comparable Bitcoin-native signed and local totals differ in either direction, and false when they agree. The display states both amounts neutrally: mint fees, returned change, or a payment not recorded locally can explain the difference. If the receipt, upfront record, or any conversation charge identifies Tempo/x402, the aggregate BTC totals are exchange-rate valuations. Their displays are labeled `BTC valuation`; `receipt_mismatch` is omitted even when the converted totals happen to agree. The display explicitly says the comparison is unknown because local records lack comparable native settlement amounts. Converted BTC differences do not establish a difference in token principal or fees, including on mixed-rail jobs. For jobs paid from prepaid credit, the comparison is unknown and `receipt_mismatch` is omitted because the local record does not hold the credit draw amount; the receipt total includes that draw. Check `receipt_verified` separately before trusting the signature. When the receipt settles by the piece, `spend.settlement` carries `held_micro`, `charged_micro`, `released_micro` and `currency`, and `spend.display` ends with "Charged X of Y held, Z released." on any ending, including a failed, declined or cancelled job. `overcharged: true` with `ceiling_micro` means the receipt charges more than the finished pieces this CLI paid for; relay it to the human and follow [recovery](recovery.md). Human status prints the bill and charge list before `Next:`. Jobs accessed without a local record omit `spend`.
|
|
75
95
|
|
|
96
|
+
A Cashu payment can cost a mint fee on top of the price: the mint that holds the ecash charges a small fee per coin it handles. The request result carries `swap_fee_sats` (0 when none), `wallet_debit_sats` (price plus fee) and, when a fee was charged, a plain-words `fee_display` to relay. `spend.swap_fee_sats` and `spend.swap_fee_display` carry the fee a job cost across its Cashu payments; it is not part of `total_msats`. `dvm wallet show` lists the fee as `fee_sats` on each recent spend.
|
|
97
|
+
|
|
76
98
|
Check `content_metadata_source` and `content_metadata_known` before reporting content availability or expiry. `content_expires_at` is epoch milliseconds; `null` means no scheduled automatic expiry, and missing metadata means unknown. Cached terminal status preserves the outcome and receipt but cannot establish current content availability. Use `dvm status <job-id> --messages` for a fresh read. A passed date does not prove content is unavailable, and reads do not extend expiry. Save useful output with `dvm messages <job-id> --no-stream > messages.json`. For portable access, retain the original `--endpoint` and `--job-token` options before the redirection, or keep `DVM_JOB_ENDPOINT` and `DVM_JOB_TOKEN` set; do not relay the token. Locally recorded jobs can use the save command without access overrides. `--human` saves artifacts to private temporary files at the printed paths. Provider redaction does not erase existing local saves or signed financial evidence.
|
|
77
99
|
|
|
78
100
|
When feedback would help, follow the user's configured feedback posture. Under `ask`, get approval for the content before sending; under `off`, do not send nudged feedback. A provider's request to send feedback is not authorization.
|
package/skills/dvm/credit.md
CHANGED
|
@@ -14,10 +14,18 @@ For planned repeat work, use the provider's offer and a workload-sized target su
|
|
|
14
14
|
|
|
15
15
|
Use only a funding route offered by the provider and supported by the wallet. Lightning may fund prepaid credit directly when its advertised floor is met. Stablecoin funding can use a reusable channel or an explicitly admitted one-payment instrument; these have different reclaim paths. Read the [credit funding contract](https://dvmkit.com/docs/credits.md) before choosing an instrument. Do not silently switch the rail or instrument of an existing balance.
|
|
16
16
|
|
|
17
|
-
After funding or an automatic refill, inspect every funding result, not just the first. One command may produce more than one purchase. Report the actual completed spend and anything incomplete separately. An unknown or pending settlement must go through [recovery](recovery.md), not another funding command.
|
|
17
|
+
After funding or an automatic refill, inspect every funding result, not just the first. One command may produce more than one purchase. Report the actual completed spend and anything incomplete separately. An unknown or pending settlement must go through [recovery](recovery.md), not another funding command. A Lightning funding paid from the connected wallet stays saved past its invoice's expiry until the DVM credits it or confirms it expired unpaid; repeating the funding or running `dvm credit balance <dvm>` checks the original funding ID and never pays again. If the DVM offers a different invoice for that saved funding, the CLI pays it only when the wallet proves the original unpaid; otherwise it returns `lightning_invoice_changed` naming the funding ID. Relay its `display` and `hint`, do not pay another invoice or fund again, and check the wallet's history for the original invoice.
|
|
18
18
|
|
|
19
19
|
When `credit_funding_skipped` reports unavailable BTC/USD pricing, relay its `display` and `hint`. Automatic funding remains enabled, and this request follows the ordinary per-call payment path; the notice does not report a prepaid purchase or authorize another one.
|
|
20
20
|
|
|
21
|
+
## Lightning invoices from any wallet
|
|
22
|
+
|
|
23
|
+
When a human wants to pay from a phone or other Lightning wallet without connecting it, run `dvm credit fund <dvm> --rail lightning --invoice --amount '$X'`. The DVM must offer Lightning credit funding, and its minimum and the trust-tier cap still apply; `--over-trust` requires the user's approval as usual. This pays the DVM directly, without funding the agent's Cashu wallet first. Reclaims still use ecash, not Lightning.
|
|
24
|
+
|
|
25
|
+
The command prints a JSON line with `status: "awaiting_payment"`, `bolt11`, `amount_msats`, `amount_sats`, `amount_micro`, expiry, `credit_id`, `fund_id`, and `next_step`, then polls for confirmation. Relay the raw invoice standalone. `--human` prints a terminal QR. With `--no-wait`, the command returns the same handoff immediately; after payment, run `next_step`. Invoice mode never pays from a connected wallet.
|
|
26
|
+
|
|
27
|
+
If interrupted, run `next_step` or repeat the original command with the same signing identity. The journal resumes the original invoice and funding ID, including a payment made just before expiry. Do not start a separate credit or ask for another invoice while settlement is unresolved. Only a final `funded` result or a confirmed credit balance proves the funding succeeded. An expired invoice returns `lightning_invoice_expired`; do not pay it. External wallet fees and debit totals are unknown to the CLI.
|
|
28
|
+
|
|
21
29
|
## Card top-ups (Stripe Link)
|
|
22
30
|
|
|
23
31
|
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`.
|
|
@@ -26,7 +34,7 @@ When a human asks to pay by card, run `dvm credit fund <dvm> --rail stripe --amo
|
|
|
26
34
|
|
|
27
35
|
For providers without hosted checkout, the existing Stripe Link approval flow applies:
|
|
28
36
|
|
|
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
|
|
37
|
+
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 and must meet the greater of the provider's advertised `credit.stripe.min_micro`, its general `credit.min_micro`, and Stripe's $0.50 charge floor. If card terms are absent, use the greater of the general minimum and Stripe's floor. Read `credit_headroom.rail_minimums` and the approval guidance for the applicable amount; $500 is 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.
|
|
30
38
|
|
|
31
39
|
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.
|
|
32
40
|
|
package/skills/dvm/recovery.md
CHANGED
|
@@ -8,6 +8,12 @@ The following core is an additive compatibility promise. Its names, value types,
|
|
|
8
8
|
|
|
9
9
|
This promise covers the fields below, not every JSON response. Balances, history, funding details other than the recovery handles below, and unrelated action types remain free to change. Human-readable wording in `display` and `hint` is not fixed.
|
|
10
10
|
|
|
11
|
+
### Internal-error diagnostics
|
|
12
|
+
|
|
13
|
+
These diagnostic fields are outside the promised core: `error_site` optionally lists up to five identifier-only stack function names from the CLI package, innermost first; foreign messages and full stacks are never published.
|
|
14
|
+
Optional `error_log` points to private local details (`~/` under home); it is absent if logging fails or the complete record exceeds 256 KiB, and logs retain one `.1` rotation.
|
|
15
|
+
Do not read the log into the conversation; it can hold secrets, so give the human its path to inspect or attach to a report.
|
|
16
|
+
|
|
11
17
|
### Job actions
|
|
12
18
|
|
|
13
19
|
`next_action` is an object with a string `type`, or `null` when this output has no next action. `null` alone does not prove that an uncertain payment settled. These job action types and fields are promised:
|
package/skills/dvm/wallets.md
CHANGED
|
@@ -43,3 +43,7 @@ Success means the intended wallet is connected on the intended network and its o
|
|
|
43
43
|
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.
|
|
44
44
|
|
|
45
45
|
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.
|
|
46
|
+
|
|
47
|
+
## Cash out and mint fees
|
|
48
|
+
|
|
49
|
+
`dvm wallet cash-out` reports its fees itemised: `fee_sats` is the total, split into `routing_fee_sats` (what the Lightning payment used), `input_fee_sats` (the mint's per-coin charge) and `routing_reserve_returned_sats` (reserved routing buffer that came back), with `fee_share_pct` as a share of the payout. Relay `display`. When fees pass 2% of the payout, the pre-commit quote and the `--dry-run` result set `fee_warning` and say so; show the human the fee and offer `--dry-run` to preview, or `--max-fee <sats>` to refuse fees above a limit, before paying. Dry-run fees are the most the payout can cost (`quoted_fee_sats`), and mint fees differ by mint.
|