@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,100 @@
1
+ // Asking the PERSON a question from inside a tool call, over the protocol.
2
+ //
3
+ // ⛔ WHY THIS EXISTS. Every other agreement this tool takes is once per machine, written down, and
4
+ // then never asked about again — which is right for a capability, and wrong for an act that
5
+ // cannot be undone and names somebody else each time. Handing a file to another account is the
6
+ // one thing here where the question is not "may this tool ever do that" but "is THIS the person
7
+ // you meant". A recorded agreement cannot answer that, because the answer is different for
8
+ // every call.
9
+ //
10
+ // ⛔ THE CHANNEL IS `elicitation/create`, AND IT IS THE ONLY ONE THERE IS. On this server stdout is
11
+ // the protocol wire and stderr may be shown to nobody, so a prompt printed anywhere is a prompt
12
+ // the person never sees. Elicitation is a request the SERVER sends to the CLIENT — the reverse
13
+ // of everything else here — and the client is the half with a screen.
14
+ //
15
+ // ⛔ A CLIENT THAT CANNOT BE ASKED IS NOT A CLIENT THAT AGREED. Elicitation arrived in protocol
16
+ // version 2025-06-18 and a client declares it or does not. When it does not, this returns
17
+ // `unreachable` and the caller REFUSES. Falling back to the recorded once-per-machine agreement
18
+ // would mean the weakest client silently sets the rule for all of them, which is how a
19
+ // protection becomes decorative.
20
+ //
21
+ // ⚠ WHAT THIS IS NOT. It is not proof a person answered. The client decides what to put on screen
22
+ // and what to send back, and a client that answers by itself is indistinguishable from one that
23
+ // asked. What this buys is that the decision is put where a person can see it, once per share,
24
+ // in the words below — not that it cannot be automated.
25
+ //
26
+ // ⛔ NOTHING SENSITIVE GOES IN THE QUESTION. The specification says a server must not use
27
+ // elicitation to request sensitive information, and this asks for nothing at all: the schema is
28
+ // one boolean, and the NMTS key, the file's key and the recipient's key appear nowhere in
29
+ // it. The recipient's public code is in the message because it is the thing being confirmed and
30
+ // the model already has it.
31
+ /**
32
+ * The question this server asks, in one place so that every caller asks it the same way.
33
+ *
34
+ * ⛔ ONE BOOLEAN, NOT A FREE-TEXT FIELD. A client renders this schema into whatever it renders it
35
+ * into, and a checkbox somebody has to tick is the shape that survives every rendering. A text
36
+ * field would let a client accept "no" as a filled-in answer.
37
+ */
38
+ export const CONFIRM_SCHEMA = {
39
+ type: "object",
40
+ properties: {
41
+ confirm: {
42
+ type: "boolean",
43
+ title: "Yes, share it",
44
+ description: "Leave this off to refuse. Refusing stops the share and nothing else.",
45
+ default: false,
46
+ },
47
+ },
48
+ required: ["confirm"],
49
+ };
50
+ /**
51
+ * Read an `elicitation/create` result. Pure, so the three actions can be tested without a pipe.
52
+ *
53
+ * ⛔ ONLY `accept` WITH `confirm === true` IS A YES. `decline` and `cancel` are both no — the
54
+ * specification distinguishes "refused" from "dismissed" so that a server can offer something
55
+ * else, and here there is nothing else to offer. An `accept` carrying no content, or content
56
+ * with the box unticked, is a no as well: the person was shown the question and did not agree.
57
+ *
58
+ * ⛔ ANYTHING UNRECOGNISED IS A NO. A malformed answer is not an answer, and the direction to fail
59
+ * in is the one where a file is not handed to somebody.
60
+ */
61
+ export function readAnswer(result) {
62
+ if (typeof result !== "object" || result === null)
63
+ return "no";
64
+ const action = Reflect.get(result, "action");
65
+ if (action !== "accept")
66
+ return "no";
67
+ const content = Reflect.get(result, "content");
68
+ if (typeof content !== "object" || content === null)
69
+ return "no";
70
+ return Reflect.get(content, "confirm") === true ? "yes" : "no";
71
+ }
72
+ /** Whether the client said, at `initialize`, that it can put a question in front of a person. */
73
+ export function declaredElicitation(capabilities) {
74
+ if (typeof capabilities !== "object" || capabilities === null)
75
+ return false;
76
+ const value = Reflect.get(capabilities, "elicitation");
77
+ return typeof value === "object" && value !== null;
78
+ }
79
+ /**
80
+ * Build the asker for a session.
81
+ *
82
+ * ⛔ THE CAPABILITY IS READ ONCE, FROM `initialize`, AND NEVER GUESSED AFTERWARDS. A client that
83
+ * did not declare elicitation is not sent one: the specification says a server may only use a
84
+ * capability the other side declared, and a request it does not understand is at best an error
85
+ * on the wire and at worst a hung tool call waiting for an answer that is never coming.
86
+ */
87
+ export function askerFor(capabilities, send) {
88
+ if (!declaredElicitation(capabilities))
89
+ return null;
90
+ return async (message) => {
91
+ // ⚠ A client that declared the capability and then fails to answer must not hang the tool.
92
+ // Whatever went wrong, nobody agreed, so it is a no.
93
+ try {
94
+ return readAnswer(await send("elicitation/create", { message, requestedSchema: CONFIRM_SCHEMA }));
95
+ }
96
+ catch {
97
+ return "no";
98
+ }
99
+ };
100
+ }
@@ -0,0 +1,46 @@
1
+ import type { Asker } from "../mcp-ask.ts";
2
+ import type { ToolDefinition } from "../mcp.ts";
3
+ export interface ToolContext {
4
+ server: string;
5
+ network: string;
6
+ /** Where anything fetched lands. Chosen by the person, never by the model. */
7
+ outDir: string;
8
+ accountId: string;
9
+ /**
10
+ * How to put a question in front of the person, or `null` when this client declared no way.
11
+ *
12
+ * ⛔ A FUNCTION, NOT A VALUE. The tools are built when the server starts and the answer is not
13
+ * known until the client has spoken, so reading it early would freeze in a `null` that was
14
+ * only ever "not yet".
15
+ */
16
+ asker: () => Asker;
17
+ }
18
+ /** The server and network every command takes, in the shape they take it. */
19
+ export declare function common(ctx: ToolContext): {
20
+ server: string;
21
+ network: string;
22
+ };
23
+ /**
24
+ * Collect what a command would have printed, so it can be handed to a model instead.
25
+ *
26
+ * ⛔ EVERY TOOL USES THIS AND NONE OF THEM PRINT. On this server stdout is the protocol wire; a
27
+ * stray line there is a parse error at the client and the whole tool list disappears with no
28
+ * explanation. Commands write through an injected sink precisely so that this can be true.
29
+ */
30
+ export declare function collector(): {
31
+ lines: string[];
32
+ write: (line: string) => void;
33
+ };
34
+ /**
35
+ * Run one command with its output collected, and hand back what it wrote.
36
+ *
37
+ * ⚠ A non-zero exit code is NOT turned into a throw. A command that returns 4 has already written
38
+ * the explanation the model needs, and replacing it with a generic failure would throw that
39
+ * away. The commands that genuinely cannot proceed throw, and the transport reports those.
40
+ */
41
+ export declare function say(run: (write: (line: string) => void) => Promise<number>): Promise<string>;
42
+ /** A required string argument, with the same refusal every tool gives for it. */
43
+ export declare function needString(args: Record<string, unknown>, name: string): string;
44
+ /** Several paths at once, as the multi-path commands take them. */
45
+ export declare function needPaths(args: Record<string, unknown>): string[];
46
+ export type ToolFactory = (ctx: ToolContext) => ToolDefinition[];
@@ -0,0 +1,3 @@
1
+ import type { ToolDefinition } from "../mcp.ts";
2
+ import { type ToolContext } from "./context.ts";
3
+ export declare function creditTools(ctx: ToolContext): ToolDefinition[];
@@ -0,0 +1,61 @@
1
+ // Moving credits between two accounts of one person's own family — the account they made, and
2
+ // every account made under it.
3
+ //
4
+ // ⛔ IT CANNOT REACH ANYONE ELSE, and the description says so before the first call. The server
5
+ // refuses a recipient outside the family and answers an account that does not exist in exactly
6
+ // the same words, so this tool cannot be used to find out which identifiers are real — and a
7
+ // model that read the refusal as "wrong identifier, try another" would be walking the account
8
+ // space one guess at a time.
9
+ //
10
+ // ⛔ IT IS REVERSIBLE AND THAT IS WHY IT IS MEDIUM RATHER THAN HIGH. Nothing is spent, nothing
11
+ // leaves the person's own accounts, and the same call the other way puts it back. What it is
12
+ // NOT is `low`: it moves value, and the person should know it happened.
13
+ //
14
+ // ⚠ IT NEEDS THE ACCOUNT'S HUMAN CHECK TO BE LIVE, the same as the free trial. The command asks
15
+ // about that first and the refusal names `nmts verify`, which is a person's act — so a model
16
+ // that meets it must hand it to somebody rather than retry.
17
+ import { credits } from "../commands/credits.js";
18
+ import { common, needString, say } from "./context.js";
19
+ export function creditTools(ctx) {
20
+ return [
21
+ {
22
+ name: "nmts_credits_transfer",
23
+ description: "Move credits from this account to another account of the SAME FAMILY — the account a " +
24
+ "person made and every account made under it — and nowhere else. Use it when the free " +
25
+ "trial's credits landed on one account and the work is happening in another: the whole " +
26
+ "family gets one application a week, not one each. The credits keep the date they were " +
27
+ "already going to lapse on; moving them does not renew them, and nothing is spent by " +
28
+ "moving them. The reply carries both balances. ⛔ A recipient outside the family and an " +
29
+ "account that does not exist are refused in the same words — do not treat that refusal " +
30
+ "as an invitation to try another identifier. It also needs the account's human check to " +
31
+ "be live; when it is not, the refusal names `nmts verify`, which only a person can run.",
32
+ inputSchema: {
33
+ type: "object",
34
+ properties: {
35
+ to: {
36
+ type: "string",
37
+ description: "The receiving account's identifier, as nmts_whoami prints it for that account. " +
38
+ "It has to be an account of this family. Not a public code and not an NMTS key.",
39
+ },
40
+ credits: {
41
+ // ⚠ NO `minimum` HERE. The transport enforces only the keywords `mcp-args.ts` knows,
42
+ // and a schema keyword nothing enforces is a promise the surface does not keep —
43
+ // so the floor is checked in `run`, where it is real.
44
+ type: "integer",
45
+ description: "How many whole credits to move, above zero. nmts_balance says how many there are.",
46
+ },
47
+ },
48
+ required: ["to", "credits"],
49
+ additionalProperties: false,
50
+ },
51
+ run: (args) => {
52
+ const to = needString(args, "to");
53
+ const amount = args["credits"];
54
+ if (typeof amount !== "number" || !Number.isSafeInteger(amount) || amount < 1) {
55
+ throw new Error("`credits` must be a whole number of credits above zero.");
56
+ }
57
+ return say((write) => credits("transfer", String(amount), { ...common(ctx), to, json: true, write }));
58
+ },
59
+ },
60
+ ];
61
+ }
@@ -0,0 +1,3 @@
1
+ import type { ToolDefinition } from "../mcp.ts";
2
+ import { type ToolContext } from "./context.ts";
3
+ export declare function fileTools(ctx: ToolContext): ToolDefinition[];
@@ -10,19 +10,49 @@
10
10
  // this disk. `nmts_get` keeps only the last segment of the account path; `nmts_pull` builds its
