@needmoretruth/nmts-cli 0.17.2 → 0.34.1

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 +124 -516
  2. package/CHANGELOG.md +98 -0
  3. package/README.ko.md +374 -467
  4. package/README.md +384 -465
  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
package/dist/help.js CHANGED
@@ -3,7 +3,12 @@
3
3
  // ⛔ COMMANDS THAT ARE NOT BUILT ARE MARKED, NOT HIDDEN. An agent that discovers a command by
4
4
  // running it and getting "unknown command" learns the wrong thing — it will try synonyms. Being
5
5
  // told the command exists and is unfinished is a fact it can act on: stop, and do not retry.
6
- import { AGENTS_DOC, BINARY_NAME, HOME_URL, PRODUCT_NAME, SOURCE_URL } from "./product.js";
6
+ import { AGENTS_DOC, BINARY_NAME, HOME_URL, PRODUCT_NAME, SOURCE_URL, VERSION } from "./product.js";
7
+ // ⛔ THE COPY IS IMPORTED, NOT RETYPED. The same sentences are printed by `nmts support --help`
8
+ // and above every preview, and what they promise is what is taken out of a message before it
9
+ // leaves — not a promise to keep in two versions. ⚠ That module has no imports of its own, so
10
+ // reading it here costs `nmts --help` nothing (`check:cli-startup`).
11
+ import { ATTACH_LOG_TEXT, SUPPORT_LONG, supportHelpText } from "./support-copy.js";
7
12
  import { API_KEY_ENV_VAR, API_KEY_FILE_ENV_VAR, CODE_ENV_VAR, CODE_FILE_ENV_VAR, PASSPHRASE_ENV_VAR, } from "./credentials.js";
8
13
  import { NETWORK_ENV_VAR } from "./network.js";
9
14
  import { LATEST_RELEASE_URL, NO_CHECK_ENV_VAR } from "./update-source.js";
