@needmoretruth/nmts-cli 0.35.0 → 0.36.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.
Files changed (118) hide show
  1. package/AGENTS.md +11 -12
  2. package/CHANGELOG.md +35 -0
  3. package/README.ko.md +19 -21
  4. package/README.md +21 -22
  5. package/dist/account.js +2 -1
  6. package/dist/arg-options.d.ts +3 -1
  7. package/dist/artifact-about.d.ts +1 -1
  8. package/dist/autonomy.d.ts +3 -10
  9. package/dist/autonomy.js +15 -17
  10. package/dist/bytes.d.ts +15 -0
  11. package/dist/bytes.js +63 -0
  12. package/dist/collision.d.ts +5 -5
  13. package/dist/collision.js +19 -22
  14. package/dist/commands/delete-account.js +1 -1
  15. package/dist/commands/erase.js +1 -1
  16. package/dist/commands/get.js +1 -1
  17. package/dist/commands/listfile.js +1 -1
  18. package/dist/commands/mcp.js +5 -1
  19. package/dist/commands/mode.js +2 -2
  20. package/dist/commands/on-collision.d.ts +1 -1
  21. package/dist/commands/on-collision.js +3 -3
  22. package/dist/commands/platform.d.ts +9 -0
  23. package/dist/commands/platform.js +153 -0
  24. package/dist/commands/pull.js +1 -1
  25. package/dist/commands/push-wallet.js +2 -1
  26. package/dist/commands/push.js +6 -4
  27. package/dist/commands/put-wallet.js +5 -3
  28. package/dist/commands/put.js +8 -5
  29. package/dist/commands/receive.js +1 -1
  30. package/dist/commands/settings.js +1 -1
  31. package/dist/commands/share.js +1 -1
  32. package/dist/commands/support.js +3 -3
  33. package/dist/commands/unlock.js +2 -2
  34. package/dist/commands/wallet-hall.d.ts +4 -1
  35. package/dist/commands/wallet-hall.js +16 -8
  36. package/dist/commands/wallet-storage-ops.d.ts +4 -1
  37. package/dist/commands/wallet-storage-ops.js +7 -2
  38. package/dist/commands/wallet-swap.d.ts +3 -0
  39. package/dist/commands/wallet-swap.js +8 -4
  40. package/dist/commands/wallet.d.ts +1 -1
  41. package/dist/crypto.d.ts +8 -5
  42. package/dist/crypto.js +15 -61
  43. package/dist/download-sink-node.d.ts +49 -0
  44. package/dist/download-sink-node.js +204 -0
  45. package/dist/download-sink.d.ts +0 -48
  46. package/dist/download-sink.js +6 -199
  47. package/dist/download.js +5 -4
  48. package/dist/engine-node.d.ts +19 -0
  49. package/dist/engine-node.js +77 -0
  50. package/dist/env-vars.d.ts +20 -0
  51. package/dist/env-vars.js +27 -0
  52. package/dist/gate.js +1 -1
  53. package/dist/help.js +9 -4
  54. package/dist/host-contract.d.ts +7 -0
  55. package/dist/host-contract.js +95 -0
  56. package/dist/host-node.d.ts +27 -0
  57. package/dist/host-node.js +192 -0
  58. package/dist/host.d.ts +99 -0
  59. package/dist/host.js +59 -0
  60. package/dist/index.d.ts +6 -49
  61. package/dist/index.js +20 -45
  62. package/dist/main.js +7 -6
  63. package/dist/manifest-chunk-cache.d.ts +3 -3
  64. package/dist/manifest-chunk-cache.js +39 -44
  65. package/dist/manifest-chunk-flow.js +15 -14
  66. package/dist/manifest-write.js +1 -1
  67. package/dist/manifest.d.ts +2 -2
  68. package/dist/manifest.js +37 -34
  69. package/dist/mcp-tools/tiers.js +1 -1
  70. package/dist/network.d.ts +1 -1
  71. package/dist/network.js +6 -2
  72. package/dist/platform-sign.d.ts +143 -0
  73. package/dist/platform-sign.js +220 -0
  74. package/dist/portable.d.ts +59 -0
  75. package/dist/portable.js +82 -0
  76. package/dist/product.d.ts +1 -1
  77. package/dist/product.js +1 -1
  78. package/dist/progress-node.d.ts +2 -0
  79. package/dist/progress-node.js +14 -0
  80. package/dist/progress.d.ts +0 -1
  81. package/dist/progress.js +4 -8
  82. package/dist/redact.js +3 -2
  83. package/dist/registration.js +5 -2
  84. package/dist/risk.d.ts +7 -0
  85. package/dist/risk.js +10 -0
  86. package/dist/run-log.d.ts +4 -4
  87. package/dist/run-log.js +29 -36
  88. package/dist/seal.js +5 -4
  89. package/dist/server.d.ts +1 -1
  90. package/dist/server.js +6 -2
  91. package/dist/setup-questions.js +2 -2
  92. package/dist/upload-file-node.d.ts +3 -0
  93. package/dist/upload-file-node.js +38 -0
  94. package/dist/upload-file.d.ts +2 -2
  95. package/dist/upload-file.js +15 -45
  96. package/dist/upload-price-node.d.ts +8 -0
  97. package/dist/upload-price-node.js +37 -0
  98. package/dist/upload-price.d.ts +0 -8
  99. package/dist/upload-price.js +4 -33
  100. package/dist/upload-steps.js +4 -4
  101. package/dist/upload-store.d.ts +14 -14
  102. package/dist/upload-store.js +68 -75
  103. package/dist/upload-wallet-chain.js +3 -2
  104. package/dist/upload-wallet-put.js +2 -2
  105. package/dist/upload-wallet.js +16 -15
  106. package/dist/upload.js +16 -15
  107. package/dist/wallet-grant.js +1 -1
  108. package/dist/wallet-sign-seams.d.ts +12 -0
  109. package/dist/wallet-sign.js +10 -13
  110. package/dist/walrus-write.js +3 -2
  111. package/dist/walrus.d.ts +1 -16
  112. package/dist/walrus.js +11 -22
  113. package/docs/commands/credits.md +1 -1
  114. package/docs/commands/platform.md +15 -0
  115. package/docs/commands/support.md +1 -1
  116. package/docs/commands/trash.md +1 -1
  117. package/docs/commands/wallet.md +11 -7
  118. package/package.json +13 -2