11
11
  // tree under that directory and refuses a stored name that would climb out; `nmts_receive` uses
12
12
  // the sender's name the same way. The only path a model may choose is one INSIDE the account.
13
+ //
14
+ // ⛔ AND ONE THAT CHANGES SOMETHING WITHOUT SPENDING ANYTHING IS HERE RATHER THAN IN `reads.ts`.
15
+ // `nmts_loss_recheck` asks the chain about one storage object now, and a chain that serves it
16
+ // takes the line off server-side — so it writes. `reads.ts` states that none of its tools
17
+ // write, and that sentence is what makes the whole read surface safe to call in a loop; a tool
18
+ // that quietly broke it would cost the other six their guarantee. It is listed first because a
19
+ // model scanning this file should meet the costless one before the two that spend.
13
20
  import { get } from "../commands/get.js";
21
+ import { losses } from "../commands/losses.js";
14
22
  import { pull } from "../commands/pull.js";
15
23
  import { push } from "../commands/push.js";
16
24
  import { put } from "../commands/put.js";
17
25
  import { receive } from "../commands/receive.js";
26
+ import { DEPOSIT_CREDITS_MAX } from "../deposit.js";
18
27
  import { destinationFor } from "../safe-path.js";
19
28
  import { common, needString, say } from "./context.js";
