@dvmkit/dvm-cli 0.18.0 → 0.19.1
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/README.md +8 -0
- package/dist/{chunk-ESQ6DCS3.js → chunk-3NXAIRFF.js} +2 -2
- package/dist/{chunk-RYFCHR6Z.js → chunk-7HJ5ZR3D.js} +9 -4
- package/dist/{chunk-REIUNZQX.js → chunk-B5KW2TPR.js} +2 -2
- package/dist/{chunk-DGA5EFKU.js → chunk-DF2OWCRY.js} +6 -6
- package/dist/{chunk-OEWENVJ7.js → chunk-MM646MFM.js} +4 -4
- package/dist/{chunk-VSOIBYBF.js → chunk-NCX4JVLU.js} +345 -49
- 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-PY4T2DOA.js} +6 -6
- package/dist/dvm.js +396 -74
- 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-U4VK5WGO.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/calling.md +3 -1
- package/skills/dvm/credit.md +4 -0
- package/skills/dvm/recovery.md +4 -0
- package/skills/dvm/wallets.md +3 -1
package/README.md
CHANGED
|
@@ -10,9 +10,17 @@ Requires Node.js 22 or later.
|
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
npm install --global @dvmkit/dvm-cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Try it
|
|
16
|
+
|
|
17
|
+
```sh
|
|
13
18
|
dvm init
|
|
19
|
+
dvm request -d dvmkit--stakeout/peek --data '{"cameras":["kiruna"]}'
|
|
14
20
|
```
|
|
15
21
|
|
|
22
|
+
Get a one-time grade of the live Kiruna aurora camera for free, with no wallet or payment; see [Stakeout](https://dvmkit.com/dvmkit/stakeout) for more capabilities.
|
|
23
|
+
|
|
16
24
|
`dvm init` returns JSON with `status: "created"` on first setup and the message "Local setup is ready. Nothing has been funded yet, so nothing can be spent yet." It also reports the configuration path and wallet setup steps.
|
|
17
25
|
|
|
18
26
|
## For agents
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
CONFIG_PINNED_FILE,
|
|
9
9
|
ensureConfigDir,
|
|
10
10
|
require_proper_lockfile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-X6BETQ7V.js";
|
|
12
12
|
import {
|
|
13
13
|
DvmError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DF2OWCRY.js";
|
|
15
15
|
import {
|
|
16
16
|
__toESM
|
|
17
17
|
} from "./chunk-IYHTITNZ.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
isSignableExactRequirement,
|
|
13
13
|
maxAdvertisedMicro,
|
|
14
14
|
withinAdvertisedTolerance
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-X6BETQ7V.js";
|
|
16
16
|
import {
|
|
17
17
|
DvmError,
|
|
18
18
|
X402_V1_VERSION,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
usdcToMsats,
|
|
31
31
|
x402NetworkByCaip2,
|
|
32
32
|
x402NetworkToCaip2
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-DF2OWCRY.js";
|
|
34
34
|
|
|
35
35
|
// src/lib/x402/client.ts
|
|
36
36
|
import { randomBytes } from "crypto";
|
|
@@ -52,15 +52,19 @@ function withJobPersistence(run, warn) {
|
|
|
52
52
|
|
|
53
53
|
// src/lib/output.ts
|
|
54
54
|
var warnings = new AsyncLocalStorage2();
|
|
55
|
+
function withOutputWarningContext(run) {
|
|
56
|
+
return warnings.run([], run);
|
|
57
|
+
}
|
|
55
58
|
function withOutputWarnings(run, human) {
|
|
56
|
-
|
|
59
|
+
const collect = () => withJobPersistence(run, ({ accessPreserved, accessUnpreserved }) => {
|
|
57
60
|
const hint = accessUnpreserved ? "Job access was not preserved. Supply --endpoint <url> and --job-token <hex>, or DVM_JOB_ENDPOINT and DVM_JOB_TOKEN, to read this job; do not submit or pay again." : "Refresh the job with dvm status <job_id> --messages before paying or submitting a replacement.";
|
|
58
61
|
addOutputWarnings([{
|
|
59
62
|
code: "local_job_state_unsaved",
|
|
60
63
|
display: "The provider's outcome is unchanged, but local job state could not be saved and may lag. Automatic payments are paused for this command." + (accessUnpreserved ? ` ${hint}` : accessPreserved ? ` Job access is preserved privately. ${hint}` : ""),
|
|
61
64
|
hint
|
|
62
65
|
}], human);
|
|
63
|
-
})
|
|
66
|
+
});
|
|
67
|
+
return warnings.getStore() ? collect() : withOutputWarningContext(collect);
|
|
64
68
|
}
|
|
65
69
|
function sameWarning(prior, entry) {
|
|
66
70
|
if (prior.code === "local_job_state_unsaved" && entry.code === "local_job_state_unsaved") return true;
|
|
@@ -452,6 +456,7 @@ async function priceableRate(btcRate) {
|
|
|
452
456
|
export {
|
|
453
457
|
jobPersistence,
|
|
454
458
|
hasUnsavedJobState,
|
|
459
|
+
withOutputWarningContext,
|
|
455
460
|
withOutputWarnings,
|
|
456
461
|
addOutputWarnings,
|
|
457
462
|
setOutputTraceId,
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
formatUsdcMicrounits,
|
|
6
6
|
listX402Channels,
|
|
7
7
|
readX402ChannelGuardFacts
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-X6BETQ7V.js";
|
|
9
9
|
import {
|
|
10
10
|
DvmError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DF2OWCRY.js";
|
|
12
12
|
|
|
13
13
|
// src/lib/x402/lifecycle.ts
|
|
14
14
|
async function assertX402WalletIdle(wallet, intent) {
|
|
@@ -3,7 +3,7 @@ import { createRequire as __dvmCreateRequire } from "node:module";
|
|
|
3
3
|
const require = __dvmCreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
diagnosticConsole
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WCX4PNEF.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
9
|
} from "./chunk-IYHTITNZ.js";
|
|
@@ -120,7 +120,7 @@ function isOpaqueToken(segment) {
|
|
|
120
120
|
return false;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
// node_modules/@dvmkit/sdk/dist/chunk-
|
|
123
|
+
// node_modules/@dvmkit/sdk/dist/chunk-LPGORCIO.js
|
|
124
124
|
var X402_DEFAULT_FACILITATOR = "https://x402.org/facilitator";
|
|
125
125
|
var DvmError = class extends Error {
|
|
126
126
|
constructor(code, message2, hint, data, display, proseSources) {
|
|
@@ -3063,7 +3063,7 @@ var schnorr = /* @__PURE__ */ (() => {
|
|
|
3063
3063
|
};
|
|
3064
3064
|
})();
|
|
3065
3065
|
|
|
3066
|
-
// node_modules/@dvmkit/sdk/dist/chunk-
|
|
3066
|
+
// node_modules/@dvmkit/sdk/dist/chunk-B5ZJZ2PG.js
|
|
3067
3067
|
function resolveX402Asset(network = X402_DEFAULT_NETWORK) {
|
|
3068
3068
|
const spec = x402NetworkByCaip2(network);
|
|
3069
3069
|
if (!spec) return null;
|
|
@@ -3176,7 +3176,7 @@ function buildNoopLoggers() {
|
|
|
3176
3176
|
};
|
|
3177
3177
|
}
|
|
3178
3178
|
|
|
3179
|
-
// node_modules/@dvmkit/sdk/dist/chunk-
|
|
3179
|
+
// node_modules/@dvmkit/sdk/dist/chunk-BU2MAVRZ.js
|
|
3180
3180
|
import { AsyncLocalStorage } from "async_hooks";
|
|
3181
3181
|
import { createPrivateKey, randomBytes as randomBytes2 } from "crypto";
|
|
3182
3182
|
|
|
@@ -10668,7 +10668,7 @@ var SignJWT = class {
|
|
|
10668
10668
|
}
|
|
10669
10669
|
};
|
|
10670
10670
|
|
|
10671
|
-
// node_modules/@dvmkit/sdk/dist/chunk-
|
|
10671
|
+
// node_modules/@dvmkit/sdk/dist/chunk-BU2MAVRZ.js
|
|
10672
10672
|
var scopes = new AsyncLocalStorage();
|
|
10673
10673
|
function withPaymentDiagnostics(fn) {
|
|
10674
10674
|
return scopes.run({}, fn);
|
|
@@ -10931,7 +10931,7 @@ function logRejected(stage) {
|
|
|
10931
10931
|
});
|
|
10932
10932
|
}
|
|
10933
10933
|
|
|
10934
|
-
// node_modules/@dvmkit/sdk/dist/chunk-
|
|
10934
|
+
// node_modules/@dvmkit/sdk/dist/chunk-4I7ALDKJ.js
|
|
10935
10935
|
async function verifyX402Payment(paymentHeader, config, requiredUsdcMicro, resource, btcUsdRate, exactVersions = { v1: true, v2: true }, declaration) {
|
|
10936
10936
|
return callerLoggers.x402.span(
|
|
10937
10937
|
"x402.verify_payment",
|
|
@@ -4,14 +4,14 @@ const require = __dvmCreateRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
loadConfig,
|
|
6
6
|
updateConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3NXAIRFF.js";
|
|
8
8
|
import {
|
|
9
9
|
tempoAccountFromConfig,
|
|
10
10
|
tryResolveTempoAsset
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-X6BETQ7V.js";
|
|
12
12
|
import {
|
|
13
13
|
DvmError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DF2OWCRY.js";
|
|
15
15
|
|
|
16
16
|
// src/lib/payment-rails/tempo-wallet.ts
|
|
17
17
|
function tempoBalanceCheckHint(token) {
|
|
@@ -46,7 +46,7 @@ async function generateTempoKey(opts = {}) {
|
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
if (existing && opts.force) {
|
|
49
|
-
const { assertTempoWalletIdle } = await import("./tempo-lifecycle-
|
|
49
|
+
const { assertTempoWalletIdle } = await import("./tempo-lifecycle-QGJ4JEHN.js");
|
|
50
50
|
await assertTempoWalletIdle("replace");
|
|
51
51
|
}
|
|
52
52
|
const { privateKeyToAccount, generatePrivateKey } = await import("./accounts-2WZE4N5F.js");
|