@needmoretruth/nmts-cli 0.42.0 → 0.44.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.
Files changed (72) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +41 -0
  3. package/README.ko.md +8 -2
  4. package/README.md +8 -2
  5. package/dist/account.d.ts +7 -3
  6. package/dist/account.js +46 -19
  7. package/dist/arg-options.d.ts +16 -0
  8. package/dist/args.js +5 -2
  9. package/dist/artifact-about.d.ts +1 -1
  10. package/dist/commands/ai-account.d.ts +34 -0
  11. package/dist/commands/ai-account.js +260 -0
  12. package/dist/commands/balance.d.ts +68 -0
  13. package/dist/commands/balance.js +11 -1
  14. package/dist/commands/extend.d.ts +3 -0
  15. package/dist/commands/extend.js +1 -0
  16. package/dist/commands/login.js +2 -2
  17. package/dist/commands/push-wallet.js +4 -1
  18. package/dist/commands/push.d.ts +3 -0
  19. package/dist/commands/put-payer.d.ts +3 -1
  20. package/dist/commands/put-payer.js +13 -1
  21. package/dist/commands/put-wallet.d.ts +31 -0
  22. package/dist/commands/put-wallet.js +84 -10
  23. package/dist/commands/put.d.ts +5 -0
  24. package/dist/commands/whoami.d.ts +4 -0
  25. package/dist/commands/whoami.js +14 -1
  26. package/dist/crypto-surface.d.ts +11 -0
  27. package/dist/crypto-surface.js +6 -0
  28. package/dist/drive-edit/tree.d.ts +12 -0
  29. package/dist/drive-edit/tree.js +25 -4
  30. package/dist/drive-erase.d.ts +5 -3
  31. package/dist/drive-erase.js +7 -2
  32. package/dist/help-options.d.ts +2 -0
  33. package/dist/help-options.js +142 -0
  34. package/dist/help.js +10 -123
  35. package/dist/main.js +14 -19
  36. package/dist/mcp-tools/reads.js +4 -3
  37. package/dist/portable.d.ts +1 -1
  38. package/dist/portable.js +1 -1
  39. package/dist/product.d.ts +1 -1
  40. package/dist/product.js +1 -1
  41. package/dist/refill-source.d.ts +69 -0
  42. package/dist/refill-source.js +143 -0
  43. package/dist/risk.d.ts +12 -0
  44. package/dist/risk.js +16 -0
  45. package/dist/shared/lib/wallet/activity.js +23 -1
  46. package/dist/standing-tip.d.ts +26 -0
  47. package/dist/standing-tip.js +31 -0
  48. package/dist/storage-control/extend.d.ts +10 -0
  49. package/dist/storage-control/extend.js +1 -1
  50. package/dist/upload-store.d.ts +10 -0
  51. package/dist/upload-wallet-plan.d.ts +8 -0
  52. package/dist/upload-wallet-plan.js +12 -3
  53. package/dist/upload-wallet-put.d.ts +16 -0
  54. package/dist/upload-wallet-put.js +4 -2
  55. package/dist/upload-wallet.d.ts +11 -0
  56. package/dist/upload-wallet.js +14 -0
  57. package/dist/wallet-sign-external.d.ts +120 -0
  58. package/dist/wallet-sign-external.js +221 -0
  59. package/dist/wallet-sign.js +3 -1
  60. package/dist/walrus.d.ts +9 -1
  61. package/dist/walrus.js +17 -3
  62. package/docs/commands/ai-account.md +25 -0
  63. package/docs/commands/login.md +4 -3
  64. package/docs/commands/verify.md +1 -1
  65. package/docs/commands/whoami.md +4 -0
  66. package/examples/podman.sh +48 -0
  67. package/package.json +6 -1
  68. package/server.json +2 -2
  69. package/vendor/nmts-crypto/nmts_crypto_wasm.d.ts +42 -6
  70. package/vendor/nmts-crypto/nmts_crypto_wasm.js +105 -2
  71. package/vendor/nmts-crypto/nmts_crypto_wasm_bg.wasm +0 -0
  72. package/vendor/nmts-crypto/nmts_crypto_wasm_bg.wasm.d.ts +9 -4
