@needmoretruth/nmts-cli 0.17.2 → 0.34.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 (419) hide show
  1. package/AGENTS.md +125 -517
  2. package/CHANGELOG.md +104 -0
  3. package/README.ko.md +377 -469
  4. package/README.md +394 -474
  5. package/dist/account-proof.d.ts +29 -0
  6. package/dist/account-proof.js +6 -6
  7. package/dist/account.d.ts +18 -0
  8. package/dist/account.js +5 -5
  9. package/dist/agent-host.d.ts +71 -0
  10. package/dist/agent-host.js +169 -0
  11. package/dist/api-advice.d.ts +2 -0
  12. package/dist/api-advice.js +210 -0
  13. package/dist/api-key.d.ts +79 -0
  14. package/dist/api-key.js +7 -7
  15. package/dist/api-refusal.d.ts +14 -0
  16. package/dist/api-refusal.js +8 -0
  17. package/dist/api.d.ts +114 -0
  18. package/dist/api.js +59 -162
  19. package/dist/args.d.ts +160 -0
  20. package/dist/args.js +118 -30
  21. package/dist/artifact-about.d.ts +49 -0
  22. package/dist/autonomy.d.ts +39 -0
  23. package/dist/autonomy.js +110 -32
  24. package/dist/code-access.d.ts +29 -0
  25. package/dist/code-access.js +3 -3
  26. package/dist/code-vault.d.ts +38 -0
  27. package/dist/code-vault.js +8 -8
  28. package/dist/collision.d.ts +67 -0
  29. package/dist/collision.js +1 -1
  30. package/dist/commands/accept-terms.d.ts +11 -0
  31. package/dist/commands/accept-terms.js +106 -0
  32. package/dist/commands/balance.d.ts +7 -0
  33. package/dist/commands/balance.js +54 -1
  34. package/dist/commands/create-code-file.d.ts +24 -0
  35. package/dist/commands/create-code-file.js +93 -0
  36. package/dist/commands/create-link.d.ts +10 -0
  37. package/dist/commands/create-link.js +232 -0
  38. package/dist/commands/create.d.ts +20 -0
  39. package/dist/commands/create.js +43 -102
  40. package/dist/commands/credits.d.ts +9 -0
  41. package/dist/commands/credits.js +110 -0
  42. package/dist/commands/delete-account.d.ts +11 -0
  43. package/dist/commands/delete-account.js +63 -0
  44. package/dist/commands/deposit.d.ts +7 -0
  45. package/dist/commands/deposit.js +85 -0
  46. package/dist/commands/devices.d.ts +12 -0
  47. package/dist/commands/devices.js +144 -0
  48. package/dist/commands/documents.d.ts +35 -0
  49. package/dist/commands/documents.js +212 -0
  50. package/dist/commands/env.d.ts +5 -0
  51. package/dist/commands/env.js +10 -2
  52. package/dist/commands/erase.d.ts +13 -0
  53. package/dist/commands/erase.js +193 -0
  54. package/dist/commands/expiring.d.ts +19 -0
  55. package/dist/commands/extend.d.ts +33 -0
  56. package/dist/commands/extend.js +54 -15
  57. package/dist/commands/get.d.ts +18 -0
  58. package/dist/commands/key-manage.d.ts +11 -0
  59. package/dist/commands/key-manage.js +162 -0
  60. package/dist/commands/key.d.ts +28 -0
  61. package/dist/commands/key.js +249 -0
  62. package/dist/commands/kit.d.ts +11 -0
  63. package/dist/commands/kit.js +7 -7
  64. package/dist/commands/listfile.d.ts +13 -0
  65. package/dist/commands/listfile.js +12 -5
  66. package/dist/commands/login.d.ts +18 -0
  67. package/dist/commands/login.js +19 -19
  68. package/dist/commands/logout.d.ts +1 -0
  69. package/dist/commands/logout.js +1 -1
  70. package/dist/commands/losses.d.ts +12 -0
  71. package/dist/commands/losses.js +180 -0
  72. package/dist/commands/ls.d.ts +23 -0
  73. package/dist/commands/marks-dispatch.d.ts +2 -0
  74. package/dist/commands/marks-dispatch.js +51 -0
  75. package/dist/commands/marks.d.ts +46 -0
  76. package/dist/commands/marks.js +80 -0
  77. package/dist/commands/mcp.d.ts +24 -0
  78. package/dist/commands/mcp.js +70 -5
  79. package/dist/commands/mode.d.ts +8 -0
  80. package/dist/commands/mode.js +60 -24
  81. package/dist/commands/on-collision.d.ts +6 -0
  82. package/dist/commands/organise.d.ts +46 -0
  83. package/dist/commands/padding.d.ts +7 -0
  84. package/dist/commands/padding.js +114 -0
  85. package/dist/commands/public-code.d.ts +9 -0
  86. package/dist/commands/public-code.js +8 -8
  87. package/dist/commands/pull.d.ts +27 -0
  88. package/dist/commands/push-wallet.d.ts +19 -0
  89. package/dist/commands/push-wallet.js +69 -0
  90. package/dist/commands/push.d.ts +47 -0
  91. package/dist/commands/push.js +37 -7
  92. package/dist/commands/put-wallet.d.ts +77 -0
  93. package/dist/commands/put-wallet.js +316 -0
  94. package/dist/commands/put.d.ts +56 -0
  95. package/dist/commands/put.js +53 -6
  96. package/dist/commands/rebuild.d.ts +18 -0
  97. package/dist/commands/rebuild.js +108 -10
  98. package/dist/commands/receive.d.ts +24 -0
  99. package/dist/commands/recovery-dispatch.d.ts +2 -0
  100. package/dist/commands/recovery-dispatch.js +34 -0
  101. package/dist/commands/recovery-list.d.ts +11 -0
  102. package/dist/commands/recovery-list.js +6 -6
  103. package/dist/commands/recovery.d.ts +25 -0
  104. package/dist/commands/recovery.js +2 -2
  105. package/dist/commands/rollback.d.ts +9 -0
  106. package/dist/commands/rollback.js +118 -0
  107. package/dist/commands/s3.d.ts +23 -0
  108. package/dist/commands/s3.js +6 -6
  109. package/dist/commands/settings.d.ts +5 -0
  110. package/dist/commands/settings.js +21 -6
  111. package/dist/commands/share-dispatch.d.ts +2 -0
  112. package/dist/commands/share-dispatch.js +46 -0
  113. package/dist/commands/share.d.ts +14 -0
  114. package/dist/commands/share.js +13 -3
  115. package/dist/commands/shares-sent.d.ts +18 -0
  116. package/dist/commands/shares-sent.js +95 -0
  117. package/dist/commands/support.d.ts +24 -0
  118. package/dist/commands/support.js +321 -0
  119. package/dist/commands/sweep.d.ts +11 -0
  120. package/dist/commands/tip.d.ts +11 -0
  121. package/dist/commands/tip.js +86 -0
  122. package/dist/commands/trash.d.ts +17 -0
  123. package/dist/commands/trash.js +1 -1
  124. package/dist/commands/trial.d.ts +7 -0
  125. package/dist/commands/trial.js +16 -18
  126. package/dist/commands/unlock.d.ts +16 -0
  127. package/dist/commands/unlock.js +159 -0
  128. package/dist/commands/update.d.ts +42 -0
  129. package/dist/commands/update.js +1 -1
  130. package/dist/commands/usage.d.ts +8 -0
  131. package/dist/commands/verify.d.ts +18 -0
  132. package/dist/commands/verify.js +10 -6
  133. package/dist/commands/wallet-activity.d.ts +26 -0
  134. package/dist/commands/wallet-activity.js +117 -0
  135. package/dist/commands/wallet-donate.d.ts +26 -0
  136. package/dist/commands/wallet-donate.js +163 -0
  137. package/dist/commands/wallet-hall.d.ts +35 -0
  138. package/dist/commands/wallet-hall.js +214 -0
  139. package/dist/commands/wallet-send.d.ts +22 -0
  140. package/dist/commands/wallet-send.js +153 -0
  141. package/dist/commands/wallet-storage-ops.d.ts +24 -0
  142. package/dist/commands/wallet-storage-ops.js +215 -0
  143. package/dist/commands/wallet-storage.d.ts +18 -0
  144. package/dist/commands/wallet-storage.js +95 -0
  145. package/dist/commands/wallet-swap.d.ts +32 -0
  146. package/dist/commands/wallet-swap.js +287 -0
  147. package/dist/commands/wallet.d.ts +36 -0
  148. package/dist/commands/wallet.js +57 -15
  149. package/dist/commands/whoami.d.ts +10 -0
  150. package/dist/commands/whoami.js +24 -6
  151. package/dist/consent.d.ts +140 -0
  152. package/dist/consent.js +89 -30
  153. package/dist/credentials.d.ts +146 -0
  154. package/dist/credentials.js +10 -10
  155. package/dist/crypto-surface.d.ts +197 -0
  156. package/dist/crypto.d.ts +81 -0
  157. package/dist/crypto.js +13 -0
  158. package/dist/deposit.d.ts +25 -0
  159. package/dist/deposit.js +78 -0
  160. package/dist/download-part.d.ts +40 -0
  161. package/dist/download-sink.d.ts +76 -0
  162. package/dist/download.d.ts +79 -0
  163. package/dist/download.js +3 -3
  164. package/dist/drive-paths.d.ts +73 -0
  165. package/dist/environment.d.ts +62 -0
  166. package/dist/environment.js +29 -9
  167. package/dist/errors.d.ts +22 -0
  168. package/dist/errors.js +3 -3
  169. package/dist/exit.d.ts +44 -0
  170. package/dist/expiry.d.ts +58 -0
  171. package/dist/extend-budget.d.ts +35 -0
  172. package/dist/extend-budget.js +81 -0
  173. package/dist/extend-chain.d.ts +43 -0
  174. package/dist/extend-chain.js +40 -3
  175. package/dist/extend-plan.d.ts +148 -0
  176. package/dist/extend-plan.js +1 -1
  177. package/dist/gate.d.ts +18 -0
  178. package/dist/gate.js +100 -0
  179. package/dist/guards.d.ts +2 -0
  180. package/dist/help.d.ts +20 -0
  181. package/dist/help.js +199 -33
  182. package/dist/human-check.d.ts +23 -0
  183. package/dist/index.d.ts +42 -0
  184. package/dist/index.js +49 -0
  185. package/dist/item-trash.d.ts +1 -0
  186. package/dist/kit-file.d.ts +56 -0
  187. package/dist/kit-file.js +10 -10
  188. package/dist/list-file.d.ts +88 -0
  189. package/dist/list-file.js +90 -7
  190. package/dist/list-view-find.d.ts +15 -0
  191. package/dist/list-view-order.d.ts +32 -0
  192. package/dist/main.d.ts +12 -0
  193. package/dist/main.js +112 -113
  194. package/dist/manifest-chunk-cache.d.ts +14 -0
  195. package/dist/manifest-chunk-cache.js +103 -0
  196. package/dist/manifest-chunk-flow.d.ts +81 -0
  197. package/dist/manifest-chunk-flow.js +307 -0
  198. package/dist/manifest-create.d.ts +23 -0
  199. package/dist/manifest-create.js +26 -30
  200. package/dist/manifest-write.d.ts +161 -0
  201. package/dist/manifest-write.js +42 -33
  202. package/dist/manifest.d.ts +82 -0
  203. package/dist/manifest.js +69 -21
  204. package/dist/mark-render.d.ts +26 -0
  205. package/dist/mcp-args.d.ts +17 -0
  206. package/dist/mcp-ask.d.ts +43 -0
  207. package/dist/mcp-ask.js +100 -0
  208. package/dist/mcp-tools/context.d.ts +46 -0
  209. package/dist/mcp-tools/credits.d.ts +3 -0
  210. package/dist/mcp-tools/credits.js +61 -0
  211. package/dist/mcp-tools/files.d.ts +3 -0
  212. package/dist/mcp-tools/files.js +34 -0
  213. package/dist/mcp-tools/organise.d.ts +3 -0
  214. package/dist/mcp-tools/organise.js +82 -2
  215. package/dist/mcp-tools/reads.d.ts +3 -0
  216. package/dist/mcp-tools/reads.js +132 -4
  217. package/dist/mcp-tools/share.d.ts +3 -0
  218. package/dist/mcp-tools/share.js +26 -7
  219. package/dist/mcp-tools/support.d.ts +3 -0
  220. package/dist/mcp-tools/support.js +140 -0
  221. package/dist/mcp-tools/tiers.d.ts +31 -0
  222. package/dist/mcp-tools/tiers.js +147 -0
  223. package/dist/mcp.d.ts +80 -0
  224. package/dist/mcp.js +110 -9
  225. package/dist/net-retry.d.ts +38 -0
  226. package/dist/network.d.ts +10 -0
  227. package/dist/notice.d.ts +7 -0
  228. package/dist/notice.js +7 -7
  229. package/dist/product.d.ts +29 -0
  230. package/dist/product.js +1 -1
  231. package/dist/progress.d.ts +37 -0
  232. package/dist/prompt.d.ts +31 -0
  233. package/dist/prompt.js +1 -1
  234. package/dist/rebuild-key-check.d.ts +26 -0
  235. package/dist/rebuild-key-check.js +90 -0
  236. package/dist/rebuild.d.ts +87 -0
  237. package/dist/rebuild.js +26 -4
  238. package/dist/recovery-assemble.d.ts +40 -0
  239. package/dist/recovery-assemble.js +1 -1
  240. package/dist/recovery-build.d.ts +40 -0
  241. package/dist/recovery-map-file.d.ts +53 -0
  242. package/dist/recovery-map-file.js +4 -4
  243. package/dist/recovery-map.d.ts +197 -0
  244. package/dist/recovery-release.d.ts +104 -0
  245. package/dist/recovery-seq.d.ts +10 -0
  246. package/dist/recovery-source.d.ts +50 -0
  247. package/dist/redact.d.ts +70 -0
  248. package/dist/redact.js +212 -0
  249. package/dist/registration.d.ts +30 -0
  250. package/dist/registration.js +5 -5
  251. package/dist/risk.d.ts +380 -0
  252. package/dist/risk.js +206 -0
  253. package/dist/run-log.d.ts +78 -0
  254. package/dist/run-log.js +301 -0
  255. package/dist/s3/listing.d.ts +47 -0
  256. package/dist/s3/multipart.d.ts +21 -0
  257. package/dist/s3/response-sink.d.ts +8 -0
  258. package/dist/s3/same-file.d.ts +54 -0
  259. package/dist/s3/server.d.ts +58 -0
  260. package/dist/s3/server.js +2 -2
  261. package/dist/s3/sigv4.d.ts +46 -0
  262. package/dist/s3/sigv4.js +1 -1
  263. package/dist/s3/staging.d.ts +10 -0
  264. package/dist/s3/xml.d.ts +28 -0
  265. package/dist/safe-path.d.ts +41 -0
  266. package/dist/seal.d.ts +120 -0
  267. package/dist/secret-reader.d.ts +28 -0
  268. package/dist/server.d.ts +9 -0
  269. package/dist/session.d.ts +32 -0
  270. package/dist/session.js +1 -1
  271. package/dist/setup-questions.d.ts +7 -0
  272. package/dist/share.d.ts +108 -0
  273. package/dist/share.js +1 -1
  274. package/dist/shared/lib/crypto/size-padding.d.ts +55 -0
  275. package/dist/shared/lib/crypto/size-padding.js +5 -0
  276. package/dist/shared/lib/drive/manifest-chunks.d.ts +95 -0
  277. package/dist/shared/lib/drive/manifest-chunks.js +252 -0
  278. package/dist/shared/lib/drive/manifest-codec.d.ts +214 -0
  279. package/dist/shared/lib/drive/manifest-codec.js +7 -7
  280. package/dist/shared/lib/drive/manifest-index.d.ts +98 -0
  281. package/dist/shared/lib/drive/manifest-ops.d.ts +167 -0
  282. package/dist/shared/lib/drive/manifest-ops.js +9 -4
  283. package/dist/shared/lib/drive/manifest-pack.d.ts +65 -0
  284. package/dist/shared/lib/drive/manifest-pack.js +287 -0
  285. package/dist/shared/lib/drive/manifest-settings.d.ts +113 -0
  286. package/dist/shared/lib/drive/manifest-settings.js +87 -6
  287. package/dist/shared/lib/drive/name-conflict.d.ts +76 -0
  288. package/dist/shared/lib/drive/rebuild-verify.d.ts +73 -0
  289. package/dist/shared/lib/drive/rebuild-verify.js +112 -0
  290. package/dist/shared/lib/drive/unique-name.d.ts +9 -0
  291. package/dist/shared/lib/drive/zstd.d.ts +27 -0
  292. package/dist/shared/lib/drive/zstd.js +74 -0
  293. package/dist/shared/lib/extend/epochs.d.ts +205 -0
  294. package/dist/shared/lib/net/retry-budget.d.ts +79 -0
  295. package/dist/shared/lib/share/shared-file-info.d.ts +21 -0
  296. package/dist/shared/lib/storage-control/chain.d.ts +57 -0
  297. package/dist/shared/lib/storage-control/chain.js +82 -0
  298. package/dist/shared/lib/storage-control/plan.d.ts +40 -0
  299. package/dist/shared/lib/storage-control/plan.js +72 -0
  300. package/dist/shared/lib/storage-control/reuse.d.ts +72 -0
  301. package/dist/shared/lib/storage-control/reuse.js +95 -0
  302. package/dist/shared/lib/storage-network.d.ts +25 -0
  303. package/dist/shared/lib/upload/part-plan.d.ts +24 -0
  304. package/dist/shared/lib/wallet/activity.d.ts +138 -0
  305. package/dist/shared/lib/wallet/activity.js +208 -0
  306. package/dist/shared/lib/wallet/send-rules.d.ts +68 -0
  307. package/dist/shared/lib/wallet/send-rules.js +116 -0
  308. package/dist/shared/lib/wallet/swap-rules.d.ts +115 -0
  309. package/dist/shared/lib/wallet/swap-rules.js +199 -0
  310. package/dist/shared/lib/wallet/tip.d.ts +14 -0
  311. package/dist/shared/lib/wallet/tip.js +34 -0
  312. package/dist/shared/lib/wallet/venue-ids.d.ts +23 -0
  313. package/dist/shared/lib/wallet/venue-ids.js +53 -0
  314. package/dist/standing-tip.d.ts +24 -0
  315. package/dist/standing-tip.js +52 -0
  316. package/dist/stdout.d.ts +38 -0
  317. package/dist/storage-control-chain.d.ts +38 -0
  318. package/dist/storage-control-chain.js +78 -0
  319. package/dist/sui-rpc.d.ts +15 -0
  320. package/dist/sui-rpc.js +59 -0
  321. package/dist/support-attach.d.ts +24 -0
  322. package/dist/support-attach.js +72 -0
  323. package/dist/support-copy.d.ts +42 -0
  324. package/dist/support-copy.js +109 -0
  325. package/dist/support-wire.d.ts +49 -0
  326. package/dist/support-wire.js +194 -0
  327. package/dist/trash-sweep.d.ts +55 -0
  328. package/dist/units.d.ts +2 -0
  329. package/dist/update-check.d.ts +50 -0
  330. package/dist/update-source.d.ts +63 -0
  331. package/dist/upload-api.d.ts +3 -0
  332. package/dist/upload-file.d.ts +97 -0
  333. package/dist/upload-file.js +3 -2
  334. package/dist/upload-price.d.ts +50 -0
  335. package/dist/upload-steps.d.ts +26 -0
  336. package/dist/upload-steps.js +29 -9
  337. package/dist/upload-store.d.ts +182 -0
  338. package/dist/upload-wallet-chain.d.ts +54 -0
  339. package/dist/upload-wallet-chain.js +203 -0
  340. package/dist/upload-wallet-plan.d.ts +128 -0
  341. package/dist/upload-wallet-plan.js +184 -0
  342. package/dist/upload-wallet.d.ts +24 -0
  343. package/dist/upload-wallet.js +208 -0
  344. package/dist/upload-wire.d.ts +244 -0
  345. package/dist/upload.d.ts +18 -0
  346. package/dist/upload.js +10 -0
  347. package/dist/usage-report.d.ts +35 -0
  348. package/dist/wallet-activity-chain.d.ts +5 -0
  349. package/dist/wallet-activity-chain.js +31 -0
  350. package/dist/wallet-chain.d.ts +19 -0
  351. package/dist/wallet-chain.js +2 -2
  352. package/dist/wallet-grant.d.ts +50 -0
  353. package/dist/wallet-grant.js +218 -0
  354. package/dist/wallet-send-chain.d.ts +24 -0
  355. package/dist/wallet-send-chain.js +49 -0
  356. package/dist/wallet-sign.d.ts +133 -0
  357. package/dist/wallet-sign.js +317 -0
  358. package/dist/wallet-storage-chain.d.ts +3 -0
  359. package/dist/wallet-storage-chain.js +20 -0
  360. package/dist/wallet-swap-chain.d.ts +52 -0
  361. package/dist/wallet-swap-chain.js +186 -0
  362. package/dist/wallet-swap-quote.d.ts +22 -0
  363. package/dist/wallet-swap-quote.js +126 -0
  364. package/dist/wallet.d.ts +135 -0
  365. package/dist/wallet.js +5 -5
  366. package/dist/walrus-write.d.ts +56 -0
  367. package/dist/walrus-write.js +5 -4
  368. package/dist/walrus.d.ts +86 -0
  369. package/dist/walrus.js +48 -10
  370. package/dist/zstd-node.d.ts +11 -0
  371. package/dist/zstd-node.js +71 -0
  372. package/docs/commands/accept-terms.md +15 -0
  373. package/docs/commands/create.md +17 -0
  374. package/docs/commands/credits.md +34 -0
  375. package/docs/commands/delete-account.md +14 -0
  376. package/docs/commands/deposit.md +27 -0
  377. package/docs/commands/devices.md +9 -0
  378. package/docs/commands/documents.md +10 -0
  379. package/docs/commands/env.md +21 -0
  380. package/docs/commands/extend.md +27 -0
  381. package/docs/commands/folders.md +10 -0
  382. package/docs/commands/get.md +14 -0
  383. package/docs/commands/key.md +14 -0
  384. package/docs/commands/login.md +23 -0
  385. package/docs/commands/logout.md +11 -0
  386. package/docs/commands/losses.md +13 -0
  387. package/docs/commands/ls.md +16 -0
  388. package/docs/commands/marks.md +9 -0
  389. package/docs/commands/mcp.md +33 -0
  390. package/docs/commands/mode.md +29 -0
  391. package/docs/commands/on-collision.md +13 -0
  392. package/docs/commands/padding.md +13 -0
  393. package/docs/commands/public-code.md +9 -0
  394. package/docs/commands/pull.md +9 -0
  395. package/docs/commands/push.md +12 -0
  396. package/docs/commands/put.md +36 -0
  397. package/docs/commands/rebuild.md +13 -0
  398. package/docs/commands/recovery.md +18 -0
  399. package/docs/commands/s3.md +17 -0
  400. package/docs/commands/share.md +15 -0
  401. package/docs/commands/support.md +16 -0
  402. package/docs/commands/tip.md +21 -0
  403. package/docs/commands/trash.md +25 -0
  404. package/docs/commands/trial.md +12 -0
  405. package/docs/commands/unlock.md +25 -0
  406. package/docs/commands/update.md +14 -0
  407. package/docs/commands/usage.md +14 -0
  408. package/docs/commands/verify.md +18 -0
  409. package/docs/commands/wallet.md +67 -0
  410. package/docs/commands/whoami.md +12 -0
  411. package/package.json +67 -8
  412. package/server.json +28 -0
  413. package/vendor/nmts-crypto/nmts_crypto_wasm.d.ts +23 -2
  414. package/vendor/nmts-crypto/nmts_crypto_wasm.js +44 -2
  415. package/vendor/nmts-crypto/nmts_crypto_wasm_bg.wasm +0 -0
  416. package/vendor/nmts-crypto/nmts_crypto_wasm_bg.wasm.d.ts +1 -0
  417. package/vendor/nmts-crypto/package.json +1 -1
  418. package/dist/commands/consent.js +0 -77
  419. package/dist/extend-sign.js +0 -130
