@dvmkit/dvm-cli 0.21.0 → 0.22.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.
@@ -467,7 +467,7 @@ import {
467
467
  x402SettledShare,
468
468
  x402VoucherPendingState,
469
469
  x402WalletFromConfig
470
- } from "./chunk-CMIEPFKP.js";
470
+ } from "./chunk-AWWLO2WW.js";
471
471
  import "./chunk-JBU7RKQ3.js";
472
472
  import "./chunk-KDNFUDOG.js";
473
473
  import "./chunk-IUTVV6N5.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-QVX7KPLS.js";
7
- import "./chunk-CMIEPFKP.js";
6
+ } from "./chunk-AWK22TUP.js";
7
+ import "./chunk-AWWLO2WW.js";
8
8
  import "./chunk-JBU7RKQ3.js";
9
9
  import "./chunk-KDNFUDOG.js";
10
10
  import "./chunk-IUTVV6N5.js";
@@ -13,22 +13,22 @@ import {
13
13
  recordFloatSpend,
14
14
  resolveFundMint,
15
15
  sweepPendingMints
16
- } from "./chunk-GWISSHP6.js";
17
- import "./chunk-L3PHIA5L.js";
18
- import "./chunk-M4Q3DBQO.js";
16
+ } from "./chunk-WGZ3HBST.js";
17
+ import "./chunk-AFR5KKJX.js";
18
+ import "./chunk-ITESN5XP.js";
19
19
  import {
20
20
  loadConfig
21
- } from "./chunk-BU5E7IDF.js";
21
+ } from "./chunk-YSALCR5X.js";
22
22
  import {
23
23
  info,
24
24
  tryResolveBtcUsdRate
25
- } from "./chunk-YRLRHJ6O.js";
25
+ } from "./chunk-23FGJKIX.js";
26
26
  import {
27
27
  effectiveFundingMint,
28
28
  effectiveMints,
29
29
  formatUsd,
30
30
  loadAgentWallet
31
- } from "./chunk-CMIEPFKP.js";
31
+ } from "./chunk-AWWLO2WW.js";
32
32
  import "./chunk-JBU7RKQ3.js";
33
33
  import "./chunk-KDNFUDOG.js";
34
34
  import "./chunk-IUTVV6N5.js";
@@ -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-7UGJALAX.js";
7
- import "./chunk-L3PHIA5L.js";
8
- import "./chunk-BU5E7IDF.js";
9
- import "./chunk-CMIEPFKP.js";
6
+ } from "./chunk-X2CKIG2D.js";
7
+ import "./chunk-AFR5KKJX.js";
8
+ import "./chunk-YSALCR5X.js";
9
+ import "./chunk-AWWLO2WW.js";
10
10
  import "./chunk-JBU7RKQ3.js";
11
11
  import "./chunk-KDNFUDOG.js";
12
12
  import "./chunk-IUTVV6N5.js";
@@ -6,9 +6,9 @@ import {
6
6
  generateTempoKey,
7
7
  tempoBalanceCheckHint,
8
8
  tempoWrongAssetHint
9
- } from "./chunk-L3PHIA5L.js";
10
- import "./chunk-BU5E7IDF.js";
11
- import "./chunk-CMIEPFKP.js";
9
+ } from "./chunk-AFR5KKJX.js";
10
+ import "./chunk-YSALCR5X.js";
11
+ import "./chunk-AWWLO2WW.js";
12
12
  import "./chunk-JBU7RKQ3.js";
13
13
  import "./chunk-KDNFUDOG.js";
14
14
  import "./chunk-IUTVV6N5.js";
@@ -7,9 +7,9 @@ import {
7
7
  removeX402Wallet,
8
8
  repinX402WalletNetwork,
9
9
  saveX402Wallet
10
- } from "./chunk-M4Q3DBQO.js";
11
- import "./chunk-BU5E7IDF.js";
12
- import "./chunk-CMIEPFKP.js";
10
+ } from "./chunk-ITESN5XP.js";
11
+ import "./chunk-YSALCR5X.js";
12
+ import "./chunk-AWWLO2WW.js";
13
13
  import "./chunk-JBU7RKQ3.js";
14
14
  import "./chunk-KDNFUDOG.js";
15
15
  import "./chunk-IUTVV6N5.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvmkit/dvm-cli",
