@needmoretruth/nmts-cli 0.17.2 → 0.34.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) hide show
  1. package/AGENTS.md +125 -517
  2. package/CHANGELOG.md +104 -0
  3. package/README.ko.md +377 -469
  4. package/README.md +394 -474
  5. package/dist/account-proof.d.ts +29 -0
  6. package/dist/account-proof.js +6 -6
  7. package/dist/account.d.ts +18 -0
  8. package/dist/account.js +5 -5
  9. package/dist/agent-host.d.ts +71 -0
  10. package/dist/agent-host.js +169 -0
  11. package/dist/api-advice.d.ts +2 -0
  12. package/dist/api-advice.js +210 -0
  13. package/dist/api-key.d.ts +79 -0
  14. package/dist/api-key.js +7 -7
  15. package/dist/api-refusal.d.ts +14 -0
  16. package/dist/api-refusal.js +8 -0
  17. package/dist/api.d.ts +114 -0
  18. package/dist/api.js +59 -162
  19. package/dist/args.d.ts +160 -0
  20. package/dist/args.js +118 -30
  21. package/dist/artifact-about.d.ts +49 -0
  22. package/dist/autonomy.d.ts +39 -0
  23. package/dist/autonomy.js +110 -32
  24. package/dist/code-access.d.ts +29 -0
  25. package/dist/code-access.js +3 -3
  26. package/dist/code-vault.d.ts +38 -0
  27. package/dist/code-vault.js +8 -8
  28. package/dist/collision.d.ts +67 -0
  29. package/dist/collision.js +1 -1
  30. package/dist/commands/accept-terms.d.ts +11 -0
  31. package/dist/commands/accept-terms.js +106 -0
  32. package/dist/commands/balance.d.ts +7 -0
  33. package/dist/commands/balance.js +54 -1
  34. package/dist/commands/create-code-file.d.ts +24 -0
  35. package/dist/commands/create-code-file.js +93 -0
  36. package/dist/commands/create-link.d.ts +10 -0
  37. package/dist/commands/create-link.js +232 -0
  38. package/dist/commands/create.d.ts +20 -0
  39. package/dist/commands/create.js +43 -102
  40. package/dist/commands/credits.d.ts +9 -0
  41. package/dist/commands/credits.js +110 -0
  42. package/dist/commands/delete-account.d.ts +11 -0
  43. package/dist/commands/delete-account.js +63 -0
  44. package/dist/commands/deposit.d.ts +7 -0
  45. package/dist/commands/deposit.js +85 -0
  46. package/dist/commands/devices.d.ts +12 -0
  47. package/dist/commands/devices.js +144 -0
  48. package/dist/commands/documents.d.ts +35 -0
  49. package/dist/commands/documents.js +212 -0
  50. package/dist/commands/env.d.ts +5 -0
  51. package/dist/commands/env.js +10 -2
  52. package/dist/commands/erase.d.ts +13 -0
  53. package/dist/commands/erase.js +193 -0
  54. package/dist/commands/expiring.d.ts +19 -0
  55. package/dist/commands/extend.d.ts +33 -0
  56. package/dist/commands/extend.js +54 -15
  57. package/dist/commands/get.d.ts +18 -0
  58. package/dist/commands/key-manage.d.ts +11 -0
  59. package/dist/commands/key-manage.js +162 -0
  60. package/dist/commands/key.d.ts +28 -0
  61. package/dist/commands/key.js +249 -0
  62. package/dist/commands/kit.d.ts +11 -0
  63. package/dist/commands/kit.js +7 -7
  64. package/dist/commands/listfile.d.ts +13 -0
  65. package/dist/commands/listfile.js +12 -5
  66. package/dist/commands/login.d.ts +18 -0
  67. package/dist/commands/login.js +19 -19
  68. package/dist/commands/logout.d.ts +1 -0
  69. package/dist/commands/logout.js +1 -1
  70. package/dist/commands/losses.d.ts +12 -0
  71. package/dist/commands/losses.js +180 -0
  72. package/dist/commands/ls.d.ts +23 -0
  73. package/dist/commands/marks-dispatch.d.ts +2 -0
  74. package/dist/commands/marks-dispatch.js +51 -0
  75. package/dist/commands/marks.d.ts +46 -0
  76. package/dist/commands/marks.js +80 -0
  77. package/dist/commands/mcp.d.ts +24 -0
  78. package/dist/commands/mcp.js +70 -5
  79. package/dist/commands/mode.d.ts +8 -0
  80. package/dist/commands/mode.js +60 -24
  81. package/dist/commands/on-collision.d.ts +6 -0
  82. package/dist/commands/organise.d.ts +46 -0
  83. package/dist/commands/padding.d.ts +7 -0
  84. package/dist/commands/padding.js +114 -0
  85. package/dist/commands/public-code.d.ts +9 -0
  86. package/dist/commands/public-code.js +8 -8
  87. package/dist/commands/pull.d.ts +27 -0
  88. package/dist/commands/push-wallet.d.ts +19 -0
  89. package/dist/commands/push-wallet.js +69 -0
  90. package/dist/commands/push.d.ts +47 -0
  91. package/dist/commands/push.js +37 -7
  92. package/dist/commands/put-wallet.d.ts +77 -0
  93. package/dist/commands/put-wallet.js +316 -0
  94. package/dist/commands/put.d.ts +56 -0
  95. package/dist/commands/put.js +53 -6
  96. package/dist/commands/rebuild.d.ts +18 -0
  97. package/dist/commands/rebuild.js +108 -10
  98. package/dist/commands/receive.d.ts +24 -0
  99. package/dist/commands/recovery-dispatch.d.ts +2 -0
  100. package/dist/commands/recovery-dispatch.js +34 -0
  101. package/dist/commands/recovery-list.d.ts +11 -0
  102. package/dist/commands/recovery-list.js +6 -6
  103. package/dist/commands/recovery.d.ts +25 -0
  104. package/dist/commands/recovery.js +2 -2
  105. package/dist/commands/rollback.d.ts +9 -0
  106. package/dist/commands/rollback.js +118 -0
  107. package/dist/commands/s3.d.ts +23 -0
  108. package/dist/commands/s3.js +6 -6
  109. package/dist/commands/settings.d.ts +5 -0
  110. package/dist/commands/settings.js +21 -6
  111. package/dist/commands/share-dispatch.d.ts +2 -0
  112. package/dist/commands/share-dispatch.js +46 -0
  113. package/dist/commands/share.d.ts +14 -0
  114. package/dist/commands/share.js +13 -3
  115. package/dist/commands/shares-sent.d.ts +18 -0
  116. package/dist/commands/shares-sent.js +95 -0
  117. package/dist/commands/support.d.ts +24 -0
  118. package/dist/commands/support.js +321 -0
  119. package/dist/commands/sweep.d.ts +11 -0
  120. package/dist/commands/tip.d.ts +11 -0
  121. package/dist/commands/tip.js +86 -0
  122. package/dist/commands/trash.d.ts +17 -0
  123. package/dist/commands/trash.js +1 -1
  124. package/dist/commands/trial.d.ts +7 -0
  125. package/dist/commands/trial.js +16 -18
  126. package/dist/commands/unlock.d.ts +16 -0
  127. package/dist/commands/unlock.js +159 -0
  128. package/dist/commands/update.d.ts +42 -0
  129. package/dist/commands/update.js +1 -1
  130. package/dist/commands/usage.d.ts +8 -0
  131. package/dist/commands/verify.d.ts +18 -0
  132. package/dist/commands/verify.js +10 -6
  133. package/dist/commands/wallet-activity.d.ts +26 -0
  134. package/dist/commands/wallet-activity.js +117 -0
  135. package/dist/commands/wallet-donate.d.ts +26 -0
  136. package/dist/commands/wallet-donate.js +163 -0
  137. package/dist/commands/wallet-hall.d.ts +35 -0
  138. package/dist/commands/wallet-hall.js +214 -0
  139. package/dist/commands/wallet-send.d.ts +22 -0
  140. package/dist/commands/wallet-send.js +153 -0
  141. package/dist/commands/wallet-storage-ops.d.ts +24 -0
  142. package/dist/commands/wallet-storage-ops.js +215 -0
  143. package/dist/commands/wallet-storage.d.ts +18 -0
  144. package/dist/commands/wallet-storage.js +95 -0
  145. package/dist/commands/wallet-swap.d.ts +32 -0
  146. package/dist/commands/wallet-swap.js +287 -0
  147. package/dist/commands/wallet.d.ts +36 -0
  148. package/dist/commands/wallet.js +57 -15
  149. package/dist/commands/whoami.d.ts +10 -0
  150. package/dist/commands/whoami.js +24 -6
  151. package/dist/consent.d.ts +140 -0
  152. package/dist/consent.js +89 -30
  153. package/dist/credentials.d.ts +146 -0
  154. package/dist/credentials.js +10 -10
  155. package/dist/crypto-surface.d.ts +197 -0
  156. package/dist/crypto.d.ts +81 -0
  157. package/dist/crypto.js +13 -0
  158. package/dist/deposit.d.ts +25 -0
  159. package/dist/deposit.js +78 -0
  160. package/dist/download-part.d.ts +40 -0
  161. package/dist/download-sink.d.ts +76 -0
  162. package/dist/download.d.ts +79 -0
  163. package/dist/download.js +3 -3
  164. package/dist/drive-paths.d.ts +73 -0
  165. package/dist/environment.d.ts +62 -0
  166. package/dist/environment.js +29 -9
  167. package/dist/errors.d.ts +22 -0
  168. package/dist/errors.js +3 -3
  169. package/dist/exit.d.ts +44 -0
  170. package/dist/expiry.d.ts +58 -0
  171. package/dist/extend-budget.d.ts +35 -0
  172. package/dist/extend-budget.js +81 -0
  173. package/dist/extend-chain.d.ts +43 -0
  174. package/dist/extend-chain.js +40 -3
  175. package/dist/extend-plan.d.ts +148 -0
  176. package/dist/extend-plan.js +1 -1
  177. package/dist/gate.d.ts +18 -0
  178. package/dist/gate.js +100 -0
  179. package/dist/guards.d.ts +2 -0
  180. package/dist/help.d.ts +20 -0
  181. package/dist/help.js +199 -33
  182. package/dist/human-check.d.ts +23 -0
  183. package/dist/index.d.ts +42 -0
  184. package/dist/index.js +49 -0
  185. package/dist/item-trash.d.ts +1 -0
  186. package/dist/kit-file.d.ts +56 -0
  187. package/dist/kit-file.js +10 -10
  188. package/dist/list-file.d.ts +88 -0
  189. package/dist/list-file.js +90 -7
  190. package/dist/list-view-find.d.ts +15 -0
  191. package/dist/list-view-order.d.ts +32 -0
  192. package/dist/main.d.ts +12 -0
  193. package/dist/main.js +112 -113
  194. package/dist/manifest-chunk-cache.d.ts +14 -0
  195. package/dist/manifest-chunk-cache.js +103 -0
  196. package/dist/manifest-chunk-flow.d.ts +81 -0
  197. package/dist/manifest-chunk-flow.js +307 -0
  198. package/dist/manifest-create.d.ts +23 -0
  199. package/dist/manifest-create.js +26 -30
  200. package/dist/manifest-write.d.ts +161 -0
  201. package/dist/manifest-write.js +42 -33
  202. package/dist/manifest.d.ts +82 -0
  203. package/dist/manifest.js +69 -21
  204. package/dist/mark-render.d.ts +26 -0
  205. package/dist/mcp-args.d.ts +17 -0
  206. package/dist/mcp-ask.d.ts +43 -0
  207. package/dist/mcp-ask.js +100 -0
  208. package/dist/mcp-tools/context.d.ts +46 -0
  209. package/dist/mcp-tools/credits.d.ts +3 -0
  210. package/dist/mcp-tools/credits.js +61 -0
  211. package/dist/mcp-tools/files.d.ts +3 -0
  212. package/dist/mcp-tools/files.js +34 -0
  213. package/dist/mcp-tools/organise.d.ts +3 -0
  214. package/dist/mcp-tools/organise.js +82 -2
  215. package/dist/mcp-tools/reads.d.ts +3 -0
  216. package/dist/mcp-tools/reads.js +132 -4
  217. package/dist/mcp-tools/share.d.ts +3 -0
  218. package/dist/mcp-tools/share.js +26 -7
  219. package/dist/mcp-tools/support.d.ts +3 -0
  220. package/dist/mcp-tools/support.js +140 -0
  221. package/dist/mcp-tools/tiers.d.ts +31 -0
  222. package/dist/mcp-tools/tiers.js +147 -0
  223. package/dist/mcp.d.ts +80 -0
  224. package/dist/mcp.js +110 -9
  225. package/dist/net-retry.d.ts +38 -0
  226. package/dist/network.d.ts +10 -0
  227. package/dist/notice.d.ts +7 -0
  228. package/dist/notice.js +7 -7
  229. package/dist/product.d.ts +29 -0
  230. package/dist/product.js +1 -1
  231. package/dist/progress.d.ts +37 -0
  232. package/dist/prompt.d.ts +31 -0
  233. package/dist/prompt.js +1 -1
  234. package/dist/rebuild-key-check.d.ts +26 -0
  235. package/dist/rebuild-key-check.js +90 -0
  236. package/dist/rebuild.d.ts +87 -0
  237. package/dist/rebuild.js +26 -4
  238. package/dist/recovery-assemble.d.ts +40 -0
  239. package/dist/recovery-assemble.js +1 -1
  240. package/dist/recovery-build.d.ts +40 -0
  241. package/dist/recovery-map-file.d.ts +53 -0
  242. package/dist/recovery-map-file.js +4 -4
  243. package/dist/recovery-map.d.ts +197 -0
  244. package/dist/recovery-release.d.ts +104 -0
  245. package/dist/recovery-seq.d.ts +10 -0
  246. package/dist/recovery-source.d.ts +50 -0
  247. package/dist/redact.d.ts +70 -0
  248. package/dist/redact.js +212 -0
  249. package/dist/registration.d.ts +30 -0
  250. package/dist/registration.js +5 -5
  251. package/dist/risk.d.ts +380 -0
  252. package/dist/risk.js +206 -0
  253. package/dist/run-log.d.ts +78 -0
  254. package/dist/run-log.js +301 -0
  255. package/dist/s3/listing.d.ts +47 -0
  256. package/dist/s3/multipart.d.ts +21 -0
  257. package/dist/s3/response-sink.d.ts +8 -0
  258. package/dist/s3/same-file.d.ts +54 -0
  259. package/dist/s3/server.d.ts +58 -0
  260. package/dist/s3/server.js +2 -2
  261. package/dist/s3/sigv4.d.ts +46 -0
  262. package/dist/s3/sigv4.js +1 -1
  263. package/dist/s3/staging.d.ts +10 -0
  264. package/dist/s3/xml.d.ts +28 -0
  265. package/dist/safe-path.d.ts +41 -0
  266. package/dist/seal.d.ts +120 -0
  267. package/dist/secret-reader.d.ts +28 -0
  268. package/dist/server.d.ts +9 -0
  269. package/dist/session.d.ts +32 -0
  270. package/dist/session.js +1 -1
  271. package/dist/setup-questions.d.ts +7 -0
  272. package/dist/share.d.ts +108 -0
  273. package/dist/share.js +1 -1
  274. package/dist/shared/lib/crypto/size-padding.d.ts +55 -0
  275. package/dist/shared/lib/crypto/size-padding.js +5 -0
  276. package/dist/shared/lib/drive/manifest-chunks.d.ts +95 -0
  277. package/dist/shared/lib/drive/manifest-chunks.js +252 -0
  278. package/dist/shared/lib/drive/manifest-codec.d.ts +214 -0
  279. package/dist/shared/lib/drive/manifest-codec.js +7 -7
  280. package/dist/shared/lib/drive/manifest-index.d.ts +98 -0
  281. package/dist/shared/lib/drive/manifest-ops.d.ts +167 -0
  282. package/dist/shared/lib/drive/manifest-ops.js +9 -4
  283. package/dist/shared/lib/drive/manifest-pack.d.ts +65 -0
  284. package/dist/shared/lib/drive/manifest-pack.js +287 -0
  285. package/dist/shared/lib/drive/manifest-settings.d.ts +113 -0
  286. package/dist/shared/lib/drive/manifest-settings.js +87 -6
  287. package/dist/shared/lib/drive/name-conflict.d.ts +76 -0
  288. package/dist/shared/lib/drive/rebuild-verify.d.ts +73 -0
  289. package/dist/shared/lib/drive/rebuild-verify.js +112 -0
  290. package/dist/shared/lib/drive/unique-name.d.ts +9 -0
  291. package/dist/shared/lib/drive/zstd.d.ts +27 -0
  292. package/dist/shared/lib/drive/zstd.js +74 -0
  293. package/dist/shared/lib/extend/epochs.d.ts +205 -0
  294. package/dist/shared/lib/net/retry-budget.d.ts +79 -0
  295. package/dist/shared/lib/share/shared-file-info.d.ts +21 -0
  296. package/dist/shared/lib/storage-control/chain.d.ts +57 -0
  297. package/dist/shared/lib/storage-control/chain.js +82 -0
  298. package/dist/shared/lib/storage-control/plan.d.ts +40 -0
  299. package/dist/shared/lib/storage-control/plan.js +72 -0
  300. package/dist/shared/lib/storage-control/reuse.d.ts +72 -0
  301. package/dist/shared/lib/storage-control/reuse.js +95 -0
  302. package/dist/shared/lib/storage-network.d.ts +25 -0
  303. package/dist/shared/lib/upload/part-plan.d.ts +24 -0
  304. package/dist/shared/lib/wallet/activity.d.ts +138 -0
  305. package/dist/shared/lib/wallet/activity.js +208 -0
  306. package/dist/shared/lib/wallet/send-rules.d.ts +68 -0
  307. package/dist/shared/lib/wallet/send-rules.js +116 -0
  308. package/dist/shared/lib/wallet/swap-rules.d.ts +115 -0
  309. package/dist/shared/lib/wallet/swap-rules.js +199 -0
  310. package/dist/shared/lib/wallet/tip.d.ts +14 -0
  311. package/dist/shared/lib/wallet/tip.js +34 -0
  312. package/dist/shared/lib/wallet/venue-ids.d.ts +23 -0
  313. package/dist/shared/lib/wallet/venue-ids.js +53 -0
  314. package/dist/standing-tip.d.ts +24 -0
  315. package/dist/standing-tip.js +52 -0
  316. package/dist/stdout.d.ts +38 -0
  317. package/dist/storage-control-chain.d.ts +38 -0
  318. package/dist/storage-control-chain.js +78 -0
  319. package/dist/sui-rpc.d.ts +15 -0
  320. package/dist/sui-rpc.js +59 -0
  321. package/dist/support-attach.d.ts +24 -0
  322. package/dist/support-attach.js +72 -0
  323. package/dist/support-copy.d.ts +42 -0
  324. package/dist/support-copy.js +109 -0
  325. package/dist/support-wire.d.ts +49 -0
  326. package/dist/support-wire.js +194 -0
  327. package/dist/trash-sweep.d.ts +55 -0
  328. package/dist/units.d.ts +2 -0
  329. package/dist/update-check.d.ts +50 -0
  330. package/dist/update-source.d.ts +63 -0
  331. package/dist/upload-api.d.ts +3 -0
  332. package/dist/upload-file.d.ts +97 -0
  333. package/dist/upload-file.js +3 -2
  334. package/dist/upload-price.d.ts +50 -0
  335. package/dist/upload-steps.d.ts +26 -0
  336. package/dist/upload-steps.js +29 -9
  337. package/dist/upload-store.d.ts +182 -0
  338. package/dist/upload-wallet-chain.d.ts +54 -0
  339. package/dist/upload-wallet-chain.js +203 -0
  340. package/dist/upload-wallet-plan.d.ts +128 -0
  341. package/dist/upload-wallet-plan.js +184 -0
  342. package/dist/upload-wallet.d.ts +24 -0
  343. package/dist/upload-wallet.js +208 -0
  344. package/dist/upload-wire.d.ts +244 -0
  345. package/dist/upload.d.ts +18 -0
  346. package/dist/upload.js +10 -0
  347. package/dist/usage-report.d.ts +35 -0
  348. package/dist/wallet-activity-chain.d.ts +5 -0
  349. package/dist/wallet-activity-chain.js +31 -0
  350. package/dist/wallet-chain.d.ts +19 -0
  351. package/dist/wallet-chain.js +2 -2
  352. package/dist/wallet-grant.d.ts +50 -0
  353. package/dist/wallet-grant.js +218 -0
  354. package/dist/wallet-send-chain.d.ts +24 -0
  355. package/dist/wallet-send-chain.js +49 -0
  356. package/dist/wallet-sign.d.ts +133 -0
  357. package/dist/wallet-sign.js +317 -0
  358. package/dist/wallet-storage-chain.d.ts +3 -0
  359. package/dist/wallet-storage-chain.js +20 -0
  360. package/dist/wallet-swap-chain.d.ts +52 -0
  361. package/dist/wallet-swap-chain.js +186 -0
  362. package/dist/wallet-swap-quote.d.ts +22 -0
  363. package/dist/wallet-swap-quote.js +126 -0
  364. package/dist/wallet.d.ts +135 -0
  365. package/dist/wallet.js +5 -5
  366. package/dist/walrus-write.d.ts +56 -0
  367. package/dist/walrus-write.js +5 -4
  368. package/dist/walrus.d.ts +86 -0
  369. package/dist/walrus.js +48 -10
  370. package/dist/zstd-node.d.ts +11 -0
  371. package/dist/zstd-node.js +71 -0
  372. package/docs/commands/accept-terms.md +15 -0
  373. package/docs/commands/create.md +17 -0
  374. package/docs/commands/credits.md +34 -0
  375. package/docs/commands/delete-account.md +14 -0
  376. package/docs/commands/deposit.md +27 -0
  377. package/docs/commands/devices.md +9 -0
  378. package/docs/commands/documents.md +10 -0
  379. package/docs/commands/env.md +21 -0
  380. package/docs/commands/extend.md +27 -0
  381. package/docs/commands/folders.md +10 -0
  382. package/docs/commands/get.md +14 -0
  383. package/docs/commands/key.md +14 -0
  384. package/docs/commands/login.md +23 -0
  385. package/docs/commands/logout.md +11 -0
  386. package/docs/commands/losses.md +13 -0
  387. package/docs/commands/ls.md +16 -0
  388. package/docs/commands/marks.md +9 -0
  389. package/docs/commands/mcp.md +33 -0
  390. package/docs/commands/mode.md +29 -0
  391. package/docs/commands/on-collision.md +13 -0
  392. package/docs/commands/padding.md +13 -0
  393. package/docs/commands/public-code.md +9 -0
  394. package/docs/commands/pull.md +9 -0
  395. package/docs/commands/push.md +12 -0
  396. package/docs/commands/put.md +36 -0
  397. package/docs/commands/rebuild.md +13 -0
  398. package/docs/commands/recovery.md +18 -0
  399. package/docs/commands/s3.md +17 -0
  400. package/docs/commands/share.md +15 -0
  401. package/docs/commands/support.md +16 -0
  402. package/docs/commands/tip.md +21 -0
  403. package/docs/commands/trash.md +25 -0
  404. package/docs/commands/trial.md +12 -0
  405. package/docs/commands/unlock.md +25 -0
  406. package/docs/commands/update.md +14 -0
  407. package/docs/commands/usage.md +14 -0
  408. package/docs/commands/verify.md +18 -0
  409. package/docs/commands/wallet.md +67 -0
  410. package/docs/commands/whoami.md +12 -0
  411. package/package.json +67 -8
  412. package/server.json +28 -0
  413. package/vendor/nmts-crypto/nmts_crypto_wasm.d.ts +23 -2
  414. package/vendor/nmts-crypto/nmts_crypto_wasm.js +44 -2
  415. package/vendor/nmts-crypto/nmts_crypto_wasm_bg.wasm +0 -0
  416. package/vendor/nmts-crypto/nmts_crypto_wasm_bg.wasm.d.ts +1 -0
  417. package/vendor/nmts-crypto/package.json +1 -1
  418. package/dist/commands/consent.js +0 -77
  419. package/dist/extend-sign.js +0 -130
