@dvmkit/dvm-cli 0.2.0 → 0.3.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
@@ -13,6 +13,12 @@ If the earlier `@dvmkit/cli` package is installed globally, remove it first with
13
13
 
14
14
  The bundled agent skill is exported as `@dvmkit/dvm-cli/skill`. Documentation lives at [dvmkit.ai](https://dvmkit.ai).
15
15
 
16
+ ## Community
17
+
18
+ Bug reports and discussions are welcome, but this repository does not accept unsolicited pull requests, including documentation and typo fixes. Send reproducible defects through the [bug report form](https://github.com/dvmkit/dvm-cli/issues/new/choose), take features and design questions to [Discussions](https://github.com/dvmkit/dvm-cli/discussions), and report suspected vulnerabilities only through the private route in [SECURITY.md](SECURITY.md).
19
+
20
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the contribution policy, [SUPPORT.md](SUPPORT.md) for support boundaries, the [Code of Conduct](CODE_OF_CONDUCT.md), and [TRADEMARKS.md](TRADEMARKS.md) for the distinction between Apache-licensed code and dvmkit names and marks.
21
+
16
22
  ## Portable job access
17
23
 
18
24
  `status`, `messages`, `message`, and `cancel` can follow a job from another machine when both its provider endpoint and job token are available. Prefer environment variables so the bearer token does not enter shell history or the process list:
@@ -33,7 +39,7 @@ Every request to a DVM or the managed dvmkit platform identifies the caller vers
33
39
 
34
40
  Use the exact Node.js release in `.nvmrc`. Install with `node scripts/pinned-npm.mjs ci --ignore-scripts`, then run the same local gate as CI with `node scripts/pinned-npm.mjs run verify`. The bootstrap downloads the exact npm release declared in `package.json`, verifies its integrity before every extraction, and keeps it under the ignored repository-local `.tooling/` directory.
35
41
 
36
- `npm run verify` builds the CLI, runs ESLint, type-checks, runs unit and standalone mock-provider contract tests, verifies the packed package and bundled skill upgrade path, scans the repository/package/Git/optional pull-request body for public-safety violations, then proves a clean locked install can build, type-check, and pass the tests.
42
+ `npm run verify` checks repository metadata in the checkout, copies only tracked and unignored source into an isolated directory, installs its locked dependencies, and runs lint, build, typecheck, the full test suite, package/upgrade smoke, packed-artifact safety, and release checks there. The clean source tree owns the only complete build and test pass, so verification cannot reuse the checkout's `node_modules` or pre-existing `dist`; after every check passes, its verified `dist` replaces the checkout's build output for release packaging.
37
43
 
38
44
  The repository scan leaves an ignored, untracked root `.kiln/` runtime directory in place. Git-tracked runtime files, nested directories with the same name, explicit scan roots, and packed-package contents remain subject to the public-safety checks.
39
45
 
@@ -10,13 +10,29 @@ import {
10
10
  resolveRpcHttpTransportOptions,
11
11
  resolveRpcOverride,
12
12
  updateConfig
13
- } from "./chunk-EGY4KDBW.js";
13
+ } from "./chunk-SKKZ4OAA.js";
14
14
 
15
- // node_modules/@dvmkit/sdk/dist/chunk-ANFX5HEG.js
15
+ // node_modules/@dvmkit/sdk/dist/chunk-2UUXIIOC.js
16
16
  var TEMPO_USDC_MAINNET = "0x20C000000000000000000000b9537d11c60E8b50";
17
17
  var TEMPO_CHAIN_ID = 4217;
18
- function resolveTempoAsset(env = process.env) {
19
- const address = env.DVM_TEMPO_CURRENCY ?? TEMPO_USDC_MAINNET;
18
+ var TEMPO_MODERATO_CHAIN_ID = 42431;
19
+ var TEMPO_PATH_USD_MODERATO = "0x20c0000000000000000000000000000000000000";
20
+ var TEMPO_MODERATO_RPC = "https://rpc.moderato.tempo.xyz";
21
+ function resolveTempoNetwork(network = "mainnet") {
22
+ return network === "moderato" ? {
23
+ network,
24
+ chainId: TEMPO_MODERATO_CHAIN_ID,
25
+ rpcUrl: TEMPO_MODERATO_RPC,
26
+ defaultToken: TEMPO_PATH_USD_MODERATO
27
+ } : {
28
+ network,
29
+ chainId: TEMPO_CHAIN_ID,
30
+ rpcUrl: "https://rpc.tempo.xyz",
31
+ defaultToken: TEMPO_USDC_MAINNET
32
+ };
33
+ }
34
+ function resolveTempoAsset(env = process.env, network = "mainnet") {
35
+ const address = env.DVM_TEMPO_CURRENCY ?? resolveTempoNetwork(network).defaultToken;
20
36
  if (!HEX_ADDRESS_RE.test(address)) {
21
37
  throw new DvmError(
22
38
  "tempo_config_invalid",
@@ -57,7 +73,9 @@ function tempoWrongAssetHint(asset) {
57
73
  return `This rail settles only in ${asset.label} (${asset.address}) on Tempo. Another Tempo dollar \u2014 USDT0 or any other stablecoin \u2014 is a different contract and will never show up here, however much of it your wallet says you hold. If you funded with the wrong one, swap it to ${asset.label} on Tempo (an on-chain swap, fees are sub-cent) or send ${asset.label} to this address.`;
58
74
  }
59
75
  function tempoTokenSymbol(address) {
60
- return address.toLowerCase() === TEMPO_USDC_MAINNET.toLowerCase() ? "USDC.e" : null;
76
+ if (address.toLowerCase() === TEMPO_USDC_MAINNET.toLowerCase()) return "USDC.e";
77
+ if (address.toLowerCase() === TEMPO_PATH_USD_MODERATO.toLowerCase()) return "pathUSD";
78
+ return null;
61
79
  }
62
80
  var HEX_ADDRESS_RE = /^0x[0-9a-fA-F]{40}$/;
63
81
  async function connectedTempoAccount() {
@@ -82,7 +100,7 @@ async function generateTempoKey(opts = {}) {
82
100
  );
83
101
  }
84
102
  if (existing && opts.force) {
85
- const { assertTempoWalletIdle } = await import("./tempo-lifecycle-SQL3KLEZ-AATA2SKI.js");
103
+ const { assertTempoWalletIdle } = await import("./tempo-lifecycle-DFIXQ54Q-LNXPKWK5.js");
86
104
  await assertTempoWalletIdle("replace");
87
105
  }
88
106
  const { privateKeyToAccount, generatePrivateKey } = await import("./accounts-2WZE4N5F.js");
@@ -90,22 +108,30 @@ async function generateTempoKey(opts = {}) {
90
108
  const account = privateKeyToAccount(privateKey);
91
109
  const generated = {
92
110
  privateKey,
93
- address: account.address.toLowerCase()
111
+ address: account.address.toLowerCase(),
112
+ network: opts.network ?? "mainnet"
94
113
  };
95
114
  await opts.beforePersist?.(generated);
96
115
  await updateConfig({
97
116
  reason: "tempo_wallet_generate",
98
- patch: () => ({ set: { tempo: { method: "tempo", apiKey: privateKey } } })
117
+ patch: () => ({
118
+ set: {
119
+ tempo: { method: "tempo", apiKey: privateKey, network: generated.network }
120
+ }
121
+ })
99
122
  });
100
123
  return generated;
101
124
  }
102
125
  async function getTempoUsdcBalance(account) {
103
- const tokenAddress = resolveTempoAsset().address;
126
+ const accountNetwork = account.network ?? "mainnet";
127
+ const network = resolveTempoNetwork(accountNetwork);
128
+ const tokenAddress = resolveTempoAsset(process.env, accountNetwork).address;
104
129
  const { createPublicClient, http, erc20Abi } = await import("./_esm-MN4BUYV6.js");
105
- const { tempo } = await import("./chains-LJ7XK6H3.js");
130
+ const { tempo, tempoModerato } = await import("./chains-LJ7XK6H3.js");
131
+ const chain = accountNetwork === "moderato" ? tempoModerato : tempo;
106
132
  const { url: rpcUrl, source: rpcSource } = resolveRpcOverride(
107
133
  process.env.DVM_TEMPO_RPC_URL,
108
- tempo.rpcUrls.default.http[0]
134
+ network.rpcUrl
109
135
  );
110
136
  try {
111
137
  const transportOptions = resolveRpcHttpTransportOptions(
@@ -113,7 +139,7 @@ async function getTempoUsdcBalance(account) {
113
139
  process.env.DVM_TEMPO_RPC_HEADERS_JSON
114
140
  );
115
141
  const client = createPublicClient({
116
- chain: tempo,
142
+ chain,
117
143
  transport: transportOptions ? http(rpcUrl, transportOptions) : http(rpcUrl)
118
144
  });
119
145
  const raw = await client.readContract({
@@ -127,7 +153,7 @@ async function getTempoUsdcBalance(account) {
127
153
  rawBaseUnits: raw,
128
154
  usdc: Number(raw) / 1e6,
129
155
  tokenAddress,
130
- chainId: TEMPO_CHAIN_ID,
156
+ chainId: network.chainId,
131
157
  // internal-review: redacted here rather than at a display surface, so the clear
132
158
  // endpoint never leaves this function on the success path either.
133
159
  rpcUrlRedacted: redactUrl(rpcUrl),
@@ -159,7 +185,7 @@ async function tempoAccountFromConfig(config) {
159
185
  if (!apiKey || !isValidEvmPrivateKey(apiKey)) return null;
160
186
  const privateKey = apiKey;
161
187
  const address = await deriveTempoAddress(privateKey);
162
- return { privateKey, address };
188
+ return { privateKey, address, network: config.tempo.network ?? "mainnet" };
163
189
  }
164
190
  function invalidTempoPrivateKey() {
165
191
  return new DvmError(
@@ -172,6 +198,10 @@ function invalidTempoPrivateKey() {
172
198
  export {
173
199
  TEMPO_USDC_MAINNET,
174
200
  TEMPO_CHAIN_ID,
201
+ TEMPO_MODERATO_CHAIN_ID,
202
+ TEMPO_PATH_USD_MODERATO,
203
+ TEMPO_MODERATO_RPC,
204
+ resolveTempoNetwork,
175
205
  resolveTempoAsset,
176
206
  tempoTokenLabel,
177
207
  tempoTokenReference,