@@ -0,0 +1,142 @@
1
+ // The OPTIONS block of `nmts --help` — every option, in one list.
2
+ //
3
+ // ⛔ IT MOVED OUT OF `help.ts` AND NOT ONE STRING CHANGED (2026-09-20). That file was two lines
4
+ // under the length gate, so the next option anybody added would have broken it — and squeezing
5
+ // a sentence to fit a line count is how help text stops saying the thing it was added to say.
6
+ // The seam is the one the printed page already has: this is WHAT THE OPTIONS ARE, and what is
7
+ // left there is the page around them.
8
+ //
9
+ // ⛔ NO IMPORTS BUT THE TWO NAMES IT PRINTS. `nmts --help` pays for whatever this file reaches, and
10
+ // `check:cli-startup` measures exactly that.
11
+ import { BINARY_NAME } from "./product.js";
12
+ import { SERVER_ENV_VAR } from "./env-vars.js";
13
+ /** The lines under `OPTIONS`, in the order they are printed. */
14
+ export function optionLines() {
15
+ return [
16
+ ` --server <url> NMTS server (default ${SERVER_ENV_VAR} or the live one)`,
17
+ ` --network <name> mainnet or testnet. Required for any server but the live one`,
18
+ ` --json Machine-readable output (ls, usage, get, put, env, verify,`,
19
+ ` expiring, losses, sweep, rebuild, rollback, pull, wallet, shares,`,
20
+ ` share, receive, label, unlabel, padding, deposit, whoami --reveal,`,
21
+ ` recovery, balance, trial, credits transfer, extend, recovery-list, kit, update, notices,`,
22
+ ` devices, key new, key list, key revoke, create. \`key new\` puts the key string in the JSON`,
23
+ ` only with --print, and \`create\` needs --out as well, so neither`,
24
+ ` secret enters the output by default)`,
25
+ ` --all Include what is in the trash (ls), or take one label off every`,
26
+ ` file that carries it (unlabel)`,
27
+ ` --sent <path> Who ONE file was shared with, instead of the inbox (shares)`,
28
+ ` --rename <old> The label to rename; the new name follows it (label)`,
29
+ ` --qr Draw the wallet address as a code to scan (wallet address)`,
30
+ ` --remove Take your name off the gift hall of fame, leaving a shortened`,
31
+ ` address (wallet hall). Give this or --name, not both`,
32
+ ` --days <n> | --until <date>`,
33
+ ` How long a wallet agreement lasts, at most 30 days (unlock`,
34
+ ` wallet), or how long a new API key lasts (key new). Default 30 days;`,
35
+ ` the server clamps at its own ceiling and the reply says the date`,
36
+ ` --scopes <list> What a new key may do (key new): read, write, spend, comma-separated.`,
37
+ ` Default read. A program that uploads needs all three`,
38
+ ` --print Put the new key on the screen once as well (key new). It is stored on`,
39
+ ` this machine either way, and NMTS keeps no copy of it`,
40
+ ` --scope storage|all What a wallet agreement covers: storage, or also exchanging and`,
41
+ ` sending (unlock wallet). Default storage. A gift is in neither`,
42
+ ` --cap-wal <coins> --cap-sui <coins>`,
43
+ ` A ceiling on what this tool may sign away under the agreement`,
44
+ ` --fee-cap <sui> A ceiling on the chain fee of one transaction (wallet send, wallet`,
45
+ ` swap). Only up to it is used; the rest stays in the wallet`,
46
+ ` --venue <name> deepbook or bluefin (wallet swap). Neither is a default: without`,
47
+ ` it both quotes are printed and nothing is signed`,
48
+ ` --slippage-bps <n> How far below the quote the swap may still fill, in bps — 1 bps`,
49
+ ` = 0.01% (wallet swap). 1 to 5000, default 50. Below 10 or above`,
50
+ ` 200 is an extreme`,
51
+ ` --accept-extremes Go on past the extremes gate — slippage, fee cap or a quote more`,
52
+ ` than 3% from the site's reference price (wallet swap). A person's`,
53
+ ` act, refused while a mode is on`,
54
+ ` --reveal Print the NMTS key itself (whoami). A person's act, and`,
55
+ ` refused while a mode is on`,
56
+ ` --phrase With --reveal: print the key as its 15-word recovery phrase`,
57
+ ` (whoami). --lang ko for the Korean word list`,
58
+ ` --find <text> List only the files whose name contains this text (ls). Folders`,
59
+ ` appear only where they hold a match`,
60
+ ` --sort <key> name, size or date. Default: whole paths, ascending (ls)`,
61
+ ` --desc Reverse whichever order is in effect (ls)`,
62
+ ` --hidden Include entries whose name begins with a dot (push)`,
63
+ ` --out <path> Where to write files (get, pull, mcp, listfile, recovery,`,
64
+ ` recovery-list, kit, create, notices, terms, privacy, platform`,
65
+ ` keygen). Default: here`,
66
+ ` --out - Send a fetched file to stdout instead of writing it (get, listfile)`,
67
+ ` --lang <en|ko> Which language of a document (terms, privacy) or word list`,
68
+ ` (whoami --phrase). Default: English`,
69
+ ` --board The message board's terms rather than the service's (terms)`,
70
+ ` --save Keep the document as a file, under the name the server gives it`,
71
+ ` (notices, terms, privacy)`,
72
+ ` --force Replace a file that is already there (get, pull, listfile,`,
73
+ ` recovery, recovery-list, kit), or rebuild an account this machine`,
74
+ ` has seen a list for (rebuild). \`create\` never replaces a file`,
75
+ ` --name <name> The name the uploaded file gets in the drive (put), or the name to`,
76
+ ` be listed under in the gift hall of fame (wallet hall)`,
77
+ ` --to <folder> Destination folder, as \`${BINARY_NAME} ls\` prints it (put, push).`,
78
+ ` For \`credits transfer\` it is the account identifier that receives`,
79
+ ` --dry-run Say what it would cost, and stop (put, push, extend), or what it`,
80
+ ` would install, and stop (update). With \`extend\` and \`--pay`,
81
+ ` wallet\` nothing is signed and the wallet key is never touched`,
82
+ ` --part-size <n> Bytes per part for a large upload (put, push). Default 64MiB.`,
83
+ ` A plain number, or one with KiB, MiB or GiB. Bigger parts mean`,
84
+ ` fewer purchases; smaller parts use less memory`,
85
+ ` --on-collision <what> rename | overwrite, for THIS run only (put, push). Without it the`,
86
+ ` machine's own setting decides -- see \`${BINARY_NAME} on-collision\`.`,
87
+ ` --deposit <n> Credits THIS upload sets aside per file, 0 to 64 (put, push, with`,
88
+ ` credits). Without it the account's own default decides -- see`,
89
+ ` \`${BINARY_NAME} deposit\`. 0 means a later release costs twice the fee`,
90
+ ` from the balance instead of coming out of the file's deposit`,
91
+ ` --yes Go ahead with something that cannot be taken back (sweep, rebuild,`,
92
+ ` rollback, wallet send, wallet swap, wallet donate),`,
93
+ ` or extend a file that is nowhere near its deadline (extend)`,
94
+ ` --epochs <n> How many of the storage network's epochs to add (extend), to buy`,
95
+ ` (put, push --pay wallet; default 2), or to keep (wallet storage split)`,
96
+ ` --size <bytes> What a cut resource keeps: bytes, or with KiB/MiB/GiB (wallet storage split)`,
97
+ ` --pay credits|wallet Who pays for an upload's storage (put, push). Default credits.`,
98
+ ` wallet = the wallet this NMTS key derives signs and pays the`,
99
+ ` network directly, under a wallet agreement of scope storage`,
100
+ ` --from <drive path> Re-upload a file the account's credits paid for, this time from the`,
101
+ ` wallet (put --pay wallet). It keeps its name and folder; the old file`,
102
+ ` goes to the trash. --dry-run prices it without reading it`,
103
+ ` --storage fit|whole|<object id>`,
104
+ ` Use a free storage resource the wallet already holds (put --pay`,
105
+ ` wallet, one-part files). fit cuts it to size and leaves the rest`,
106
+ ` free; whole binds all of it with the file. The review says which`,
107
+ ` bytes go where. Without it new storage is bought`,
108
+ ` --trust-server-tip-address Send the standing gift where this server says rather than where`,
109
+ ` this build says (put, push, extend --pay wallet). For your own server`,
110
+ ` --port <n> Which loopback port to listen on (s3). Default 9000`,
111
+ ` --accept-terms <v> The version of the Terms of Service a PERSON read and accepts for`,
112
+ ` the new account (create). A version, never "the current one"`,
113
+ ` --accept-privacy <v> The version of the Privacy Policy accepted in the same act (create)`,
114
+ ` --no-wait Print the registration address and stop, instead of waiting for a`,
115
+ ` person to open it (create, when there is no verified key)`,
116
+ ` --publish Publish this account's public code (public-code). Permanent —`,
117
+ ` it cannot be withdrawn or changed afterwards`,
118
+ ` --category <c> What a report is about (support send). The categories are listed by`,
119
+ ` \`${BINARY_NAME} support --help\``,
120
+ ` --sub <s> Which part of that category (support send). Always optional`,
121
+ ` --message <text> The message itself (support send, support reply)`,
122
+ ` --message-file <p> A file holding the message instead (support send). With neither, the`,
123
+ ` message is read from the standard input`,
124
+ ` --attach-log [n] Attach this tool's own record of its last n runs (support send).`,
125
+ ` Default 3, most 20`,
126
+ ` --omit <text> A value that must not travel. May be given more than once (support`,
127
+ ` send, support reply)`,
128
+ ` --status Say whether the check is live, and stop (verify)`,
129
+ ` --plain Store the NMTS key unsealed instead (login). Asks for an agreement`,
130
+ ` --env Store nothing; print the variable to set (login). Same agreement`,
131
+ // Copy facts — these four lines. Facts: `--wallet` with no number means the NMTS key comes from
132
+ // a wallet's signature (login, create); the wallet's secret is never an option value, only a
133
+ // file path; the account number is inside what is signed, so another number is another
134
+ // signature; without `--app` one wallet opens the same account in every product that asks.
135
+ ` --wallet The NMTS key comes from a wallet's signature (login, create)`,
136
+ ` --sui-key-file <p> File holding the wallet's \`suiprivkey1…\` line. Never the key itself`,
137
+ ` --account <n> Which of that wallet's accounts. Default 1; it is inside what is signed`,
138
+ ` --app <name> Scope the signature to one product. Without it, one account everywhere`,
139
+ ` --version Print the version and exit`,
140
+ ` --help Print this and exit`,
141
+ ];
142
+ }
package/dist/help.js CHANGED
@@ -14,6 +14,7 @@ import { API_KEY_ENV_VAR, API_KEY_FILE_ENV_VAR, CODE_ENV_VAR, CODE_FILE_ENV_VAR,
14
14
  // three reach the host register, and loading them to print a variable's name would put that
15
15
  // chain in front of every `nmts --help` (`check:cli-startup`).
16
16
  import { AGGREGATOR_ENV_VAR, NETWORK_ENV_VAR, SERVER_ENV_VAR } from "./env-vars.js";
17
+ import { optionLines } from "./help-options.js";
17
18
  import { LATEST_RELEASE_URL, NO_CHECK_ENV_VAR } from "./update-source.js";
18
19
  import { CHECK_DOES_NOT_PROVE, CHECK_PROVES, RECOVERY_TOOL_URL, wrapText, } from "./recovery-release.js";
19
20
  export function helpText(version) {
@@ -51,7 +52,9 @@ export function helpText(version) {
51
52
  ` Move credits to another account of your own — the one that made this`,
52
53
  ` account, or one made under it. Never to anyone else`,
53
54
  ` expiring List files whose bought storage runs out soon`,
54
- ` losses Storage the daily check could not find on the chain; --recheck <id> · --dismiss <id>`,
55
+ ` losses Storage the chain lost — a program uploading with a key keeps writing into it`,
56
+ ` ai-account Accounts made under this one for an AI to work in: list, create, delete.`,
57
+ ` Each has its own NMTS key and its own empty drive. Needs the NMTS key`,
55
58
  ` extend <path> Buy more storage time for one file — **spends WAL from the wallet**`,
56
59
  ` public-code The code other accounts send files to. \`--publish\` makes it reachable`,
57
60
  ` delete-account A PERSON erases this account's server record — irreversible; needs the`,
@@ -136,130 +139,14 @@ export function helpText(version) {
136
139
  ` platform register Where that public key is registered: a browser session, not this tool`,
137
140
  ``,
138
141
  `OPTIONS`,
139
- ` --server <url> NMTS server (default ${SERVER_ENV_VAR} or the live one)`,
140
- ` --network <name> mainnet or testnet. Required for any server but the live one`,
141
- ` --json Machine-readable output (ls, usage, get, put, env, verify,`,
142
- ` expiring, losses, sweep, rebuild, rollback, pull, wallet, shares,`,
143
- ` share, receive, label, unlabel, padding, deposit, whoami --reveal,`,
144
- ` recovery, balance, trial, credits transfer, extend, recovery-list, kit, update, notices,`,
145
- ` devices, key new, key list, key revoke, create. \`key new\` puts the key string in the JSON`,
146
- ` only with --print, and \`create\` needs --out as well, so neither`,
147
- ` secret enters the output by default)`,
148
- ` --all Include what is in the trash (ls), or take one label off every`,
149
- ` file that carries it (unlabel)`,
150
- ` --sent <path> Who ONE file was shared with, instead of the inbox (shares)`,
151
- ` --rename <old> The label to rename; the new name follows it (label)`,
152
- ` --qr Draw the wallet address as a code to scan (wallet address)`,
153
- ` --remove Take your name off the gift hall of fame, leaving a shortened`,
154
- ` address (wallet hall). Give this or --name, not both`,
155
- ` --days <n> | --until <date>`,
156
- ` How long a wallet agreement lasts, at most 30 days (unlock`,
157
- ` wallet), or how long a new API key lasts (key new). Default 30 days;`,
158
- ` the server clamps at its own ceiling and the reply says the date`,
159
- ` --scopes <list> What a new key may do (key new): read, write, spend, comma-separated.`,
160
- ` Default read. A program that uploads needs all three`,
161
- ` --print Put the new key on the screen once as well (key new). It is stored on`,
162
- ` this machine either way, and NMTS keeps no copy of it`,
163
- ` --scope storage|all What a wallet agreement covers: storage, or also exchanging and`,
164
- ` sending (unlock wallet). Default storage. A gift is in neither`,
165
- ` --cap-wal <coins> --cap-sui <coins>`,
166
- ` A ceiling on what this tool may sign away under the agreement`,
167
- ` --fee-cap <sui> A ceiling on the chain fee of one transaction (wallet send, wallet`,
168
- ` swap). Only up to it is used; the rest stays in the wallet`,
169
- ` --venue <name> deepbook or bluefin (wallet swap). Neither is a default: without`,
170
- ` it both quotes are printed and nothing is signed`,
171
- ` --slippage-bps <n> How far below the quote the swap may still fill, in bps — 1 bps`,
172
- ` = 0.01% (wallet swap). 1 to 5000, default 50. Below 10 or above`,
173
- ` 200 is an extreme`,
174
- ` --accept-extremes Go on past the extremes gate — slippage, fee cap or a quote more`,
175
- ` than 3% from the site's reference price (wallet swap). A person's`,
176
- ` act, refused while a mode is on`,
177
- ` --reveal Print the NMTS key itself (whoami). A person's act, and`,
178
- ` refused while a mode is on`,
179
- ` --find <text> List only the files whose name contains this text (ls). Folders`,
180
- ` appear only where they hold a match`,
181
- ` --sort <key> name, size or date. Default: whole paths, ascending (ls)`,
182
- ` --desc Reverse whichever order is in effect (ls)`,
183
- ` --hidden Include entries whose name begins with a dot (push)`,
184
- ` --out <path> Where to write files (get, pull, mcp, listfile, recovery,`,
185
- ` recovery-list, kit, create, notices, terms, privacy, platform`,
186
- ` keygen). Default: here`,
187
- ` --out - Send a fetched file to stdout instead of writing it (get, listfile)`,
188
- ` --lang <en|ko> Which language of a document (terms, privacy). Default: English`,
189
- ` --board The message board's terms rather than the service's (terms)`,
190
- ` --save Keep the document as a file, under the name the server gives it`,
191
- ` (notices, terms, privacy)`,
192
- ` --force Replace a file that is already there (get, pull, listfile,`,
193
- ` recovery, recovery-list, kit), or rebuild an account this machine`,
194
- ` has seen a list for (rebuild). \`create\` never replaces a file`,
195
- ` --name <name> The name the uploaded file gets in the drive (put), or the name to`,
196
- ` be listed under in the gift hall of fame (wallet hall)`,
197
- ` --to <folder> Destination folder, as \`${BINARY_NAME} ls\` prints it (put, push).`,
198
- ` For \`credits transfer\` it is the account identifier that receives`,
199
- ` --dry-run Say what it would cost, and stop (put, push, extend), or what it`,
200
- ` would install, and stop (update). With \`extend\` and \`--pay`,
201
- ` wallet\` nothing is signed and the wallet key is never touched`,
202
- ` --part-size <n> Bytes per part for a large upload (put, push). Default 64MiB.`,
203
- ` A plain number, or one with KiB, MiB or GiB. Bigger parts mean`,
204
- ` fewer purchases; smaller parts use less memory`,
205
- ` --on-collision <what> rename | overwrite, for THIS run only (put, push). Without it the`,
206
- ` machine's own setting decides -- see \`${BINARY_NAME} on-collision\`.`,
207
- ` --deposit <n> Credits THIS upload sets aside per file, 0 to 64 (put, push, with`,
208
- ` credits). Without it the account's own default decides -- see`,
209
- ` \`${BINARY_NAME} deposit\`. 0 means a later release costs twice the fee`,
210
- ` from the balance instead of coming out of the file's deposit`,
211
- ` --yes Go ahead with something that cannot be taken back (sweep, rebuild,`,
212
- ` rollback, wallet send, wallet swap, wallet donate),`,
213
- ` or extend a file that is nowhere near its deadline (extend)`,
214
- ` --epochs <n> How many of the storage network's epochs to add (extend), to buy`,
215
- ` (put, push --pay wallet; default 2), or to keep (wallet storage split)`,
216
- ` --size <bytes> What a cut resource keeps: bytes, or with KiB/MiB/GiB (wallet storage split)`,
217
- ` --pay credits|wallet Who pays for an upload's storage (put, push). Default credits.`,
218
- ` wallet = the wallet this NMTS key derives signs and pays the`,
219
- ` network directly, under a wallet agreement of scope storage`,
220
- ` --storage fit|whole|<object id>`,
221
- ` Use a free storage resource the wallet already holds (put --pay`,
222
- ` wallet, one-part files). fit cuts it to size and leaves the rest`,
223
- ` free; whole binds all of it with the file. The review says which`,
224
- ` bytes go where. Without it new storage is bought`,
225
- ` --port <n> Which loopback port to listen on (s3). Default 9000`,
226
- ` --accept-terms <v> The version of the Terms of Service a PERSON read and accepts for`,
227
- ` the new account (create). A version, never "the current one"`,
228
- ` --accept-privacy <v> The version of the Privacy Policy accepted in the same act (create)`,
229
- ` --no-wait Print the registration address and stop, instead of waiting for a`,
230
- ` person to open it (create, when there is no verified key)`,
231
- ` --publish Publish this account's public code (public-code). Permanent —`,
232
- ` it cannot be withdrawn or changed afterwards`,
233
- ` --category <c> What a report is about (support send). The categories are listed by`,
234
- ` \`${BINARY_NAME} support --help\``,
235
- ` --sub <s> Which part of that category (support send). Always optional`,
236
- ` --message <text> The message itself (support send, support reply)`,
237
- ` --message-file <p> A file holding the message instead (support send). With neither, the`,
238
- ` message is read from the standard input`,
239
- ` --attach-log [n] Attach this tool's own record of its last n runs (support send).`,
240
- ` Default 3, most 20`,
241
- ` --omit <text> A value that must not travel. May be given more than once (support`,
242
- ` send, support reply)`,
243
- ` --status Say whether the check is live, and stop (verify)`,
244
- ` --plain Store the NMTS key unsealed instead (login). Asks for an agreement`,
245
- ` --env Store nothing; print the variable to set (login). Same agreement`,
246
- // Copy facts — these four lines. Facts: `--wallet` with no number means the NMTS key comes from
247
- // a wallet's signature (login, create); the wallet's secret is never an option value, only a
248
- // file path; the account number is inside what is signed, so another number is another
249
- // signature; without `--app` one wallet opens the same account in every product that asks.
250
- ` --wallet The NMTS key comes from a wallet's signature (login, create)`,
251
- ` --sui-key-file <p> File holding the wallet's \`suiprivkey1…\` line. Never the key itself`,
252
- ` --account <n> Which of that wallet's accounts. Default 1; it is inside what is signed`,
253
- ` --app <name> Scope the signature to one product. Without it, one account everywhere`,
254
- ` --version Print the version and exit`,
255
- ` --help Print this and exit`,
142
+ ...optionLines(),
256
143
  ``,
257
144
  `ENVIRONMENT`,
258
- ` ${CODE_FILE_ENV_VAR.padEnd(24)}Names a FILE holding the NMTS key. The recommended way, and`,
259
- ` the only one that asks nothing: the file is read, never copied.`,
260
- ` ${CODE_ENV_VAR.padEnd(24)}The NMTS key itself. Takes precedence over anything stored,`,
261
- ` and asks once — an environment variable is readable through`,
262
- ` \`docker inspect\`, /proc/<pid>/environ and most CI logs.`,
145
+ ` ${CODE_FILE_ENV_VAR.padEnd(24)}Names a FILE holding the NMTS key, read once and never copied. The`,
146
+ ` recommended way, and how a container is given it (examples/podman.sh).`,
147
+ ` ${CODE_ENV_VAR.padEnd(24)}The NMTS key itself. It wins over that file and over what`,
148
+ ` \`${BINARY_NAME} login\` stored, and asks once — an environment variable is`,
149
+ ` readable through \`docker inspect\`, /proc/<pid>/environ and CI logs.`,
263
150
  ` ${PASSPHRASE_ENV_VAR.padEnd(24)}Opens a sealed stored NMTS key without a terminal.`,
264
151
  ` ${API_KEY_FILE_ENV_VAR.padEnd(24)}Names a FILE holding the API key. \`${BINARY_NAME} login\` reads this`,
265
152
  ` first, and a container cannot leak it the way it leaks a value.`,
package/dist/main.js CHANGED
@@ -83,6 +83,8 @@ export async function run(argv) {
83
83
  server: args.server,
84
84
  network: args.network,
85
85
  reveal: args.reveal,
86
+ phrase: args.phrase,
87
+ lang: args.lang,
86
88
  json: args.json,
87
89
  });
88
90
  }
@@ -131,13 +133,14 @@ export async function run(argv) {
131
133
  case "losses": {
132
134
  const { losses } = await import("./commands/losses.js");
133
135
  return await losses({
134
- server: args.server,
135
- network: args.network,
136
- json: args.json,
137
- recheck: args.recheck,
138
- dismiss: args.dismiss,
136
+ server: args.server, network: args.network, json: args.json,
137
+ recheck: args.recheck, dismiss: args.dismiss,
139
138
  });
140
139
  }
140
+ case "ai-account": {
141
+ const { aiAccount } = await import("./commands/ai-account.js");
142
+ return await aiAccount(args.operands[0], args);
143
+ }
141
144
  case "extend": {
142
145
  const { extend } = await import("./commands/extend.js");
143
146
  return await extend(args.operands[0], {
@@ -146,7 +149,7 @@ export async function run(argv) {
146
149
  epochs: args.epochs,
147
150
  dryRun: args.dryRun,
148
151
  yes: args.yes,
149
- json: args.json, wallet: args.wallet,
152
+ json: args.json, wallet: args.wallet, trustServerTipAddress: args.trustServerTipAddress,
150
153
  });
151
154
  }
152
155
  case "create": {
@@ -168,11 +171,7 @@ export async function run(argv) {
168
171
  case "get": {
169
172
  const { get } = await import("./commands/get.js");
170
173
  return await get(args.operands[0], {
171
- server: args.server,
172
- network: args.network,
173
- out: args.out,
174
- force: args.force,
175
- json: args.json,
174
+ server: args.server, network: args.network, out: args.out, force: args.force, json: args.json,
176
175
  });
177
176
  }
178
177
  case "put": {
@@ -188,8 +187,8 @@ export async function run(argv) {
188
187
  deposit: args.deposit,
189
188
  pay: args.pay,
190
189
  epochs: args.epochs,
191
- storage: args.storage,
192
- json: args.json, wallet: args.wallet,
190
+ storage: args.storage, from: args.from,
191
+ json: args.json, wallet: args.wallet, trustServerTipAddress: args.trustServerTipAddress,
193
192
  });
194
193
  }
195
194
  case "push": {
@@ -206,7 +205,7 @@ export async function run(argv) {
206
205
  pay: args.pay,
207
206
  epochs: args.epochs,
208
207
  storage: args.storage,
209
- json: args.json, wallet: args.wallet,
208
+ json: args.json, wallet: args.wallet, trustServerTipAddress: args.trustServerTipAddress,
210
209
  });
211
210
  }
212
211
  case "rm": {
@@ -258,11 +257,7 @@ export async function run(argv) {
258
257
  case "pull": {
259
258
  const { pull } = await import("./commands/pull.js");
260
259
  return await pull(args.operands[0], {
261
- server: args.server,
262
- network: args.network,
263
- out: args.out,
264
- force: args.force,
265
- json: args.json,
260
+ server: args.server, network: args.network, out: args.out, force: args.force, json: args.json,
266
261
  });
267
262
  }
268
263
  case "mkdir": {
@@ -68,9 +68,10 @@ export function readTools(ctx) {
68
68
  {
69
69
  name: "nmts_losses",
70
70
  description: "Storage objects paid with this account's credits that NMTS's daily check could not find " +
71
- "on the chain, newest first. Read-only; costs nothing. Each row is a public chain object " +
72
- "id and the day a check first missed it — no file name, because the server cannot pair " +
73
- "them.",
71
+ "on the chain, newest first. Read-only; costs nothing. A program uploading with a key is " +
72
+ "the caller that keeps writing into storage that is gone, so read this before a long run. " +
73
+ "Each row is a public chain object id and the day a check first missed it — no file name, " +
74
+ "because the server cannot pair them.",
74
75
  inputSchema: NO_ARGS,
75
76
  run: () => say((write) => losses({ ...common(ctx), json: true, write })),
76
77
  },
@@ -12,7 +12,7 @@ export type { RequestOptions, ServerRefusal } from "./api.ts";
12
12
  export { DEFAULT_SERVER, SERVER_ENV_VAR, resolveServer } from "./server.ts";
13
13
  export { NETWORKS, NETWORK_ENV_VAR, resolveNetwork } from "./network.ts";
14
14
  export type { Network } from "./network.ts";
15
- export { assertUsableCode, identityOf } from "./account.ts";
15
+ export { assertUsableCode, identityOf, phraseOf } from "./account.ts";
16
16
  export type { AccountIdentity } from "./account.ts";
17
17
  export { AAD, DERIVED, loadCrypto } from "./crypto.ts";
18
18
  export type { CryptoGlue } from "./crypto.ts";
package/dist/portable.js CHANGED
@@ -35,7 +35,7 @@ export { request, ServerError, DEFAULT_TIMEOUT_MS } from "./api.js";
35
35
  export { DEFAULT_SERVER, SERVER_ENV_VAR, resolveServer } from "./server.js";
36
36
  export { NETWORKS, NETWORK_ENV_VAR, resolveNetwork } from "./network.js";
37
37
  // The account: what a code derives, and the engine that derives it.
38
- export { assertUsableCode, identityOf } from "./account.js";
38
+ export { assertUsableCode, identityOf, phraseOf } from "./account.js";
39
39
  export { AAD, DERIVED, loadCrypto } from "./crypto.js";
40
40
  // The gate every engine load passes, whichever runtime found the build. A host that fetched one
41
41
  // runs its answer through this rather than trusting it.
package/dist/product.d.ts CHANGED
@@ -9,7 +9,7 @@ export declare const BINARY_NAME = "nmts";
9
9
  * beside it. Here rather than in `main.ts` because the MCP server has to say it too, and a
10
10
  * command importing the entry point is a cycle waiting to bite.
11
11
  */
12
- export declare const VERSION = "0.42.0";
12
+ export declare const VERSION = "0.44.0";
13
13
  /** Where the product lives, for messages that need to send somebody somewhere real. */
14
14
  export declare const HOME_URL = "https://nmts.me";
15
15
  /** The source, so a person holding only the built program can find what it was built from. */
package/dist/product.js CHANGED
@@ -18,7 +18,7 @@ export const BINARY_NAME = "nmts";
18
18
  * beside it. Here rather than in `main.ts` because the MCP server has to say it too, and a
19
19
  * command importing the entry point is a cycle waiting to bite.
20
20
  */
21
- export const VERSION = "0.42.0";
21
+ export const VERSION = "0.44.0";
22
22
  /** Where the product lives, for messages that need to send somebody somewhere real. */
23
23
  export const HOME_URL = "https://nmts.me";
24
24
  /** The source, so a person holding only the built program can find what it was built from. */
@@ -0,0 +1,69 @@
1
+ import { type ListEditInput } from "./manifest-write.ts";
2
+ import type { Network } from "./network.ts";
3
+ import type { ManifestEntry } from "./shared/lib/drive/manifest-codec.ts";
4
+ /** The file a re-upload is built from, and exactly where the new one goes. */
5
+ export interface DriveOriginal {
6
+ /** The entry as the list holds it — the id that goes to the trash, and the key that opens it. */
7
+ entry: ManifestEntry;
8
+ /** The name the new file takes: the old one's, because this replaces it in place. */
9
+ name: string;
10
+ parentId: string | null;
11
+ /**
12
+ * The folder the new file goes in, spelled as a path.
13
+ *
14
+ * ⚠ IT IS PART OF THE RESERVATION KEY, so it has to be the same string on a second attempt at
15
+ * the same re-upload. Built from the list rather than from what somebody typed, which is what
16
+ * makes it stable: `--from ./docs/a.txt` and `--from docs/a.txt` are one file and one key.
17
+ */
18
+ destination: string;
19
+ }
20
+ /**
21
+ * The live file a drive path names, with the place the replacement goes.
22
+ *
23
+ * ⛔ A FOLDER, A TRASHED FILE AND A FILE WITH NO KEY ARE ALL REFUSED HERE, before anything is
24
+ * priced. Each one would fail later, after a price had been quoted and possibly after money had
25
+ * moved, and the third would fail in the worst place of all: the download.
26
+ */
27
+ export declare function findOriginal(entries: readonly ManifestEntry[], path: string): DriveOriginal;
28
+ /** Where a downloaded plaintext waits while it is being sealed again. */
29
+ export interface Scratch {
30
+ localPath: string;
31
+ /** Remove it. Safe to call twice, and called on every path out. */
32
+ remove: () => void;
33
+ }
34
+ /**
35
+ * Read one file out of the account and leave it on this machine, checked.
36
+ *
37
+ * ⛔ THE SAME READ `nmts get` MAKES, including the whole-file hash. A re-upload that sealed bytes
38
+ * the download had not proved would replace a good file with a corrupt one and put the good one
39
+ * in the trash — the one outcome this command must never produce.
40
+ */
41
+ export declare function downloadForRefill(input: {
42
+ server: string;
43
+ apiKey: string;
44
+ code: string;
45
+ network: Network;
46
+ original: DriveOriginal;
47
+ }): Promise<Scratch>;
48
+ /**
49
+ * Give the new file the old one's name and put the old one in the trash — after the upload, in one
50
+ * write.
51
+ *
52
+ * ⛔ WHY IT IS A SECOND WRITE AND NOT AN OVERWRITE ON THE COMMIT. `collision.ts` refuses to let a
53
+ * per-run answer of "overwrite" take effect while this machine is in the default mode, on
54
+ * purpose: a program passing a flag must not be able to destroy a file. That rule is not worked
55
+ * around here. The upload lands as an ordinary addition — numbered beside the original if the
56
+ * machine renames — and only then, with the paid-for bytes safely in the list, is the name moved
57
+ * across and the original trashed. A person named the file they were replacing; nothing here
58
+ * decides that for anybody.
59
+ *
60
+ * ⛔ AND THE ORDER IS THE ONE THE WHOLE TOOL KEEPS: the new file is committed first, so a failure
61
+ * anywhere in this step leaves both files in the drive rather than neither. Running the same
62
+ * command again is not the repair for that — the file is already there under a numbered name —
63
+ * so what a failure here costs is a rename somebody does by hand, never bytes.
64
+ *
65
+ * ⚠ IT IS DECIDED AGAIN ON EVERY ATTEMPT of the compare-and-swap, which is what makes it safe to
66
+ * replay: a list where another device already trashed the original, or where this run's own
67
+ * earlier attempt already renamed the new file, produces no intent for that half.
68
+ */
69
+ export declare function settleRefill(input: ListEditInput, original: DriveOriginal, newItemId: string): Promise<number>;