20
29
  const SPENDS = "⛔ THIS SPENDS THE ACCOUNT'S CREDITS — one credit per started mebibyte, per lease period, and " +
21
30
  "credits are not refundable. Pass dry_run to be told the price without spending it. The first " +
22
31
  "upload on a machine stops and asks the person to agree; show them what it says rather than " +
23
32
  "agreeing for them.";
33
+ const DEPOSIT_HINT = `Credits each uploaded file sets aside as a deposit, 0 to ${DEPOSIT_CREDITS_MAX}. Leave it out to use ` +
34
+ "the account's own default (nmts_deposit reads it). The deposit pays the chain fee of a later " +
35
+ "operation on that file and comes back when its storage period ends; 0 means a later release " +
36
+ "costs twice that fee out of the balance instead.";
24
37
  export function fileTools(ctx) {
25
38
  return [
39
+ {
40
+ name: "nmts_loss_recheck",
41
+ description: "Ask the chain right now about one storage object listed by nmts_losses. Costs nothing. " +
42
+ "Answers found, still missing, or unread.",
43
+ inputSchema: {
44
+ type: "object",
45
+ properties: {
46
+ blob_object_id: {
47
+ type: "string",
48
+ description: "The chain object id, exactly as nmts_losses printed it.",
49
+ },
50
+ },
51
+ required: ["blob_object_id"],
52
+ additionalProperties: false,
53
+ },
54
+ run: (args) => say((write) => losses({ ...common(ctx), json: true, recheck: needString(args, "blob_object_id"), write })),
55
+ },
26
56
  {
27
57
  name: "nmts_get",
28
58
  description: `Fetch one file from the NMTS account, decrypt it, and write it into ${ctx.outDir}. Takes ` +
@@ -86,6 +116,7 @@ export function fileTools(ctx) {
86
116
  file: { type: "string", description: "Path to a file ON THIS MACHINE to upload." },
87
117
  name: { type: "string", description: "The name it gets in the account. Defaults to the file's own." },
88
118
  to: { type: "string", description: "An existing folder in the account, as nmts_list prints it." },
119
+ deposit_credits: { type: "integer", description: DEPOSIT_HINT },
89
120
  dry_run: { type: "boolean", description: "Say what it would cost and stop. Nothing is sent or charged." },
90
121
  },
91
122
  required: ["file"],
@@ -96,6 +127,7 @@ export function fileTools(ctx) {
96
127
  json: true,
97
128
  ...(typeof args["name"] === "string" ? { name: args["name"] } : {}),
98
129
  ...(typeof args["to"] === "string" ? { to: args["to"] } : {}),
130
+ ...(typeof args["deposit_credits"] === "number" ? { deposit: args["deposit_credits"] } : {}),
99
131
  ...(args["dry_run"] === true ? { dryRun: true } : {}),
100
132
  write,
101
133
  })),
@@ -115,6 +147,7 @@ export function fileTools(ctx) {
115
147
  directory: { type: "string", description: "Path to a directory ON THIS MACHINE." },
116
148
  to: { type: "string", description: "An existing folder in the account to put it under." },
117
149
  include_hidden: { type: "boolean", description: "Also send names beginning with a dot." },
150
+ deposit_credits: { type: "integer", description: DEPOSIT_HINT },
118
151
  dry_run: { type: "boolean", description: "Price the whole tree and stop. Nothing is sent or charged." },
119
152
  },
120
153
  required: ["directory"],
@@ -125,6 +158,7 @@ export function fileTools(ctx) {
125
158
  json: true,
126
159
  ...(typeof args["to"] === "string" ? { to: args["to"] } : {}),
127
160
  ...(args["include_hidden"] === true ? { hidden: true } : {}),
161
+ ...(typeof args["deposit_credits"] === "number" ? { deposit: args["deposit_credits"] } : {}),
128
162
  ...(args["dry_run"] === true ? { dryRun: true } : {}),
129
163
  write,
130
164
  })),