@@ -0,0 +1,38 @@
1
+ /** What `--out` is spelled as when the file goes to stdout. The spelling every tool shares. */
2
+ export declare const STDOUT_TARGET = "-";
3
+ /** Somewhere a whole file can be handed to, once. */
4
+ export interface ByteDestination {
5
+ /** True when these bytes would land on a terminal rather than a pipe, a file or another program. */
6
+ isTerminal: boolean;
7
+ /** Resolves when the bytes have been handed over; rejects with the reason they were not. */
8
+ write(bytes: Uint8Array): Promise<void>;
9
+ }
10
+ /**
11
+ * Whether these bytes can go to a terminal without the terminal acting on them.
12
+ *
13
+ * ⛔ A TERMINAL EXECUTES WHAT IT IS SENT. An escape sequence stored in a file can retitle the
14
+ * window, blank the screen, change what the reader's next keystrokes mean, and on terminals
15
+ * that answer queries it can put text of its choosing into their next command line. So the
16
+ * question is not "will this look like rubbish" — it is "does this contain instructions", and
17
+ * the answer decides whether the bytes are refused or written. A pipe is a different question
18
+ * and gets a different answer: a program reading this is expected to handle whatever it asked
19
+ * for, and refusing binary there would make the whole option useless.
20
+ *
21
+ * ⚠ Tab, newline and carriage return are the three control characters that mean in a terminal
22
+ * exactly what they mean in a text file, so they pass.
23
+ *
24
+ * ⚠ Bytes that are not well-formed UTF-8 fail too, and not for tidiness: what a terminal does with
25
+ * a broken sequence is its own business, and this is somebody else's terminal.
26
+ */
27
+ export declare function readableOnATerminal(bytes: Uint8Array): boolean;
28
+ /** This program's own stdout, as a destination. */
29
+ export declare function processStdout(): ByteDestination;
30
+ /**
31
+ * Hand the whole file over, refusing rather than writing bytes a terminal would act on.
32
+ *
33
+ * Answers false when the program reading it closed the pipe before the file was done — `nmts get
34
+ * big.bin --out - | head -c 100` is an ordinary thing to do, and the reader that stopped listening
35
+ * is the one that decided it had enough. Every other failure throws: a caller must not be able to
36
+ * mistake "the disk filled up half way" for "handed over".
37
+ */
38
+ export declare function handOver(bytes: Uint8Array, to: ByteDestination): Promise<boolean>;
@@ -0,0 +1,38 @@
1
+ import { Transaction } from "@mysten/sui/transactions";
2
+ import type { Network } from "./network.ts";
3
+ import type { StorageRead } from "./commands/wallet-storage.ts";
4
+ export type StorageOpShape = {
5
+ kind: "splitSize";
6
+ objectId: string;
7
+ keepBytes: number;
8
+ } | {
9
+ kind: "splitEpoch";
10
+ objectId: string;
11
+ splitEpoch: number;
12
+ } | {
13
+ kind: "fuse";
14
+ first: string;
15
+ second: string;
16
+ how: "amount" | "periods";
17
+ } | {
18
+ kind: "transfer";
19
+ objectId: string;
20
+ to: string;
21
+ };
22
+ /** The transaction one shape is, for `sender`. */
23
+ export declare function storageOpTransaction(shape: StorageOpShape, input: {
24
+ walrusPackageId: string;
25
+ sender: string;
26
+ }): Transaction;
27
+ /** What the dry run said: a fee, or the chain's own reason for refusing. */
28
+ export interface DryRunVerdict {
29
+ feeMist: bigint | null;
30
+ refusal: string | null;
31
+ }
32
+ /** What the command reads before it prints a review, and the seam a test replaces. */
33
+ export interface StorageOpsReads {
34
+ readStorage(address: string): Promise<StorageRead>;
35
+ walrusPackageId(): Promise<string>;
36
+ dryRun(shape: StorageOpShape, sender: string): Promise<DryRunVerdict>;
37
+ }
38
+ export declare function storageOpsReads(network: Network): StorageOpsReads;
@@ -0,0 +1,78 @@
1
+ // The chain behind `nmts wallet storage split|merge|transfer`: one builder per shape, the dry run
2
+ // that prices it and says whether the contract would take it, and the package to call.
3
+ //
4
+ // ⛔ ONE BUILDER FOR THE FEE AND THE SIGNATURE — the rule `wallet-send-chain.ts` keeps. What the
5
+ // review priced is what `wallet-sign.ts` signs.
6
+ //
7
+ // ⛔ THE CALLS ARE WRITTEN BY HAND, as `shared/lib/storage-control/reuse.ts` writes `split_by_size`:
8
+ // the SDK exports the `Storage` struct and no function wrappers, and its generated bindings are
9
+ // not on an exported path. The signatures are the contract's (`storage_resource.move`):
10
+ // · `split_by_size(&mut Storage, u64) → Storage` self keeps `split_size`; the rest is returned
11
+ // · `split_by_epoch(&mut Storage, u32) → Storage` self keeps [start, split); [split, end) is returned
12
+ // · `fuse_amount(&mut Storage, Storage)` same period; the second's size joins the first
13
+ // · `fuse_periods(&mut Storage, Storage)` same size, adjacent periods; the second is consumed
14
+ // ⛔ A returned resource must be transferred or the transaction is refused at assembly for an
15
+ // unused value; a consumed one needs nothing. The dry run is the final judge of every rule.
16
+ import { Transaction } from "@mysten/sui/transactions";
17
+ import { walrusClient, netGasFee } from "./extend-chain.js";
18
+ import { splitStorageToFit } from "./shared/lib/storage-control/reuse.js";
19
+ /** The transaction one shape is, for `sender`. */
20
+ export function storageOpTransaction(shape, input) {
21
+ const tx = new Transaction();
22
+ tx.setSender(input.sender);
23
+ switch (shape.kind) {
24
+ case "splitSize":
25
+ return splitStorageToFit({ walrusPackageId: input.walrusPackageId, storageObjectId: shape.objectId, keepBytes: shape.keepBytes, owner: input.sender }, tx);
26
+ case "splitEpoch": {
27
+ const later = tx.moveCall({
28
+ package: input.walrusPackageId,
29
+ module: "storage_resource",
30
+ function: "split_by_epoch",
31
+ arguments: [tx.object(shape.objectId), tx.pure.u32(shape.splitEpoch)],
32
+ });
33
+ tx.transferObjects([later], input.sender);
34
+ return tx;
35
+ }
36
+ case "fuse":
37
+ tx.moveCall({
38
+ package: input.walrusPackageId,
39
+ module: "storage_resource",
40
+ function: shape.how === "amount" ? "fuse_amount" : "fuse_periods",
41
+ arguments: [tx.object(shape.first), tx.object(shape.second)],
42
+ });
43
+ return tx;
44
+ case "transfer":
45
+ tx.transferObjects([tx.object(shape.objectId)], shape.to);
46
+ return tx;
47
+ }
48
+ }
49
+ export function storageOpsReads(network) {
50
+ const client = walrusClient(network);
51
+ return {
52
+ async readStorage(address) {
53
+ return (await import("./wallet-storage-chain.js")).readWalletStorage(network, address);
54
+ },
55
+ async walrusPackageId() {
56
+ return (await client.walrus.systemObject()).package_id;
57
+ },
58
+ async dryRun(shape, sender) {
59
+ try {
60
+ const walrusPackageId = await this.walrusPackageId();
61
+ const bytes = await storageOpTransaction(shape, { walrusPackageId, sender }).build({ client });
62
+ const { effects } = await client.dryRunTransactionBlock({ transactionBlock: bytes });
63
+ if (effects.status.status !== "success") {
64
+ return { feeMist: null, refusal: effects.status.error ?? "the chain gave no reason" };
65
+ }
66
+ return { feeMist: netGasFee(effects.gasUsed), refusal: null };
67
+ }
68
+ catch (error) {
69
+ // ⚠ A refusal at ASSEMBLY (a wrong argument, an object that is not this wallet's) is an
70
+ // answer the person needs; a node that did not answer is not, and is said as unmeasured.
71
+ const message = error instanceof Error ? error.message : String(error);
72
+ return /abort|MoveAbort|InsufficientGas|ObjectNotFound|IncorrectUserSignature|not owned/i.test(message)
73
+ ? { feeMist: null, refusal: message }
74
+ : { feeMist: null, refusal: null };
75
+ }
76
+ },
77
+ };
78
+ }
@@ -0,0 +1,15 @@
1
+ import { JsonRpcHTTPTransport } from "@mysten/sui/jsonRpc";
2
+ /**
3
+ * A Sui transport that asks the network's hosts in order.
4
+ *
5
+ * ⭐ 2026-09-01. There used to be one host per network, and on that morning
6
+ * the testnet one was measured dead — `rpc-testnet.suiscan.xyz` completes the TCP handshake in
7
+ * 31 ms and then sends nothing for twelve seconds, three times running. It had been that way for
8
+ * eleven days, so every command that needed the shard count on testnet had simply stopped.
9
+ *
10
+ * ⚠ One transport per client on purpose: the host that answered becomes the one asked first, and
11
+ * sharing that state across clients would let one command's bad luck redirect every other. The
12
+ * flip side is that a recovered first host is not noticed until the process restarts — that is
13
+ * the price of not probing a node nobody asked us to talk to.
14
+ */
15
+ export declare function suiRpcTransport(network: string): JsonRpcHTTPTransport;
@@ -0,0 +1,59 @@
1
+ // The chain transport: which Sui node a command talks to, and what happens when it does not answer.
2
+ //
3
+ // ⛔ WHY THIS IS ITS OWN FILE AND NOT PART OF walrus.ts. `walrus.ts` holds the host tables, and it
4
+ // is loaded by EVERY invocation including `nmts --help`. Importing the Sui SDK there pulled 150
5
+ // modules into a command that prints text and exits — `deploy/check-cli-startup.mjs` measured it
6
+ // and failed the build, which is exactly what that gate is for. The SDK is imported here, and
7
+ // only the commands that actually reach the chain import this.
8
+ //
9
+ // ⛔ NOT A RETRIER. Each host is asked once. Anything other than "no answer" — any 4xx that is not
10
+ // 429 — is an answer, and asking a different node the same question gets the same one.
11
+ import { JsonRpcHTTPTransport } from "@mysten/sui/jsonRpc";
12
+ import { suiRpcHosts } from "./walrus.js";
13
+ /** HTTP statuses that mean "no answer came", the only ones worth asking a second node about. */
14
+ function worthAnotherHost(status) {
15
+ return status >= 500 || status === 429;
16
+ }
17
+ /**
18
+ * A Sui transport that asks the network's hosts in order.
19
+ *
20
+ * ⭐ 2026-09-01. There used to be one host per network, and on that morning
21
+ * the testnet one was measured dead — `rpc-testnet.suiscan.xyz` completes the TCP handshake in
22
+ * 31 ms and then sends nothing for twelve seconds, three times running. It had been that way for
23
+ * eleven days, so every command that needed the shard count on testnet had simply stopped.
24
+ *
25
+ * ⚠ One transport per client on purpose: the host that answered becomes the one asked first, and
26
+ * sharing that state across clients would let one command's bad luck redirect every other. The
27
+ * flip side is that a recovered first host is not noticed until the process restarts — that is
28
+ * the price of not probing a node nobody asked us to talk to.
29
+ */
30
+ export function suiRpcTransport(network) {
31
+ const hosts = suiRpcHosts(network);
32
+ let preferred = 0;
33
+ const fetchWithFailover = async (input, init) => {
34
+ const asked = new URL(typeof input === "string" ? input : input instanceof URL ? input.href : input.url);
35
+ let lastError = null;
36
+ for (let step = 0; step < hosts.length; step += 1) {
37
+ const index = (preferred + step) % hosts.length;
38
+ const host = hosts[index];
39
+ if (host === undefined)
40
+ continue;
41
+ try {
42
+ const res = await fetch(new URL(asked.pathname + asked.search, host), init);
43
+ if (worthAnotherHost(res.status) && step < hosts.length - 1) {
44
+ lastError = new Error(`${host} answered ${res.status}`);
45
+ continue;
46
+ }
47
+ preferred = index;
48
+ return res;
49
+ }
50
+ catch (err) {
51
+ lastError = err;
52
+ }
53
+ }
54
+ throw lastError instanceof Error
55
+ ? lastError
56
+ : new Error(`no Sui node answered (${hosts.length} tried)`);
57
+ };
58
+ return new JsonRpcHTTPTransport({ url: hosts[0] ?? "", fetch: fetchWithFailover });
59
+ }
@@ -0,0 +1,24 @@
1
+ import type { RunRecord } from "./run-log.ts";
2
+ /** What one attachment turned out to be. */
3
+ export interface LogAttachment {
4
+ /** The text, oldest run first. Empty when there was nothing to attach. */
5
+ readonly text: string;
6
+ /** How many runs are in it. */
7
+ readonly runs: number;
8
+ /** How many were left out to fit the cap. */
9
+ readonly dropped: number;
10
+ /** What it weighs on the wire. */
11
+ readonly bytes: number;
12
+ }
13
+ /** The server's ceiling on the log field. `api/src/routes/support.rs` is the origin. */
14
+ export declare const MAX_ATTACHMENT_BYTES: number;
15
+ /** One run, as a person reads it. */
16
+ export declare function formatRun(record: RunRecord): string;
17
+ /**
18
+ * Build the attachment.
19
+ *
20
+ * `clean` is the caller's redaction — it runs over each run's own text rather than over the
21
+ * finished attachment, so that a value replaced by a longer label cannot push the result back over
22
+ * the cap after it has been measured.
23
+ */
24
+ export declare function buildLogAttachment(records: readonly RunRecord[], clean: (text: string) => string, limit?: number): LogAttachment;
@@ -0,0 +1,72 @@
1
+ // Turning the run log into the text that travels with a report.
2
+ //
3
+ // ⛔ IT IS FOR A PERSON TO READ, NOT FOR A MACHINE TO PARSE. The log on disk is JSON because it is
4
+ // appended to and trimmed; what goes into a report is a transcript, because the thing that
5
+ // makes a report useful is somebody being able to see the sequence at a glance.
6
+ //
7
+ // ⛔ THE CAP DROPS WHOLE RUNS, OLDEST FIRST. Cutting the text at a byte offset would end the
8
+ // attachment in the middle of the one run that matters — the newest one, which is the one the
9
+ // report is about — and a half line is worse than an honest count of what was left out.
10
+ /** The server's ceiling on the log field. `api/src/routes/support.rs` is the origin. */
11
+ export const MAX_ATTACHMENT_BYTES = 32 * 1024;
12
+ /** Room held back for the "older runs left out" line and the blank line above it. */
13
+ const NOTICE_RESERVE = 48;
14
+ function bytes(text) {
15
+ return Buffer.byteLength(text, "utf8");
16
+ }
17
+ /** One run, as a person reads it. */
18
+ export function formatRun(record) {
19
+ const lines = [
20
+ `${record.t} v${record.v} exit ${record.exit} in ${record.ms}ms`,
21
+ `$ nmts ${[record.cmd, ...record.args].join(" ")}`.trimEnd(),
22
+ ];
23
+ for (const event of record.events) {
24
+ if (event.kind === "http") {
25
+ const tail = event.error === undefined ? "" : ` ${event.error}`;
26
+ lines.push(` ${event.method} ${event.path} → ${event.status}${tail}`);
27
+ }
28
+ else {
29
+ lines.push(` ! ${event.message}`);
30
+ }
31
+ }
32
+ return lines.join("\n");
33
+ }
34
+ /**
35
+ * Build the attachment.
36
+ *
37
+ * `clean` is the caller's redaction — it runs over each run's own text rather than over the
38
+ * finished attachment, so that a value replaced by a longer label cannot push the result back over
39
+ * the cap after it has been measured.
40
+ */
41
+ export function buildLogAttachment(records, clean, limit = MAX_ATTACHMENT_BYTES) {
42
+ const blocks = records.map((record) => clean(formatRun(record)));
43
+ const kept = [];
44
+ let used = 0;
45
+ let dropped = 0;
46
+ // Newest first while packing, because the newest run is the one the report is about.
47
+ for (let i = blocks.length - 1; i >= 0; i -= 1) {
48
+ const block = blocks[i];
49
+ if (block === undefined)
50
+ continue;
51
+ // Every run but the first costs a blank line between it and the one before.
52
+ const cost = bytes(block) + (kept.length === 0 ? 0 : 2);
53
+ // ⛔ ROOM FOR THE NOTICE IS HELD BACK WHILE OLDER RUNS REMAIN, not added afterwards. An
54
+ // attachment that filled the cap and then said "3 runs left out" would be over it, and the
55
+ // server would refuse the whole message rather than the sentence.
56
+ const reserve = i === 0 ? 0 : NOTICE_RESERVE;
57
+ if (used + cost + reserve > limit) {
58
+ dropped = i + 1;
59
+ break;
60
+ }
61
+ used += cost;
62
+ kept.unshift(block);
63
+ }
64
+ const parts = kept.length === 0 ? [] : [kept.join("\n\n")];
65
+ if (dropped > 0)
66
+ parts.unshift(noticeLine(dropped));
67
+ const text = parts.join("\n\n");
68
+ return { text, runs: kept.length, dropped, bytes: bytes(text) };
69
+ }
70
+ function noticeLine(dropped) {
71
+ return `(${dropped} older ${dropped === 1 ? "run" : "runs"} left out to fit.)`;
72
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The long text: what this is, who reads it, and what not to type.
3
+ *
4
+ * Printed by `nmts support --help` and `nmts support send --help`, and by the general help.
5
+ */
6
+ export declare const SUPPORT_LONG: readonly string[];
7
+ /**
8
+ * The short text, printed once above every preview.
9
+ *
10
+ * ⛔ TWO LINES AND NOT THE LONG ONE. The long text belongs where somebody is deciding whether to
11
+ * write at all; on the send itself it would be four paragraphs between a person and the thing
12
+ * they came to do, and text nobody reads protects nobody (owner, 2026-09-03).
13
+ */
14
+ export declare const SUPPORT_SHORT: readonly string[];
15
+ /** What `--attach-log` attaches, and what has already been taken out of it. */
16
+ export declare const ATTACH_LOG_TEXT: readonly string[];
17
+ /** One thing a report can be about, with the narrowings the server accepts for it. */
18
+ export interface SupportCategory {
19
+ readonly code: string;
20
+ readonly subs: readonly string[];
21
+ }
22
+ /**
23
+ * What the command line offers.
24
+ *
25
+ * ⛔ A COPY OF THE SERVER'S TABLE (`api/src/domain/support.rs`, `CATEGORIES`) AND NOT ALL OF IT.
26
+ * The two the server also knows are deliberately not here: `board` is the channel the terms
27
+ * name for contesting a moderation decision and carries statutory clocks that belong on a
28
+ * screen where a person reads what they are starting, and `other` is what the server files a
29
+ * ticket as when none was named — offering it would make "I did not choose" a choice.
30
+ *
31
+ * ⚠ A category the server drops is a 400 naming the field, and the refusal names these. One the
32
+ * server ADDS is simply not offered here until somebody adds it, which is the safe direction.
33
+ */
34
+ export declare const SUPPORT_CATEGORIES: readonly SupportCategory[];
35
+ /** The category codes, for a refusal that has to name them. */
36
+ export declare function categoryCodes(): string[];
37
+ /** The categories and their narrowings, one line each, for the help text. */
38
+ export declare function categoryLines(): string[];
39
+ /** The usage lines. Kept beside the copy because the two are read together. */
40
+ export declare const SUPPORT_USAGE: readonly string[];
41
+ /** What `nmts support --help` and `nmts support send --help` print. */
42
+ export declare function supportHelpText(): string;
@@ -0,0 +1,109 @@
1
+ // Every sentence `nmts support` shows a person, in one place.
2
+ //
3
+ // ⛔ WRITTEN ONCE AND IMPORTED, NEVER RETYPED. The same words are printed by the help text, by the
4
+ // preview above every send, and by the MCP tool descriptions. A second copy is how one of them
5
+ // starts saying something the others do not — and what these particular sentences promise is
6
+ // what is taken out of a message before it leaves the machine, which is not a promise to keep
7
+ // in two versions.
8
+ //
9
+ // ⛔ IT HAS NO IMPORTS AND MUST NOT GROW ANY. `help.ts` reads it, and `nmts --help` is measured
10
+ // (`check:cli-startup`): a module that pulled the command in behind it would make every run of
11
+ // the help text load the server client.
12
+ //
13
+ // ⛔ ENGLISH ONLY, LIKE THE WHOLE OF THIS PACKAGE (owner, 2026-09-03). Korean lives in
14
+ // `README.ko.md` and nowhere else in `cli/`.
15
+ /**
16
+ * The long text: what this is, who reads it, and what not to type.
17
+ *
18
+ * Printed by `nmts support --help` and `nmts support send --help`, and by the general help.
19
+ */
20
+ export const SUPPORT_LONG = [
21
+ "Send a message to the person who builds NMTS: a bug, an error, an idea, a question, or",
22
+ "anything else. It lands in the same inbox as the app's contact form, and replies come",
23
+ "back to this thread (`nmts support show <code>`).",
24
+ "",
25
+ "NMTS is built and run by one developer. I test it hard as a user myself, and on my own",
26
+ "that is nowhere near enough. The tiniest report counts, and so does anything you are not",
27
+ "sure is a bug. Every message is read, seriously.",
28
+ "",
29
+ "Write in English if you can. Korean is read too; if Korean is not your own language,",
30
+ "English is the better choice.",
31
+ "",
32
+ "Keep personal details out. Your NMTS key, API key, passphrase and file contents are",
33
+ "removed on this machine before anything is sent; file names and your public code may go.",
34
+ "Please do not type your name, address, health or anything else about yourself. The form",
35
+ "does not need it, and this inbox is the wrong place for it.",
36
+ ];
37
+ /**
38
+ * The short text, printed once above every preview.
39
+ *
40
+ * ⛔ TWO LINES AND NOT THE LONG ONE. The long text belongs where somebody is deciding whether to
41
+ * write at all; on the send itself it would be four paragraphs between a person and the thing
42
+ * they came to do, and text nobody reads protects nobody (owner, 2026-09-03).
43
+ */
44
+ export const SUPPORT_SHORT = [
45
+ "This goes to the developer of NMTS and is read. Leave personal details out: your NMTS key,",
46
+ "API key and file contents are stripped here before sending. English preferred; Korean is read too.",
47
+ ];
48
+ /** What `--attach-log` attaches, and what has already been taken out of it. */
49
+ export const ATTACH_LOG_TEXT = [
50
+ "--attach-log adds the CLI's own record of its last runs: the commands, the server's",
51
+ "answers and any error text. It is written already redacted (NMTS keys, API keys,",
52
+ "passphrases, tokens and key material become labels before they touch the disk) and is",
53
+ "redacted once more when attached. You do not need to read it before sending. If you know",
54
+ "a value that must not travel, add --omit <text> and it is replaced too.",
55
+ ];
56
+ /**
57
+ * What the command line offers.
58
+ *
59
+ * ⛔ A COPY OF THE SERVER'S TABLE (`api/src/domain/support.rs`, `CATEGORIES`) AND NOT ALL OF IT.
60
+ * The two the server also knows are deliberately not here: `board` is the channel the terms
61
+ * name for contesting a moderation decision and carries statutory clocks that belong on a
62
+ * screen where a person reads what they are starting, and `other` is what the server files a
63
+ * ticket as when none was named — offering it would make "I did not choose" a choice.
64
+ *
65
+ * ⚠ A category the server drops is a 400 naming the field, and the refusal names these. One the
66
+ * server ADDS is simply not offered here until somebody adds it, which is the safe direction.
67
+ */
68
+ export const SUPPORT_CATEGORIES = [
69
+ { code: "bug", subs: ["upload", "download", "files", "wallet", "signin", "display", "other"] },
70
+ { code: "idea", subs: ["files", "sharing", "wallet", "app", "other"] },
71
+ { code: "account", subs: ["signin", "lostcode", "devices", "delete", "other"] },
72
+ { code: "storage", subs: ["extend", "expiry", "erase", "network", "other"] },
73
+ { code: "payment", subs: ["failed", "amount", "credits", "trial", "other"] },
74
+ { code: "privacy", subs: ["mydata", "removal", "legal", "security", "other"] },
75
+ ];
76
+ /** The category codes, for a refusal that has to name them. */
77
+ export function categoryCodes() {
78
+ return SUPPORT_CATEGORIES.map((c) => c.code);
79
+ }
80
+ /** The categories and their narrowings, one line each, for the help text. */
81
+ export function categoryLines() {
82
+ return SUPPORT_CATEGORIES.map((c) => ` ${c.code.padEnd(10)}${c.subs.join(" · ")}`);
83
+ }
84
+ /** The usage lines. Kept beside the copy because the two are read together. */
85
+ export const SUPPORT_USAGE = [
86
+ " nmts support send --category <c> [--sub <s>] (--message <text> | --message-file <path>)",
87
+ " nmts support send --category <c> --attach-log [n] [--omit <text>] [--yes] [--json]",
88
+ " nmts support list",
89
+ " nmts support show <code>",
90
+ " nmts support reply <code> --message <text>",
91
+ ];
92
+ /** What `nmts support --help` and `nmts support send --help` print. */
93
+ export function supportHelpText() {
94
+ return [
95
+ "nmts support — write to the developer of NMTS.",
96
+ "",
97
+ "USAGE",
98
+ ...SUPPORT_USAGE,
99
+ "",
100
+ ...SUPPORT_LONG,
101
+ "",
102
+ "CATEGORIES",
103
+ ...categoryLines(),
104
+ "",
105
+ "THE LOG",
106
+ ...ATTACH_LOG_TEXT,
107
+ "",
108
+ ].join("\n");
109
+ }
@@ -0,0 +1,49 @@
1
+ /** The server's own ceilings on what one message may carry. */
2
+ export declare const MAX_MESSAGE_CHARS = 4000;
3
+ export declare const MAX_REPLY_CHARS = 8000;
4
+ export interface Wire {
5
+ server: string;
6
+ apiKey: string;
7
+ }
8
+ export declare function open(options: {
9
+ server?: string | undefined;
10
+ }): Wire;
11
+ export declare function call(wire: Wire, path: string, init: {
12
+ method?: "POST";
13
+ body?: unknown;
14
+ }): Promise<unknown>;
15
+ export interface Message {
16
+ fromOperator: boolean;
17
+ body: string;
18
+ createdAt: string;
19
+ deletedAt: string | null;
20
+ }
21
+ export interface Ticket {
22
+ id: string;
23
+ code: string;
24
+ category: string;
25
+ subcategory: string | null;
26
+ message: string;
27
+ status: string;
28
+ createdAt: string;
29
+ lastReadAt: string | null;
30
+ messages: Message[] | null;
31
+ }
32
+ export declare function asTicket(value: unknown): Ticket;
33
+ export declare function asList(value: unknown): {
34
+ tickets: Ticket[];
35
+ unread: number;
36
+ };
37
+ /** The date part of an instant. The time of day is noise in a list of reports. */
38
+ export declare function day(at: string): string;
39
+ export declare function requireCategory(given: string | undefined): string;
40
+ /**
41
+ * The narrowing, checked against the category it was given with.
42
+ *
43
+ * ⚠ It is optional everywhere, and stays optional here: somebody who does not know which one
44
+ * applies must be able to send anyway.
45
+ */
46
+ export declare function checkSub(category: string, given: string | undefined): string | null;
47
+ /** Values too short to name one thing would blank half the report, so they are refused. */
48
+ export declare function checkOmit(values: readonly string[]): string[];
49
+ export declare function requireLength(message: string, most: number, what: string): void;