@@ -0,0 +1,36 @@
1
+ import { type Network } from "../network.ts";
2
+ import { type ChainReader } from "../wallet.ts";
3
+ export interface WalletOptions {
4
+ server?: string | undefined;
5
+ network?: string | undefined;
6
+ json?: boolean;
7
+ write?: (line: string) => void;
8
+ /** `wallet address --qr`: the address as a code a phone can scan, drawn in the terminal. */
9
+ qr?: boolean;
10
+ /** `wallet send`: the operands after "send", and its flags (`wallet-send.ts`). */
11
+ rest?: readonly string[];
12
+ yes?: boolean;
13
+ dryRun?: boolean;
14
+ feeCap?: string | undefined;
15
+ /** `wallet swap`: the coin to receive, the venue, the slippage, and the person's say past the gate. */
16
+ to?: string | undefined;
17
+ venue?: string | undefined;
18
+ slippageBps?: string | undefined;
19
+ acceptExtremes?: boolean;
20
+ /** `wallet storage split`: what the resource keeps, by size or by epochs (`wallet-storage-ops.ts`). */
21
+ size?: string | undefined;
22
+ epochs?: string | undefined;
23
+ /** `wallet hall`: the name to be listed under, or `remove` to go back to a shortened address. */
24
+ name?: string | undefined;
25
+ remove?: boolean;
26
+ /**
27
+ * Where the balances come from.
28
+ *
29
+ * ⚠ A SEAM, NOT AN OPTION: no flag reaches it and nothing on a command line can supply one. It
30
+ * is here because the alternative is a test that talks to a live chain — which cannot run
31
+ * offline, answers differently every day, and can never be asked to fail on purpose, which is
32
+ * most of what this command has to get right.
33
+ */
34
+ openChain?: (network: Network, address: string) => Promise<ChainReader> | ChainReader;
35
+ }
36
+ export declare function wallet(what: string | undefined, options?: WalletOptions): Promise<number>;
@@ -1,12 +1,13 @@
1
- // `nmts wallet` — which wallet this account code opens, and what the chain says is in it.
1
+ // `nmts wallet` — which wallet this NMTS key opens, and what the chain says is in it.
2
2
  //
