@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,88 @@
1
+ import { WRITTEN_BY, type ArtifactAbout } from "./artifact-about.ts";
2
+ /** Wrapper format identifier, distinct from the recovery list's. */
3
+ export declare const LIST_FILE_FORMAT = "nmts-file-list";
4
+ /**
5
+ * The shell's version for a file holding ONE sealed blob. Not the file list's own version (`seq`).
6
+ *
7
+ * ⛔ A shell of version 1 means `sealed` is the whole list, and that has not changed. It is what an
8
+ * account still on the single-blob format produces, and every reader that ever handled this file
9
+ * goes on handling it.
10
+ */
11
+ export declare const LIST_FILE_VERSION = 1;
12
+ /**
13
+ * The shell's version for a file holding an INDEX and the chunks it names (NCF-3 §6.3).
14
+ *
15
+ * ⛔ WHY THE SHELL HAD TO MOVE TOO. At format version 2 the sealed blob the server stores is an
16
+ * index: it carries the settings, the version and the parent link, and NOT the entries. A copy
17
+ * of that blob alone is a copy of nothing anybody can use, so the chunks travel in the same
18
+ * file — one artefact, as before, because the whole point of this file is that the person
19
+ * holding it has everything.
20
+ */
21
+ export declare const LIST_FILE_VERSION_CHUNKED = 2;
22
+ /** Filename extension. Deliberately not the recovery list's: the two must not be confusable. */
23
+ export declare const LIST_FILE_EXTENSION = "nmtslist";
24
+ export { WRITTEN_BY };
25
+ /** The on-disk document. */
26
+ export interface FileListFile {
27
+ format: typeof LIST_FILE_FORMAT;
28
+ version: typeof LIST_FILE_VERSION | typeof LIST_FILE_VERSION_CHUNKED;
29
+ /** The list's own version number — higher is newer, the counter every device syncs by. */
30
+ seq: number;
31
+ /** RFC3339 — when the machine wrote its copy, on its own clock. Absent when it is not known. */
32
+ saved_at?: string;
33
+ /** Public account id, so a person holding several files knows which is which. */
34
+ account_id: string;
35
+ /** The sealed file list, base64url. At shell version 2 this is the INDEX. */
36
+ sealed: string;
37
+ /**
38
+ * The sealed chunks the index names, base64url, in the order it names them. Shell version 2 only.
39
+ *
40
+ * ⛔ IN THE INDEX'S OWN ORDER, and a reader must keep it. The index names each chunk by the hash
41
+ * of its transport string, so a reader can pair them up by hashing — but it should not have
42
+ * to, and a copy that arrived shuffled would be a copy nobody could check quickly.
43
+ */
44
+ chunks?: string[];
45
+ /** Plain-language lines for a finder. */
46
+ note: string[];
47
+ about: ArtifactAbout;
48
+ }
49
+ export interface BuildListFileInput {
50
+ accountId: string;
51
+ seq: number;
52
+ /** When the copy was taken, RFC3339. Omitted when the copy does not record one. */
53
+ savedAt?: string | undefined;
54
+ sealed: string;
55
+ /** The chunks the sealed index names. Absent or empty for a single-blob list. */
56
+ chunks?: readonly string[] | undefined;
57
+ }
58
+ /**
59
+ * Build the document and the name to offer it under.
60
+ *
61
+ * Pure on purpose: it touches no disk and no clock, so what it produces can be compared against
62
+ * the format itself rather than against whatever the machine running it happened to be doing.
63
+ *
64
+ * ⚠ THE VERSION IS IN THE FILENAME, ZERO-PADDED, so a folder holding several copies sorts into
65
+ * the order they were written and the newest is the last one.
66
+ */
67
+ export declare function buildFileListFile(input: BuildListFileInput): {
68
+ filename: string;
69
+ content: string;
70
+ };
71
+ /** What a `.nmtslist` turned out to hold, whichever shell version wrote it. */
72
+ export interface ReadListFile {
73
+ /** The list's own version number. */
74
+ seq: number;
75
+ accountId: string;
76
+ /** The sealed blob: the whole list at shell version 1, the index at shell version 2. */
77
+ sealed: string;
78
+ /** The sealed chunks the index names, in its order. Empty for a single-blob file. */
79
+ chunks: string[];
80
+ }
81
+ /**
82
+ * Read one of these files back, accepting BOTH shells.
83
+ *
84
+ * ⛔ IT REFUSES RATHER THAN GUESSING. A file missing its sealed bytes, or naming chunks that are
85
+ * not strings, is not a shorter list — it is a copy somebody has been keeping for years that
86
+ * turns out not to be one, and the moment to say so is the moment they reach for it.
87
+ */
88
+ export declare function parseFileListFile(text: string): ReadListFile;
package/dist/list-file.js CHANGED
@@ -9,24 +9,47 @@
9
9
  //