@@ -0,0 +1,3 @@
1
+ import type { ToolDefinition } from "../mcp.ts";
2
+ import { type ToolContext } from "./context.ts";
3
+ export declare function organiseTools(ctx: ToolContext): ToolDefinition[];
@@ -1,7 +1,7 @@
1
1
  // Rearranging what the account holds, without moving a byte or spending anything.
2
2
  //
3
3
  // ⛔ EVERYTHING HERE IS AN EDIT TO THE SEALED LIST AND NOTHING HERE IS PERMANENT. Names, folders
4
- // and marks live only inside the list the account code opens; the server never sees them and no
4
+ // and marks live only inside the list the NMTS key opens; the server never sees them and no
5
5
  // stored bytes move. That is why these are the tools a model may use freely: the worst outcome
6
6
  // is a tidy-up somebody has to undo, and every one of them has an undo.
7
7
  //
@@ -12,9 +12,12 @@
12
12
  // ⛔ SIX MARK VERBS ARE ONE TOOL, NOT SIX. A model choosing between `nmts_star` and `nmts_unstar`
13
13
  // is choosing between two spellings of the same decision, and the pair that gets forgotten is
14
14
  // the "un" one. One tool with the mark named and a switch says what is actually being decided.
15
- import { label, pin, star, unlabel, unpin, unstar } from "../commands/marks.js";
15
+ import { deposit } from "../commands/deposit.js";
16
+ import { label, labelRename, pin, star, unlabel, unlabelAll, unpin, unstar } from "../commands/marks.js";
16
17
  import { mkdir, mv, rename } from "../commands/organise.js";