3
- // ⛔ IT READS. Nothing in this command signs, sends, swaps or spends, and there is no option that
4
- // makes it. That is why it asks for no agreement: the agreement ladder stops a program from
5
- // signing with a wallet on somebody's behalf, and asking for it here — where nothing can move
6
- // would teach a person to grant the one key that matters in order to look at a number.
3
+ // ⛔ EVERY MODE HERE READS, EXCEPT `send`. Address, balance, activity and storage sign nothing and
4
+ // ask for no agreement: the agreement ladder stops a program from signing with a wallet on
5
+ // somebody's behalf, and asking for it where nothing can move would teach a person to grant the
6
+ // one key that matters in order to look at a number. `send` lives in `wallet-send.ts`, prints a
7
+ // review, and signs only with --yes and under the wallet agreement.
7
8
  //
8
9
  // ⛔ THE ADDRESS AND THE BALANCES ARE DIFFERENT KINDS OF FACT, so they fail differently. The
9
- // address is computed on this machine from the account code and cannot fail for any reason
10
+ // address is computed on this machine from the NMTS key and cannot fail for any reason
10
11
  // outside it; the balances come from a public node that can be slow, wrong or down. `nmts
11
12
  // wallet address` is the half that never needs a network, and it exists because "what is my
12
13
  // address" is the question somebody asks when the network is the thing that is broken.