10
10
  // ⛔ NOTHING SECRET IN THE HEADER, AND THAT INCLUDES SIZES. The plaintext part of this file says
11
11
  // what the file IS — never what is inside it, not a file name, not a count, not a total. The
12
- // contents are one sealed envelope that opens with the account code and nothing else, so a
12
+ // contents are one sealed envelope that opens with the NMTS key and nothing else, so a
13
13
  // stranger who finds this learns which account it belongs to and no more.
14
14
  //
15
- // ⛔ THE ACCOUNT CODE IS NOT IN IT, and that is not an oversight to fix later. This file plus the
15
+ // ⛔ THE NMTS KEY IS NOT IN IT, and that is not an oversight to fix later. This file plus the
16
16
  // code is the account; keeping both in one place would make one theft into a total loss.
17
17
  //
18
- // ⚠ WHAT DIFFERS FROM THE BROWSER'S COPY, and neither is a format difference:
18
+ // ⚠ WHAT DIFFERS FROM THE BROWSER'S COPY. The first two are not format differences:
19
19
  // · The finder's note is English only. The browser ships it in English and Korean because it
20
20
  // cannot know which language the person who finds the file years later reads; this package
21
21
  // ships English strings only, and inventing a translation here would be worse than the gap.
22
22
  // · `about.app_version` names THIS PROGRAM and its version rather than the site release. It is
23
23
  // the field's own contract — a claim the writer makes about itself — and a person holding two
24
24
  // copies of one account's list can then tell which program wrote each.
25
+ // · ⛔ THE THIRD ONE IS: this command writes shell version 2 — the index plus the chunks it
26
+ // names — for an account whose list is in chunks, and the browser does not yet. Both write
27
+ // shell version 1 for a single-blob list, and the reader below takes either. It was done here
28
+ // first because a copy of an index alone is a copy of nothing anybody can use, and this is
29
+ // the command whose whole job is that the copy is complete. ▶ The browser's writer has the
30
+ // same gap to close, and until it does, a `.nmtslist` saved from a browser on a chunked
31
+ // account is an index with no entries behind it.
25
32
  import { artifactAbout, WRITTEN_BY } from "./artifact-about.js";
26
33
  /** Wrapper format identifier, distinct from the recovery list's. */
27
34
  export const LIST_FILE_FORMAT = "nmts-file-list";
28
- /** The shell's version. Not the file list's own version, which is `seq`. */
35
+ /**
36
+ * The shell's version for a file holding ONE sealed blob. Not the file list's own version (`seq`).
37
+ *
38
+ * ⛔ A shell of version 1 means `sealed` is the whole list, and that has not changed. It is what an
39
+ * account still on the single-blob format produces, and every reader that ever handled this file
40
+ * goes on handling it.
41
+ */
29
42
  export const LIST_FILE_VERSION = 1;
43
+ /**
44
+ * The shell's version for a file holding an INDEX and the chunks it names (NCF-3 §6.3).
45
+ *
46
+ * ⛔ WHY THE SHELL HAD TO MOVE TOO. At format version 2 the sealed blob the server stores is an
47
+ * index: it carries the settings, the version and the parent link, and NOT the entries. A copy
48
+ * of that blob alone is a copy of nothing anybody can use, so the chunks travel in the same
49
+ * file — one artefact, as before, because the whole point of this file is that the person
50
+ * holding it has everything.
51
+ */
52
+ export const LIST_FILE_VERSION_CHUNKED = 2;
30
53
  /** Filename extension. Deliberately not the recovery list's: the two must not be confusable. */