3
- "version": "0.21.0",
3
+ "version": "0.22.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": [
@@ -44,8 +44,8 @@ Failed Cashu spend preparation, including mid-job payment, reports the same orde
44
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`:
45
45
 
46
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.
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.
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`.
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. `request_seq_unverified: true` means the available messages could not confirm which ask the payment answered.
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. When present, `mandate_payments` gives the latest payment checks. A final history read can resolve a request link that was unverified in a live line. Act on `next_action`.
49
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.
50
50
 
51
51
  The wait ends when the job ends (`next_action: null`), at a charge or question it cannot answer on its own, at an error, or at the wait limit. At the limit it returns a `poll` action whose hint names the wait limit: with the job still running it gives the command to keep watching, and with an earlier payment unconfirmed it says so and how to resolve it. If the output stops without a `result` or `error` line, the process was stopped from outside: run the same command again. A rerun can repeat a message that is still waiting for an answer, so skip any `seq` you have already handled and forward each artifact once. Silent stream reads reconnect after 60 seconds by default; use `--timeout <seconds>` to change that interval.
@@ -46,6 +46,8 @@ Return to [calling](calling.md) for jobs. Keep the same signing identity. If the
46
46
 
47
47
  To reclaim unused credit, inspect the balance and use `dvm credit drain <dvm>` with the indicated credit ID when necessary. Distinguish a requested refund, a pending settlement, and funds actually returned. Provider-marked refund text is the provider's account of events; it does not override the CLI's verified state.
48
48
 
49
+ If a drain returns `drain_outcome_unknown`, the DVM may already have recorded or paid it. Run the error's `next_command` with the same signing identity and `drain_id` to recover the result of that drain.
50
+
49
51
  A Tempo drain with status `exit_required` cannot return the money directly. Relay the CLI's `display` and `hint` and stop polling a terminal drain. The `tempo_channel_exit_required` HTTP 409 form exits 1 and the `exit_required` status form exits 0; both mean run the timed exit, although a 409 with `status: "pending"` still permits a retry of the same drain with a valid close credential (approval to close the deposit). Use the named `dvm wallet tempo-exit <dvm> --credit-id <id>` command, preserving any `--as <name>` selector or the same `DVM_IDENTITY_KEY`. If this machine has no channel recovery record, run the exit from the wallet and machine that opened the channel. This timed exit returns the remaining channel funds after its delay; already approved payments and chain fees can reduce the return. Keep any recovery records until the funds arrive. An `unknown_drain_status` error requires upgrading `dvm` before continuing, not repeated polling.
50
52
 
51
53
  If the provider cannot answer, the available recovery depends on the original funding instrument. Channel exits can recover remaining collateral after the required delay; one-payment funding may depend on a provider refund. Follow [recovery](recovery.md) and the published contract before promising an amount or a completion time. Expiry alone is not proof of a refund or continued recoverability.
@@ -20,7 +20,9 @@ To claim an existing Cashu token, run `dvm wallet receive-token < token.txt` wit
20
20
 
21
21
  Check the required amount and existing balance before topping up. Wallet funding and job payments both count toward spending caps; leave enough authorized headroom for both. Quote shell amounts containing a dollar sign, for example `dvm wallet fund '$5'`, so the shell does not substitute them.
22
22
 
23
- For autonomous funding, follow the output until it reports the observed result. When a human pays a Cashu Lightning invoice, run `dvm wallet fund '<amount>' --no-float --no-wait`, then run the returned `next_step` (`dvm wallet show`) after payment to collect it. An existing unpaid-quote warning names an earlier invoice: avoid asking the human to pay both for the same top-up. Collect before the returned `collect_before` time: a mint can refuse to issue for a paid invoice once its quote has expired. `dvm wallet show` keeps an unpaid invoice past its expiry and keeps checking it for a late payment for 24 hours (`sweep.kept_past_expiry`); it removes one only when the mint no longer honors it (`sweep.expired`). An invoice whose mint named no expiry stays pending until it is paid or you run `dvm wallet forget-quote <quote-id> --yes`. Forget a quote only when you are sure its invoice will not be paid: a payment made afterwards cannot be collected.
23
+ For autonomous funding, follow the output until it reports the observed result. When a human pays a Cashu Lightning invoice and you can relay output while the command runs, use `dvm wallet fund '<amount>' --no-float --no-wait --collect-for 2m`. Relay the `awaiting_payment` handoff immediately. The command checks for payment in the foreground until collection, the duration limit, or quote expiry. A `minted` event confirms collection. If the command reports `collection_stopped`, follow its `next_step` (`dvm wallet show`) and the `collect_before` deadline. If your harness only returns output after the command exits, use `--no-float --no-wait` and run the returned `next_step` after payment.
24
+
25
+ An existing unpaid-quote warning names an earlier invoice. Avoid asking the human to pay both for the same top-up. Collect before `collect_before`. A mint can refuse to issue for a paid invoice once its quote has expired. `dvm wallet show` keeps checking unpaid quotes past expiry for late payment for 24 hours (`sweep.kept_past_expiry`) and reports removed quotes in `sweep.expired`. An invoice whose mint named no expiry stays pending until payment, a final answer from the mint, or `dvm wallet forget-quote <quote-id> --yes`. Forget a quote only when you are sure its invoice will not be paid, since a later payment cannot be collected.
24
26
 
25
27
  For human-assisted funding, show the invoice as soon as the CLI prints it; never wait for the funding command to finish. Send:
26
28