@@ -23,21 +24,51 @@ import { BINARY_NAME } from "../product.js";
23
24
  import { resolveServer } from "../server.js";
24
25
  import { coinAmount, readBalances, walCoinType, walletAddress, SUI_COIN_TYPE, } from "../wallet.js";
25
26
  /** What the operand may say. Anything else is a command line to correct, not a guess to act on. */
26
- const MODES = ["address", "balance"];
27
+ const MODES = ["address", "balance", "activity", "storage", "send", "donate", "swap", "hall"];
27
28
  function modeOf(what) {
28
- if (what === undefined || what === "balance")
29
+ if (what === undefined)
29
30
  return "balance";
30
- if (what === "address")
31
- return "address";
31
+ const found = MODES.find((m) => m === what);
32
+ if (found !== undefined)
33
+ return found;
32
34
  throw new NmtsError(`\`${BINARY_NAME} wallet ${what}\` is not something this command does.`, {
33
35
  exitCode: 2,
34
- nextStep: `\`${BINARY_NAME} wallet\` shows the address and the balances, and ` +
35
- `\`${BINARY_NAME} wallet address\` shows the address alone, without touching a network.`,
36
+ nextStep: `\`${BINARY_NAME} wallet\` shows the address and the balances; \`${BINARY_NAME} wallet address\` ` +
37
+ `shows the address alone, without touching a network (add --qr for a code to scan); ` +
38
+ `\`${BINARY_NAME} wallet activity\` lists the recent transactions; \`${BINARY_NAME} wallet storage\` ` +
39
+ `lists the storage resources it holds. None of those signs. \`${BINARY_NAME} wallet send <SUI|WAL> ` +
40
+ `<amount|max> <address>\`, \`${BINARY_NAME} wallet swap <SUI|WAL> <amount|max>\` and ` +
41
+ `\`${BINARY_NAME} wallet donate <SUI|WAL> <amount>\` are the three that do, and only with --yes. ` +
42
+ `\`${BINARY_NAME} wallet hall\` shows the gift hall of fame; with --name it signs a name into it.`,
36
43
  });
37
44
  }