31
54
  export const LIST_FILE_EXTENSION = "nmtslist";
32
55
  // ⚠ THE HEADER BLOCK IS NOT SPELLED HERE. Three artefacts carry the same one — this file, the
@@ -37,11 +60,11 @@ export { WRITTEN_BY };
37
60
  /** Plain-language lines for whoever finds this file with no idea what it is. */
38
61
  const NOTE = [
39
62
  `This file is an encrypted copy of an NMTS (nmts.me) file list — the names, folders and file ` +
40
- `keys of one account, locked with its account code.`,
63
+ `keys of one account, locked with its NMTS key.`,
41
64
  `It is written by the \`nmts\` command from the copy that machine keeps. A higher number in the ` +
42
65
  `filename is a newer copy.`,
43
66
  `It does not replace the recovery list: storage-network addresses live only in the recovery ` +
44
- `list. Keep both, somewhere other than the account code.`,
67
+ `list. Keep both, somewhere other than the NMTS key.`,
45
68
  ];
46
69
  /**
47
70
  * Build the document and the name to offer it under.
@@ -53,13 +76,15 @@ const NOTE = [
53
76
  * the order they were written and the newest is the last one.
54
77
  */
55
78
  export function buildFileListFile(input) {
79
+ const chunks = input.chunks === undefined ? [] : [...input.chunks];
56
80
  const doc = {
57
81
  format: LIST_FILE_FORMAT,
58
- version: LIST_FILE_VERSION,
82
+ version: chunks.length > 0 ? LIST_FILE_VERSION_CHUNKED : LIST_FILE_VERSION,
59
83
  seq: input.seq,
60
84
  ...(input.savedAt === undefined ? {} : { saved_at: input.savedAt }),
61
85
  account_id: input.accountId,
62
86
  sealed: input.sealed,
87
+ ...(chunks.length > 0 ? { chunks } : {}),
63
88
  note: [...NOTE],
64
89
  about: artifactAbout("file-list"),
65
90
  };
@@ -69,3 +94,61 @@ export function buildFileListFile(input) {
69
94
  content: `${JSON.stringify(doc, null, 2)}\n`,
70
95
  };
71
96
  }
