@dvmkit/dvm-cli 0.16.0 → 0.18.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/README.md CHANGED
@@ -30,7 +30,7 @@ Keep the skill and CLI on the same package version. After `npm update --global @
30
30
 
31
31
  ## First job
32
32
 
33
- For a first job, ask your agent: "Load the dvm skill, find a service for my task, and show me its price before spending." The skill's calling procedure takes over from discovery through submitting a job and retrieving its result. If payment is needed, its wallet procedure explains the human steps for connecting or funding a wallet. Commands return structured JSON by default; use `--human` for direct terminal reading.
33
+ For a first job, ask your agent: "Load the dvm skill, find a service for my task, and show me its price before spending." The skill's calling procedure takes over from discovery through submitting a job and retrieving its result. If payment is needed, its wallet procedure explains the human steps for connecting or funding a wallet. Commands return structured JSON by default; use `--human` for direct terminal reading. `dvm messages <job-id> --wait` instead writes one JSON object per line as the job runs, ending with a `result` or `error` line; the [calling procedure](skills/dvm/calling.md#run-and-deliver) explains how to read it.
34
34
 
35
35
  ## What's in the package
36
36
 
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_PINNED_FILE,
9
9
  ensureConfigDir,
10
10
  require_proper_lockfile
11
- } from "./chunk-U2PODYIS.js";
11
+ } from "./chunk-THTPKBZX.js";
12
12
  import {
13
13
  DvmError
14
14
  } from "./chunk-DGA5EFKU.js";
@@ -301,8 +301,8 @@ var PROTECTED_FIELDS = {
301
301
  };
302
302
  var CONFIG_PATH_SHAPE = {
303
303
  float: { statedBudget: {}, connectedAt: {}, alias: {}, methods: {} },
304
- x402: { privateKey: {}, network: {} },
305
- tempo: { method: {}, accountId: {}, apiKey: {}, network: {} },
304
+ x402: { privateKey: {}, network: {}, generated: {} },
305
+ tempo: { method: {}, accountId: {}, apiKey: {}, network: {}, generated: {} },
306
306
  credit: {
307
307
  targetJobs: {},
308
308
  posture: {},
@@ -4,11 +4,11 @@ const require = __dvmCreateRequire(import.meta.url);
4
4
  import {
5
5
  loadConfig,
6
6
  updateConfig
7
- } from "./chunk-WRIXUSMR.js";
7
+ } from "./chunk-ESQ6DCS3.js";
8
8
  import {
9
9
  tempoAccountFromConfig,
10
10
  tryResolveTempoAsset
11
- } from "./chunk-U2PODYIS.js";
11
+ } from "./chunk-THTPKBZX.js";
12
12
  import {
13
13
  DvmError
14
14
  } from "./chunk-DGA5EFKU.js";
@@ -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-GAM3DJ63.js");
49
+ const { assertTempoWalletIdle } = await import("./tempo-lifecycle-WGTX6MJR.js");
50
50
  await assertTempoWalletIdle("replace");
51
51
  }
52
52
  const { privateKeyToAccount, generatePrivateKey } = await import("./accounts-2WZE4N5F.js");
@@ -62,7 +62,7 @@ async function generateTempoKey(opts = {}) {
62
62
  reason: "tempo_wallet_generate",
63
63
  patch: () => ({
64
64
  set: {
65
- tempo: { method: "tempo", apiKey: privateKey, network: generated.network }
65
+ tempo: { method: "tempo", apiKey: privateKey, network: generated.network, generated: true }
66
66
  }
67
67
  })
68
68
  });
@@ -5,7 +5,7 @@ import {
5
5
  formatUsdcMicrounits,
6
6
  listX402Channels,
7
7
  readX402ChannelGuardFacts
8
- } from "./chunk-U2PODYIS.js";
8
+ } from "./chunk-THTPKBZX.js";
9
9
  import {
10
10
  DvmError
11
11
  } from "./chunk-DGA5EFKU.js";
@@ -12,7 +12,7 @@ import {
12
12
  isSignableExactRequirement,
13
13
  maxAdvertisedMicro,
14
14
  withinAdvertisedTolerance
15
- } from "./chunk-U2PODYIS.js";
15
+ } from "./chunk-THTPKBZX.js";
16
16
  import {
17
17
  DvmError,
18
18
  X402_V1_VERSION,
@@ -106,6 +106,9 @@ function json(data) {
106
106
  const out = _traceId !== null && typeof data === "object" && data !== null && !Array.isArray(data) && !("trace_id" in data) ? { trace_id: _traceId, ...data } : data;
107
107
  writeAllSync(1, JSON.stringify(out) + "\n");
108
108
  }
109
+ function jsonEvent(data) {
110
+ writeAllSync(1, JSON.stringify(data) + "\n");
111
+ }
109
112
  function info(msg) {
110
113
  writeAllSync(2, msg + "\n");
111
114
  }
@@ -454,12 +457,10 @@ export {
454
457
  setOutputTraceId,
455
458
  getOutputTraceId,
456
459
  json,
460
+ jsonEvent,
457
461
  info,
458
462
  raw,
459
463
  progress,
460
- resolveBtcUsdRate,
461
- tryResolveBtcUsdRate,
462
- staleRateNotice,
463
464
  formatSats,
464
465
  formatAmount,
465
466
  formatPaymentAmount,
@@ -468,5 +469,8 @@ export {
468
469
  parseBudget,
469
470
  assertValidBudget,
470
471
  formatAmountBestEffort,
472
+ resolveBtcUsdRate,
473
+ tryResolveBtcUsdRate,
474
+ staleRateNotice,
471
475
  tryX402Payment
472
476
  };
@@ -96817,6 +96817,7 @@ export {
96817
96817
  u64Lengths,
96818
96818
  copyBytes,
96819
96819
  base64,
96820
+ bech32,
96820
96821
  X402_SELF_RELAY_KEY,
96821
96822
  X402_RECEIVER_AUTHORIZER_KEY,
96822
96823
  X402_BATCH_SETTLEMENT_KEY,
@@ -5,11 +5,11 @@ import {
5
5
  authorizeProtectedRemoval,
6
6
  loadConfig,
7
7
  updateConfig
8
- } from "./chunk-WRIXUSMR.js";
8
+ } from "./chunk-ESQ6DCS3.js";
9
9
  import {
10
10
  withX402ChannelLock,
11
11
  x402WalletFromConfig
12
- } from "./chunk-U2PODYIS.js";
12
+ } from "./chunk-THTPKBZX.js";
13
13
  import {
14
14
  DvmError,
15
15
  X402_DEFAULT_NETWORK,
@@ -58,7 +58,7 @@ async function repinX402WalletNetwork(network) {
58
58
  const privateKey = current.x402?.privateKey;
59
59
  if (privateKey === void 0) throw x402WalletMissingError();
60
60
  if (!isValidEvmPrivateKey(privateKey)) throw invalidX402PrivateKey();
61
- return { set: { x402: { privateKey, network } } };
61
+ return { set: { x402: { privateKey, network, ...current.x402?.generated === true ? { generated: true } : {} } } };
62
62
  }
63
63
  });
64
64
  const stored = previous?.x402;
@@ -72,7 +72,7 @@ async function repinX402WalletNetwork(network) {
72
72
  };
73
73
  });
74
74
  }
75
- async function saveX402Wallet(privateKey, network) {
75
+ async function saveX402Wallet(privateKey, network, generated = false) {
76
76
  if (network !== void 0) assertSupportedX402Network(network);
77
77
  if (!isValidEvmPrivateKey(privateKey)) throw invalidX402PrivateKey();
78
78
  const { privateKeyToAccount } = await import("./accounts-2WZE4N5F.js");
@@ -83,7 +83,7 @@ async function saveX402Wallet(privateKey, network) {
83
83
  patch: (current) => {
84
84
  resolved = network ?? current?.x402?.network;
85
85
  return {
86
- set: { x402: resolved === void 0 ? { privateKey } : { privateKey, network: resolved } }
86
+ set: { x402: { privateKey, ...resolved === void 0 ? {} : { network: resolved }, ...generated ? { generated: true } : {} } }
87
87
  };
88
88
  }
89
89
  });