@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
@@ -0,0 +1,30 @@
1
+ /** What `POST /v1/accounts` is told about a new account. Both values are public or one-way. */
2
+ export interface RegistrationProof {
3
+ /** Base64url of the 16 bytes the server will know this account by. */
4
+ accountId: string;
5
+ /** Base64url of the 32 bytes the server stores a verifier of. Sent once; never stored here. */
6
+ authSecret: string;
7
+ }
8
+ /**
9
+ * A brand-new NMTS key, from the engine.
10
+ *
11
+ * ⛔ THE RETURNED STRING IS THE ONLY COPY THAT WILL EVER EXIST. The server keeps a verifier of a
12
+ * value derived from it and nothing else, so a caller that loses this has destroyed an account
13
+ * and nobody — not the holder, not NMTS — can bring it back. Every caller of this owes the
14
+ * person a way to keep it before anything else happens.
15
+ *
16
+ * ⛔ AND THE RANDOMNESS IS THE ENGINE'S, NEVER NODE'S — the reason `generate_dek` gives, with more
17
+ * at stake. These twenty bytes are the seed every key in an account descends from, so a second
18
+ * source of them would be a source the conformance vectors say nothing about, in the one place
19
+ * where a weak draw loses an entire account rather than one file. `crypto.ts` declares the
20
+ * engine call; this is the only thing in the program that makes it.
21
+ */
22
+ export declare function newAccountCode(): Promise<string>;
23
+ /**
24
+ * The pair the server is told about a code, derived here and nowhere else.
25
+ *
26
+ * ⚠ It re-parses the code rather than taking bytes: the parser checks the trailing check symbol,
27
+ * so a code that arrived through anything but `newAccountCode` is refused before it is used to
28
+ * claim an account id.
29
+ */
30
+ export declare function registrationProofOf(code: string): Promise<RegistrationProof>;
@@ -8,7 +8,7 @@
8
8
  // for that would have made a promise false everywhere it is read; a separate module keeps the
9
9
  // exception in one file, next to the reason for it.
10
10
  //
11
- // ⛔ `authSecret` IS NOT THE ACCOUNT CODE AND CANNOT BE TURNED BACK INTO ONE. It is 32 bytes out
11
+ // ⛔ `authSecret` IS NOT THE NMTS KEY AND CANNOT BE TURNED BACK INTO ONE. It is 32 bytes out
12
12
  // of a one-way derivation (NCF-3 §1.2), it opens no file, and the same value goes over the
13
13
  // wire on every sign-in the browser makes. What it can do is prove ownership, so it is built
14
14
  // here, sent once, and never written down, printed or returned to a caller that did not ask.
@@ -20,7 +20,7 @@
20
20
  import { DERIVED, loadCrypto } from "./crypto.js";
21
21
  import { NmtsError } from "./errors.js";