package/dist/walrus.d.ts CHANGED
@@ -28,22 +28,7 @@ export declare const RELAY_HOSTS: Readonly<Record<string, readonly string[]>>;
28
28
  export declare const SUI_RPC_HOSTS: Readonly<Record<string, readonly string[]>>;
29
29
  /** How long one host gets before the next is tried. A read that stalls is a read that failed. */
30
30
  export declare const READ_TIMEOUT_MS = 60000;
31
- /**
32
- * Point reads at somebody else's aggregator, or at a development stack.
33
- *
34
- * ⚠ It replaces the list rather than adding to it, and that is deliberate: a run should read from
35
- * where it was told to read, not from there AND the public hosts. Comma-separated for more
36
- * than one, tried in the order given.
37
- */
38
- export declare const AGGREGATOR_ENV_VAR = "NMTS_AGGREGATOR";
39
- /**
40
- * Push writes through somebody else's relay, or through a development stack.
41
- *
42
- * ⚠ ONE host, not a list. Unlike reads there is nothing to fail over to — see `RELAY_HOSTS`.
43
- */
44
- export declare const RELAY_ENV_VAR = "NMTS_RELAY";
45
- /** Ask a different Sui JSON-RPC node the shard-count question. */
46
- export declare const SUI_RPC_ENV_VAR = "NMTS_SUI_RPC";
31
+ export { AGGREGATOR_ENV_VAR, RELAY_ENV_VAR, SUI_RPC_ENV_VAR } from "./env-vars.ts";
47
32
  /** The relay this run writes through: the environment's if it named one, else the network's. */