97
+ function stringAt(doc, name) {
98
+ const value = doc[name];
99
+ return typeof value === "string" && value !== "" ? value : null;
100
+ }
101
+ /**
102
+ * Read one of these files back, accepting BOTH shells.
103
+ *
104
+ * ⛔ IT REFUSES RATHER THAN GUESSING. A file missing its sealed bytes, or naming chunks that are
105
+ * not strings, is not a shorter list — it is a copy somebody has been keeping for years that
106
+ * turns out not to be one, and the moment to say so is the moment they reach for it.
107
+ */
108
+ export function parseFileListFile(text) {
109
+ let parsed;
110
+ try {
111
+ parsed = JSON.parse(text);
112
+ }
113
+ catch {
114
+ throw new Error("that is not an NMTS file-list copy: it is not JSON");
115
+ }
116
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
117
+ throw new Error("that is not an NMTS file-list copy: it is not an object");
118
+ }
119
+ const doc = { ...parsed };
120
+ if (doc["format"] !== LIST_FILE_FORMAT) {
121
+ throw new Error(`that is not an NMTS file-list copy: format is ${String(doc["format"])}`);
122
+ }
123
+ const version = doc["version"];
124
+ if (version !== LIST_FILE_VERSION && version !== LIST_FILE_VERSION_CHUNKED) {
125
+ // A shell this build predates. Refusing by version is the honest answer: a newer writer may
126
+ // have put something beside `sealed` that this reader would silently drop.
127
+ throw new Error(`this NMTS file-list copy is shell version ${String(version)}, which this build cannot read`);
128
+ }
129
+ const seq = doc["seq"];
130
+ const sealed = stringAt(doc, "sealed");
131
+ const accountId = stringAt(doc, "account_id");
132
+ if (typeof seq !== "number" || !Number.isSafeInteger(seq) || seq < 1) {
133
+ throw new Error("this NMTS file-list copy does not say which version it is");
134
+ }
135
+ if (sealed === null)
136
+ throw new Error("this NMTS file-list copy carries no sealed list");
137
+ if (accountId === null)
138
+ throw new Error("this NMTS file-list copy does not say which account it is");
139
+ const raw = doc["chunks"];
140
+ if (raw !== undefined && !Array.isArray(raw)) {
141
+ throw new Error("this NMTS file-list copy has a broken list of parts");
142
+ }
143
+ const chunks = [];
144
+ for (const item of raw === undefined ? [] : raw) {
145
+ if (typeof item !== "string" || item === "") {
146
+ throw new Error("this NMTS file-list copy has a part that is not sealed bytes");
147
+ }
148
+ chunks.push(item);
149
+ }
150
+ if (version === LIST_FILE_VERSION_CHUNKED && chunks.length === 0) {
151
+ throw new Error("this NMTS file-list copy says it is in parts and carries none");
152
+ }
153
+ return { seq, accountId, sealed, chunks };
154
+ }
@@ -0,0 +1,15 @@
1
+ import { type ManifestIndex } from "./drive-paths.ts";
2
+ import type { ManifestEntry } from "./shared/lib/drive/manifest-codec.ts";
3
+ /** The text to look for, folded. Empty means the option carried nothing to search on. */
4
+ export declare function needleOf(query: string): string;
5
+ /** Does this name contain the (already folded) needle? */
6
+ export declare function nameContains(name: string, needle: string): boolean;
7
+ /**
8
+ * The ids to print for one query: the matching files, and the folders that lead to them.
9
+ *
10
+ * `entries` is what the listing was going to show anyway — live only, or everything under `--all`
11
+ * — and the ancestors added here are inside that same set by construction. Being in the trash is
12
+ * INHERITED, so a live file cannot sit under a trashed folder, and with `--all` there is nothing
13
+ * left to be outside the set.
14
+ */
15
+ export declare function idsForQuery(index: ManifestIndex, entries: readonly ManifestEntry[], needle: string): Set<string>;
@@ -0,0 +1,32 @@
1
+ export type SortKey = "name" | "size" | "date";
2
+ export type SortDir = "asc" | "desc";
3
+ /** What `--sort` accepts, in the order the help text names them. */
4
+ export declare const SORT_KEYS: readonly SortKey[];
5
+ /** The fields ordering reads. Everything else about a row is the listing's business. */
6
+ export interface OrderableRow {
7
+ name: string;
8
+ /** Plaintext bytes. Folders carry 0. */
9
+ size: number;
10
+ /** Created, milliseconds since the Unix epoch. */
11
+ createdAt: number;
12
+ /** 0 folder · 1 file — the codes the sealed list stores. */
13
+ kind: number;
14
+ /** Held at the top of its group under every sort. Absent on rows that carry no mark. */
15
+ pinned?: boolean;
16
+ }
17
+ /**
18
+ * One of the three keys, or the refusal that names all three.
19
+ *
20
+ * ⛔ IT IS CHECKED BEFORE ANYTHING IS FETCHED. A misspelled key is a wrong command line, not a
21
+ * failing account, and an agent that read "could not list your files" after typing `--sort
22
+ * largest` would go looking at the account. Exit 2 says the same thing every other bad option
23
+ * in this tool says.
24
+ */
25
+ export declare function parseSortKey(input: string): SortKey;
26
+ /**
27
+ * Rows in the browser's order: folders first, then files, each group by the chosen key.
28
+ *
29
+ * The input array is left alone — a caller printing one order and counting over another would
30
+ * otherwise depend on which of the two ran first.
31
+ */
32
+ export declare function orderRows<T extends OrderableRow>(rows: readonly T[], sort: SortKey, dir: SortDir): T[];
package/dist/main.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Commands the help text announces but this version cannot run.
4
+ *
5
+ * ⛔ ANNOUNCED-AND-UNFINISHED IS NOT THE SAME AS UNKNOWN, and an agent needs to tell them apart:
6
+ * unknown means "you guessed the name wrong, try again", unfinished means "stop, this will not
7
+ * work however you spell it". They get different exit codes for exactly that reason.
8
+ *
9
+ * ⛔ EMPTY IS THE GOAL, NOT AN OVERSIGHT. Everything help names, this version runs.
10
+ */
11
+ export declare const NOT_BUILT_YET: readonly string[];
12
+ export declare function run(argv: readonly string[]): Promise<number>;
package/dist/main.js CHANGED
@@ -19,19 +19,15 @@
19
19
  // 0 done · 1 something went wrong · 2 the command line was wrong · 3 not signed in ·