38
45
  export async function wallet(what, options = {}) {
39
46
  const say = options.write ?? ((line) => process.stdout.write(`${line}\n`));
40
47
  const mode = modeOf(what);
48
+ // The two lists live in files of their own; each reads through a seam of its own.
49
+ if (mode === "activity")
50
+ return (await import("./wallet-activity.js")).walletActivity(options);
51
+ if (mode === "storage") {
52
+ const [sub, ...more] = options.rest ?? [];
53
+ if (sub === "split" || sub === "merge" || sub === "transfer") {
54
+ return (await import("./wallet-storage-ops.js")).walletStorageOps(sub, more, options);
55
+ }
56
+ if (sub !== undefined) {
57
+ throw new NmtsError(`\`${BINARY_NAME} wallet storage ${sub}\` is not something this command does.`, {
58
+ exitCode: 2,
59
+ nextStep: `\`${BINARY_NAME} wallet storage\` lists; \`split\`, \`merge\` and \`transfer\` sign — \`${BINARY_NAME} help wallet\`.`,
60
+ });
61
+ }
62
+ return (await import("./wallet-storage.js")).walletStorage(options);
63
+ }
64
+ if (mode === "send")
65
+ return (await import("./wallet-send.js")).walletSend(options.rest ?? [], options);
66
+ if (mode === "donate")
67
+ return (await import("./wallet-donate.js")).walletDonate(options.rest ?? [], options);
68
+ if (mode === "swap")
69
+ return (await import("./wallet-swap.js")).walletSwap(options.rest ?? [], options);
70
+ if (mode === "hall")
71
+ return (await import("./wallet-hall.js")).walletHall(options);
41
72
  const resolved = await requireAccountCode();
42
73
  const address = await walletAddress(resolved.code);
43
74
  if (mode === "address") {
@@ -49,10 +80,19 @@ export async function wallet(what, options = {}) {
49
80
  return 0;
50
81
  }
51
82
  say(`Address ${address}`);
83
+ if (options.qr === true) {
84
+ // ⛔ THE SAME TEXT THE BROWSER'S CODE CARRIES — the bare address, nothing wrapped around it —
85
+ // so a phone that reads one reads the other. Medium error correction and a two-module
86
+ // quiet zone are the browser's settings too; without the quiet zone many scanners see nothing.
87
+ const { renderUnicodeCompact } = await import("uqr");
88
+ say(``);
89
+ for (const row of renderUnicodeCompact(address, { ecc: "M", border: 2 }).split("\n"))
90
+ say(` ${row}`);
91
+ }
52
92
  say(``);
53
- say(` Derived on this machine from the account code. Nothing was asked of the NMTS server or`);
93
+ say(` Derived on this machine from the NMTS key. Nothing was asked of the NMTS server or`);
54
94
  say(` of any chain, so this says what the wallet is called and nothing about what is in it.`);
55
- say(` The browser app derives the same address from the same code.`);
95
+ say(` The browser app derives the same address from the same NMTS key.`);
56
96
  return 0;
57
97
  }
58
98
  // ⛔ THE SERVER IS RESOLVED BUT NEVER CALLED. It is here for one thing only: the live server
@@ -80,7 +120,7 @@ export async function wallet(what, options = {}) {
80
120
  say(`SUI ${inWords(balances.sui)}`);
81
121
  say(`WAL ${inWords(balances.wal)}`);
82
122
  say(``);
83
- say(` The address is derived on this machine from the account code; the balances were read`);
123
+ say(` The address is derived on this machine from the NMTS key; the balances were read`);
84
124
  say(` from the ${network} chain just now, and they move without this tool.`);
85
125
  if (!balances.sui.read || !balances.wal.read) {
86
126
  say(` A balance that could not be read is printed as that and never as zero, and this command`);
@@ -89,6 +129,8 @@ export async function wallet(what, options = {}) {
89
129
  }
90
130
  say(` Nothing here signs or spends. \`${BINARY_NAME} extend\` is the one command that signs, and it`);
91
131
  say(` asks for a separate agreement before it does.`);
132
+ say(` Storing needs no coin here: credits pay the network. \`${BINARY_NAME} help wallet\` says where`);
133
+ say(` SUI comes from when you want to pay the network yourself.`);
92
134
  return exitCodeFor(balances);
93
135
  }
94
136
  /**
@@ -0,0 +1,10 @@
1
+ export interface WhoamiOptions {
2
+ server?: string | undefined;
3
+ network?: string | undefined;
4
+ write?: (line: string) => void;
5
+ /** Print the NMTS key itself. A person's act — see the header. */
6
+ reveal?: boolean;
7
+ /** Machine-readable output. Only `--reveal` has one; the listing is for a person. */
8
+ json?: boolean;
9
+ }
10
+ export declare function whoami(options?: WhoamiOptions): Promise<number>;
@@ -4,16 +4,34 @@
4
4
  // code on this machine; nothing is asked of a server. So it proves the code is well-formed and
5
5
  // which account it is, and it proves nothing about whether that account exists, has credits, or
6
6
  // is signed in. Printing an account id without saying that would read as "connected".
7
+ //
8
+ // ⛔ AND `--reveal` PUTS THE NMTS KEY ITSELF ON THE SCREEN. Everything else this command
9
+ // prints is public: an account id and a public code give nobody anything. The code is the
10
+ // account — every file key and the wallet derive from it — so the flag exists for one
11
+ // situation, a person copying it out of a machine they are sitting at, and it is refused while
12
+ // a mode is on. There is no MCP tool for it either: an agent driving this tool was handed the
13
+ // code already, so a surface that prints it can only ever move it somewhere new.
7
14
  import { identityOf } from "../account.js";
8
15
  import { requireAccountCode } from "../code-access.js";
9
16
  import { CODE_ENV_VAR, readCredentialsFile } from "../credentials.js";
10
- import { BINARY_NAME } from "../product.js";
11
17
  import { resolveNetwork } from "../network.js";
12
18
  import { resolveServer } from "../server.js";
13
19
  export async function whoami(options = {}) {
14
20
  const say = options.write ?? ((line) => process.stdout.write(`${line}\n`));
15
21
  const resolved = await requireAccountCode();
16
22
  const identity = await identityOf(resolved.code);
23
+ if (options.reveal === true) {
24
+ if (options.json === true) {
25
+ say(JSON.stringify({ account_code: identity.displayCode }));
26
+ return 0;
27
+ }
28
+ // ⛔ THE WARNING COMES FIRST AND THE CODE IS ALONE ON ITS OWN LINE. Whoever is about to copy
29
+ // it reads what it is before they see it, and a line with nothing else on it is one a
30
+ // person can select without dragging a label into their clipboard.
31
+ say(`The NMTS key is the account: anyone who reads it can open every file and delete the account.`);
32
+ say(identity.displayCode);
33
+ return 0;
34
+ }
17
35
  // ⛔ BOTH STORED SHAPES, and an adversarial review is why. This read `source === "file"` only,
18
36
  // which was right while the file always held the code in the clear — and became wrong the
19
37
  // day `login` started sealing by default. Somebody who ran `login --server … --network
@@ -21,11 +39,11 @@ export async function whoami(options = {}) {
21
39
  const stored = resolved.source === "file" || resolved.source === "file-locked" ? readCredentialsFile() : null;
22
40
  const server = resolveServer(options.server ?? stored?.server);
23
41
  const network = resolveNetwork(server, options.network ?? stored?.network);
24
- say(`Account id ${identity.accountId}`);
25
- say(`Public code ${identity.publicCode}`);
26
- say(`Code from ${resolved.source === "env" ? `${CODE_ENV_VAR} (not stored)` : "this machine"}`);
27
- say(`Server ${server}`);
28
- say(`Network ${network}`);
42
+ say(`Account id ${identity.accountId}`);
43
+ say(`Public code ${identity.publicCode}`);
44
+ say(`NMTS key from ${resolved.source === "env" ? `${CODE_ENV_VAR} (not stored)` : "this machine"}`);
45
+ say(`Server ${server}`);
46
+ say(`Network ${network}`);
29
47
  say(``);
30
48
  say(` Derived on this machine. Nothing was asked of the server, so this does not say whether`);
31
49
  say(` the account exists there, has credits, or is signed in.`);
@@ -0,0 +1,140 @@
1
+ /** One thing worth stopping for, and everything a person needs to decide about it. */
2
+ export interface Consent {
3
+ /** What the tool would do. One line, in the second person. */
4
+ what: string;
5
+ /** What can go wrong. The reason this key exists, said plainly. */
6
+ risk: string;
7
+ /** What is NOT covered, said before it matters rather than after. */
8
+ limit: string;
9
+ }
10
+ export declare const CONSENTS: {
11
+ /**
12
+ * Writing the NMTS key down UNSEALED — in the clear, in this tool's own file.
13
+ *
14
+ * ⛔ THE DEFAULT IS THE SEALED FORM, and this key is what unlocks the other one (owner,
15
+ * 2026-08-23: support storing it, but only behind encryption unless somebody agrees to a
16
+ * disclaimer). It covers both the ordinary case, where mode 600 is the only protection and
17
+ * every program running as you can read it, and the worse one, where the filesystem cannot
18
+ * keep the mode either — a Windows share, some container mounts, a network drive. `login`
19
+ * prints which of the two this machine is before it asks.
20
+ *
21
+ * ⚠ IT WAS NARROWER UNTIL 2026-08-23, covering only the filesystem case. Nothing had shipped
22
+ * under the old meaning — the tool is not published — so no grant anywhere means less than
23
+ * the words above. If it ever does, this needs a new key rather than a wider one: a grant
24
+ * means what it said on the day it was given.
25
+ */
26
+ readonly "unsafe-code-storage": {
27
+ readonly what: "Store the NMTS key in the clear, unsealed, in this tool's own file.";
28
+ readonly risk: string;
29
+ readonly limit: string;
30
+ };
31
+ /**
32
+ * Reading the code out of a plain environment variable, or printing one to be set.
33
+ *
34
+ * ⛔ IT IS A DIFFERENT PLACE, NOT A SMALLER VERSION OF THE FILE (owner, 2026-08-23: an agent
35
+ * must be able to choose this, with the person's agreement). An environment variable leaks
36
+ * through channels a file does not: `docker inspect` prints the whole environment of a
37
+ * container, `/proc/<pid>/environ` is readable by the same user for as long as the process
38
+ * lives, every child process inherits it, and CI systems echo it into logs. A variable that
39
+ * names a FILE — `NMTS_ACCOUNT_CODE_FILE` — has none of those, which is why it needs no
40
+ * agreement.
41
+ */
42
+ readonly "plain-env": {
43
+ readonly what: "Use the NMTS key from a plain environment variable, or print one to be set.";
44
+ readonly risk: string;
45
+ readonly limit: string;
46
+ };
47
+ /**
48
+ * Signing a chain transaction with the wallet the NMTS key derives.
49
+ *
50
+ * Separate from `spend` because it is a different pot of money: credits are a promise this
51
+ * service made, and a wallet holds assets nobody can restore.
52
+ */
53
+ /**
54
+ * Handing a file to another account.
55
+ *
56
+ * ⛔ IT IS HERE BECAUSE THE UNDO DOES NOT UNDO IT. Every other irreversible thing in this tool
57
+ * costs money or moves the NMTS key; this one gives somebody else a copy of a file, and
58
+ * taking the share back afterwards stops future downloads and reaches nothing already
59
+ * fetched. That gap is not a flaw to be fixed later — it is what handing somebody a file
60
+ * means — so it is said before the first share rather than after it.
61
+ */
62
+ readonly share: {
63
+ readonly what: "Give another account the key to one of this account's files.";
64
+ readonly risk: string;
65
+ readonly limit: string;
66
+ };
67
+ /**
68
+ * ⛔ THIS ONE IS NOT A BARE DATE. `wallet-grant.ts` writes it with a scope, an expiry of at most
69
+ * 30 days and optional ceilings, and `requireWalletGrant` is what asks for it — the plain
70
+ * `requireConsent("wallet")` would read an older bare-date record as "everything, forever".
71
+ */
72
+ readonly wallet: {
73
+ readonly what: "Use the wallet this NMTS key derives, and sign transactions with it.";
74
+ readonly risk: string;
75
+ readonly limit: string;
76
+ };
77
+ /** Ending another device's session — the browser's, usually. */
78
+ readonly "sign-out": {
79
+ readonly what: "Sign devices out of this account from this machine.";
80
+ readonly risk: string;
81
+ readonly limit: "This does not touch files, credits or the wallet. It ends sessions and nothing else.";
82
+ };
83
+ /** Putting the previous file list back. */
84
+ readonly rollback: {
85
+ readonly what: "Replace the current file list with the previous one.";
86
+ readonly risk: string;
87
+ readonly limit: "This covers the list. It cannot restore a file whose storage has run out.";
88
+ };
89
+ /** Printing the NMTS key. */
90
+ readonly reveal: {
91
+ readonly what: "Print the NMTS key on this screen.";
92
+ readonly risk: string;
93
+ readonly limit: "This covers printing it. Where it goes afterwards is not something this tool can see.";
94
+ };
95
+ /** Writing the NMTS key into a recovery kit. */
96
+ readonly kit: {
97
+ readonly what: "Write the NMTS key into a recovery kit file on this disk.";
98
+ readonly risk: string;
99
+ readonly limit: "The recovery list alone (`recovery-list`) holds no NMTS key and asks for nothing.";
100
+ };
101
+ /** A gift to the developer — on its own, or as a tip at payment (2026-09-06). */
102
+ readonly donate: {
103
+ readonly what: "Send gifts to the developer of NMTS from this account's wallet.";
104
+ readonly risk: string;
105
+ readonly limit: string;
106
+ };
107
+ /** Destroying the treasury-owned storage under a credit-paid file. */
108
+ readonly "release-storage": {
109
+ readonly what: "Destroy the credit-paid storage under a file, so the network stops serving its bytes.";
110
+ readonly risk: string;
111
+ readonly limit: "This covers credit-paid storage only. Storage bought with your own wallet is burned by the wallet.";
112
+ };
113
+ };
114
+ export type ConsentKey = keyof typeof CONSENTS;
115
+ /**
116
+ * ⛔ DERIVED FROM THE TABLE, so a key added above cannot be missing from the checks below.
117
+ * Written as `Object.keys` of the table rather than a hand-kept array: a hand-kept one goes
118
+ * stale silently, and the failure is a capability nobody is ever asked about.
119
+ */
120
+ export declare const CONSENT_KEYS: ConsentKey[];
121
+ /**
122
+ * The whole file, as written. `wallet-grant.ts` keeps its richer record under the same key so
123
+ * `consent` still lists one thing per key; nothing else should reach for this.
124
+ */
125
+ export declare function readConsentRecords(): Record<string, unknown>;
126
+ export declare function writeConsentRecords(all: Record<string, unknown>): void;
127
+ /** When this key was agreed to on this machine, or null. */
128
+ export declare function grantedAt(key: ConsentKey): string | null;
129
+ export declare function isGranted(key: ConsentKey): boolean;
130
+ /** Write the grant down, with the date and the version that asked. */
131
+ export declare function grant(key: ConsentKey, version: string, now: Date): void;
132
+ export declare function revoke(key: ConsentKey): void;
133
+ /**
134
+ * Stop unless this has been agreed to, and say exactly what agreeing would mean.
135
+ *
136
+ * ⛔ THE MESSAGE IS THE PRODUCT HERE. It is the only thing standing between somebody and a
137
+ * decision they cannot take back, so it says what happens, what can go wrong, what is not
138
+ * covered, and the one command that agrees — in that order, every time.
139
+ */
140
+ export declare function requireConsent(key: ConsentKey): void;
package/dist/consent.js CHANGED
@@ -8,7 +8,7 @@
8
8
  // ⛔ FIVE KEYS, NOT TWENTY. A tool that asks about everything trains the person to say yes
9
9
  // without reading, and then the one question that mattered is the one they clicked through.
10
10
  // The bar for a key existing is one of: it cannot be undone · it costs money · it puts the
11
- // account code somewhere that is not this tool's sealed file. Anything else happens without
11
+ // NMTS key somewhere that is not this tool's sealed file. Anything else happens without
12
12
  // asking, and the count is written here so that adding a sixth has to be a decision.
13
13
  // ⚠ The fifth was added for sharing, which is the first thing this tool can do that hands
14
14
  // something to a person who is not the account holder — and the only one whose undo does not
@@ -29,22 +29,7 @@ import { NmtsError } from "./errors.js";
29
29
  import { BINARY_NAME, SUPPORT_EMAIL } from "./product.js";
30
30
  export const CONSENTS = {
31
31
  /**
32
- * Spending the account's credits.
33
- *
34
- * Asked once because the price of every single upload is printed anyway — what this covers is
35
- * the person understanding that this tool can spend at all, which is not obvious from a command
36
- * called `put`.
37
- */
38
- spend: {
39
- what: "Spend this account's credits on storage.",
40
- risk: "Credits are consumed and are not refundable. Storage is bought on a public network and " +
41
- "cannot be un-bought. The price of each upload is printed before it happens, and daily " +
42
- "ceilings apply on the server whatever this machine asks for.",
43
- limit: "This does not cover anything spent from a wallet. That is a separate agreement, and this " +
44
- "one does not grant it.",
45
- },
46
- /**
47
- * Writing the account code down UNSEALED — in the clear, in this tool's own file.
32
+ * Writing the NMTS key down UNSEALED — in the clear, in this tool's own file.
48
33
  *
49
34
  * ⛔ THE DEFAULT IS THE SEALED FORM, and this key is what unlocks the other one (owner,
50
35
  * 2026-08-23: support storing it, but only behind encryption unless somebody agrees to a
@@ -59,14 +44,14 @@ export const CONSENTS = {
59
44
  * means what it said on the day it was given.
60
45
  */
61
46
  "unsafe-code-storage": {
62
- what: "Store the account code in the clear, unsealed, in this tool's own file.",
63
- risk: "The account code opens every file in this account and derives its wallet. Written in the " +
47
+ what: "Store the NMTS key in the clear, unsealed, in this tool's own file.",
48
+ risk: "The NMTS key opens every file in this account and derives its wallet. Written in the " +
64
49
  "clear it is readable by anything running as you — every agent, every script, every " +
65
50
  "backup that copies your home directory, every image layer built from it. Where the " +
66
51
  "filesystem cannot keep a file private, it is readable by others as well.",
67
- limit: "There is no recovery from a leaked code: it cannot be changed while it still opens the " +
52
+ limit: "There is no recovery from a leaked NMTS key: it cannot be changed while it still opens the " +
68
53
  "files it opened. The alternatives are the sealed form, which is what `login` does by " +
69
- "default, and a secret file the code is read from and never copied into.",
54
+ "default, and a secret file the NMTS key is read from and never copied into.",
70
55
  },
71
56
  /**
72
57
  * Reading the code out of a plain environment variable, or printing one to be set.
@@ -80,7 +65,7 @@ export const CONSENTS = {
80
65
  * agreement.
81
66
  */
82
67
  "plain-env": {
83
- what: "Use the account code from a plain environment variable, or print one to be set.",
68
+ what: "Use the NMTS key from a plain environment variable, or print one to be set.",
84
69
  risk: "An environment variable is not private to the program that reads it. `docker inspect` " +
85
70
  "prints the entire environment of a container, anything running as you can read " +
86
71
  "/proc/<pid>/environ while the process lives, every child process inherits it, and " +
@@ -90,7 +75,7 @@ export const CONSENTS = {
90
75
  "NMTS_ACCOUNT_CODE_FILE — avoids all of the above and asks for nothing.",
91
76
  },
92
77
  /**
93
- * Signing a chain transaction with the wallet the account code derives.
78
+ * Signing a chain transaction with the wallet the NMTS key derives.
94
79
  *
95
80
  * Separate from `spend` because it is a different pot of money: credits are a promise this
96
81
  * service made, and a wallet holds assets nobody can restore.
@@ -99,7 +84,7 @@ export const CONSENTS = {
99
84
  * Handing a file to another account.
100
85
  *
101
86
  * ⛔ IT IS HERE BECAUSE THE UNDO DOES NOT UNDO IT. Every other irreversible thing in this tool
102
- * costs money or moves the account code; this one gives somebody else a copy of a file, and
87
+ * costs money or moves the NMTS key; this one gives somebody else a copy of a file, and
103
88
  * taking the share back afterwards stops future downloads and reaches nothing already
104
89
  * fetched. That gap is not a flaw to be fixed later — it is what handing somebody a file
105
90
  * means — so it is said before the first share rather than after it.
@@ -112,13 +97,66 @@ export const CONSENTS = {
112
97
  limit: "This does not cover uploading, spending, or anything to do with a wallet. It covers giving " +
113
98
  "away files this account already holds.",
114
99
  },
100
+ /**
101
+ * ⛔ THIS ONE IS NOT A BARE DATE. `wallet-grant.ts` writes it with a scope, an expiry of at most
102
+ * 30 days and optional ceilings, and `requireWalletGrant` is what asks for it — the plain
103
+ * `requireConsent("wallet")` would read an older bare-date record as "everything, forever".
104
+ */
115
105
  wallet: {
116
- what: "Use the wallet this account code derives, and sign transactions with it.",
106
+ what: "Use the wallet this NMTS key derives, and sign transactions with it.",
117
107
  risk: "A signed transaction moves real assets and cannot be reversed by anybody, including NMTS. " +
118
- "A mistake here is permanent.",
119
- limit: "Only what this tool signs. Handing the account code to another program gives that program " +
108
+ "A mistake here is permanent. The agreement names a scope, runs out after at most 30 days, " +
109
+ "and can carry a ceiling on what this tool signs away.",
110
+ limit: "Only what this tool signs. Handing the NMTS key to another program gives that program " +
120
111
  "the same wallet, and nothing here can see that happen.",
121
112
  },
113
+ /** Ending another device's session — the browser's, usually. */
114
+ "sign-out": {
115
+ what: "Sign devices out of this account from this machine.",
116
+ risk: "Whoever is signed in on that device is signed out at once, in the middle of whatever they were " +
117
+ "doing. From a key, signing out everywhere ends every browser session, including the one that " +
118
+ "can revoke this machine's key.",
119
+ limit: "This does not touch files, credits or the wallet. It ends sessions and nothing else.",
120
+ },
121
+ /** Putting the previous file list back. */
122
+ rollback: {
123
+ what: "Replace the current file list with the previous one.",
124
+ risk: "Every change since the previous list was written disappears from the list: uploads since then " +
125
+ "are no longer named by it, and moves, renames and labels since then are undone. The files " +
126
+ "themselves are not touched, and a rebuild can find what the list forgot.",
127
+ limit: "This covers the list. It cannot restore a file whose storage has run out.",
128
+ },
129
+ /** Printing the NMTS key. */
130
+ reveal: {
131
+ what: "Print the NMTS key on this screen.",
132
+ risk: "The NMTS key is the account: anyone who reads it can open every file and delete the " +
133
+ "account. A screen is copied by terminals, session recorders and screenshots, and by any " +
134
+ "program reading this tool's output.",
135
+ limit: "This covers printing it. Where it goes afterwards is not something this tool can see.",
136
+ },
137
+ /** Writing the NMTS key into a recovery kit. */
138
+ kit: {
139
+ what: "Write the NMTS key into a recovery kit file on this disk.",
140
+ risk: "The kit holds the NMTS key in the clear. Anything that reads this disk — a backup, a sync " +
141
+ "folder, another user, an image built from it — reads it, and the NMTS key is the account.",
142
+ limit: "The recovery list alone (`recovery-list`) holds no NMTS key and asks for nothing.",
143
+ },
144
+ /** A gift to the developer — on its own, or as a tip at payment (2026-09-06). */
145
+ donate: {
146
+ what: "Send gifts to the developer of NMTS from this account's wallet.",
147
+ risk: "A gift is voluntary, buys nothing, and is not refunded. It goes to the address the site " +
148
+ "publishes, and like every transaction on the chain it is visible to anyone on an explorer " +
149
+ "such as Suiscan. Once sent it cannot be recalled by anybody, NMTS included.",
150
+ limit: "This covers gifts this tool sends: `wallet donate`, and a tip named at a payment. Every gift " +
151
+ "still asks on the run that sends it, and a standing tip above ten percent asks once more.",
152
+ },
153
+ /** Destroying the treasury-owned storage under a credit-paid file. */
154
+ "release-storage": {
155
+ what: "Destroy the credit-paid storage under a file, so the network stops serving its bytes.",
156
+ risk: "The bytes stop being served for good. The server allows forty of these a day for the whole " +
157
+ "service, so a loop here can stop other people's credit uploads for the day.",
158
+ limit: "This covers credit-paid storage only. Storage bought with your own wallet is burned by the wallet.",
159
+ },
122
160
  };
123
161
  /**
124
162
  * ⛔ DERIVED FROM THE TABLE, so a key added above cannot be missing from the checks below.
@@ -129,6 +167,27 @@ export const CONSENT_KEYS = Object.keys(CONSENTS);
129
167
  function path() {
130
168
  return join(configDir(), "consent.json");
131
169
  }
170
+ /**
171
+ * The whole file, as written. `wallet-grant.ts` keeps its richer record under the same key so
172
+ * `consent` still lists one thing per key; nothing else should reach for this.
173
+ */
174
+ export function readConsentRecords() {
175
+ try {
176
+ const parsed = JSON.parse(readFileSync(path(), "utf8"));
177
+ if (typeof parsed !== "object" || parsed === null)
178
+ return {};
179
+ return { ...parsed };
180
+ }
181
+ catch {
182
+ return {};
183
+ }
184
+ }
185
+ export function writeConsentRecords(all) {
186
+ mkdirSync(configDir(), { recursive: true, mode: 0o700 });
187
+ writeFileSync(path(), `${JSON.stringify(all, null, 2)}\n`, { mode: 0o600 });
188
+ if (modesAreEnforced())
189
+ chmodSync(path(), 0o600);
190
+ }
132
191
  function read() {
133
192
  try {
134
193
  const parsed = JSON.parse(readFileSync(path(), "utf8"));
@@ -188,11 +247,11 @@ export function requireConsent(key) {
188
247
  `machine, including an AI agent. The published Terms are what govern the service; this is a`,
189
248
  `warning, not a substitute for them.`,
190
249
  "",
191
- `To agree, on this machine, once: ${BINARY_NAME} consent grant ${key}`,
192
- `To see what has been agreed to: ${BINARY_NAME} consent`,
250
+ `To unlock, at a terminal, once: ${BINARY_NAME} unlock ${key}`,
251
+ `To see what is unlocked: ${BINARY_NAME} unlock`,
193
252
  "",
194
253
  `⛔ If a program is reading this on somebody's behalf: show it to them and let them decide.`,
195
- ` Do not run the grant command yourself.`,
254
+ ` Do not run the unlock command yourself.`,
196
255
  "",
197
256
  `Something wrong or confusing here? ${SUPPORT_EMAIL}`,
198
257
  ].join("\n"),