48
33
  export declare function relayHost(network: string): string;
49
34
  /**
package/dist/walrus.js CHANGED
@@ -10,7 +10,9 @@
10
10
  // them: here, the browser build, and the standalone recovery tool. One copy going stale shows
11
11
  // up as "file not found", which reads as "the file is gone" — so the machine holds them level
12
12
  // rather than a person remembering to.
13
+ import { AGGREGATOR_ENV_VAR, RELAY_ENV_VAR, SUI_RPC_ENV_VAR } from "./env-vars.js";
13
14
  import { NmtsError } from "./errors.js";
15
+ import { host as runtime } from "./host.js";
14
16
  /** Curated Walrus aggregator (read) endpoints per network, preference order. */
15
17
  export const AGGREGATOR_HOSTS = {
16
18
  testnet: ["https://aggregator.walrus-testnet.walrus.space"],
@@ -50,34 +52,21 @@ export const SUI_RPC_HOSTS = {
50
52
  };
51
53
  /** How long one host gets before the next is tried. A read that stalls is a read that failed. */
52
54
  export const READ_TIMEOUT_MS = 60_000;
53
- /**
54
- * Point reads at somebody else's aggregator, or at a development stack.
55
- *
56
- * ⚠ It replaces the list rather than adding to it, and that is deliberate: a run should read from
57
- * where it was told to read, not from there AND the public hosts. Comma-separated for more
58
- * than one, tried in the order given.
59
- */
60
- export const AGGREGATOR_ENV_VAR = "NMTS_AGGREGATOR";
61
- /**
62
- * Push writes through somebody else's relay, or through a development stack.
63
- *
64
- * ⚠ ONE host, not a list. Unlike reads there is nothing to fail over to — see `RELAY_HOSTS`.
65
- */
66
- export const RELAY_ENV_VAR = "NMTS_RELAY";
67
- /** Ask a different Sui JSON-RPC node the shard-count question. */
68
- export const SUI_RPC_ENV_VAR = "NMTS_SUI_RPC";
55
+ // Re-exported so every caller still finds them here; the names themselves live in a module with no
56
+ // imports, because `nmts --help` prints them (`env-vars.ts`).
57
+ export { AGGREGATOR_ENV_VAR, RELAY_ENV_VAR, SUI_RPC_ENV_VAR } from "./env-vars.js";
69
58
  /** The relay this run writes through: the environment's if it named one, else the network's. */
70
59
  export function relayHost(network) {
71
- const named = process.env[RELAY_ENV_VAR]?.trim();
60
+ const named = runtime().env(RELAY_ENV_VAR)?.trim();
72
61
  if (named)
73
62
  return named;
74
- const host = RELAY_HOSTS[network]?.[0];
75
- if (host === undefined) {
63
+ const known = RELAY_HOSTS[network]?.[0];
64
+ if (known === undefined) {
76
65
  throw new NmtsError(`No upload relay is known for the ${network} storage network.`, {
77
66
  nextStep: `Name one in ${RELAY_ENV_VAR} to upload anyway.`,
78
67
  });
79
68
  }
80
- return host;
69
+ return known;
81
70
  }
82
71
  /**
83
72
  * Every Sui JSON-RPC node this run may ask, in order.
@@ -88,7 +77,7 @@ export function relayHost(network) {
88
77
  * they did not choose.
89
78
  */
90
79
  export function suiRpcHosts(network) {
91
- const named = process.env[SUI_RPC_ENV_VAR]?.trim();
80
+ const named = runtime().env(SUI_RPC_ENV_VAR)?.trim();
92
81
  if (named)
93
82
  return [named];
94
83
  const hosts = SUI_RPC_HOSTS[network];
@@ -104,7 +93,7 @@ export function suiRpcHost(network) {
104
93
  return suiRpcHosts(network)[0] ?? "";
105
94
  }
106
95
  function fromEnvironment() {
107
- const raw = process.env[AGGREGATOR_ENV_VAR];
96
+ const raw = runtime().env(AGGREGATOR_ENV_VAR);
108
97
  if (raw === undefined)
109
98
  return null;
110
99
  const hosts = raw.split(",").map((h) => h.trim()).filter((h) => h !== "");
@@ -27,7 +27,7 @@ is spent by moving credits, and running the same command the other way puts them
27
27
  The credits keep the expiry they already had. The move drains the soonest-expiring lots first, so
28
28
  sending 100 may arrive as several grants with different dates, and moving them never renews them.
29
29
 
30
- Four refusals, four different remedies, and none of them is a retry:
30
+ Four refusals, none of them worth retrying:
31
31
  `CREDIT_TRANSFER_OUTSIDE_FAMILY` (name an account of your own) · `CREDIT_TRANSFER_SELF` (that is
32
32
  the account sending) · `CREDIT_TRANSFER_INSUFFICIENT` (send less — the refusal carries what was
33
33
  needed and what the account can spend) · `CREDIT_TRANSFER_ZERO` (send some). Nothing is moved and
@@ -0,0 +1,15 @@
1
+ # nmts platform — the key pair a business signs with
2
+
3
+ Commands: platform
4
+ Tiers: platform=none · platform.keygen=medium
5
+
6
+ `platform keygen` makes an Ed25519 key pair and writes both halves to `nmts-business-key.json`, or
7
+ to `--out <file>`, with mode 0600 (on Windows, where no file mode applies, it removes the inherited
8
+ permissions with `icacls` and leaves your account alone on the file, and says so if that fails). It
9
+ refuses a name that already exists, whatever `--force` says, and prints only the public half.
10
+ `platform register` cannot register it: that needs a signed-in browser session at nmts.me, under
11
+ Settings › Developer › Platform, and the command prints that path and exits 2.
12
+
13
+ The private half is what signs every request a business makes and every delegation token it mints
14
+ for one of its users. Nothing can derive it again, and replacing the registered key invalidates every
15
+ token the old one signed.
@@ -13,4 +13,4 @@ English. One report per problem.
13
13
 
14
14
  In the default mode it prints what it would send and asks (or takes `--yes`); in an auto mode it
15
15
  sends after printing. Replies arrive in the thread: `support list`, `support show <code>`,
16
- `support reply <code> --message`. If the CLI itself cannot run, the second door is nmts@nmts.me.
16
+ `support reply <code> --message`. If the CLI itself cannot run, write to nmts@nmts.me.
@@ -1,4 +1,4 @@
1
- # nmts rm, restore, sweep, erase — the trash, and the one way past it
1
+ # nmts rm, restore, sweep, erase — the trash, and erasing for good
2
2
 
3
3
  Commands: rm, restore, sweep, erase
4
4
  Tiers: rm=low · restore=low · sweep=medium · erase=ultra-high · erase.release=ultra-high(release-storage)
@@ -17,9 +17,11 @@ kept inside your sealed file list, so the browser, this tool and every other dev
17
17
  Numbers come from the key, so a wallet cannot be deleted, and a wallet you leave keeps whatever is
18
18
  in it.
19
19
 
20
- `put`, `push`, `extend`, `wallet send` and `wallet donate` all pay from that wallet, and each takes
21
- `--wallet <number>` to pay from a different one for that run only, without changing the setting.
22
- If the file list cannot be read, they refuse rather than falling back to wallet 0 — paying from
20
+ `put`, `push`, `extend`, `wallet send` and `wallet donate` all pay from that wallet. The same
21
+ number decides the rest: `wallet swap` swaps its coins, `wallet storage split|merge|transfer`
22
+ reshapes the resources it holds, and `wallet hall --name` signs as its address. Each takes
23
+ `--wallet <number>` to use a different one for that run only, without changing the setting.
24
+ ⛔ If the file list cannot be read, they refuse rather than falling back to wallet 0 — signing with
23
25
  a wallet nobody chose is not a thing to guess at.
24
26
 
25
27
  ## Where SUI comes from, and why it is SUI
@@ -28,8 +30,8 @@ You can store without any coin here: credits pay the network for you (the weekly
28
30
  nmts.me, or credits somebody gave you), and `nmts balance` shows them. The wallet matters only when
29
31
  you pay the network yourself.
30
32
 
31
- The files live on Walrus, and Walrus is paid on the Sui chain in WAL, with gas in SUI. That is why
32
- this wallet holds SUI and WAL and nothing else — not a preference, the chain the storage runs on.
33
+ The files live on Walrus, and Walrus is paid on the Sui chain in WAL, with gas in SUI, so
34
+ this wallet holds SUI and WAL and nothing else.
33
35
  Fiat is not taken because taking it would make NMTS hold your money, which it never does.
34
36
 
35
37
  Getting SUI (as of 2026-09-06): buy it on an exchange that lists it (Binance and Upbit did on that
@@ -77,5 +79,7 @@ One more reads the gifts back, and one flag on it publishes a name:
77
79
  - `wallet hall` prints the gift hall of fame — the developer, then the ten largest senders as read
78
80
  from the public chain, with the rest of the list at nmts.me/hall; reading it signs nothing and
79
81
  needs no NMTS key. `--name <name>` (1 to 24 characters, no links, not an address) signs a
80
- short message with this account's wallet so the server shows that name beside the address, and
81
- `--remove` puts the entry back to a shortened address.
82
+ short message with the wallet this account pays from the wallet a gift left from so the
83
+ server shows that name beside its address, and `--remove` puts the entry back to a shortened
84
+ address. Reading which wallet that is opens the file list, so naming yourself needs an API key
85
+ where reading the hall needs none.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needmoretruth/nmts-cli",
3
- "version": "0.35.0",
3
+ "version": "0.36.2",
4
4
  "description": "Command-line and MCP access to NMTS (NeedMoreTruthStorage, https://nmts.me): open-source, end-to-end encrypted storage on the Walrus network. No fee to NMTS; you pay the network from your own wallet. For people and for their agents.",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -41,6 +41,14 @@
41
41
  "types": "./dist/index.d.ts",
42
42
  "default": "./dist/index.js"
43
43
  },
44
+ "./portable": {
45
+ "types": "./dist/portable.d.ts",
46
+ "default": "./dist/portable.js"
47
+ },
48
+ "./host": {
49
+ "types": "./dist/host.d.ts",
50
+ "default": "./dist/host.js"
51
+ },
44
52
  "./api": {
45
53
  "types": "./dist/api.d.ts",
46
54
  "default": "./dist/api.js"
@@ -81,6 +89,7 @@
81
89
  "types": "./dist/wallet-sign.d.ts",
82
90
  "default": "./dist/wallet-sign.js"
83
91
  },
92
+ "./vendor/nmts-crypto/*": "./vendor/nmts-crypto/*",
84
93
  "./package.json": "./package.json"
85
94
  },
86
95
  "engines": {
@@ -100,7 +109,7 @@
100
109
  "scripts": {
101
110
  "compile": "tsc -p tsconfig.json",
102
111
  "typecheck": "tsc -p tsconfig.json --noEmit",
103
- "test": "node --test \"test/**/*.test.ts\""
112
+ "test": "node --import ./test/host.ts --test \"test/**/*.test.ts\""
104
113
  },
105
114
  "devDependencies": {
106
115
  "@types/node": "^24.3.0",
@@ -109,6 +118,8 @@
109
118
  "dependencies": {
110
119
  "@mysten/sui": "^2.20.1",
111
120
  "@mysten/walrus": "^1.2.3",
121
+ "@noble/curves": "^2.3.0",
122
+ "@noble/hashes": "^2.2.0",
112
123
  "uqr": "^0.1.3"
113
124
  },
114
125
  "mcpName": "io.github.needmoretruth/nmts"