20
20
  // 4 the command exists but could not do it · 5 waiting on the person's agreement ·
21
21
  // 130 cancelled.
22
- // ⚠ 4 IS "COULD NOT", NOT "NOT BUILT". This block used to say "the command exists but is not
23
- // built", which is not what any command means by it — "no such path", "that is a file", "a
24
- // folder cannot go inside itself" are all 4. `NotBuiltYetError` shares the number and carries
25
- // "do not retry"; nothing collides today because nothing is announced-and-unfinished, and if
26
- // that list is ever repopulated the unfinished case needs a number of its own
27
- // (2026-08-23).
22
+ // ⚠ 4 IS "COULD NOT", NOT "NOT BUILT" "no such path", "that is a file" are 4;
23
+ // `NotBuiltYetError` shares the number and carries "do not retry" (2026-08-23).
28
24
  //
29
25
  // ⛔ `run` RETURNS A CODE AND NEVER EXITS. Only the bottom of this file calls process.exit, so the
30
26
  // whole command surface can be driven from a test without ending the test runner.
31
27
  import { parseArgs } from "./args.js";
32
28
  import { NmtsError, NotBuiltYetError, renderError } from "./errors.js";
33
29
  import { endQuietlyOnClosedPipe, exitCodeFor, invokedDirectly, noteUpdateAfter } from "./exit.js";
34
- import { helpText } from "./help.js";
30
+ import { printHelp } from "./help.js";
35
31
  import { BINARY_NAME, VERSION } from "./product.js";
