@dvmkit/dvm-cli 0.15.0 → 0.15.2
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-ZKC6KN36.js → chunk-ECJO73RZ.js} +2686 -2344
- package/dist/{client-RSHQFXCA.js → client-YIHI4AIC.js} +1 -1
- package/dist/dvm.js +960 -249
- package/dist/{pocket-refill-7Q6CR6I4.js → pocket-refill-XZTMPTP6.js} +2 -2
- package/package.json +1 -1
- package/skills/dvm/calling.md +2 -2
- package/skills/dvm/recovery.md +4 -3
- package/dist/{chunk-LPILVPFG.js → chunk-5SHB3MZ7.js} +3 -3
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
recordFloatSpend,
|
|
14
14
|
resolveFundMint,
|
|
15
15
|
sweepPendingMints
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ECJO73RZ.js";
|
|
17
17
|
import "./chunk-HJ2JYBTT.js";
|
|
18
18
|
import {
|
|
19
19
|
info,
|
|
20
20
|
tryResolveBtcUsdRate
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-5SHB3MZ7.js";
|
|
22
22
|
import "./chunk-UWVMG4VG.js";
|
|
23
23
|
import {
|
|
24
24
|
loadConfig
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dvmkit/dvm-cli",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
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": [
|
package/skills/dvm/calling.md
CHANGED
|
@@ -35,7 +35,7 @@ Successful upfront Cashu fallback includes optional `mint_attempts`: an array of
|
|
|
35
35
|
|
|
36
36
|
For long jobs, run `dvm messages <job-id> --wait` in the background (default limit `12h`, override with `--until 30m`) and act on its `next_action`; it keeps paying charges authorised by the stored policy while attached. Silent stream reads reconnect after 60 seconds by default; use `--timeout <seconds>` to change that interval.
|
|
37
37
|
|
|
38
|
-
Follow the returned action: respond to a provider question only with authorized information; pay an existing job only within consent; poll when still processing. After `dvm pay <job-id>`, continue with `dvm messages <job-id>`, not a new request. If a `pay` action warns that a payment may already have been sent, run `dvm pay <job-id>` to resolve it: the command checks fresh provider history before spending. A send has a 60-second client timeout. A lost send waits 45 seconds after its failure before
|
|
38
|
+
Follow the returned action: respond to a provider question only with authorized information; pay an existing job only within consent; poll when still processing. After `dvm pay <job-id>`, continue with `dvm messages <job-id>`, not a new request. If a `pay` action warns that a payment may already have been sent, run `dvm pay <job-id>` to resolve it: the command checks fresh provider history before spending. A send has a 60-second client timeout. A lost send waits 45 seconds after its failure before it is sent again, and then only if history still shows the same unanswered charge and the job is `awaiting-input`. The retry re-delivers the payment already signed for that charge: the same Cashu token and request ID, or the same x402 or Tempo credential. No second payment is signed while the first is unconfirmed. It is booked as paid only on evidence that it was taken: the provider's acceptance or replay answer, a recorded payment in history that carries its Cashu request ID or exact credential, or Cashu proofs minted for this payment that the provider or the wallet sweep reports spent. It is released for a new payment when a newer ask replaces it, when the wallet confirms it reclaimed the token, or on a refusal whose code the provider's own `error` field names: `payment_invalid` (except for a re-sent x402 or Tempo credential, which a provider also answers that way when it already settled or used it; that one stays held), `lock_not_exclusive`, an invalid token, or a validation refusal. A short payment (`payment_insufficient`) is never released automatically: a provider keeps a short Cashu token, on credit where it has a ledger. Auto-pay stops, the hint names `dvm credit drain`, and only an explicit `dvm pay <job-id>` signs a new payment. Spent reserve proofs need the same explicit `dvm pay`. Transient, throttled (408, 425, 429), unrecognized or unstructured answers keep the payment held and re-sent; answers that would repeat on every re-send keep it held with `dvm decline` and `dvm cancel` as the ways out. Inside that window, `payment_settling` gives the retry time and command; `--wait` keeps checking automatically. Concurrent payment commands are serialized per job; another payer gets `payment_settling`, and `--wait` keeps watching. A later question does not invalidate a still-pending charge. Older local records without a send timestamp skip the delay but still require the same pending charge. `payment_unconfirmed` means nothing new was signed: the held payment cannot be re-sent here (a record from an older CLI, a wallet entry that is gone, or a different `--rail` or `--endpoint`). Follow its hint: re-send without the conflicting flag, keep watching with `dvm messages <job-id> --wait`, or end the job with `dvm decline <job-id>` (keeps finished work) or `dvm cancel <job-id>`. Recovery reads time out after 60 seconds by default; a failed or timed-out history read never authorizes a payment. If history cannot be read, retry once the provider is reachable or enter [recovery](recovery.md).
|
|
39
39
|
|
|
40
40
|
Answer with `dvm message <job-id> "<answer>" --type response --prompt-id <prompt-id>` (use `--json '<object matching schema>'` in place of `"<answer>"` for structured prompts); relay `next_action.display` and use exactly one of `next_action.options` unless the human chose otherwise.
|
|
41
41
|
|
|
@@ -47,7 +47,7 @@ A charge above the job's `--auto-pay-below` limit is never paid automatically. T
|
|
|
47
47
|
|
|
48
48
|
Every payment buys the next piece of work, and every ask is new money. However a job ends, it charges the pieces already finished.
|
|
49
49
|
|
|
50
|
-
- **Keep the finished work:** decline at the next ask with `dvm decline <job-id>` (optional `--reason`). The job ends at once and nothing further is bought. JSON returns `declined: true` and, when the receipt arrives, `settlement` with `charged_micro`, `held_micro`, `released_micro` and `currency`. Relay `display
|
|
50
|
+
- **Keep the finished work:** decline at the next ask with `dvm decline <job-id>` (optional `--reason`). The job ends at once and nothing further is bought. JSON returns `declined: true` and, when the receipt arrives, `settlement` with `charged_micro`, `held_micro`, `released_micro` and `currency`. Relay `display` and `next_step_hint`: finished artifacts stay with the job. Read them with `dvm messages <job-id> --no-stream`; `has_artifacts` and `artifact_count` say what the job holds when known. `no_open_ask` means nothing is waiting for an answer: wait for the next ask with `dvm messages <job-id> --wait` and decline then. `decline_unsupported` means the DVM predates decline and the job is still running.
|
|
51
51
|
- **Halt the work now:** `dvm cancel <job-id>` cancels immediately with no confirmation and spends no new money. It charges every paid piece, including the one in progress, and its `display` names that amount, e.g. "Stopped. The $0.36 USD paid for the work in progress is not refunded." Use it only when the work must stop before the next ask.
|
|
52
52
|
|
|
53
53
|
Both commands wait and resend automatically while the DVM is still verifying a payment. If they still return `payment_in_progress`, nothing changed: run the same command again in a few seconds and do not pay again.
|
package/skills/dvm/recovery.md
CHANGED
|
@@ -31,7 +31,7 @@ Preserve these identifiers exactly as opaque strings; do not rebuild them from p
|
|
|
31
31
|
|
|
32
32
|
| Surface | Promised recovery fields and meaning |
|
|
33
33
|
| --- | --- |
|
|
34
|
-
| Request submission and `request-result` / `request-resume` output | `request_id`, when a public request ID was supplied, identifies the original signed request. Recovered output has `request_id` and `jobId`; a live recovered job has a `poll` action with that same ID in `job_id`, and a terminal recovered job has `next_action: null`. Structured unknown-outcome errors retain `error.request_id` and `error.status: "unknown"` where emitted. |
|
|
34
|
+
| Request submission and `request-result` / `request-resume` output | `request_id`, when a public request ID was supplied, identifies the original signed request. Recovered output has `request_id` and `jobId`; a live recovered job has a `poll` action with that same ID in `job_id`, and a terminal recovered job has `next_action: null`. Structured unknown-outcome errors retain `error.request_id` and `error.status: "unknown"` where emitted. A `dvm request` the CLI refused before sending anything carries `error.submitted: false`; the lookup commands then fail with `error.code: "request_not_submitted"`, `error.status: "not_submitted"`, `error.submitted: false`, `error.refusal_code`, optional `error.refusal_reason`, and `error.refused_at` (ISO-8601). |
|
|
35
35
|
| `wallet submissions` entries in `pending_submissions` | `request_id` is the wallet journal's request UUID. Optional `public_request_id` is the signed request ID used by `request-result`; these IDs can differ. `state: "reclaimable"` means retries have stopped but a refund clause can return unredeemed funds; `reclaim_at` is its ISO-8601 eligibility time. `state: "reclaim_failed"` means reclaim was attempted unsuccessfully; `reclaim_error` is the string reason. Both states retain recoverable records and are excluded from `stranded_count`. Forgetting them requires explicit `--force` as well as confirmation. |
|
|
36
36
|
| Credit recovery records and notices | `credit_id` identifies the credit reported by the operation, `fund_id` is its reported funding idempotency key, and `drain_id` identifies the original refund where emitted. A reconciled credit ID can differ from the one requested: follow the returned ID. Deferred notices have the exception below. A returned `drain_command` is the command for that recorded reclaim, not permission to create another payment. The rest of funding output is outside this promise. |
|
|
37
37
|
| `wallet recover-submission` output | `request_id` is the exact wallet journal UUID; `recovery_attempts` is a number and `job_id` is a string or null. Its recovery action is `verify_receipt` with string `job_id` when a job was recovered, or `lookup_receipt` with string `request_id` when no job ID was established. These actions request verification/lookup, never a second payment. |
|
|
@@ -44,7 +44,7 @@ These command forms and safeguards are promised:
|
|
|
44
44
|
|
|
45
45
|
| Command or action | Prerequisites and effect |
|
|
46
46
|
| --- | --- |
|
|
47
|
-
| `dvm request-result <request-id>` | Requires the saved request intent and original signing identity. Reads the original accepted job without submitting a replacement or sending payment credentials. Missing state or not found leaves the payment outcome unknown. |
|
|
47
|
+
| `dvm request-result <request-id>` | Requires the saved request intent and original signing identity. Reads the original accepted job without submitting a replacement or sending payment credentials. Missing state or not found leaves the payment outcome unknown, except `request_not_submitted`: the CLI recorded refusing that request ID before sending it, so no job or payment exists and retrying the same approved request is safe. A saved intent always takes precedence over that record. |
|
|
48
48
|
| `dvm request-resume <request-id>` | First tries `request-result`; only a not-found result allows the dedicated resume route to finish a durably accepted request. Uses the original intent and signer without payment credentials, then reads the canonical result. |
|
|
49
49
|
| `next_action.type: "resubmit"` | Has string `command` and `hint`, and `requires_user_approval: true`. `command` is a shell-ready `dvm request …` preserving the original request and safety options with the stated adjustments. Run it only after the user approves and the prior outcome permits resubmission. There is no separate `request-resubmit` command. |
|
|
50
50
|
| `dvm wallet recover-submission <request-id> --binding-fingerprint <sha256>` | Requires the exact journal UUID and original binding fingerprint. Under the wallet lock it permits one recovery attempt using the same payment, records that attempt before I/O, and leaves unrelated submissions untouched. An unknown outcome consumes that attempt; verification or lookup must follow. |
|
|
@@ -60,10 +60,11 @@ Cold starts do not justify replaying an arbitrary command. The CLI already retri
|
|
|
60
60
|
| Known state | Next step |
|
|
61
61
|
| --- | --- |
|
|
62
62
|
| A job ID exists | Inspect `dvm status <job-id>` and its messages. Continue that job's requested action. After payment, resume messages rather than submit a replacement. |
|
|
63
|
-
| A request ID exists but the job outcome is unknown | Use `dvm request-result <request-id>` with the original caller state. Follow the returned recovery guidance, including `dvm request-resume <request-id>` when appropriate. Missing state or a not-found response does not authorize a new payment. |
|
|
63
|
+
| A request ID exists but the job outcome is unknown | Use `dvm request-result <request-id>` with the original caller state. Follow the returned recovery guidance, including `dvm request-resume <request-id>` when appropriate. Missing state or a not-found response does not authorize a new payment. A `request_not_submitted` response (or `submitted: false` on the refusal itself) means nothing was sent under that ID; fix the refusal reason and retry the same approved request. |
|
|
64
64
|
| The CLI reports committed or uncertain wallet spend, including `spend_committed` or `float_payment_unknown` | Run `dvm wallet show` to reconcile and inspect the result before any retry. |
|
|
65
65
|
| Credit funding or a refund remains pending | Preserve its funding or credit ID and follow the CLI's named reconcile action. Do not create a second funding while the first may settle. |
|
|
66
66
|
| A job is waiting on a charge nobody approved | Relay the `pay` action's `display`, including its deadline and what stopping costs. To stop and keep the finished work, run `dvm decline <job-id>`; run `dvm cancel <job-id>` only to halt the work now, which charges the work in progress. Do not cancel to get money back. |
|
|
67
|
+
| `dvm pay` returned `payment_unconfirmed`, or a held payment's hint names no `dvm pay` re-send | An earlier payment for that charge may still be accepted, and no new payment was signed. Follow the error's hint: watch with `dvm messages <job-id> --wait`, or end the job with `dvm decline <job-id>` or `dvm cancel <job-id>`. Do not pay the charge another way. Forgetting its wallet submission does not release the charge. |
|
|
67
68
|
| `cancel` or `decline` returned `payment_in_progress` | Nothing changed and a payment is still being verified. Run the same command again in a few seconds; do not pay again. |
|
|
68
69
|
| A receipt `settlement` shows `overcharged: true`, or the CLI warns of a credit balance mismatch | Keep the receipt (`dvm receipts show <job-id>`) and the credit record. Report the charge and the stated ceiling to the human. Do not pay further charges from that provider without new approval. |
|
|
69
70
|
|
|
@@ -427,6 +427,9 @@ export {
|
|
|
427
427
|
info,
|
|
428
428
|
raw,
|
|
429
429
|
progress,
|
|
430
|
+
resolveBtcUsdRate,
|
|
431
|
+
tryResolveBtcUsdRate,
|
|
432
|
+
staleRateNotice,
|
|
430
433
|
formatSats,
|
|
431
434
|
formatAmount,
|
|
432
435
|
formatPaymentAmount,
|
|
@@ -435,8 +438,5 @@ export {
|
|
|
435
438
|
parseBudget,
|
|
436
439
|
assertValidBudget,
|
|
437
440
|
formatAmountBestEffort,
|
|
438
|
-
resolveBtcUsdRate,
|
|
439
|
-
tryResolveBtcUsdRate,
|
|
440
|
-
staleRateNotice,
|
|
441
441
|
tryX402Payment
|
|
442
442
|
};
|