22
22
  /**
23
- * A brand-new account code, from the engine.
23
+ * A brand-new NMTS key, from the engine.
24
24
  *
25
25
  * ⛔ THE RETURNED STRING IS THE ONLY COPY THAT WILL EVER EXIST. The server keeps a verifier of a
26
26
  * value derived from it and nothing else, so a caller that loses this has destroyed an account
@@ -39,7 +39,7 @@ export async function newAccountCode() {
39
39
  if (typeof code !== "string" || code.length === 0) {
40
40
  // ⛔ Refused rather than passed on. An empty code would be registered as a real account, and
41
41
  // the failure would surface much later as an account nobody can open.
42
- throw new NmtsError("The NMTS crypto engine did not produce an account code.", {
42
+ throw new NmtsError("The NMTS crypto engine did not produce an NMTS key.", {
43
43
  exitCode: 1,
44
44
  nextStep: "Nothing was created. Reinstall the package and try again.",
45
45
  });
@@ -61,8 +61,8 @@ export async function registrationProofOf(code) {
61
61
  }
62
62
  catch {
63
63
  // ⛔ The engine's own message is not repeated: it can contain the input, and the input is the
64
- // account code.
65
- throw new NmtsError("That is not a valid NMTS account code.", {
64
+ // NMTS key.
65
+ throw new NmtsError("That is not a valid NMTS key.", {
66
66
  exitCode: 2,
67
67
  nextStep: "The last character is a check symbol, and it does not match the rest.",
68
68
  });
package/dist/risk.d.ts ADDED
@@ -0,0 +1,380 @@
1
+ import type { ParsedArgs } from "./args.ts";
2
+ import type { ConsentKey } from "./consent.ts";
3
+ export type Tier = "none" | "low" | "medium" | "high" | "ultra-high";
4
+ export interface Act {
5
+ tier: Tier;
6
+ /** What the gate asks about, in the second person. Absent for `none`. */
7
+ what?: string;
8
+ /** The unlock this act sits behind. Only high acts have one. */
9
+ lock?: ConsentKey;
10
+ /**
11
+ * The command prints its own review and takes its own yes (`--yes`, a typed sentence, a version
12
+ * string). The gate then decides only whether a yes is NEEDED, and the command asks.
13
+ */
14
+ asksItself?: true;
15
+ /**
16
+ * The unlock is itself the standing consent, so a run under it is not asked again: wallet acts
17
+ * under the `wallet` grant (scope, expiry, ceiling), and the two ways of keeping the code outside
18
+ * the sealed file, where unlocking IS the decision the command carries out.
19
+ */
20
+ standing?: true;
21
+ }
22
+ export declare const ACTS: {
23
+ readonly login: {
24
+ readonly tier: "none";
25
+ };
26
+ readonly logout: {
27
+ readonly tier: "none";
28
+ };
29
+ readonly whoami: {
30
+ readonly tier: "none";
31
+ };
32
+ readonly ls: {
33
+ readonly tier: "none";
34
+ };
35
+ readonly usage: {
36
+ readonly tier: "none";
37
+ };
38
+ readonly balance: {
39
+ readonly tier: "none";
40
+ };
41
+ readonly credits: {
42
+ readonly tier: "none";
43
+ };
44
+ readonly trial: {
45
+ readonly tier: "none";
46
+ };
47
+ readonly expiring: {
48
+ readonly tier: "none";
49
+ };
50
+ readonly losses: {
51
+ readonly tier: "none";
52
+ };
53
+ readonly "public-code": {
54
+ readonly tier: "none";
55
+ };
56
+ readonly wallet: {
57
+ readonly tier: "none";
58
+ };
59
+ readonly get: {
60
+ readonly tier: "none";
61
+ };
62
+ readonly pull: {
63
+ readonly tier: "none";
64
+ };
65
+ readonly receive: {
66
+ readonly tier: "none";
67
+ };
68
+ readonly shares: {
69
+ readonly tier: "none";
70
+ };
71
+ readonly listfile: {
72
+ readonly tier: "none";
73
+ };
74
+ readonly "recovery-list": {
75
+ readonly tier: "none";
76
+ };
77
+ readonly recovery: {
78
+ readonly tier: "none";
79
+ };
80
+ readonly mkdir: {
81
+ readonly tier: "none";
82
+ };
83
+ readonly mv: {
84
+ readonly tier: "none";
85
+ };
86
+ readonly rename: {
87
+ readonly tier: "none";
88
+ };
89
+ readonly star: {
90
+ readonly tier: "none";
91
+ };
92
+ readonly unstar: {
93
+ readonly tier: "none";
94
+ };
95
+ readonly pin: {
96
+ readonly tier: "none";
97
+ };
98
+ readonly unpin: {
99
+ readonly tier: "none";
100
+ };
101
+ readonly label: {
102
+ readonly tier: "none";
103
+ };
104
+ readonly unlabel: {
105
+ readonly tier: "none";
106
+ };
107
+ readonly devices: {
108
+ readonly tier: "none";
109
+ };
110
+ readonly key: {
111
+ readonly tier: "none";
112
+ };
113
+ readonly env: {
114
+ readonly tier: "none";
115
+ };
116
+ readonly mode: {
117
+ readonly tier: "none";
118
+ };
119
+ readonly unlock: {
120
+ readonly tier: "none";
121
+ };
122
+ readonly lock: {
123
+ readonly tier: "none";
124
+ };
125
+ readonly consent: {
126
+ readonly tier: "none";
127
+ };
128
+ readonly "on-collision": {
129
+ readonly tier: "none";
130
+ };
131
+ readonly padding: {
132
+ readonly tier: "none";
133
+ };
134
+ readonly deposit: {
135
+ readonly tier: "none";
136
+ };
137
+ readonly notices: {
138
+ readonly tier: "none";
139
+ };
140
+ readonly terms: {
141
+ readonly tier: "none";
142
+ };
143
+ readonly privacy: {
144
+ readonly tier: "none";
145
+ };
146
+ readonly verify: {
147
+ readonly tier: "none";
148
+ };
149
+ readonly support: {
150
+ readonly tier: "none";
151
+ };
152
+ readonly mcp: {
153
+ readonly tier: "none";
154
+ };
155
+ readonly "accept-terms": {
156
+ readonly tier: "none";
157
+ };
158
+ readonly rm: {
159
+ readonly tier: "low";
160
+ readonly what: "Move these to the trash, restorable for 30 days.";
161
+ };
162
+ readonly restore: {
163
+ readonly tier: "low";
164
+ readonly what: "Bring these back out of the trash.";
165
+ };
166
+ readonly unshare: {
167
+ readonly tier: "low";
168
+ readonly what: "Withdraw this share. Whoever had it cannot download it again.";
169
+ };
170
+ readonly tip: {
171
+ readonly tier: "none";
172
+ };
173
+ readonly "tip.set": {
174
+ readonly tier: "none";
175
+ };
176
+ readonly "on-collision.set": {
177
+ readonly tier: "low";
178
+ readonly what: "Change what an upload does when its name is already taken.";
179
+ };
180
+ readonly "padding.set": {
181
+ readonly tier: "low";
182
+ readonly what: "Change how file sizes are hidden for the next uploads.";
183
+ };
184
+ readonly "deposit.set": {
185
+ readonly tier: "low";
186
+ readonly what: "Change how many credits the next uploads set aside as a deposit.";
187
+ };
188
+ readonly update: {
189
+ readonly tier: "low";
190
+ readonly what: "Replace this program with the newest published release.";
191
+ };
192
+ readonly "trial.apply": {
193
+ readonly tier: "low";
194
+ readonly what: "Ask for this week's free credits.";
195
+ };
196
+ readonly "support.send": {
197
+ readonly tier: "low";
198
+ readonly what: "Send this message to the developer of NMTS.";
199
+ readonly asksItself: true;
200
+ };
201
+ readonly s3: {
202
+ readonly tier: "medium";
203
+ readonly what: "Serve the drive to S3 programs on this machine. Uploads through it spend credits.";
204
+ };
205
+ readonly put: {
206
+ readonly tier: "medium";
207
+ readonly what: "Upload this file and spend credits on its storage. Credits are not refundable.";
208
+ };
209
+ readonly push: {
210
+ readonly tier: "medium";
211
+ readonly what: "Upload this directory and spend credits on its storage. Credits are not refundable.";
212
+ };
213
+ readonly sweep: {
214
+ readonly tier: "medium";
215
+ readonly what: "Drop trash entries whose 30 days have run out.";
216
+ readonly asksItself: true;
217
+ };
218
+ readonly "key.list": {
219
+ readonly tier: "none";
220
+ };
221
+ readonly "key.new": {
222
+ readonly tier: "medium";
223
+ readonly what: "Make a new API key for this machine.";
224
+ };
225
+ readonly "key.revoke": {
226
+ readonly tier: "medium";
227
+ readonly what: "Revoke an API key. Whatever used it stops working.";
228
+ };
229
+ readonly "public-code.publish": {
230
+ readonly tier: "medium";
231
+ readonly what: "Publish this account's public code. Publishing cannot be undone.";
232
+ };
233
+ readonly "losses.dismiss": {
234
+ readonly tier: "medium";
235
+ readonly what: "Put this loss notice down. It will not be shown again.";
236
+ };
237
+ readonly "credits.transfer": {
238
+ readonly tier: "medium";
239
+ readonly what: "Move credits to another account of your own.";
240
+ };
241
+ readonly rebuild: {
242
+ readonly tier: "medium";
243
+ readonly what: "Build a file list from the server's rows and write it as this account's list.";
244
+ };
245
+ readonly share: {
246
+ readonly tier: "high";
247
+ readonly lock: "share";
248
+ readonly what: "Give another account this file.";
249
+ readonly asksItself: true;
250
+ };
251
+ readonly "login.plain": {
252
+ readonly tier: "high";
253
+ readonly lock: "unsafe-code-storage";
254
+ readonly what: "Store the NMTS key in the clear.";
255
+ readonly standing: true;
256
+ };
257
+ readonly "login.env": {
258
+ readonly tier: "high";
259
+ readonly lock: "plain-env";
260
+ readonly what: "Print the NMTS key for an environment variable.";
261
+ readonly standing: true;
262
+ };
263
+ readonly extend: {
264
+ readonly tier: "high";
265
+ readonly lock: "wallet";
266
+ readonly what: "Sign a transaction that spends WAL from the wallet.";
267
+ readonly standing: true;
268
+ };
269
+ readonly "put.wallet": {
270
+ readonly tier: "high";
271
+ readonly lock: "wallet";
272
+ readonly what: "Sign a transaction that spends WAL and SUI from the wallet.";
273
+ readonly standing: true;
274
+ };
275
+ readonly "push.wallet": {
276
+ readonly tier: "high";
277
+ readonly lock: "wallet";
278
+ readonly what: "Sign transactions that spend WAL and SUI from the wallet.";
279
+ readonly standing: true;
280
+ };
281
+ readonly "wallet.send": {
282
+ readonly tier: "high";
283
+ readonly lock: "wallet";
284
+ readonly what: "Send coins out of the wallet.";
285
+ readonly asksItself: true;
286
+ };
287
+ readonly "wallet.swap": {
288
+ readonly tier: "high";
289
+ readonly lock: "wallet";
290
+ readonly what: "Swap one coin for the other on a public venue.";
291
+ readonly asksItself: true;
292
+ };
293
+ readonly "devices.sign-out": {
294
+ readonly tier: "high";
295
+ readonly lock: "sign-out";
296
+ readonly what: "Sign a device out of this account.";
297
+ readonly asksItself: true;
298
+ };
299
+ readonly rollback: {
300
+ readonly tier: "high";
301
+ readonly lock: "rollback";
302
+ readonly what: "Put the previous file list back in place of the current one.";
303
+ readonly asksItself: true;
304
+ };
305
+ readonly "whoami.reveal": {
306
+ readonly tier: "high";
307
+ readonly lock: "reveal";
308
+ readonly what: "Print the NMTS key on this screen.";
309
+ };
310
+ readonly kit: {
311
+ readonly tier: "high";
312
+ readonly lock: "kit";
313
+ readonly what: "Write the NMTS key into a recovery kit file on this disk.";
314
+ };
315
+ readonly create: {
316
+ readonly tier: "high";
317
+ readonly what: "Create a new account under the Terms in force.";
318
+ readonly asksItself: true;
319
+ };
320
+ readonly "accept-terms.accept": {
321
+ readonly tier: "high";
322
+ readonly what: "Accept a new version of the Terms for this account.";
323
+ readonly asksItself: true;
324
+ };
325
+ readonly "delete-account": {
326
+ readonly tier: "ultra-high";
327
+ readonly what: "Erase this account's server record, permanently.";
328
+ readonly asksItself: true;
329
+ };
330
+ readonly erase: {
331
+ readonly tier: "ultra-high";
332
+ readonly what: "Erase files for good: the server's record and this account's key to them.";
333
+ readonly asksItself: true;
334
+ };
335
+ readonly "erase.release": {
336
+ readonly tier: "ultra-high";
337
+ readonly lock: "release-storage";
338
+ readonly what: "Erase files for good AND destroy the storage bought with credits under them.";
339
+ readonly asksItself: true;
340
+ };
341
+ readonly "wallet.donate": {
342
+ readonly tier: "high";
343
+ readonly lock: "donate";
344
+ readonly what: "Send a gift to the developer from the wallet.";
345
+ readonly asksItself: true;
346
+ };
347
+ readonly "wallet.hall": {
348
+ readonly tier: "none";
349
+ };
350
+ readonly "wallet.hall.set": {
351
+ readonly tier: "medium";
352
+ readonly what: "Publish this name beside your wallet's address in the gift hall of fame.";
353
+ };
354
+ readonly "wallet.storage.reshape": {
355
+ readonly tier: "high";
356
+ readonly lock: "wallet";
357
+ readonly what: "Cut or join a storage resource the wallet holds — a signed transaction.";
358
+ readonly asksItself: true;
359
+ };
360
+ readonly "wallet.storage.give": {
361
+ readonly tier: "high";
362
+ readonly lock: "wallet";
363
+ readonly what: "Hand a storage resource to another address — signed, and not undoable.";
364
+ readonly asksItself: true;
365
+ };
366
+ };
367
+ export type ActId = keyof typeof ACTS;
368
+ export declare const ACT_IDS: ActId[];
369
+ /**
370
+ * Which act this command line performs. `null` only for a command the entry point does not know,
371
+ * which it refuses on its own.
372
+ */
373
+ export declare function actOf(args: ParsedArgs): ActId | null;
374
+ /**
375
+ * The hook `main.ts` calls once per run: find the act, pass it through the gate, and when the
376
+ * gate itself has taken the yes, hand the command a `--yes` so it does not ask twice.
377
+ * ⚠ The gate is loaded only when there is an act: this file is on every run's path
378
+ * (`check:cli-startup`), and the gate reaches the consent and prompt modules.
379
+ */
380
+ export declare function gateArgs(args: ParsedArgs): Promise<void>;
package/dist/risk.js ADDED
@@ -0,0 +1,206 @@
1
+ // Every act this tool performs, and the risk tier it carries — the one table the gate reads.
2
+ //
3
+ // ⛔ WHY ONE TABLE (owner, 2026-09-06). Before it, each command decided for itself whether to ask,
4
+ // whether a mode may run it and whether a person had to be present, and no two decided the same
5
+ // way. Now a command names its ACT and the tier does the rest: `gate.ts` refuses, asks or waves
6
+ // through by tier and mode, the same way every time, and the instructions can describe the rule
7
+ // in one table instead of once per command.
8
+ //
9
+ // ⛔ AN ACT IS FINER THAN A COMMAND. `devices` reads; `devices --sign-out` ends a session. The tier
10
+ // belongs to what is DONE, so `actOf` looks at the flags and operands, not only the command word.
11
+ //
12
+ // ⛔ EVERY COMMAND THE ENTRY POINT KNOWS HAS AN ACT, and a test holds the two lists together: a
13
+ // command that reaches `main.ts` without a row here fails the build, because a command with no
14
+ // tier is a command nobody decided about.
15
+ //
16
+ // The tiers, and what a mode does with each (the full table is AGENTS.md and the spec):
17
+ // none reads and reversible tidying — runs everywhere.
18
+ // low reversible, but a change a person should know about — auto runs it, default asks.
19
+ // medium hard to undo or costs money, within a ceiling — auto is the agent's own call,
20
+ // default asks.
21
+ // high irreversible, unbounded money, or something reaching a third party — LOCKED until
22
+ // a person unlocks it, and asked about on every run in every mode but skip.
23
+ // ultra-high permanent destruction — a person at the terminal types a sentence; an auto mode
24
+ // never; skip-permissions with a written --reason.
25
+ export const ACTS = {
26
+ // ── none: reads and reversible tidying ──
27
+ login: { tier: "none" },
28
+ logout: { tier: "none" },
29
+ whoami: { tier: "none" },
30
+ ls: { tier: "none" },
31
+ usage: { tier: "none" },
32
+ balance: { tier: "none" },
33
+ // The bare word does nothing but name its one verb; the verb itself is `credits.transfer` below.
34
+ credits: { tier: "none" },
35
+ trial: { tier: "none" },
36
+ expiring: { tier: "none" },
37
+ losses: { tier: "none" },
38
+ "public-code": { tier: "none" },
39
+ wallet: { tier: "none" },
40
+ get: { tier: "none" },
41
+ pull: { tier: "none" },
42
+ receive: { tier: "none" },
43
+ shares: { tier: "none" },
44
+ listfile: { tier: "none" },
45
+ "recovery-list": { tier: "none" },
46
+ recovery: { tier: "none" },
47
+ mkdir: { tier: "none" },
48
+ mv: { tier: "none" },
49
+ rename: { tier: "none" },
50
+ star: { tier: "none" },
51
+ unstar: { tier: "none" },
52
+ pin: { tier: "none" },
53
+ unpin: { tier: "none" },
54
+ label: { tier: "none" },
55
+ unlabel: { tier: "none" },
56
+ devices: { tier: "none" },
57
+ key: { tier: "none" },
58
+ env: { tier: "none" },
59
+ mode: { tier: "none" },
60
+ unlock: { tier: "none" },
61
+ lock: { tier: "none" },
62
+ consent: { tier: "none" },
63
+ "on-collision": { tier: "none" },
64
+ padding: { tier: "none" },
65
+ deposit: { tier: "none" },
66
+ notices: { tier: "none" },
67
+ terms: { tier: "none" },
68
+ privacy: { tier: "none" },
69
+ verify: { tier: "none" },
70
+ support: { tier: "none" },
71
+ mcp: { tier: "none" },
72
+ "accept-terms": { tier: "none" },
73
+ // ── low ──
74
+ rm: { tier: "low", what: "Move these to the trash, restorable for 30 days." },
75
+ restore: { tier: "low", what: "Bring these back out of the trash." },
76
+ unshare: { tier: "low", what: "Withdraw this share. Whoever had it cannot download it again." },
77
+ tip: { tier: "none" },
78
+ "tip.set": { tier: "none" },
79
+ "on-collision.set": { tier: "low", what: "Change what an upload does when its name is already taken." },
80
+ "padding.set": { tier: "low", what: "Change how file sizes are hidden for the next uploads." },
81
+ "deposit.set": { tier: "low", what: "Change how many credits the next uploads set aside as a deposit." },
82
+ update: { tier: "low", what: "Replace this program with the newest published release." },
83
+ "trial.apply": { tier: "low", what: "Ask for this week's free credits." },
84
+ "support.send": { tier: "low", what: "Send this message to the developer of NMTS.", asksItself: true },
85
+ s3: { tier: "medium", what: "Serve the drive to S3 programs on this machine. Uploads through it spend credits." },
86
+ // ── medium ──
87
+ put: { tier: "medium", what: "Upload this file and spend credits on its storage. Credits are not refundable." },
88
+ push: { tier: "medium", what: "Upload this directory and spend credits on its storage. Credits are not refundable." },
89
+ sweep: { tier: "medium", what: "Drop trash entries whose 30 days have run out.", asksItself: true },
90
+ "key.list": { tier: "none" },
91
+ "key.new": { tier: "medium", what: "Make a new API key for this machine." },
92
+ "key.revoke": { tier: "medium", what: "Revoke an API key. Whatever used it stops working." },
93
+ "public-code.publish": { tier: "medium", what: "Publish this account's public code. Publishing cannot be undone." },
94
+ "losses.dismiss": { tier: "medium", what: "Put this loss notice down. It will not be shown again." },
95
+ // ⛔ MEDIUM AND NOT HIGH. It moves value, so it is not `low`; but it moves it INSIDE one person's
96
+ // own family of accounts — nothing reaches a third party, nothing is spent, and the same
97
+ // command in the other direction puts it back. `high` is where a stranger or the chain is.
98
+ "credits.transfer": { tier: "medium", what: "Move credits to another account of your own." },
99
+ rebuild: { tier: "medium", what: "Build a file list from the server's rows and write it as this account's list." },
100
+ // ── high: locked until a person unlocks, asked on every run ──
101
+ share: { tier: "high", lock: "share", what: "Give another account this file.", asksItself: true },
102
+ "login.plain": { tier: "high", lock: "unsafe-code-storage", what: "Store the NMTS key in the clear.", standing: true },
103
+ "login.env": { tier: "high", lock: "plain-env", what: "Print the NMTS key for an environment variable.", standing: true },
104
+ extend: { tier: "high", lock: "wallet", what: "Sign a transaction that spends WAL from the wallet.", standing: true },
105
+ "put.wallet": { tier: "high", lock: "wallet", what: "Sign a transaction that spends WAL and SUI from the wallet.", standing: true },
106
+ "push.wallet": { tier: "high", lock: "wallet", what: "Sign transactions that spend WAL and SUI from the wallet.", standing: true },
107
+ "wallet.send": { tier: "high", lock: "wallet", what: "Send coins out of the wallet.", asksItself: true },
108
+ "wallet.swap": { tier: "high", lock: "wallet", what: "Swap one coin for the other on a public venue.", asksItself: true },
109
+ "devices.sign-out": { tier: "high", lock: "sign-out", what: "Sign a device out of this account.", asksItself: true },
110
+ rollback: { tier: "high", lock: "rollback", what: "Put the previous file list back in place of the current one.", asksItself: true },
111
+ "whoami.reveal": { tier: "high", lock: "reveal", what: "Print the NMTS key on this screen." },
112
+ kit: { tier: "high", lock: "kit", what: "Write the NMTS key into a recovery kit file on this disk." },
113
+ create: { tier: "high", what: "Create a new account under the Terms in force.", asksItself: true },
114
+ "accept-terms.accept": { tier: "high", what: "Accept a new version of the Terms for this account.", asksItself: true },
115
+ // ── ultra-high: permanent destruction ──
116
+ "delete-account": { tier: "ultra-high", what: "Erase this account's server record, permanently.", asksItself: true },
117
+ erase: { tier: "ultra-high", what: "Erase files for good: the server's record and this account's key to them.", asksItself: true },
118
+ "erase.release": {
119
+ tier: "ultra-high",
120
+ lock: "release-storage",
121
+ what: "Erase files for good AND destroy the storage bought with credits under them.",
122
+ asksItself: true,
123
+ },
124
+ "wallet.donate": { tier: "high", lock: "donate", what: "Send a gift to the developer from the wallet.", asksItself: true },
125
+ // ⛔ READING THE HALL IS `none` AND LISTING A NAME IS `medium`. The read signs nothing and asks
126
+ // nobody's wallet a question; setting a name PUBLISHES a name beside an address on a public
127
+ // page, which is undone by one more run of the same command but cannot be unseen.
128
+ "wallet.hall": { tier: "none" },
129
+ "wallet.hall.set": { tier: "medium", what: "Publish this name beside your wallet's address in the gift hall of fame." },
130
+ "wallet.storage.reshape": { tier: "high", lock: "wallet", what: "Cut or join a storage resource the wallet holds — a signed transaction.", asksItself: true },
131
+ "wallet.storage.give": { tier: "high", lock: "wallet", what: "Hand a storage resource to another address — signed, and not undoable.", asksItself: true },
132
+ };
133
+ export const ACT_IDS = Object.keys(ACTS);
134
+ /**
135
+ * Which act this command line performs. `null` only for a command the entry point does not know,
136
+ * which it refuses on its own.
137
+ */
138
+ export function actOf(args) {
139
+ const c = args.command;
140
+ const sub = args.operands[0] ?? "";
141
+ switch (c) {
142
+ case null:
143
+ return null;
144
+ case "login":
145
+ return args.plain ? "login.plain" : args.env ? "login.env" : "login";
146
+ case "whoami":
147
+ return args.reveal ? "whoami.reveal" : "whoami";
148
+ case "devices":
149
+ return args.signOut !== undefined ? "devices.sign-out" : "devices";
150
+ case "wallet":
151
+ if (sub === "storage") {
152
+ const what = args.operands[1] ?? "";
153
+ return what === "transfer" ? "wallet.storage.give" : what === "split" || what === "merge" ? "wallet.storage.reshape" : "wallet";
154
+ }
155
+ // ⛔ `hall` READS UNTIL A NAME IS NAMED. `--name` and `--remove` both write the listing, so
156
+ // both land on the act that publishes; the bare command is a read like `wallet` itself.
157
+ if (sub === "hall")
158
+ return args.name !== undefined || args.remove ? "wallet.hall.set" : "wallet.hall";
159
+ return sub === "send" ? "wallet.send" : sub === "swap" ? "wallet.swap" : sub === "donate" ? "wallet.donate" : "wallet";
160
+ case "put":
161
+ return args.pay === "wallet" ? "put.wallet" : "put";
162
+ case "push":
163
+ return args.pay === "wallet" ? "push.wallet" : "push";
164
+ case "key":
165
+ return sub === "new" ? "key.new" : sub === "revoke" ? "key.revoke" : "key";
166
+ case "trial":
167
+ return sub === "apply" ? "trial.apply" : "trial";
168
+ case "credits":
169
+ return sub === "transfer" ? "credits.transfer" : "credits";
170
+ case "losses":
171
+ return args.dismiss !== undefined ? "losses.dismiss" : "losses";
172
+ case "public-code":
173
+ return args.publish ? "public-code.publish" : "public-code";
174
+ case "support":
175
+ return sub === "send" || sub === "reply" ? "support.send" : "support";
176
+ case "on-collision":
177
+ return sub === "" ? "on-collision" : "on-collision.set";
178
+ case "padding":
179
+ return sub === "" ? "padding" : "padding.set";
180
+ case "deposit":
181
+ return sub === "" ? "deposit" : "deposit.set";
182
+ case "erase":
183
+ return args.releaseStorage ? "erase.release" : "erase";
184
+ case "tip":
185
+ return sub === "" ? "tip" : "tip.set";
186
+ case "accept-terms":
187
+ return args.status ? "accept-terms" : "accept-terms.accept";
188
+ default:
189
+ return ACT_IDS.includes(c) ? c : null;
190
+ }
191
+ }
192
+ /**
193
+ * The hook `main.ts` calls once per run: find the act, pass it through the gate, and when the
194
+ * gate itself has taken the yes, hand the command a `--yes` so it does not ask twice.
195
+ * ⚠ The gate is loaded only when there is an act: this file is on every run's path
196
+ * (`check:cli-startup`), and the gate reaches the consent and prompt modules.
197
+ */
198
+ export async function gateArgs(args) {
199
+ const act = actOf(args);
200
+ if (act === null || args.dryRun)
201
+ return;
202
+ const { gate } = await import("./gate.js");
203
+ const passage = await gate(act, args);
204
+ if (!passage.ask)
205
+ args.yes = true;
206
+ }