36
32
  /**
37
33
  * Commands the help text announces but this version cannot run.
@@ -50,8 +46,7 @@ export async function run(argv) {
50
46
  return 0;
51
47
  }
52
48
  if (args.help || args.command === null || args.command === "help") {
53
- process.stdout.write(helpText(VERSION));
54
- return 0;
49
+ return await printHelp(args, (text) => process.stdout.write(text));
55
50
  }
56
51
  // ⛔ A MODE THAT STOPPED ANNOUNCING ITSELF IS ONE PEOPLE FORGET THEY TURNED ON, and this one
57
52
  // decides whether anybody is asked before money is spent. So it is said on EVERY run, to
@@ -67,8 +62,10 @@ export async function run(argv) {
67
62
  // SDK, which is the largest thing this package can load, and importing it at the top of this
68
63
  // file made `nmts --help` pay for it: startup went from 0.13s to 0.20s the day `put` landed.
69
64
  // An agent runs this tool in a loop, so a fixed cost per invocation is paid thousands of
70
- // times and the cost grows with every command added, which is exactly the shape of problem
71
- // that is never noticed until it is large. `check:cli-startup` measures it.
65
+ // times. `check:cli-startup` measures it.
66
+ // THE TIER GATE, BEFORE ANY COMMAND LOADS (`risk.ts` · `gate.ts`): asked or refused by the
67
+ // act's tier and this machine's mode, the same way for every command.
68
+ await (await import("./risk.js")).gateArgs(args);
72
69
  switch (args.command) {
73
70
  case "login": {
74
71
  const { login } = await import("./commands/login.js");
@@ -85,7 +82,12 @@ export async function run(argv) {
85
82
  }
86
83
  case "whoami": {
87
84
  const { whoami } = await import("./commands/whoami.js");
88
- return await whoami({ server: args.server, network: args.network });
85
+ return await whoami({
86
+ server: args.server,
87
+ network: args.network,
88
+ reveal: args.reveal,
89
+ json: args.json,
90
+ });
89
91
  }
90
92
  case "ls": {
91
93
  const { ls } = await import("./commands/ls.js");
@@ -107,27 +109,38 @@ export async function run(argv) {
107
109
  const { balance } = await import("./commands/balance.js");
108
110
  return await balance({ server: args.server, network: args.network, json: args.json });
109
111
  }
112
+ case "credits": {
113
+ const { credits } = await import("./commands/credits.js");
114
+ return await credits(args.operands[0], args.operands[1], {
115
+ server: args.server, network: args.network, json: args.json, to: args.to,
116
+ });
117
+ }
110
118
  case "public-code": {
111
119
  const { publicCode } = await import("./commands/public-code.js");
112
- return await publicCode({
113
- server: args.server,
114
- network: args.network,
115
- publish: args.publish,
116
- json: args.json,
117
- });
120
+ return await publicCode({ server: args.server, network: args.network, publish: args.publish, json: args.json });
118
121
  }
119
122
  case "wallet": {
120
123
  const { wallet } = await import("./commands/wallet.js");
121
124
  return await wallet(args.operands[0], {
122
- server: args.server,
123
- network: args.network,
124
- json: args.json,
125
+ server: args.server, network: args.network, json: args.json, qr: args.qr,
126
+ rest: args.operands.slice(1), yes: args.yes, dryRun: args.dryRun, feeCap: args.feeCap,
127
+ to: args.to, venue: args.venue, slippageBps: args.slippageBps, acceptExtremes: args.acceptExtremes, size: args.size, epochs: args.epochs, name: args.name, remove: args.remove,
125
128
  });
126
129
  }
127
130
  case "expiring": {
128
131
  const { expiring } = await import("./commands/expiring.js");
129
132
  return await expiring({ server: args.server, network: args.network, json: args.json });
130
133
  }
134
+ case "losses": {
135
+ const { losses } = await import("./commands/losses.js");
136
+ return await losses({
137
+ server: args.server,
138
+ network: args.network,
139
+ json: args.json,
140
+ recheck: args.recheck,
141
+ dismiss: args.dismiss,
142
+ });
143
+ }
131
144
  case "extend": {
132
145
  const { extend } = await import("./commands/extend.js");
133
146
  return await extend(args.operands[0], {
@@ -147,16 +160,12 @@ export async function run(argv) {
147
160
  out: args.out,
148
161
  acceptTerms: args.acceptTerms,
149
162
  acceptPrivacy: args.acceptPrivacy,
150
- json: args.json,
163
+ json: args.json, noWait: args.noWait,
151
164
  });
152
165
  }
153
166
  case "trial": {
154
167
  const { trial } = await import("./commands/trial.js");
155
- return await trial(args.operands[0], {
156
- server: args.server,
157
- network: args.network,
158
- json: args.json,
159
- });
168
+ return await trial(args.operands[0], { server: args.server, network: args.network, json: args.json });
160
169
  }
161
170
  case "get": {
162
171
  const { get } = await import("./commands/get.js");
@@ -178,6 +187,10 @@ export async function run(argv) {
178
187
  dryRun: args.dryRun,
179
188
  partSize: args.partSize,
180
189
  onCollision: args.onCollision,
190
+ deposit: args.deposit,
191
+ pay: args.pay,
192
+ epochs: args.epochs,
193
+ storage: args.storage,
181
194
  json: args.json,
182
195
  });
183
196
  }
@@ -191,6 +204,10 @@ export async function run(argv) {
191
204
  hidden: args.hidden,
192
205
  partSize: args.partSize,
193
206
  onCollision: args.onCollision,
207
+ deposit: args.deposit,
208
+ pay: args.pay,
209
+ epochs: args.epochs,
210
+ storage: args.storage,
194
211
  json: args.json,
195
212
  });
196
213
  }
@@ -204,12 +221,15 @@ export async function run(argv) {
204
221
  }
205
222
  case "sweep": {
206
223
  const { sweep } = await import("./commands/sweep.js");
207
- return await sweep({
208
- server: args.server,
209
- network: args.network,
210
- json: args.json,
211
- yes: args.yes,
212
- });
224
+ return await sweep({ server: args.server, network: args.network, json: args.json, yes: args.yes });
225
+ }
226
+ case "key": {
227
+ const { key } = await import("./commands/key.js");
228
+ return await key(args.operands[0], args);
229
+ }
230
+ case "devices": {
231
+ const { devices } = await import("./commands/devices.js");
232
+ return await devices({ server: args.server, json: args.json, signOut: args.signOut, yes: args.yes });
213
233
  }
214
234
  case "rebuild": {
215
235
  const { rebuild } = await import("./commands/rebuild.js");
@@ -221,6 +241,18 @@ export async function run(argv) {
221
241
  force: args.force,
222
242
  });
223
243
  }
244
+ case "padding": {
245
+ const { padding } = await import("./commands/padding.js");
246
+ return await padding(args.operands[0], { server: args.server, network: args.network, json: args.json });
247
+ }
248
+ case "deposit": {
249
+ const { deposit } = await import("./commands/deposit.js");
250
+ return await deposit(args.operands[0], { server: args.server, network: args.network, json: args.json });
251
+ }
252
+ case "rollback": {
253
+ const { rollback } = await import("./commands/rollback.js");
254
+ return await rollback({ server: args.server, network: args.network, json: args.json, yes: args.yes });
255
+ }
224
256
  case "listfile": {
225
257
  const { listfile } = await import("./commands/listfile.js");
226
258
  return await listfile({ out: args.out, force: args.force });
@@ -255,73 +287,48 @@ export async function run(argv) {
255
287
  json: args.json,
256
288
  });
257
289
  }
258
- case "star": {
259
- const { star } = await import("./commands/marks.js");
260
- return await star(args.operands, { server: args.server, network: args.network, json: args.json });
261
- }
262
- case "unstar": {
263
- const { unstar } = await import("./commands/marks.js");
264
- return await unstar(args.operands, { server: args.server, network: args.network, json: args.json });
265
- }
266
- case "pin": {
267
- const { pin } = await import("./commands/marks.js");
268
- return await pin(args.operands, { server: args.server, network: args.network, json: args.json });
269
- }
270
- case "unpin": {
271
- const { unpin } = await import("./commands/marks.js");
272
- return await unpin(args.operands, { server: args.server, network: args.network, json: args.json });
273
- }
274
- case "label": {
275
- const { label } = await import("./commands/marks.js");
276
- return await label(args.operands[0], args.operands.slice(1), {
277
- server: args.server,
278
- network: args.network,
279
- json: args.json,
280
- });
281
- }
290
+ case "star":
291
+ case "unstar":
292
+ case "pin":
293
+ case "unpin":
294
+ case "label":
282
295
  case "unlabel": {
283
- const { unlabel } = await import("./commands/marks.js");
284
- return await unlabel(args.operands[0], args.operands.slice(1), {
285
- server: args.server,
286
- network: args.network,
287
- json: args.json,
288
- });
289
- }
290
- case "share": {
291
- const { share } = await import("./commands/share.js");
292
- return await share(args.operands[0], args.operands[1], {
293
- server: args.server,
294
- network: args.network,
295
- json: args.json,
296
- });
297
- }
298
- case "shares": {
299
- const { shares } = await import("./commands/share.js");
300
- return await shares({ server: args.server, network: args.network, json: args.json });
301
- }
302
- case "unshare": {
303
- const { unshare } = await import("./commands/share.js");
304
- return await unshare(args.operands[0], {
305
- server: args.server,
306
- network: args.network,
307
- json: args.json,
308
- });
296
+ const { runMarks } = await import("./commands/marks-dispatch.js");
297
+ return await runMarks(args.command, args);
309
298
  }
299
+ case "share":
300
+ case "shares":
301
+ case "unshare":
310
302
  case "receive": {
311
- const { receive } = await import("./commands/receive.js");
312
- return await receive(args.operands[0], {
313
- server: args.server,
314
- network: args.network,
315
- out: args.out,
316
- force: args.force,
317
- json: args.json,
318
- });
303
+ const { runShare } = await import("./commands/share-dispatch.js");
304
+ return await runShare(args.command, args);
305
+ }
306
+ case "support": {
307
+ // ⚠ Options passed whole, as `runSettings` below takes them: this one reads ten of them.
308
+ const { support } = await import("./commands/support.js");
309
+ return await support(args.operands[0], args.operands.slice(1), args);
310
+ }
311
+ case "notices":
312
+ case "erase":
313
+ return await (await import("./commands/erase.js")).erase(args.operands, { server: args.server, network: args.network, json: args.json, releaseStorage: args.releaseStorage, yes: args.yes });
314
+ case "tip":
315
+ return await (await import("./commands/tip.js")).tip(args.operands[0], { server: args.server, network: args.network, json: args.json, yes: args.yes });
316
+ case "delete-account":
317
+ return await (await import("./commands/delete-account.js")).deleteAccount({ server: args.server, yes: args.yes });
318
+ case "accept-terms":
319
+ return await (await import("./commands/accept-terms.js")).acceptTerms({ server: args.server, terms: args.acceptTerms, privacy: args.acceptPrivacy });
320
+ case "terms":
321
+ case "privacy": {
322
+ const { runDocuments } = await import("./commands/documents.js");
323
+ return await runDocuments(args.command, { ...args, id: args.operands[0] });
319
324
  }
320
325
  case "env": {
321
326
  const { env } = await import("./commands/env.js");
322
327
  return env({ json: args.json });
323
328
  }
324
329
  case "consent":
330
+ case "unlock":
331
+ case "lock":
325
332
  case "mode":
326
333
  case "on-collision": {
327
334
  const { runSettings } = await import("./commands/settings.js");
@@ -331,29 +338,11 @@ export async function run(argv) {
331
338
  const { verify } = await import("./commands/verify.js");
332
339
  return await verify({ server: args.server, json: args.json, status: args.status });
333
340
  }
334
- case "recovery": {
335
- const { recovery } = await import("./commands/recovery.js");
336
- return await recovery({ out: args.out, force: args.force, json: args.json });
337
- }
338
- case "recovery-list": {
339
- const { recoveryList } = await import("./commands/recovery-list.js");
340
- return await recoveryList({
341
- server: args.server,
342
- network: args.network,
343
- out: args.out,
344
- force: args.force,
345
- json: args.json,
346
- });
347
- }
341
+ case "recovery":
342
+ case "recovery-list":
348
343
  case "kit": {
349
- const { kit } = await import("./commands/kit.js");
350
- return await kit({
351
- server: args.server,
352
- network: args.network,
353
- out: args.out,
354
- force: args.force,
355
- json: args.json,
356
- });
344
+ const { runRecovery } = await import("./commands/recovery-dispatch.js");
345
+ return await runRecovery(args.command, args);
357
346
  }
358
347
  case "update": {
359
348
  const { update } = await import("./commands/update.js");
@@ -380,13 +369,23 @@ export async function run(argv) {
380
369
  async function main() {
381
370
  endQuietlyOnClosedPipe();
382
371
  const argv = process.argv.slice(2);
372
+ const started = Date.now();
373
+ let failed = null;
383
374
  try {
384
375
  process.exitCode = await run(argv);
385
376
  }
386
377
  catch (error) {
387
378
  process.stderr.write(`${renderError(error, BINARY_NAME)}\n`);
388
379
  process.exitCode = exitCodeFor(error);
380
+ failed = error instanceof Error ? error.message : String(error);
389
381
  }
382
+ // ⛔ LOADED AFTER THE COMMAND, LIKE EVERY COMMAND ABOVE: the run log's chain reaches the
383
+ // credentials module and `--help` must not pay for it first (`check:cli-startup`). It is
384
+ // outside `run` because the tests drive that directly, and it cannot throw.
385
+ const { noteFailure, recordRun } = await import("./run-log.js");
386
+ if (failed !== null)
387
+ noteFailure(failed);
388
+ recordRun(argv, typeof process.exitCode === "number" ? process.exitCode : 0, Date.now() - started);
390
389
  await noteUpdateAfter(argv, VERSION);
391
390
  }
392
391
  if (invokedDirectly(import.meta.filename)) {