18
+ import { padding } from "../commands/padding.js";
17
19
  import { restore, rm } from "../commands/trash.js";
20
+ import { DEPOSIT_CREDITS_MAX } from "../deposit.js";
18
21
  import { common, needPaths, needString, say } from "./context.js";
19
22
  export function organiseTools(ctx) {
20
23
  return [
@@ -99,6 +102,83 @@ export function organiseTools(ctx) {
99
102
  });
100
103
  },
101
104
  },
105
+ {
106
+ name: "nmts_label_rename",
107
+ description: "Rename a label on every file that carries it. Changes only the file list; costs nothing.",
108
+ inputSchema: {
109
+ type: "object",
110
+ properties: {
111
+ old: { type: "string", description: "The label as it is now." },
112
+ new: { type: "string", description: "What it should be called instead." },
113
+ },
114
+ required: ["old", "new"],
115
+ additionalProperties: false,
116
+ },
117
+ run: (args) => say((write) => labelRename(needString(args, "old"), needString(args, "new"), {
118
+ ...common(ctx),
119
+ json: true,
120
+ write,
121
+ })),
122
+ },
123
+ {
124
+ name: "nmts_unlabel_all",
125
+ description: "Take one label off every file that carries it. Changes only the file list; costs nothing.",
126
+ inputSchema: {
127
+ type: "object",
128
+ properties: { name: { type: "string", description: "The label to take off." } },
129
+ required: ["name"],
130
+ additionalProperties: false,
131
+ },
132
+ run: (args) => say((write) => unlabelAll(needString(args, "name"), { ...common(ctx), json: true, write })),
133
+ },
134
+ {
135
+ name: "nmts_padding",
136
+ description: "Read or set how file sizes are hidden on the storage network: standard (a few fixed " +
137
+ "sizes per doubling), pow2 (one per doubling, hides more, costs more storage on " +
138
+ "average), or off (no padding — the file's exact length is visible to the network and " +
139
+ "to anyone who reads the blob, and about 1 % less storage is used). Applies to the next " +
140
+ "uploads from every device.",
141
+ inputSchema: {
142
+ type: "object",
143
+ properties: {
144
+ mode: {
145
+ type: "string",
146
+ enum: ["standard", "pow2", "off"],
147
+ description: "Leave it out to read the setting rather than change it.",
148
+ },
149
+ },
150
+ additionalProperties: false,
151
+ },
152
+ run: (args) => say((write) => padding(typeof args["mode"] === "string" ? args["mode"] : undefined, {
153
+ ...common(ctx),
154
+ json: true,
155
+ write,
156
+ })),
157
+ },
158
+ {
159
+ name: "nmts_deposit",
160
+ description: "Read or set how many credits this account sets aside as a deposit on each credit-paid " +
161
+ `upload, 0 to ${DEPOSIT_CREDITS_MAX}. Nothing here spends: it records what the next uploads will ` +
162
+ "set aside, from every device. The deposit pays the chain fee of a later operation on " +
163
+ "that file, measured rather than spent whole, and what is left comes back when the " +
164
+ "storage period ends. 0 is a real answer — a file with no deposit still releases, but " +
165
+ "pays twice the same fee out of the balance at that moment.",
166
+ inputSchema: {
167
+ type: "object",
168
+ properties: {
169
+ credits: {
170
+ type: "integer",
171
+ description: `0 to ${DEPOSIT_CREDITS_MAX}. Leave it out to read the setting rather than change it.`,
172
+ },
173
+ },
174
+ additionalProperties: false,
175
+ },
176
+ run: (args) => say((write) => deposit(typeof args["credits"] === "number" ? String(args["credits"]) : undefined, {
177
+ ...common(ctx),
178
+ json: true,
179
+ write,
180
+ })),
181
+ },
102
182
  {
103
183
  name: "nmts_trash",
104
184
  description: "Put files in the NMTS account's trash. Nothing is destroyed and nothing is refunded: the " +
@@ -0,0 +1,3 @@
1
+ import type { ToolDefinition } from "../mcp.ts";
2
+ import { type ToolContext } from "./context.ts";
3
+ export declare function readTools(ctx: ToolContext): ToolDefinition[];
@@ -6,11 +6,17 @@
6
6
  // the opposite of the habit this tool wants.
7
7
  import { publicCode } from "../commands/public-code.js";
8
8
  import { balance } from "../commands/balance.js";
9
+ import { devices } from "../commands/devices.js";
10
+ import { legal, notices } from "../commands/documents.js";
9
11
  import { expiring } from "../commands/expiring.js";
12
+ import { losses } from "../commands/losses.js";
10
13
  import { ls } from "../commands/ls.js";
11
14
  import { shares } from "../commands/share.js";
15
+ import { sharesSent } from "../commands/shares-sent.js";
12
16
  import { usage } from "../commands/usage.js";
13
- import { common, say } from "./context.js";
17
+ import { walletActivity } from "../commands/wallet-activity.js";
18
+ import { walletStorage } from "../commands/wallet-storage.js";
19
+ import { common, needString, say } from "./context.js";
14
20
  const NO_ARGS = { type: "object", properties: {}, additionalProperties: false };
15
21
  export function readTools(ctx) {
16
22
  return [
@@ -59,21 +65,59 @@ export function readTools(ctx) {
59
65
  inputSchema: NO_ARGS,
60
66
  run: () => say((write) => expiring({ ...common(ctx), json: true, write })),
61
67
  },
68
+ {
69
+ name: "nmts_losses",
70
+ description: "Storage objects paid with this account's credits that NMTS's daily check could not find " +
71
+ "on the chain, newest first. Read-only; costs nothing. Each row is a public chain object " +
72
+ "id and the day a check first missed it — no file name, because the server cannot pair " +
73
+ "them.",
74
+ inputSchema: NO_ARGS,
75
+ run: () => say((write) => losses({ ...common(ctx), json: true, write })),
76
+ },
62
77
  {
63
78
  name: "nmts_balance",
64
79
  description: "How many credits this account has left, what that buys, and the ceilings on spending. " +
65
80
  "Read this before uploading anything large: the price of an upload is printed, but only " +
66
- "this says whether the account can pay it.",
81
+ "this says whether the account can pay it. `ai_account` is true when the account was made " +
82
+ "under somebody else's for an AI to work in, so it is not that person's own account.",
67
83
  inputSchema: NO_ARGS,
68
84
  run: () => say((write) => balance({ ...common(ctx), json: true, write })),
69
85
  },
86
+ {
87
+ name: "nmts_wallet_activity",
88
+ description: "The recent transactions of the wallet this account derives (newest first, 20 at most), " +
89
+ "each named only where the chain proves it — seal, extend, erase, exchange, send, receive, " +
90
+ "otherwise 'other' — with its balance changes and an explorer link. Read-only. Gifts to the " +
91
+ "developer appear as sends here; this tool does not know that address.",
92
+ inputSchema: NO_ARGS,
93
+ run: () => say((write) => walletActivity({ ...common(ctx), json: true, write })),
94
+ },
95
+ {
96
+ name: "nmts_wallet_storage",
97
+ description: "The storage resources (size × time on the storage network) this wallet holds unbound — " +
98
+ "what deleting a file from the network gave back — with whether each is usable now. " +
99
+ "Read-only; nothing here spends or signs.",
100
+ inputSchema: NO_ARGS,
101
+ run: () => say((write) => walletStorage({ ...common(ctx), json: true, write })),
102
+ },
103
+ {
104
+ name: "nmts_devices",
105
+ description: "What is signed in to this NMTS account: for each device, when it was first signed in, " +
106
+ "when it was last used, and when it runs out. ⛔ READ-ONLY. Signing a device out is a " +
107
+ "person's act at nmts.me and no API key can do it — including this one — so if a row " +
108
+ "looks wrong, say so and let the person end it rather than looking for a way to do it " +
109
+ "here. ⚠ The name each device was given is encrypted with the NMTS key, which the " +
110
+ "server has never had, so no name is returned.",
111
+ inputSchema: NO_ARGS,
112
+ run: () => say((write) => devices({ server: ctx.server, json: true, write })),
113
+ },
70
114
  {
71
115
  name: "nmts_public_code",
72
116
  description: "The account's PUBLIC CODE — the value other accounts send files to — and whether it has " +
73
117
  "been published yet. Until it is published nobody can send to this account. ⛔ It only " +
74
118
  "reads. Publishing is permanent and is a person's decision at the command line: if the " +
75
- "reply says it is not published, say so rather than working around it. ⚠ Not the account " +
76
- "code, which opens every file and is never given away.",
119
+ "reply says it is not published, say so rather than working around it. ⚠ Not the NMTS " +
120
+ "key, which opens every file and is never given away.",
77
121
  inputSchema: NO_ARGS,
78
122
  run: () => say((write) => publicCode({ ...common(ctx), json: true, write })),
79
123
  },
@@ -85,5 +129,89 @@ export function readTools(ctx) {
85
129
  inputSchema: NO_ARGS,
86
130
  run: () => say((write) => shares({ ...common(ctx), json: true, write })),
87
131
  },
132
+ {
133
+ name: "nmts_shares_sent",
134
+ description: "Who one file in the account was shared with: recipient address, since when, and the " +
135
+ "share id. Read-only; costs nothing.",
136
+ inputSchema: {
137
+ type: "object",
138
+ properties: {
139
+ path: { type: "string", description: "The file, as nmts_list prints it." },
140
+ },
141
+ required: ["path"],
142
+ additionalProperties: false,
143
+ },
144
+ run: (args) => say((write) => sharesSent(needString(args, "path"), { ...common(ctx), json: true, write })),
145
+ },
146
+ // ── The documents this service publishes ──────────────────────────────────────────────────
147
+ //
148
+ // ⛔ THEY ARE HERE BECAUSE AN AGENT IS OFTEN THE ONLY READER. An account driven from a program
149
+ // is still governed by the Terms, and is still owed the seven days' warning a notice gives
150
+ // before a new version takes effect. A surface that could upload but could not read the
151
+ // notice saying uploads stop on Tuesday is a surface that keeps somebody uninformed.
152
+ //
153
+ // ⛔ NONE OF THEM SAVES A FILE. Keeping a dated copy is `nmts notices --save`, at a command
154
+ // line, where a person chose the directory — the rule this whole surface is built on.
155
+ {
156
+ name: "nmts_notices",
157
+ description: "The NMTS notice board as JSON, newest first: interruptions, incidents, and the notice " +
158
+ "given before a new version of the Terms takes effect. Ids here are what nmts_notice " +
159
+ "takes. Public and read-only; it costs nothing and needs no account.",
160
+ inputSchema: NO_ARGS,
161
+ run: () => say((write) => notices({ ...common(ctx), json: true, write })),
162
+ },
163
+ {
164
+ name: "nmts_notice",
165
+ description: "One notice in full, as the dated text the board's download button writes — the same " +
166
+ "bytes. Read this before acting on anything nmts_notices only summarised.",
167
+ inputSchema: {
168
+ type: "object",
169
+ properties: {
170
+ id: { type: "string", description: "The notice, as nmts_notices lists it." },
171
+ },
172
+ required: ["id"],
173
+ additionalProperties: false,
174
+ },
175
+ run: (args) => say((write) => notices({ ...common(ctx), id: needString(args, "id"), write })),
176
+ },
177
+ {
178
+ name: "nmts_terms",
179
+ description: "The NMTS Terms of Service in force, as text, with its version and effective date at the " +
180
+ "head. ⛔ Reading them is not accepting them: nothing here or anywhere in this tool can " +
181
+ "agree to a document on somebody's behalf, and the server refuses until a person does it " +
182
+ "at nmts.me.",
183
+ inputSchema: {
184
+ type: "object",
185
+ properties: {
186
+ lang: { type: "string", enum: ["en", "ko"], description: "Absent means English, the canonical text." },
187
+ board: { type: "boolean", description: "The message board's terms rather than the service's." },
188
+ },
189
+ additionalProperties: false,
190
+ },
191
+ run: (args) => say((write) => legal("terms", {
192
+ ...common(ctx),
193
+ ...(typeof args["lang"] === "string" ? { lang: args["lang"] } : {}),
194
+ ...(args["board"] === true ? { board: true } : {}),
195
+ write,
196
+ })),
197
+ },
198
+ {
199
+ name: "nmts_privacy",
200
+ description: "The NMTS Privacy Policy in force, as text, with its version and effective date at the " +
201
+ "head. It is what the service says it collects and keeps; read it rather than describing " +
202
+ "it from memory.",
203
+ inputSchema: {
204
+ type: "object",
205
+ properties: {
206
+ lang: { type: "string", enum: ["en", "ko"], description: "Absent means English, the canonical text." },
207
+ },
208
+ additionalProperties: false,
209
+ },
210
+ run: (args) => say((write) => legal("privacy", {
211
+ ...common(ctx),
212
+ ...(typeof args["lang"] === "string" ? { lang: args["lang"] } : {}),
213
+ write,
214
+ })),
215
+ },
88
216
  ];
89
217
  }
@@ -0,0 +1,3 @@
1
+ import type { ToolDefinition } from "../mcp.ts";
2
+ import { type ToolContext } from "./context.ts";
3
+ export declare function shareTools(ctx: ToolContext): ToolDefinition[];