@@ -18,27 +23,65 @@ export function helpText(version) {
18
23
  ` ${BINARY_NAME} <command> [options]`,
19
24
  ``,
20
25
  `COMMANDS`,
21
- ` login Keep an account code on this machine, sealed — and take an API key`,
22
- ` logout Remove the stored account code`,
23
- ` whoami Show which account the stored code belongs to (offline)`,
24
- ` create Make a NEW account. Prints its code once — nothing can print it again`,
26
+ ` login Keep an NMTS key on this machine, sealed — and take an API key`,
27
+ ` logout Remove the stored NMTS key`,
28
+ ` whoami Show which account the stored NMTS key belongs to (offline)`,
29
+ ` create Make a NEW account. Prints its NMTS key once — nothing can print it again.`,
30
+ ` With no verified API key, it prints an address for a PERSON to open`,
31
+ ` key new Make an API key for this machine out of the NMTS key it already`,
32
+ ` holds, and store it. \`--print\` shows it once as well`,
33
+ ` key list Every API key of this account: what it may do, when it stops, when it`,
34
+ ` was last used. Needs the NMTS key; an API key cannot list keys`,
35
+ ` key revoke <id|all> Cut one key, or all of them — whatever uses it stops at once`,
36
+ ` devices What is signed in to this account. \`--sign-out <id|all>\` ends one`,
37
+ ` or all — a person's act: needs the NMTS key, refused in mode auto`,
25
38
  ` ls List files in the account`,
26
39
  ` usage What the account holds: counts, bytes, largest files, trash`,
27
40
  ` balance Credits left, what they buy, and the ceilings on spending`,
28
41
  ` trial What is left of this week's free credits. \`trial apply\` asks for some`,
42
+ ` credits transfer --to <account identifier> <credits>`,
43
+ ` Move credits to another account of your own — the one that made this`,
44
+ ` account, or one made under it. Never to anyone else`,
29
45
  ` expiring List files whose bought storage runs out soon`,
46
+ ` losses Storage the daily check could not find on the chain; --recheck <id> · --dismiss <id>`,
30
47
  ` extend <path> Buy more storage time for one file — **spends WAL from the wallet**`,
31
48
  ` public-code The code other accounts send files to. \`--publish\` makes it reachable`,
49
+ ` delete-account A PERSON erases this account's server record — irreversible; needs the`,
50
+ ` NMTS key, types a sentence, refused in mode auto`,
51
+ ` accept-terms A PERSON accepts a new version of the Terms, by typing its version;`,
52
+ ` refused in mode auto. Read first: terms · privacy · notices`,
32
53
  ` wallet Show the account's wallet address, and its SUI and WAL balances`,
33
- ` wallet address Just the address, derived on this machine — no network call`,
34
- ` put <file> Encrypt one file and upload it, paid with credits`,
54
+ ` wallet address Just the address, derived on this machine — no network call.`,
55
+ ` \`--qr\` draws it as a code a phone can scan`,
56
+ ` wallet activity The wallet's recent transactions, named where the chain proves it`,
57
+ ` wallet storage The storage resources (size × time) the wallet holds, unbound`,
58
+ ` wallet storage split <id> --size <n>|--epochs <n> · merge <id> <id> · transfer <id> <address>`,
59
+ ` Cut, join or hand over a resource — **signs**, under the wallet unlock`,
60
+ ` wallet send <SUI|WAL> <amount|max> <address>`,
61
+ ` Send coins to an address — **signs and spends from the wallet**.`,
62
+ ` Prints the review; sends only with --yes`,
63
+ ` wallet swap <SUI|WAL> <amount|max>`,
64
+ ` Swap one coin for the other on DeepBook or Bluefin (mainnet) —`,
65
+ ` **signs and spends**. Without --venue, quotes both and stops`,
66
+ ` wallet donate <SUI|WAL> <amount>`,
67
+ ` A voluntary gift to the developer — **signs and spends**. A person's`,
68
+ ` act: refused in mode auto, and needs --yes every time`,
69
+ ` wallet hall The gift hall of fame, read from the chain. \`--name <name>\` lists you`,
70
+ ` under a name your wallet signs for; \`--remove\` goes back to a`,
71
+ ` shortened address. Reading it signs nothing`,
72
+ ` put <file> Encrypt one file and upload it, paid with credits — or, with`,
73
+ ` \`--pay wallet\`, **signs and spends WAL and SUI from the wallet**`,
35
74
  ` get <path> Download one file and decrypt it`,
36
75
  ` pull [folder] Download a whole folder, or the whole account, keeping its shape`,
37
- ` push <directory> Upload a whole directory, keeping its shape — **spends credits**`,
76
+ ` push <directory> Upload a whole directory, keeping its shape — **spends credits**,`,
77
+ ` or the wallet with \`--pay wallet\``,
38
78
  ` rm <paths> Move things to the trash — restorable for 30 days`,
39
79
  ` restore <paths> Bring things back out of the trash`,
40
80
  ` sweep Drop trash entries whose 30 days have run out. Asks first`,
81
+ ` erase <paths> Erase files for good — the server's record and this account's key.`,
82
+ ` A typed sentence; \`--release-storage\` also destroys credit-paid storage`,
41
83
  ` rebuild Build a file list from the server's rows, for an account with none`,
84
+ ` rollback Put the previous file list back — a person's act`,
42
85
  ` listfile Write this machine's copy of the sealed file list out as a file`,
43
86
  ` mkdir <path> Make a folder, and any folder above it that is missing`,
44
87
  ` mv <paths> <folder> Move things into a folder. \`/\` is the top of the drive`,
@@ -50,19 +93,32 @@ export function helpText(version) {
50
93
  ` label <name> <files> Put one label on files. A label exists while a file wears it`,
51
94
  ` unlabel <name> <files>`,
52
95
  ` Take one label off files`,
53
- ` share <path> <addr> Give one file to another account. Withdrawing does not recall it`,
96
+ ` share <path> <addr> Give one file to another account. Withdrawing does not recall it.`,
97
+ ` In normal mode it asks every time: answer with --yes`,
54
98
  ` shares What was shared with this account`,
55
99
  ` receive <id> Download one file somebody shared with this account`,
56
100
  ` unshare <id> Withdraw a share you sent, or remove one you were sent`,
57
- ` env What this machine is, and what it means for the account code`,
58
- ` consent See what this machine has agreed to, and change it`,
59
- ` mode How much an agent driving this tool may decide without asking`,
101
+ ` env What this machine is, and what it means for the NMTS key`,
102
+ ` unlock [name] What this machine has unlocked; \`unlock <name>\` opens one — a person,`,
103
+ ` at a terminal. \`lock <name>\` closes it. (\`consent\` is the older name)`,
104
+ ` mode [name] How much an agent may decide without asking: default · auto-low ·`,
105
+ ` auto-high · skip-permissions. Switched by a person at a terminal`,
60
106
  ` on-collision What to do when an upload's name is already in use`,
107
+ ` padding [mode] How file sizes are hidden: standard, pow2, or off for the exact size.`,
108
+ ` Applies to the next uploads`,
109
+ ` deposit [credits] Credits each credit-paid upload sets aside as a deposit, 0 to 64.`,
110
+ ` Default 64; \`put --deposit <n>\` sets it for one upload`,
111
+ ` tip [percent|off] The standing share of every storage payment sent to the developer as a`,
112
+ ` gift, in WAL, without asking. 0 by default; the gift terms are agreed once`,
61
113
  ` update Install the newest published release of this tool`,
62
114
  ` recovery Download the standalone program that reads files back without NMTS`,
63
- ` recovery-list Write the file that finds your bytes without NMTS. Holds no code`,
64
- ` kit Recovery kit: that list AND your account code, together in one file`,
115
+ ` recovery-list Write the file that finds your bytes without NMTS. Holds no NMTS key`,
116
+ ` kit Recovery kit: that list AND your NMTS key, together in one file`,
65
117
  ` verify Ask a person to pass the check that opens this account's limits`,
118
+ ` support Write to the developer of NMTS: a bug, an error, an idea, a question`,
119
+ ` notices What NMTS has posted. <id> prints one; --save <id> keeps it as a file`,
120
+ ` terms The Terms of Service in force. --board for the message board's`,
121
+ ` privacy The Privacy Policy in force`,
66
122
  ` mcp Serve this account's commands as tools, for an agent that speaks MCP`,
67
123
  ` s3 Serve the drive to any S3 program, on this machine only`,
68
124
  ``,
@@ -70,54 +126,119 @@ export function helpText(version) {
70
126
  ` --server <url> NMTS server (default ${SERVER_ENV_VAR} or the live one)`,
71
127
  ` --network <name> mainnet or testnet. Required for any server but the live one`,
72
128
  ` --json Machine-readable output (ls, usage, get, put, env, verify,`,
73
- ` expiring, sweep, rebuild, pull, wallet, shares, share, receive,`,
74
- ` recovery, balance, trial, extend, recovery-list, kit, update,`,
75
- ` create create needs --out as well, so the code never enters`,
76
- ` the output)`,
77
- ` --all Include what is in the trash (ls)`,
129
+ ` expiring, losses, sweep, rebuild, rollback, pull, wallet, shares,`,
130
+ ` share, receive, label, unlabel, padding, deposit, whoami --reveal,`,
131
+ ` recovery, balance, trial, credits transfer, extend, recovery-list, kit, update, notices,`,
132
+ ` devices, key new, key list, key revoke, create. \`key new\` puts the key string in the JSON`,
133
+ ` only with --print, and \`create\` needs --out as well, so neither`,
134
+ ` secret enters the output by default)`,
135
+ ` --all Include what is in the trash (ls), or take one label off every`,
136
+ ` file that carries it (unlabel)`,
137
+ ` --sent <path> Who ONE file was shared with, instead of the inbox (shares)`,
138
+ ` --rename <old> The label to rename; the new name follows it (label)`,
139
+ ` --qr Draw the wallet address as a code to scan (wallet address)`,
140
+ ` --remove Take your name off the gift hall of fame, leaving a shortened`,
141
+ ` address (wallet hall). Give this or --name, not both`,
142
+ ` --days <n> | --until <date>`,
143
+ ` How long a wallet agreement lasts, at most 30 days (unlock`,
144
+ ` wallet), or how long a new API key lasts (key new). Default 30 days;`,
145
+ ` the server clamps at its own ceiling and the reply says the date`,
146
+ ` --scopes <list> What a new key may do (key new): read, write, spend, comma-separated.`,
147
+ ` Default read. A program that uploads needs all three`,
148
+ ` --print Put the new key on the screen once as well (key new). It is stored on`,
149
+ ` this machine either way, and NMTS keeps no copy of it`,
150
+ ` --scope storage|all What a wallet agreement covers: storage, or also exchanging and`,
151
+ ` sending (unlock wallet). Default storage. A gift is in neither`,
152
+ ` --cap-wal <coins> --cap-sui <coins>`,
153
+ ` A ceiling on what this tool may sign away under the agreement`,
154
+ ` --fee-cap <sui> A ceiling on the chain fee of one transaction (wallet send, wallet`,
155
+ ` swap). Only up to it is used; the rest stays in the wallet`,
156
+ ` --venue <name> deepbook or bluefin (wallet swap). Neither is a default: without`,
157
+ ` it both quotes are printed and nothing is signed`,
158
+ ` --slippage-bps <n> How far below the quote the swap may still fill, in bps — 1 bps`,
159
+ ` = 0.01% (wallet swap). 1 to 5000, default 50. Below 10 or above`,
160
+ ` 200 is an extreme`,
161
+ ` --accept-extremes Go on past the extremes gate — slippage, fee cap or a quote more`,
162
+ ` than 3% from the site's reference price (wallet swap). A person's`,
163
+ ` act, refused while a mode is on`,
164
+ ` --reveal Print the NMTS key itself (whoami). A person's act, and`,
165
+ ` refused while a mode is on`,
78
166
  ` --find <text> List only the files whose name contains this text (ls). Folders`,
79
167
  ` appear only where they hold a match`,
80
168
  ` --sort <key> name, size or date. Default: whole paths, ascending (ls)`,
81
169
  ` --desc Reverse whichever order is in effect (ls)`,
82
170
  ` --hidden Include entries whose name begins with a dot (push)`,
83
171
  ` --out <path> Where to write files (get, pull, mcp, listfile, recovery,`,
84
- ` recovery-list, kit, create). Default: here`,
172
+ ` recovery-list, kit, create, notices, terms, privacy). Default: here`,
85
173
  ` --out - Send a fetched file to stdout instead of writing it (get, listfile)`,
174
+ ` --lang <en|ko> Which language of a document (terms, privacy). Default: English`,
175
+ ` --board The message board's terms rather than the service's (terms)`,
176
+ ` --save Keep the document as a file, under the name the server gives it`,
177
+ ` (notices, terms, privacy)`,
86
178
  ` --force Replace a file that is already there (get, pull, listfile,`,
87
179
  ` recovery, recovery-list, kit), or rebuild an account this machine`,
88
180
  ` has seen a list for (rebuild). \`create\` never replaces a file`,
89
- ` --name <name> The name the uploaded file gets in the drive (put)`,
90
- ` --to <folder> Destination folder, as \`${BINARY_NAME} ls\` prints it (put, push)`,
181
+ ` --name <name> The name the uploaded file gets in the drive (put), or the name to`,
182
+ ` be listed under in the gift hall of fame (wallet hall)`,
183
+ ` --to <folder> Destination folder, as \`${BINARY_NAME} ls\` prints it (put, push).`,
184
+ ` For \`credits transfer\` it is the account identifier that receives`,
91
185
  ` --dry-run Say what it would cost, and stop (put, push, extend), or what it`,
92
- ` would install, and stop (update). With \`extend\` nothing is`,
93
- ` signed and the wallet key is never touched`,
186
+ ` would install, and stop (update). With \`extend\` and \`--pay`,
187
+ ` wallet\` nothing is signed and the wallet key is never touched`,
94
188
  ` --part-size <n> Bytes per part for a large upload (put, push). Default 64MiB.`,
95
189
  ` --on-collision <what> rename | overwrite, for THIS run only (put, push). Without it the`,
96
190
  ` machine's own setting decides -- see \`${BINARY_NAME} on-collision\`.`,
97
191
  ` a plain number, or one with KiB, MiB or GiB. Bigger parts mean`,
98
192
  ` fewer purchases; smaller parts use less memory`,
99
- ` --yes Go ahead with something that cannot be taken back (sweep, rebuild),`,
193
+ ` --deposit <n> Credits THIS upload sets aside per file, 0 to 64 (put, push, with`,
194
+ ` credits). Without it the account's own default decides -- see`,
195
+ ` \`${BINARY_NAME} deposit\`. 0 means a later release costs twice the fee`,
196
+ ` from the balance instead of coming out of the file's deposit`,
197
+ ` --yes Go ahead with something that cannot be taken back (sweep, rebuild,`,
198
+ ` rollback, wallet send, wallet swap, wallet donate),`,
100
199
  ` or extend a file that is nowhere near its deadline (extend)`,
101
- ` --epochs <n> How many of the storage network's epochs to add (extend)`,
200
+ ` --epochs <n> How many of the storage network's epochs to add (extend), to buy`,
201
+ ` (put, push --pay wallet; default 2), or to keep (wallet storage split)`,
202
+ ` --size <bytes> What a cut resource keeps: bytes, or with KiB/MiB/GiB (wallet storage split)`,
203
+ ` --pay credits|wallet Who pays for an upload's storage (put, push). Default credits.`,
204
+ ` wallet = the wallet this NMTS key derives signs and pays the`,
205
+ ` network directly, under a wallet agreement of scope storage`,
206
+ ` --storage fit|whole|<object id>`,
207
+ ` Use a free storage resource the wallet already holds (put --pay`,
208
+ ` wallet, one-part files). fit cuts it to size and leaves the rest`,
209
+ ` free; whole binds all of it with the file. The review says which`,
210
+ ` bytes go where. Without it new storage is bought`,
102
211
  ` --port <n> Which loopback port to listen on (s3). Default 9000`,
103
212
  ` --accept-terms <v> The version of the Terms of Service a PERSON read and accepts for`,
104
213
  ` the new account (create). A version, never "the current one"`,
105
214
  ` --accept-privacy <v> The version of the Privacy Policy accepted in the same act (create)`,
215
+ ` --no-wait Print the registration address and stop, instead of waiting for a`,
216
+ ` person to open it (create, when there is no verified key)`,
106
217
  ` --publish Publish this account's public code (public-code). Permanent —`,
107
218
  ` it cannot be withdrawn or changed afterwards`,
219
+ ` --category <c> What a report is about (support send). The categories are listed by`,
220
+ ` \`${BINARY_NAME} support --help\``,
221
+ ` --sub <s> Which part of that category (support send). Always optional`,
222
+ ` --message <text> The message itself (support send, support reply)`,
223
+ ` --message-file <p> A file holding the message instead (support send). With neither, the`,
224
+ ` message is read from the standard input`,
225
+ ` --attach-log [n] Attach this tool's own record of its last n runs (support send).`,
226
+ ` Default 3, most 20`,
227
+ ` --omit <text> A value that must not travel. May be given more than once (support`,
228
+ ` send, support reply)`,
108
229
  ` --status Say whether the check is live, and stop (verify)`,
109
- ` --plain Store the code unsealed instead (login). Asks for an agreement`,
230
+ ` --plain Store the NMTS key unsealed instead (login). Asks for an agreement`,
110
231
  ` --env Store nothing; print the variable to set (login). Same agreement`,
111
232
  ` --version Print the version and exit`,
112
233
  ` --help Print this and exit`,
113
234
  ``,
114
235
  `ENVIRONMENT`,
115
- ` ${CODE_FILE_ENV_VAR.padEnd(24)}Names a FILE holding the account code. The recommended way, and`,
236
+ ` ${CODE_FILE_ENV_VAR.padEnd(24)}Names a FILE holding the NMTS key. The recommended way, and`,
116
237
  ` the only one that asks nothing: the file is read, never copied.`,
117
- ` ${CODE_ENV_VAR.padEnd(24)}The account code itself. Takes precedence over anything stored,`,
238
+ ` ${CODE_ENV_VAR.padEnd(24)}The NMTS key itself. Takes precedence over anything stored,`,
118
239
  ` and asks once — an environment variable is readable through`,
119
240
  ` \`docker inspect\`, /proc/<pid>/environ and most CI logs.`,
120
- ` ${PASSPHRASE_ENV_VAR.padEnd(24)}Opens a sealed stored code without a terminal.`,
241
+ ` ${PASSPHRASE_ENV_VAR.padEnd(24)}Opens a sealed stored NMTS key without a terminal.`,
121
242
  ` ${API_KEY_FILE_ENV_VAR.padEnd(24)}Names a FILE holding the API key. \`${BINARY_NAME} login\` reads this`,
122
243
  ` first, and a container cannot leak it the way it leaks a value.`,
123
244
  ` ${API_KEY_ENV_VAR.padEnd(24)}Key made on the account screen. It waives the human check a`,
@@ -131,6 +252,11 @@ export function helpText(version) {
131
252
  ` your files were never stored.`,
132
253
  ` ${NO_CHECK_ENV_VAR.padEnd(24)}Set to anything to stop the version check described below.`,
133
254
  ``,
255
+ `SENDING A REPORT`,
256
+ ...SUPPORT_LONG.map((line) => (line === `` ? `` : ` ${line}`)),
257
+ ``,
258
+ ...ATTACH_LOG_TEXT.map((line) => ` ${line}`),
259
+ ``,
134
260
  // ⛔ THE TWO SENTENCES ABOUT THE CHECK ARE IMPORTED, NOT RETYPED. They are also printed by
135
261
  // the command itself, and a second copy is how one of them starts promising more than the
136
262
  // other. What is added here is the other half of the same honesty: where the file goes.
@@ -155,14 +281,14 @@ export function helpText(version) {
155
281
  ` ${LATEST_RELEASE_URL}`,
156
282
  ``,
157
283
  ` and writes the answer down. When it is newer than the one running, the NEXT run prints one`,
158
- ` line on stderr saying so. It sends no account code, no key and no command name: the`,
284
+ ` line on stderr saying so. It sends no NMTS key, no API key and no command name: the`,
159
285
  ` request is for a page address, and what the site can see is that it was asked.`,
160
286
  ``,
161
287
  ` Setting ${NO_CHECK_ENV_VAR} to anything stops both halves. \`${BINARY_NAME} env\` shows what`,
162
288
  ` it last found, and \`${BINARY_NAME} update\` asks now and installs what it finds.`,
163
289
  ``,
164
290
  `BEFORE YOU HAND THIS TO AN AGENT`,
165
- ` Your account code is the only key to your account — the file keys and the wallet are all`,
291
+ ` Your NMTS key is the only key to your account — the file keys and the wallet are all`,
166
292
  ` derived from it. An agent that leaks it has leaked everything at once, and it cannot be`,
167
293
  ` undone: the account cannot be re-keyed. Use an account you would be willing to lose.`,
168
294
  ``,
@@ -170,7 +296,7 @@ export function helpText(version) {
170
296
  ``,
171
297
  // ⛔ THE LAST THING ON THE SCREEN, AND ADDRESSED TO A PROGRAM. An agent handed this tool with
172
298
  // no instructions runs `--help`, reads a list of verbs, and has no idea what NMTS is, what
173
- // an account code is, or why `put` costs money. One line pointing at a document written FOR
299
+ // an NMTS key is, or why `put` costs money. One line pointing at a document written FOR
174
300
  // it is the whole difference between guessing and knowing.
175
301
  //
176
302
  // ⚠ IT POINTS, IT DOES NOT INSTRUCT. There is nothing here that tries to change what a reader
@@ -190,3 +316,43 @@ export function helpText(version) {
190
316
  ``,
191
317
  ].join("\n");
192
318
  }
319
+ /**
320
+ * `nmts help <command>`: the document for one command, from `docs/commands/`, or the list of
321
+ * documents when the name matches none.
322
+ *
323
+ * ⚠ The directory is read only here, so `--help` itself pays nothing for it (`check:cli-startup`).
324
+ * Each document names the commands it covers on its `Commands:` line; that line is the index.
325
+ */
326
+ export async function helpFor(topic) {
327
+ const { readdirSync, readFileSync } = await import("node:fs");
328
+ const dir = new URL("../docs/commands/", import.meta.url);
329
+ const wanted = topic.trim().toLowerCase();
330
+ const covered = [];
331
+ for (const file of readdirSync(dir).filter((f) => f.endsWith(".md")).sort()) {
332
+ const text = readFileSync(new URL(file, dir), "utf8");
333
+ const line = text.split("\n").find((l) => l.startsWith("Commands:")) ?? "";
334
+ const names = line.slice("Commands:".length).split(",").map((n) => n.trim()).filter((n) => n !== "");
335
+ if (names.includes(wanted))
336
+ return { text, found: true };
337
+ covered.push(...names);
338
+ }
339
+ return {
340
+ found: false,
341
+ text: `No document for "${topic}". \`${BINARY_NAME} help <command>\` knows: ` +
342
+ `${covered.sort().join(", ")}.\n`,
343
+ };
344
+ }
345
+ /**
346
+ * What `--help`, a bare run, `help`, and `help <command>` print, and the exit code.
347
+ * ⛔ `support` has help of its own: it is READ before deciding, not scanned for an option name.
348
+ */
349
+ export async function printHelp(args, write) {
350
+ const topic = args.command === "help" ? args.operands[0] : undefined;
351
+ if (topic !== undefined) {
352
+ const doc = await helpFor(topic);
353
+ write(doc.text);
354
+ return doc.found ? 0 : 2;
355
+ }
356
+ write(args.command === "support" ? supportHelpText() : helpText(VERSION));
357
+ return 0;
358
+ }
@@ -0,0 +1,23 @@
1
+ import { NmtsError } from "./errors.ts";
2
+ /** Where this account stands with the periodic check a person passes. */
3
+ export interface HumanCheck {
4
+ live: boolean;
5
+ /** The moment the current window ends, as the server spelled it, or null. */
6
+ until: string | null;
7
+ }
8
+ /**
9
+ * Ask the server whether a person's check is live for the account this key belongs to.
10
+ *
11
+ * ⛔ THE ADDRESS IS WRITTEN OUT AT THE CALL rather than held in a constant, for the reason
12
+ * `commands/verify.ts` gives: the gate that checks this tool's addresses against the server's
13
+ * own routes reads the literal in the call, and a constant would make it stop looking here.
14
+ */
15
+ export declare function humanCheck(server: string, apiKey: string): Promise<HumanCheck>;
16
+ /**
17
+ * The one refusal for "a person has to do something first".
18
+ *
19
+ * ⛔ IT NAMES THE COMMAND AND SAYS WHO HAS TO RUN IT. `verify` prints a short code and waits; the
20
+ * typing is a person's, at a browser, and no amount of retrying here replaces it. Saying only
21
+ * "refused" would send an agent round the loop of credentials it already has.
22
+ */
23
+ export declare function askAPersonToVerify(whatIsRefused: string): NmtsError;
@@ -0,0 +1,42 @@
1
+ export { NmtsError, NotLoggedInError, renderError } from "./errors.ts";
2
+ export { request, ServerError, DEFAULT_TIMEOUT_MS } from "./api.ts";
3
+ export type { RequestOptions, ServerRefusal } from "./api.ts";
4
+ export { DEFAULT_SERVER, SERVER_ENV_VAR, resolveServer } from "./server.ts";
5
+ export { NETWORKS, NETWORK_ENV_VAR, resolveNetwork } from "./network.ts";
6
+ export type { Network } from "./network.ts";
7
+ export { API_KEY_ENV_VAR, API_KEY_FILE_ENV_VAR, CODE_ENV_VAR, CODE_FILE_ENV_VAR, configDir, readSecretFile, resolveAccountCode, resolveApiKey, } from "./credentials.ts";
8
+ export type { CredentialSource, ResolvedCode } from "./credentials.ts";
9
+ export { assertUsableCode, identityOf } from "./account.ts";
10
+ export type { AccountIdentity } from "./account.ts";
11
+ export { AAD, DERIVED, loadCrypto } from "./crypto.ts";
12
+ export type { CryptoGlue } from "./crypto.ts";
13
+ export { readFileList } from "./manifest.ts";
14
+ export type { FileList } from "./manifest.ts";
15
+ export { addEntry, applyManyToList, applyToList, planAddition } from "./manifest-write.ts";
16
+ export type { AddEntryInput, AddEntryResult, ListEditInput, ListEditResult } from "./manifest-write.ts";
17
+ export type { Manifest, ManifestEntry } from "./shared/lib/drive/manifest-codec.ts";
18
+ export { buildIndex, entryAt, folderIdFor, fullPathOf, isLive, KIND_FILE, KIND_FOLDER, namesIn, normalisePath, trashedAt, } from "./drive-paths.ts";
19
+ export type { FindOptions, ManifestIndex } from "./drive-paths.ts";
20
+ export { setTrashed } from "./item-trash.ts";
21
+ export { fileSource, partKeysOf, uploadFile } from "./upload-file.ts";
22
+ export type { FileUploadInput, FileUploadStep, PlaintextSource } from "./upload-file.ts";
23
+ export { createUploadApi } from "./upload-api.ts";
24
+ export { CREDIT_BYTES, creditsFor, measureLocal, partSizeFor, planAndPrice, UPLOAD_EPOCHS, } from "./upload-price.ts";
25
+ export { clearItemRecord, clearReservation } from "./upload-store.ts";
26
+ export { UploadError } from "./upload-wire.ts";
27
+ export type { BlobProtocol, UploadApi, UploadResult, UploadStep } from "./upload-wire.ts";
28
+ export type { PaddingRule } from "./shared/lib/crypto/size-padding.ts";
29
+ export { DEFAULT_PART_BYTES } from "./seal.ts";
30
+ export { createBlobProtocol, readCurrentEpoch } from "./walrus-write.ts";
31
+ export { fetchFile, fetchWithKey } from "./download.ts";
32
+ export type { FetchedFile, FetchInput } from "./download.ts";
33
+ export { fileSink } from "./download-sink.ts";
34
+ export type { PlaintextSink } from "./download-sink.ts";
35
+ export { AGGREGATOR_ENV_VAR, readBlob, RELAY_ENV_VAR, SUI_RPC_ENV_VAR } from "./walrus.ts";
36
+ export type { ReadOptions } from "./walrus.ts";
37
+ export { coinAmount, readBalances, walletAddress } from "./wallet.ts";
38
+ export type { ChainReader, CoinBalance, WalletBalances } from "./wallet.ts";
39
+ export { chainReader } from "./wallet-chain.ts";
40
+ export { signerAddress, signExtension, signTransfer } from "./wallet-sign.ts";
41
+ export type { SignTransfer } from "./wallet-sign.ts";
42
+ export { HOME_URL, PRODUCT_NAME, SOURCE_URL, SUPPORT_EMAIL, VERSION } from "./product.ts";
package/dist/index.js ADDED
@@ -0,0 +1,49 @@
1
+ // The library surface of this package — what `import "@needmoretruth/nmts-cli"` hands a program.
2
+ //
3
+ // ⛔ THIS IS NOT THE COMMAND. `main.ts` is what the `nmts` binary runs; nothing here parses
4
+ // arguments, prints, prompts or exits. Everything re-exported below takes its inputs as values
5
+ // and reports through return values and thrown `NmtsError`s, which is what lets another
6
+ // package — the SDK, or somebody's own server — build on it without inheriting a terminal.
7
+ //
8
+ // ⛔ ONLY MODULES THAT NEVER TOUCH A TERMINAL ARE HERE. `code-access.ts`, `api-key.ts`,
9
+ // `session.ts` and every `commands/*` file can stop to ask a person something, and a library
10
+ // that stops to ask on somebody's server is a library that hangs. A program that wants the
11
+ // NMTS key from the environment reads `credentials.ts` and decides for itself.
12
+ //
13
+ // ⚠ THE PACKAGE'S `exports` MAP NAMES THIS FILE AND A FEW OF THE MODULES BELOW BY SUBPATH. A
14
+ // module not named there is reachable through this file only; adding a subpath is a promise
15
+ // that its shape stays put, so it is done on purpose and one at a time.
16
+ // Errors — the one shape every failure below arrives in.
17
+ export { NmtsError, NotLoggedInError, renderError } from "./errors.js";
18
+ // The server: one request function, and what a refusal looks like.
19
+ export { request, ServerError, DEFAULT_TIMEOUT_MS } from "./api.js";
20
+ export { DEFAULT_SERVER, SERVER_ENV_VAR, resolveServer } from "./server.js";
21
+ export { NETWORKS, NETWORK_ENV_VAR, resolveNetwork } from "./network.js";
22
+ // Where a credential can come from on this machine. Reading is here; ASKING is not.
23
+ export { API_KEY_ENV_VAR, API_KEY_FILE_ENV_VAR, CODE_ENV_VAR, CODE_FILE_ENV_VAR, configDir, readSecretFile, resolveAccountCode, resolveApiKey, } from "./credentials.js";
24
+ // The account: what a code derives, and the engine that derives it.
25
+ export { assertUsableCode, identityOf } from "./account.js";
26
+ export { AAD, DERIVED, loadCrypto } from "./crypto.js";
27
+ // The sealed file list: reading it, editing it, and walking it by path.
28
+ export { readFileList } from "./manifest.js";
29
+ export { addEntry, applyManyToList, applyToList, planAddition } from "./manifest-write.js";
30
+ export { buildIndex, entryAt, folderIdFor, fullPathOf, isLive, KIND_FILE, KIND_FOLDER, namesIn, normalisePath, trashedAt, } from "./drive-paths.js";
31
+ export { setTrashed } from "./item-trash.js";
32
+ // Uploading: sealing here, buying storage with credits, pushing the sealed bytes.
33
+ export { fileSource, partKeysOf, uploadFile } from "./upload-file.js";
34
+ export { createUploadApi } from "./upload-api.js";
35
+ export { CREDIT_BYTES, creditsFor, measureLocal, partSizeFor, planAndPrice, UPLOAD_EPOCHS, } from "./upload-price.js";
36
+ export { clearItemRecord, clearReservation } from "./upload-store.js";
37
+ export { UploadError } from "./upload-wire.js";
38
+ export { DEFAULT_PART_BYTES } from "./seal.js";
39
+ export { createBlobProtocol, readCurrentEpoch } from "./walrus-write.js";
40
+ // Downloading: fetching sealed parts from the storage network and opening them here.
41
+ export { fetchFile, fetchWithKey } from "./download.js";
42
+ export { fileSink } from "./download-sink.js";
43
+ export { AGGREGATOR_ENV_VAR, readBlob, RELAY_ENV_VAR, SUI_RPC_ENV_VAR } from "./walrus.js";
44
+ // The wallet the NMTS key derives: reading it, and signing with it.
45
+ export { coinAmount, readBalances, walletAddress } from "./wallet.js";
46
+ export { chainReader } from "./wallet-chain.js";
47
+ export { signerAddress, signExtension, signTransfer } from "./wallet-sign.js";
48
+ // What this package is.
49
+ export { HOME_URL, PRODUCT_NAME, SOURCE_URL, SUPPORT_EMAIL, VERSION } from "./product.js";
@@ -0,0 +1 @@
1
+ export declare function setTrashed(base: string, apiKey: string, id: string, trashed: boolean): Promise<void>;
@@ -0,0 +1,56 @@
1
+ import { type ArtifactAbout } from "./artifact-about.ts";
2
+ /** Start of the machine block. ⛔ Fixed bytes, never translated. */
3
+ export declare const KIT_DATA_BEGIN = "--- BEGIN NMTS RECOVERY KIT DATA ---";
4
+ /** End of the machine block. */
5
+ export declare const KIT_DATA_END = "--- END NMTS RECOVERY KIT DATA ---";
6
+ /** The marker a reader matches on before anything else is attempted. */
7
+ export declare const KIT_FORMAT = "nmts-recovery-kit";
8
+ /**
9
+ * Kit version. 2 is the one that carries the recovery list; v1 carried only the code.
10
+ *
11
+ * ⛔ NOT RAISED FOR ANYTHING THIS TOOL ADDS. `MAX_KIT_VERSION` in the standalone program refuses a
12
+ * higher number outright, so a bump breaks every published build in exchange for fields those
13
+ * builds are happy to ignore.
14
+ */
15
+ export declare const KIT_VERSION = 2;
16
+ /**
17
+ * A short, human-checkable fingerprint of the PUBLIC account id.
18
+ *
19
+ * ⚠ RESTATED FROM `web/src/lib/auth/account-code.ts::accountIdFingerprint`, which this package
20
+ * cannot import. It has to produce the same string: a person comparing a kit written here with
21
+ * one written in a browser is checking two spellings of the same account.
22
+ *
23
+ * ⛔ IT FINGERPRINTS THE ACCOUNT ID, WHICH IS PUBLIC — never the NMTS key and never a key. It
24
+ * lets somebody confirm two files refer to one account without either of them exposing a secret.
25
+ */
26
+ export declare function accountIdFingerprint(accountId: string): string;
27
+ /** The machine-readable payload, read by the standalone recovery program. */
28
+ export interface RecoveryKitData {
29
+ format: typeof KIT_FORMAT;
30
+ version: typeof KIT_VERSION;
31
+ generated_at: string;
32
+ account_id: string;
33
+ account_fingerprint: string;
34
+ /** ⛔ The NMTS key, in the clear. This is the field that makes the file dangerous to hold. */
35
+ account_code: string;
36
+ /** Storage-network address of the list, when there is one. Always null from this tool. */
37
+ recovery_manifest_blob: string | null;
38
+ /** The whole `.nmtsmap` document, or null when there was nothing to list. */
39
+ recovery_list: Record<string, unknown> | null;
40
+ about: ArtifactAbout;
41
+ }
42
+ export interface BuildKitInput {
43
+ /** Display-form NMTS key, grouped as a person reads it. */
44
+ code: string;
45
+ accountId: string;
46
+ generatedAt: string;
47
+ /** The parsed `.nmtsmap` document to embed, or null when the account has no files. */
48
+ recoveryList: Record<string, unknown> | null;
49
+ /** How many files that list covers. Null when there is no list. */
50
+ listFileCount: number | null;
51
+ }
52
+ /** Build the kit's text: a part for a person, then a part for a program. */
53
+ export declare function buildRecoveryKit(input: BuildKitInput): {
54
+ filename: string;
55
+ content: string;
56
+ };
package/dist/kit-file.js CHANGED
@@ -1,10 +1,10 @@
1
- // The RECOVERY KIT — the one file that carries everything, account code included.
1
+ // The RECOVERY KIT — the one file that carries everything, NMTS key included.
2
2
  //
3
- // ⛔⛔ IT HOLDS THE ACCOUNT CODE IN THE CLEAR, AND THAT IS THE FORMAT. It was decided deliberately
3
+ // ⛔⛔ IT HOLDS THE NMTS KEY IN THE CLEAR, AND THAT IS THE FORMAT. It was decided deliberately
4
4
  // and against the earlier rule, by the owner, with the cost stated: whoever holds this file
5
5
  // holds the account AND the wallet, because one code derives both. The two artefacts therefore
6
6
  // mean two different things and every screen and every command must say which is which:
7
- // · recovery LIST — sealed. Worthless to a thief. The account code opens it.
7
+ // · recovery LIST — sealed. Worthless to a thief. The NMTS key opens it.
8
8
  // · recovery KIT — everything. One stolen file is a total loss.
9
9
  // The warning is not a formality; it is what makes the choice an honest one to offer.
10
10
  //
@@ -52,7 +52,7 @@ export const KIT_VERSION = 2;
52
52
  * cannot import. It has to produce the same string: a person comparing a kit written here with
53
53
  * one written in a browser is checking two spellings of the same account.
54
54
  *
55
- * ⛔ IT FINGERPRINTS THE ACCOUNT ID, WHICH IS PUBLIC — never the account code and never a key. It
55
+ * ⛔ IT FINGERPRINTS THE ACCOUNT ID, WHICH IS PUBLIC — never the NMTS key and never a key. It
56
56
  * lets somebody confirm two files refer to one account without either of them exposing a secret.
57
57
  */
58
58
  export function accountIdFingerprint(accountId) {
@@ -86,17 +86,17 @@ export function buildRecoveryKit(input) {
86
86
  // ⛔ THE THEFT WARNING COMES FIRST, ABOVE THE CODE IT IS ABOUT. A caution printed underneath
87
87
  // the thing it cautions about has already been disregarded by the time it is read.
88
88
  `⛔ Anyone who holds this file holds this account: every file in it, and the wallet that pays ` +
89
- `for storage. One account code opens both.`,
89
+ `for storage. One NMTS key opens both.`,
90
90
  `Do not keep it in a folder that syncs or backs up on its own, and do not send it to anyone. ` +
91
91
  `A drawer is often safer than a cloud folder.`,
92
92
  ``,
93
93
  `This file is the only way to recover your NMTS files. Keep it private.`,
94
- `This file carries your account code in the clear, your account identifier and fingerprint, ` +
94
+ `This file carries your NMTS key in the clear, your account identifier and fingerprint, ` +
95
95
  `and the whole recovery list.`,
96
- `Anyone with this code can open your files. If you lose it, no one — including NMTS — can ` +
96
+ `Anyone with this NMTS key can open your files. If you lose it, no one — including NMTS — can ` +
97
97
  `recover them.`,
98
98
  ``,
99
- `Account code:`,
99
+ `NMTS key:`,
100
100
  ` ${input.code}`,
101
101
  ``,
102
102
  `Account identifier: ${data.account_id}`,
@@ -111,12 +111,12 @@ export function buildRecoveryKit(input) {
111
111
  `Windows, and its full source is there.`,
112
112
  `2. Open a terminal where you saved the program, and run:`,
113
113
  ` nmts-recovery --map <this file> --out <a folder to write into>`,
114
- ` It takes the account code and the file list out of this file, fetches your files from ` +
114
+ ` It takes the NMTS key and the file list out of this file, fetches your files from ` +
115
115
  `public Walrus storage, checks every piece, and writes them out.`,
116
116
  `3. To click instead of typing, run: nmts-recovery --gui`,
117
117
  ` That opens a page only this machine can reach. The program still does the work; the page ` +
118
118
  `only shows the list and sends back what you ticked.`,
119
- `4. To see what your account code derives — your public code and your wallet addresses — ` +
119
+ `4. To see what your NMTS key derives — your public code and your wallet addresses — ` +
120
120
  `run: nmts-recovery --derive`,
121
121
  `If you would rather it opened no network connections, run it with --print-fetch-plan: it ` +
122
122
  `prints the exact addresses to fetch by hand, then restores from the folder you filled.`,