@minca/core 0.1.14 → 0.1.16

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 (528) hide show
  1. package/README.md +4 -4
  2. package/dist/elements/auth-styles.d.ts +1 -1
  3. package/dist/elements/auth-styles.d.ts.map +1 -1
  4. package/dist/elements/auth-styles.js +21 -4
  5. package/dist/elements/auth-styles.js.map +1 -1
  6. package/dist/elements/minca-auth.d.ts.map +1 -1
  7. package/dist/elements/minca-auth.js +151 -57
  8. package/dist/elements/minca-auth.js.map +1 -1
  9. package/dist/files/space-files.d.ts +15 -3
  10. package/dist/files/space-files.d.ts.map +1 -1
  11. package/dist/files/space-files.js +225 -37
  12. package/dist/files/space-files.js.map +1 -1
  13. package/dist/identity/abilities.d.ts +2 -0
  14. package/dist/identity/abilities.d.ts.map +1 -1
  15. package/dist/identity/abilities.js +2 -0
  16. package/dist/identity/abilities.js.map +1 -1
  17. package/dist/identity/account-vault.d.ts +15 -71
  18. package/dist/identity/account-vault.d.ts.map +1 -1
  19. package/dist/identity/account-vault.js +45 -104
  20. package/dist/identity/account-vault.js.map +1 -1
  21. package/dist/identity/channel.d.ts +3 -9
  22. package/dist/identity/channel.d.ts.map +1 -1
  23. package/dist/identity/channel.js +42 -42
  24. package/dist/identity/channel.js.map +1 -1
  25. package/dist/identity/contact-key.d.ts +14 -29
  26. package/dist/identity/contact-key.d.ts.map +1 -1
  27. package/dist/identity/contact-key.js +31 -51
  28. package/dist/identity/contact-key.js.map +1 -1
  29. package/dist/identity/crypto-p256.d.ts.map +1 -1
  30. package/dist/identity/crypto-p256.js +39 -53
  31. package/dist/identity/crypto-p256.js.map +1 -1
  32. package/dist/identity/hpke.d.ts.map +1 -1
  33. package/dist/identity/hpke.js +19 -19
  34. package/dist/identity/hpke.js.map +1 -1
  35. package/dist/identity/identity-manager.d.ts.map +1 -1
  36. package/dist/identity/identity-manager.js +1 -2
  37. package/dist/identity/identity-manager.js.map +1 -1
  38. package/dist/identity/policy.d.ts.map +1 -1
  39. package/dist/identity/policy.js +35 -61
  40. package/dist/identity/policy.js.map +1 -1
  41. package/dist/identity/recovery-code.d.ts +2 -8
  42. package/dist/identity/recovery-code.d.ts.map +1 -1
  43. package/dist/identity/recovery-code.js +4 -11
  44. package/dist/identity/recovery-code.js.map +1 -1
  45. package/dist/identity/root-signer.d.ts +1 -6
  46. package/dist/identity/root-signer.d.ts.map +1 -1
  47. package/dist/identity/root-signer.js +12 -15
  48. package/dist/identity/root-signer.js.map +1 -1
  49. package/dist/identity/ucan.d.ts.map +1 -1
  50. package/dist/identity/ucan.js +48 -39
  51. package/dist/identity/ucan.js.map +1 -1
  52. package/dist/identity/webauthn.d.ts +6 -11
  53. package/dist/identity/webauthn.d.ts.map +1 -1
  54. package/dist/identity/webauthn.js +18 -30
  55. package/dist/identity/webauthn.js.map +1 -1
  56. package/dist/inbox/inbox.d.ts.map +1 -1
  57. package/dist/inbox/inbox.js +40 -30
  58. package/dist/inbox/inbox.js.map +1 -1
  59. package/dist/inbox/index.d.ts +2 -0
  60. package/dist/inbox/index.d.ts.map +1 -1
  61. package/dist/inbox/index.js +1 -0
  62. package/dist/inbox/index.js.map +1 -1
  63. package/dist/inbox/names.d.ts +54 -0
  64. package/dist/inbox/names.d.ts.map +1 -0
  65. package/dist/inbox/names.js +299 -0
  66. package/dist/inbox/names.js.map +1 -0
  67. package/dist/index.d.ts +3 -6
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +9 -12
  70. package/dist/index.js.map +1 -1
  71. package/dist/network/mesh.d.ts +7 -20
  72. package/dist/network/mesh.d.ts.map +1 -1
  73. package/dist/network/mesh.js +267 -245
  74. package/dist/network/mesh.js.map +1 -1
  75. package/dist/network/relay-link.d.ts +31 -0
  76. package/dist/network/relay-link.d.ts.map +1 -0
  77. package/dist/network/relay-link.js +62 -0
  78. package/dist/network/relay-link.js.map +1 -0
  79. package/dist/network/relay-minca.d.ts +12 -1
  80. package/dist/network/relay-minca.d.ts.map +1 -1
  81. package/dist/network/relay-minca.js +25 -55
  82. package/dist/network/relay-minca.js.map +1 -1
  83. package/dist/network/relay-nostr.d.ts +14 -3
  84. package/dist/network/relay-nostr.d.ts.map +1 -1
  85. package/dist/network/relay-nostr.js +34 -72
  86. package/dist/network/relay-nostr.js.map +1 -1
  87. package/dist/network/relay-socket.d.ts +1 -1
  88. package/dist/network/relay-socket.d.ts.map +1 -1
  89. package/dist/network/relay-socket.js +3 -1
  90. package/dist/network/relay-socket.js.map +1 -1
  91. package/dist/network/relays.d.ts +26 -17
  92. package/dist/network/relays.d.ts.map +1 -1
  93. package/dist/network/relays.js +21 -28
  94. package/dist/network/relays.js.map +1 -1
  95. package/dist/network/rendezvous.d.ts +1 -1
  96. package/dist/network/rendezvous.d.ts.map +1 -1
  97. package/dist/network/rendezvous.js +2 -2
  98. package/dist/network/rendezvous.js.map +1 -1
  99. package/dist/node/actions.d.ts.map +1 -1
  100. package/dist/node/actions.js +56 -39
  101. package/dist/node/actions.js.map +1 -1
  102. package/dist/node/api.d.ts +6 -0
  103. package/dist/node/api.d.ts.map +1 -1
  104. package/dist/node/api.js +6 -0
  105. package/dist/node/api.js.map +1 -1
  106. package/dist/node/carrier.d.ts +5 -0
  107. package/dist/node/carrier.d.ts.map +1 -1
  108. package/dist/node/carrier.js +94 -73
  109. package/dist/node/carrier.js.map +1 -1
  110. package/dist/node/copy.d.ts +8 -7
  111. package/dist/node/copy.d.ts.map +1 -1
  112. package/dist/node/copy.js +54 -56
  113. package/dist/node/copy.js.map +1 -1
  114. package/dist/node/host.d.ts +39 -65
  115. package/dist/node/host.d.ts.map +1 -1
  116. package/dist/node/host.js +362 -379
  117. package/dist/node/host.js.map +1 -1
  118. package/dist/node/index.d.ts +2 -2
  119. package/dist/node/index.d.ts.map +1 -1
  120. package/dist/node/index.js +1 -1
  121. package/dist/node/index.js.map +1 -1
  122. package/dist/node/node-carriers.d.ts +35 -0
  123. package/dist/node/node-carriers.d.ts.map +1 -0
  124. package/dist/node/node-carriers.js +562 -0
  125. package/dist/node/node-carriers.js.map +1 -0
  126. package/dist/node/node-contacts.d.ts +11 -0
  127. package/dist/node/node-contacts.d.ts.map +1 -0
  128. package/dist/node/node-contacts.js +808 -0
  129. package/dist/node/node-contacts.js.map +1 -0
  130. package/dist/node/node-context.d.ts +76 -0
  131. package/dist/node/node-context.d.ts.map +1 -0
  132. package/dist/node/node-context.js +54 -0
  133. package/dist/node/node-context.js.map +1 -0
  134. package/dist/node/node-hosting.d.ts +20 -0
  135. package/dist/node/node-hosting.d.ts.map +1 -0
  136. package/dist/node/node-hosting.js +449 -0
  137. package/dist/node/node-hosting.js.map +1 -0
  138. package/dist/node/node-records.d.ts +18 -0
  139. package/dist/node/node-records.d.ts.map +1 -0
  140. package/dist/node/node-records.js +262 -0
  141. package/dist/node/node-records.js.map +1 -0
  142. package/dist/node/node.d.ts.map +1 -1
  143. package/dist/node/node.js +197 -1989
  144. package/dist/node/node.js.map +1 -1
  145. package/dist/node/remote.d.ts +5 -6
  146. package/dist/node/remote.d.ts.map +1 -1
  147. package/dist/node/remote.js +272 -260
  148. package/dist/node/remote.js.map +1 -1
  149. package/dist/node/space-catalog.d.ts +40 -0
  150. package/dist/node/space-catalog.d.ts.map +1 -0
  151. package/dist/node/space-catalog.js +158 -0
  152. package/dist/node/space-catalog.js.map +1 -0
  153. package/dist/node/space-checks.d.ts +25 -0
  154. package/dist/node/space-checks.d.ts.map +1 -0
  155. package/dist/node/space-checks.js +343 -0
  156. package/dist/node/space-checks.js.map +1 -0
  157. package/dist/node/space-history.d.ts +37 -0
  158. package/dist/node/space-history.d.ts.map +1 -0
  159. package/dist/node/space-history.js +350 -0
  160. package/dist/node/space-history.js.map +1 -0
  161. package/dist/node/space-holding.d.ts +49 -0
  162. package/dist/node/space-holding.d.ts.map +1 -0
  163. package/dist/node/space-holding.js +267 -0
  164. package/dist/node/space-holding.js.map +1 -0
  165. package/dist/node/space-index.d.ts +41 -0
  166. package/dist/node/space-index.d.ts.map +1 -0
  167. package/dist/node/space-index.js +217 -0
  168. package/dist/node/space-index.js.map +1 -0
  169. package/dist/node/space-keys.d.ts +34 -0
  170. package/dist/node/space-keys.d.ts.map +1 -0
  171. package/dist/node/space-keys.js +309 -0
  172. package/dist/node/space-keys.js.map +1 -0
  173. package/dist/node/space-lines.d.ts +33 -0
  174. package/dist/node/space-lines.d.ts.map +1 -0
  175. package/dist/node/space-lines.js +145 -0
  176. package/dist/node/space-lines.js.map +1 -0
  177. package/dist/node/space-membership.d.ts +69 -0
  178. package/dist/node/space-membership.d.ts.map +1 -0
  179. package/dist/node/space-membership.js +242 -0
  180. package/dist/node/space-membership.js.map +1 -0
  181. package/dist/node/space-mirrors.d.ts +43 -0
  182. package/dist/node/space-mirrors.d.ts.map +1 -0
  183. package/dist/node/space-mirrors.js +125 -0
  184. package/dist/node/space-mirrors.js.map +1 -0
  185. package/dist/node/space-peers.d.ts +104 -0
  186. package/dist/node/space-peers.d.ts.map +1 -0
  187. package/dist/node/space-peers.js +595 -0
  188. package/dist/node/space-peers.js.map +1 -0
  189. package/dist/node/space-profiles.d.ts +18 -0
  190. package/dist/node/space-profiles.d.ts.map +1 -0
  191. package/dist/node/space-profiles.js +105 -0
  192. package/dist/node/space-profiles.js.map +1 -0
  193. package/dist/node/space-rules.d.ts +29 -0
  194. package/dist/node/space-rules.d.ts.map +1 -0
  195. package/dist/node/space-rules.js +144 -0
  196. package/dist/node/space-rules.js.map +1 -0
  197. package/dist/node/space-runtime.d.ts +104 -143
  198. package/dist/node/space-runtime.d.ts.map +1 -1
  199. package/dist/node/space-runtime.js +293 -3954
  200. package/dist/node/space-runtime.js.map +1 -1
  201. package/dist/node/space-standing.d.ts +20 -0
  202. package/dist/node/space-standing.d.ts.map +1 -0
  203. package/dist/node/space-standing.js +317 -0
  204. package/dist/node/space-standing.js.map +1 -0
  205. package/dist/node/space-versions.d.ts +104 -0
  206. package/dist/node/space-versions.d.ts.map +1 -0
  207. package/dist/node/space-versions.js +153 -0
  208. package/dist/node/space-versions.js.map +1 -0
  209. package/dist/node/space-warrants.d.ts +25 -0
  210. package/dist/node/space-warrants.d.ts.map +1 -0
  211. package/dist/node/space-warrants.js +214 -0
  212. package/dist/node/space-warrants.js.map +1 -0
  213. package/dist/node/space-writing.d.ts +72 -0
  214. package/dist/node/space-writing.d.ts.map +1 -0
  215. package/dist/node/space-writing.js +440 -0
  216. package/dist/node/space-writing.js.map +1 -0
  217. package/dist/node/stores.d.ts +19 -50
  218. package/dist/node/stores.d.ts.map +1 -1
  219. package/dist/node/stores.js +14 -33
  220. package/dist/node/stores.js.map +1 -1
  221. package/dist/node/types.d.ts +225 -305
  222. package/dist/node/types.d.ts.map +1 -1
  223. package/dist/node/usage.d.ts +2 -24
  224. package/dist/node/usage.d.ts.map +1 -1
  225. package/dist/node/usage.js +118 -102
  226. package/dist/node/usage.js.map +1 -1
  227. package/dist/node/watch-notifications.d.ts.map +1 -1
  228. package/dist/node/watch-notifications.js +32 -29
  229. package/dist/node/watch-notifications.js.map +1 -1
  230. package/dist/node/worker.d.ts +5 -6
  231. package/dist/node/worker.d.ts.map +1 -1
  232. package/dist/node/worker.js +80 -72
  233. package/dist/node/worker.js.map +1 -1
  234. package/dist/node/writer-keys.d.ts +5 -6
  235. package/dist/node/writer-keys.d.ts.map +1 -1
  236. package/dist/node/writer-keys.js +66 -57
  237. package/dist/node/writer-keys.js.map +1 -1
  238. package/dist/node/writers.d.ts +12 -19
  239. package/dist/node/writers.d.ts.map +1 -1
  240. package/dist/node/writers.js +7 -15
  241. package/dist/node/writers.js.map +1 -1
  242. package/dist/privacy/direct.d.ts.map +1 -1
  243. package/dist/privacy/direct.js +31 -27
  244. package/dist/privacy/direct.js.map +1 -1
  245. package/dist/privacy/space-encryption.d.ts.map +1 -1
  246. package/dist/privacy/space-encryption.js +5 -9
  247. package/dist/privacy/space-encryption.js.map +1 -1
  248. package/dist/query/computed.d.ts.map +1 -1
  249. package/dist/query/computed.js +78 -77
  250. package/dist/query/computed.js.map +1 -1
  251. package/dist/query/engine.d.ts +3 -4
  252. package/dist/query/engine.d.ts.map +1 -1
  253. package/dist/query/engine.js +93 -86
  254. package/dist/query/engine.js.map +1 -1
  255. package/dist/query/filter.d.ts +8 -10
  256. package/dist/query/filter.d.ts.map +1 -1
  257. package/dist/query/filter.js +144 -161
  258. package/dist/query/filter.js.map +1 -1
  259. package/dist/records/cel-types.d.ts.map +1 -1
  260. package/dist/records/cel-types.js +13 -27
  261. package/dist/records/cel-types.js.map +1 -1
  262. package/dist/records/cel.d.ts.map +1 -1
  263. package/dist/records/cel.js +177 -242
  264. package/dist/records/cel.js.map +1 -1
  265. package/dist/records/rules.d.ts.map +1 -1
  266. package/dist/records/rules.js +46 -50
  267. package/dist/records/rules.js.map +1 -1
  268. package/dist/records/topics.d.ts.map +1 -1
  269. package/dist/records/topics.js +18 -22
  270. package/dist/records/topics.js.map +1 -1
  271. package/dist/schema/collection-def.d.ts.map +1 -1
  272. package/dist/schema/collection-def.js +16 -5
  273. package/dist/schema/collection-def.js.map +1 -1
  274. package/dist/schemas/automations.d.ts +16 -15
  275. package/dist/schemas/automations.d.ts.map +1 -1
  276. package/dist/schemas/automations.js +203 -165
  277. package/dist/schemas/automations.js.map +1 -1
  278. package/dist/schemas/blueprints.d.ts.map +1 -1
  279. package/dist/schemas/blueprints.js +14 -13
  280. package/dist/schemas/blueprints.js.map +1 -1
  281. package/dist/schemas/connectors.d.ts +12 -0
  282. package/dist/schemas/connectors.d.ts.map +1 -1
  283. package/dist/schemas/connectors.js +16 -11
  284. package/dist/schemas/connectors.js.map +1 -1
  285. package/dist/schemas/contacts.d.ts +57 -0
  286. package/dist/schemas/contacts.d.ts.map +1 -1
  287. package/dist/schemas/contacts.js +32 -0
  288. package/dist/schemas/contacts.js.map +1 -1
  289. package/dist/schemas/cron.d.ts.map +1 -1
  290. package/dist/schemas/cron.js +27 -28
  291. package/dist/schemas/cron.js.map +1 -1
  292. package/dist/schemas/defined.d.ts +6 -0
  293. package/dist/schemas/defined.d.ts.map +1 -0
  294. package/dist/schemas/defined.js +7 -0
  295. package/dist/schemas/defined.js.map +1 -0
  296. package/dist/schemas/fragments.d.ts +22 -2
  297. package/dist/schemas/fragments.d.ts.map +1 -1
  298. package/dist/schemas/fragments.js +20 -12
  299. package/dist/schemas/fragments.js.map +1 -1
  300. package/dist/schemas/guides.d.ts +3 -1
  301. package/dist/schemas/guides.d.ts.map +1 -1
  302. package/dist/schemas/guides.js +13 -12
  303. package/dist/schemas/guides.js.map +1 -1
  304. package/dist/schemas/index.d.ts +2 -2
  305. package/dist/schemas/index.d.ts.map +1 -1
  306. package/dist/schemas/index.js +18 -14
  307. package/dist/schemas/index.js.map +1 -1
  308. package/dist/schemas/library/annotations.d.ts +30 -0
  309. package/dist/schemas/library/annotations.d.ts.map +1 -1
  310. package/dist/schemas/library/annotations.js +1 -0
  311. package/dist/schemas/library/annotations.js.map +1 -1
  312. package/dist/schemas/library/community.d.ts +28 -0
  313. package/dist/schemas/library/community.d.ts.map +1 -1
  314. package/dist/schemas/library/life.d.ts +62 -2
  315. package/dist/schemas/library/life.d.ts.map +1 -1
  316. package/dist/schemas/library/media.d.ts +36 -0
  317. package/dist/schemas/library/media.d.ts.map +1 -1
  318. package/dist/schemas/library/money.d.ts +74 -2
  319. package/dist/schemas/library/money.d.ts.map +1 -1
  320. package/dist/schemas/library/planning.d.ts +56 -0
  321. package/dist/schemas/library/planning.d.ts.map +1 -1
  322. package/dist/schemas/library/publishing.d.ts +80 -4
  323. package/dist/schemas/library/publishing.d.ts.map +1 -1
  324. package/dist/schemas/library/social.d.ts +44 -0
  325. package/dist/schemas/library/social.d.ts.map +1 -1
  326. package/dist/session/account-hint.d.ts.map +1 -1
  327. package/dist/session/account-hint.js +8 -5
  328. package/dist/session/account-hint.js.map +1 -1
  329. package/dist/session/auth.d.ts +36 -2
  330. package/dist/session/auth.d.ts.map +1 -1
  331. package/dist/session/auth.js +95 -2
  332. package/dist/session/auth.js.map +1 -1
  333. package/dist/session/connect.d.ts +1 -0
  334. package/dist/session/connect.d.ts.map +1 -1
  335. package/dist/session/connect.js +3 -1
  336. package/dist/session/connect.js.map +1 -1
  337. package/dist/session/credentials.d.ts +8 -26
  338. package/dist/session/credentials.d.ts.map +1 -1
  339. package/dist/session/credentials.js +14 -32
  340. package/dist/session/credentials.js.map +1 -1
  341. package/dist/session/index.d.ts +1 -0
  342. package/dist/session/index.d.ts.map +1 -1
  343. package/dist/session/index.js +1 -0
  344. package/dist/session/index.js.map +1 -1
  345. package/dist/session/pairing.d.ts.map +1 -1
  346. package/dist/session/pairing.js +92 -88
  347. package/dist/session/pairing.js.map +1 -1
  348. package/dist/session/password-strength.d.ts.map +1 -1
  349. package/dist/session/password-strength.js +37 -37
  350. package/dist/session/password-strength.js.map +1 -1
  351. package/dist/session/places.d.ts.map +1 -1
  352. package/dist/session/places.js +18 -13
  353. package/dist/session/places.js.map +1 -1
  354. package/dist/session/popup.d.ts +13 -0
  355. package/dist/session/popup.d.ts.map +1 -0
  356. package/dist/session/popup.js +23 -0
  357. package/dist/session/popup.js.map +1 -0
  358. package/dist/space/constitution.d.ts.map +1 -1
  359. package/dist/space/constitution.js +22 -29
  360. package/dist/space/constitution.js.map +1 -1
  361. package/dist/space/grants.d.ts.map +1 -1
  362. package/dist/space/grants.js +37 -39
  363. package/dist/space/grants.js.map +1 -1
  364. package/dist/space/invite-link.d.ts.map +1 -1
  365. package/dist/space/invite-link.js +33 -33
  366. package/dist/space/invite-link.js.map +1 -1
  367. package/dist/space/own-automations.d.ts +13 -24
  368. package/dist/space/own-automations.d.ts.map +1 -1
  369. package/dist/space/own-automations.js +47 -37
  370. package/dist/space/own-automations.js.map +1 -1
  371. package/dist/space/roles.d.ts +56 -80
  372. package/dist/space/roles.d.ts.map +1 -1
  373. package/dist/space/roles.js +448 -441
  374. package/dist/space/roles.js.map +1 -1
  375. package/dist/space/space-access.d.ts +3 -4
  376. package/dist/space/space-access.d.ts.map +1 -1
  377. package/dist/space/space-access.js +3 -8
  378. package/dist/space/space-access.js.map +1 -1
  379. package/dist/storage/blob/directory.d.ts.map +1 -1
  380. package/dist/storage/blob/directory.js +39 -32
  381. package/dist/storage/blob/directory.js.map +1 -1
  382. package/dist/storage/blob/s3.d.ts.map +1 -1
  383. package/dist/storage/blob/s3.js +21 -19
  384. package/dist/storage/blob/s3.js.map +1 -1
  385. package/dist/storage/blob-store.d.ts +0 -9
  386. package/dist/storage/blob-store.d.ts.map +1 -1
  387. package/dist/storage/directory-access.d.ts +8 -32
  388. package/dist/storage/directory-access.d.ts.map +1 -1
  389. package/dist/storage/directory-access.js +11 -36
  390. package/dist/storage/directory-access.js.map +1 -1
  391. package/dist/storage/encrypted-adapter.d.ts +12 -32
  392. package/dist/storage/encrypted-adapter.d.ts.map +1 -1
  393. package/dist/storage/encrypted-adapter.js +31 -54
  394. package/dist/storage/encrypted-adapter.js.map +1 -1
  395. package/dist/storage/folder-adapter.d.ts +12 -26
  396. package/dist/storage/folder-adapter.d.ts.map +1 -1
  397. package/dist/storage/folder-adapter.js +37 -54
  398. package/dist/storage/folder-adapter.js.map +1 -1
  399. package/dist/storage/folder-reconcile.d.ts +12 -26
  400. package/dist/storage/folder-reconcile.d.ts.map +1 -1
  401. package/dist/storage/folder-reconcile.js +39 -48
  402. package/dist/storage/folder-reconcile.js.map +1 -1
  403. package/dist/storage/indexeddb-adapter.d.ts +2 -6
  404. package/dist/storage/indexeddb-adapter.d.ts.map +1 -1
  405. package/dist/storage/indexeddb-adapter.js +60 -114
  406. package/dist/storage/indexeddb-adapter.js.map +1 -1
  407. package/dist/storage/mirror.d.ts +0 -29
  408. package/dist/storage/mirror.d.ts.map +1 -1
  409. package/dist/storage/mirror.js +153 -110
  410. package/dist/storage/mirror.js.map +1 -1
  411. package/dist/storage/segment.d.ts.map +1 -1
  412. package/dist/storage/segment.js +3 -7
  413. package/dist/storage/segment.js.map +1 -1
  414. package/dist/storage/storage-provider.d.ts +6 -11
  415. package/dist/storage/storage-provider.d.ts.map +1 -1
  416. package/dist/storage/storage-provider.js +112 -116
  417. package/dist/storage/storage-provider.js.map +1 -1
  418. package/dist/sync/sync-engine.d.ts +10 -44
  419. package/dist/sync/sync-engine.d.ts.map +1 -1
  420. package/dist/sync/sync-engine.js +245 -247
  421. package/dist/sync/sync-engine.js.map +1 -1
  422. package/dist/sync/sync-messages.d.ts +1 -1
  423. package/dist/sync/sync-messages.d.ts.map +1 -1
  424. package/dist/sync/sync-messages.js +1 -1
  425. package/dist/sync/sync-messages.js.map +1 -1
  426. package/dist/utils/guards.d.ts +1 -0
  427. package/dist/utils/guards.d.ts.map +1 -1
  428. package/dist/utils/guards.js +1 -0
  429. package/dist/utils/guards.js.map +1 -1
  430. package/dist/utils/hmac.d.ts +5 -0
  431. package/dist/utils/hmac.d.ts.map +1 -0
  432. package/dist/utils/hmac.js +20 -0
  433. package/dist/utils/hmac.js.map +1 -0
  434. package/dist/utils/map.d.ts +10 -0
  435. package/dist/utils/map.d.ts.map +1 -0
  436. package/dist/utils/map.js +30 -0
  437. package/dist/utils/map.js.map +1 -0
  438. package/dist/utils/serial.d.ts +2 -0
  439. package/dist/utils/serial.d.ts.map +1 -1
  440. package/dist/utils/serial.js +9 -0
  441. package/dist/utils/serial.js.map +1 -1
  442. package/dist/validation/capability-gate.d.ts +7 -15
  443. package/dist/validation/capability-gate.d.ts.map +1 -1
  444. package/dist/validation/capability-gate.js +32 -36
  445. package/dist/validation/capability-gate.js.map +1 -1
  446. package/dist/validation/crypto-gate.d.ts.map +1 -1
  447. package/dist/validation/crypto-gate.js +12 -21
  448. package/dist/validation/crypto-gate.js.map +1 -1
  449. package/docs/README.md +3 -2
  450. package/docs/actions.md +47 -20
  451. package/docs/automations.md +1 -1
  452. package/docs/blueprints-and-guides.md +57 -13
  453. package/docs/building-an-app.md +11 -8
  454. package/docs/collections.md +33 -5
  455. package/docs/contacts.md +34 -1
  456. package/docs/contracts.md +1 -1
  457. package/docs/direct-messages.md +1 -1
  458. package/docs/inbox.md +5 -11
  459. package/docs/node.md +36 -26
  460. package/docs/records-and-queries.md +1 -1
  461. package/docs/sign-in.md +54 -26
  462. package/docs/spaces.md +6 -6
  463. package/docs/standard-library.md +33 -31
  464. package/docs/storage.md +37 -15
  465. package/docs/usernames.md +161 -0
  466. package/docs/warrants.md +1 -1
  467. package/package.json +2 -21
  468. package/dist/calls/calls.d.ts +0 -140
  469. package/dist/calls/calls.d.ts.map +0 -1
  470. package/dist/calls/calls.js +0 -861
  471. package/dist/calls/calls.js.map +0 -1
  472. package/dist/calls/index.d.ts +0 -4
  473. package/dist/calls/index.d.ts.map +0 -1
  474. package/dist/calls/index.js +0 -3
  475. package/dist/calls/index.js.map +0 -1
  476. package/dist/react/context.d.ts +0 -81
  477. package/dist/react/context.d.ts.map +0 -1
  478. package/dist/react/context.js +0 -97
  479. package/dist/react/context.js.map +0 -1
  480. package/dist/react/follow.d.ts +0 -11
  481. package/dist/react/follow.d.ts.map +0 -1
  482. package/dist/react/follow.js +0 -7
  483. package/dist/react/follow.js.map +0 -1
  484. package/dist/react/index.d.ts +0 -44
  485. package/dist/react/index.d.ts.map +0 -1
  486. package/dist/react/index.js +0 -40
  487. package/dist/react/index.js.map +0 -1
  488. package/dist/react/minca-auth.d.ts +0 -19
  489. package/dist/react/minca-auth.d.ts.map +0 -1
  490. package/dist/react/minca-auth.js +0 -36
  491. package/dist/react/minca-auth.js.map +0 -1
  492. package/dist/react/use-calls.d.ts +0 -21
  493. package/dist/react/use-calls.d.ts.map +0 -1
  494. package/dist/react/use-calls.js +0 -39
  495. package/dist/react/use-calls.js.map +0 -1
  496. package/dist/react/use-invite-link.d.ts +0 -24
  497. package/dist/react/use-invite-link.d.ts.map +0 -1
  498. package/dist/react/use-invite-link.js +0 -62
  499. package/dist/react/use-invite-link.js.map +0 -1
  500. package/dist/react/use-live.d.ts +0 -16
  501. package/dist/react/use-live.d.ts.map +0 -1
  502. package/dist/react/use-live.js +0 -56
  503. package/dist/react/use-live.js.map +0 -1
  504. package/dist/react/use-my-name.d.ts +0 -12
  505. package/dist/react/use-my-name.d.ts.map +0 -1
  506. package/dist/react/use-my-name.js +0 -38
  507. package/dist/react/use-my-name.js.map +0 -1
  508. package/dist/react/use-names.d.ts +0 -7
  509. package/dist/react/use-names.d.ts.map +0 -1
  510. package/dist/react/use-names.js +0 -13
  511. package/dist/react/use-names.js.map +0 -1
  512. package/dist/react/use-network.d.ts +0 -9
  513. package/dist/react/use-network.d.ts.map +0 -1
  514. package/dist/react/use-network.js +0 -33
  515. package/dist/react/use-network.js.map +0 -1
  516. package/dist/react/use-query.d.ts +0 -14
  517. package/dist/react/use-query.d.ts.map +0 -1
  518. package/dist/react/use-query.js +0 -26
  519. package/dist/react/use-query.js.map +0 -1
  520. package/dist/react/use-space.d.ts +0 -29
  521. package/dist/react/use-space.d.ts.map +0 -1
  522. package/dist/react/use-space.js +0 -57
  523. package/dist/react/use-space.js.map +0 -1
  524. package/dist/react/use-spaces.d.ts +0 -29
  525. package/dist/react/use-spaces.d.ts.map +0 -1
  526. package/dist/react/use-spaces.js +0 -78
  527. package/dist/react/use-spaces.js.map +0 -1
  528. package/docs/calls.md +0 -189
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @module node/types
3
- * The shape of a node. Everything a method returns is JSON-serialisable on
4
- * purpose: the same calls cross a port, and are actions for a CLI, MCP and WebMCP.
3
+ * The shape of a node. Everything a method returns is JSON-serialisable: the
4
+ * same calls cross a port, and are actions for a CLI, MCP and WebMCP.
5
5
  */
6
6
  import type { MailboxClient } from '../network/relays.js';
7
7
  import type { BodyOf, CollectionRef, IncludeMap, Query, ResultFor } from '../query/types.js';
@@ -21,66 +21,66 @@ import type { StoreFactory } from './stores.js';
21
21
  import type { JsonSchema, SchemaIssue } from '../schema/collection-def.js';
22
22
  import type { Keeper } from '../space/roles.js';
23
23
  import type { Automation } from '../schemas/automations.js';
24
+ import type { FundOffer, FundPayment, HostConnectorOffer, HostStatus, HostedBot, OverSpace, PayAnswer } from '../session/hosting.js';
24
25
  export interface NodeNetworkConfig {
25
26
  /** Relays for WebRTC, browsers only. Each space meets in the room named after its id. */
26
27
  readonly relays?: ReadonlyArray<string>;
27
- /** Always-on nodes to hold a socket to, `wss://host/peer`, pinned by `#<DID>` (spec 04 §5.2). The space id is appended. */
28
+ /** Always-on nodes to hold a socket to, `wss://host/peer#<DID>` (spec 04 §5.2); the space id is appended */
28
29
  readonly nodes?: ReadonlyArray<string>;
29
- /** Hosts to look for the account registry at, `https://host`: how a new device with only the recovery code finds its spaces */
30
+ /** Hosts to look for the account registry at, so a new device with only the recovery code finds its spaces */
30
31
  readonly hosts?: ReadonlyArray<string>;
31
32
  readonly iceServers?: ReadonlyArray<RTCIceServer>;
32
- /** How WebRTC connections are made; a node in a worker passes `remoteTransport`, so the page makes them */
33
+ /** How WebRTC connections are made; a node in a worker passes `remoteTransport` */
33
34
  readonly createTransport?: (iceServers: () => ReadonlyArray<RTCIceServer>) => SignalledTransport;
34
- /** Extra transports per space, given this node's session DID — how a node serving sockets, or a test, plugs in */
35
+ /** Extra transports per space, given this node's session DID: for a node serving sockets, or a test */
35
36
  readonly transports?: (spaceId: string, sessionDid: string) => ReadonlyArray<PeerTransport>;
36
37
  }
37
38
  export interface NodeConfig {
38
- /** Who this node acts for. The root key only ever signs session delegations. */
39
+ /** Who this node acts for. The root key only signs session delegations. */
39
40
  readonly signer: RootSigner;
40
- /** The account key (`deriveAccountKey(seed)`): with it, the node follows the account registry, so spaces are joined and left on every device */
41
+ /** The account key (`deriveAccountKey(seed)`): the node then follows the account registry */
41
42
  readonly accountKey?: Uint8Array;
42
- /** The account's contact key (`deriveContactKeyBytes(seed)`), for a node allowed to open contact requests and knocks */
43
+ /** The account's contact key (`deriveContactKeyBytes(seed)`), to open contact requests and knocks */
43
44
  readonly contactKey?: Uint8Array;
44
45
  /** The account's contacts space, for a node given it without the account key */
45
46
  readonly contactsSpace?: string;
46
- /** How the inbox and short links reach mailboxes. Default: a WebSocket to each (`createMailboxClient`). */
47
+ /**
48
+ * The account's name as a grant gives it: what knocks and a new inbox say
49
+ * until the account's profile reaches this node from its registry
50
+ */
51
+ readonly accountName?: string;
52
+ /** How the inbox and short links reach mailboxes. Default: `createMailboxClient` */
47
53
  readonly mailbox?: MailboxClient;
48
54
  /** Where the registry and each space's store live */
49
55
  readonly stores: StoreFactory;
50
56
  readonly provider?: CryptoProvider;
51
- /** Collections this node knows the shape of, where a space does not describe them: checked on write, flagged (`conforms`) on read, never refused on arrival */
57
+ /** Collection shapes to use where a space has none: checked on write, flagged (`conforms`) on read, never refused */
52
58
  readonly collections?: ReadonlyArray<CollectionDef>;
53
59
  /** Omit to stay offline */
54
60
  readonly network?: NodeNetworkConfig;
55
- /** How long each session delegation lasts. Renewed before it runs out. Default 3600. */
61
+ /** Seconds each session delegation lasts; renewed before it runs out. Default 3600. */
56
62
  readonly sessionTtlSeconds?: number;
57
- /** The key this node signs with, when the signer already named it (an app an account home delegated to). Default: one claimed from `writerKey`, else a fresh one */
63
+ /** The key to sign with, when the signer already named it. Default: one claimed from `writerKey`, else a fresh one */
58
64
  readonly sessionKey?: CryptoKeyPair;
59
- /**
60
- * Where to keep a signing key across runs, so this device keeps one log in
61
- * each space (`browserWriterKeys`; the CLI keeps them on disk). Ignored with
62
- * `sessionKey`. Without it, or when no key can be claimed, the node makes a
63
- * key for this run alone.
64
- */
65
+ /** Where to keep a signing key across runs (`browserWriterKeys`). Without one, each run makes a new key. */
65
66
  readonly writerKey?: WriterKeySource;
66
- /** How often to look for writes another process made to a folder store. 0 disables. Default 2000. */
67
+ /** How often to look for another process's writes to a folder store, ms. 0 disables. Default 2000. */
67
68
  readonly watchIntervalMs?: number;
68
69
  /**
69
- * Fetch every file the records it keeps name, as soon as they are named:
70
- * what a node keeping a space for others does. Without it, a file is
71
- * fetched when it is read (spec 05 §16.6).
70
+ * Fetch and keep every file of any size, as a keeper does. Default: others'
71
+ * files up to 5 MiB, dropping the least used past 256 MiB a space (spec 05 §16.6).
72
72
  */
73
73
  readonly fetchFiles?: 'all';
74
74
  /** Hold only the collections this node uses, once a space names a keeper to hold the rest */
75
75
  readonly cache?: CacheConfig;
76
76
  }
77
- /** How a node holds part of a space: its own choice, which nothing else depends on */
77
+ /** How a node holds part of a space: its own choice */
78
78
  export interface CacheConfig {
79
79
  /** Collections this app uses: held from the start, and dropped last */
80
80
  readonly collections?: ReadonlyArray<string>;
81
- /** Drop a collection no query has touched for this many days, unless it holds writes of this node's still waiting. Default 30. */
81
+ /** Drop a collection no query touched for this many days, unless it holds unsent writes. Default 30. */
82
82
  readonly unusedAfterDays?: number;
83
- /** How many keepers a write must reach before it can be dropped; only ever raises the space's own `copies` (default 2) */
83
+ /** How many keepers a write must reach before it can be dropped; only raises the space's `copies` (default 2) */
84
84
  readonly copies?: number;
85
85
  }
86
86
  /** A space, as the node describes it. Never carries the key. */
@@ -88,37 +88,33 @@ export interface SpaceSummary {
88
88
  readonly id: string;
89
89
  readonly name: string;
90
90
  readonly visibility: SpaceVisibility;
91
- /** Its founders, as its constitution names them: none under `top: "none"`. Some may have stepped down since (`access`) */
91
+ /** Its founders, as its constitution names them; some may have stepped down since (`access`) */
92
92
  readonly founders: ReadonlyArray<string>;
93
- /** The space it succeeds, as its constitution says. Whether that space names it back is `spaces.successors` there */
93
+ /** The space it succeeds, as its constitution says */
94
94
  readonly succeeds?: string;
95
95
  readonly createdAt: string;
96
- /** Whether this node can read the space: always for public ones, only with the key for private */
96
+ /** Whether this node can read the space: public, or private with the key */
97
97
  readonly readable: boolean;
98
- /** Whether this account holds a role here, and so may write, as far as this node last heard */
98
+ /** Whether this account holds a role here, and so may write */
99
99
  readonly writable: boolean;
100
100
  /** What this account is here: `founder`, a role it holds by name, or null when it holds none */
101
101
  readonly role: string | null;
102
- /** Whether an invite is waiting to be used — its record has not reached this device yet */
102
+ /** Whether an invite is waiting to be used: its record has not arrived yet */
103
103
  readonly joining: boolean;
104
104
  }
105
105
  export interface NewSpace {
106
106
  readonly name: string;
107
107
  /** `private` encrypts every body with the space key */
108
108
  readonly visibility: SpaceVisibility;
109
- /** The roles it is founded with, and their grants (`rolePresets` has some). Default: none, the creator, its founder, alone */
109
+ /** The roles it is founded with (`rolePresets` has some). Default: none */
110
110
  readonly roles?: ReadonlyArray<SpaceRole>;
111
- /**
112
- * `founders` (the default): you, and any `cofounders`, hold every command
113
- * and no one else can remove you. `none`: no one is above the roles, and
114
- * you hold only `creatorRoles`
115
- */
111
+ /** `founders` (default): you and any `cofounders` hold every command. `none`: you hold only `creatorRoles` */
116
112
  readonly top?: 'founders' | 'none';
117
113
  /** Under `top: founders`, accounts that found it with you */
118
114
  readonly cofounders?: ReadonlyArray<string>;
119
115
  /** Roles the constitution gives you. Under `top: none` you need one */
120
116
  readonly creatorRoles?: ReadonlyArray<string>;
121
- /** The space this one succeeds. Name it there too, with `spaces.succeed`, so members can tell it from a copy */
117
+ /** The space this one succeeds; name it there too, with `spaces.succeed` */
122
118
  readonly succeeds?: string;
123
119
  }
124
120
  export interface InvitePreview {
@@ -126,30 +122,26 @@ export interface InvitePreview {
126
122
  readonly invitedBy: string;
127
123
  /** Whether the invite carries the key to a private space */
128
124
  readonly carriesKey: boolean;
129
- /** Whether the invite lets you join with a role — false for a view-only one */
125
+ /** Whether the invite gives a role: false for a view-only one */
130
126
  readonly carriesWrite: boolean;
131
- /** The role it is for, as the link says. The space's own invite record is what counts. */
127
+ /** The role it is for, as the link says; the space's invite record is what counts */
132
128
  readonly role: string | null;
133
- /** For a short link: when its inviter stops sharing it, ms. Nothing a peer enforces */
129
+ /** For a short link: when its inviter stops sharing it, ms */
134
130
  readonly until?: number;
135
131
  }
136
132
  export interface InviteOptions {
137
- /** The role whoever uses it will hold. Default: the lowest below yours, or view-only when there is none */
133
+ /** The role it gives. Default: the lowest below yours, or view-only */
138
134
  readonly role?: string;
139
- /** False for a view-only invite: the key to read a private space, and no role */
135
+ /** False for a view-only invite: the key, and no role */
140
136
  readonly write?: boolean;
141
- /**
142
- * A short link (spec 03 §7.7): about 85 characters, the rest of the invite
143
- * kept sealed in mailboxes. Falls back to the long form when no mailbox
144
- * takes it, or the space is too large for one.
145
- */
137
+ /** A short link, the rest sealed in mailboxes (spec 03 §7.7); the long form when no mailbox takes it */
146
138
  readonly short?: boolean;
147
- /** For a short link: when to stop sharing it, ms. Closing the invite is what ends it */
139
+ /** For a short link: when to stop sharing it, ms. Closing the invite is what ends it. */
148
140
  readonly until?: number;
149
141
  }
150
142
  /** Who holds what in a space, now */
151
143
  export interface SpaceAccess {
152
- /** The space's roles, by name, each with its current definitions: more than one are rivals, holding what they share */
144
+ /** The space's roles, each with its current definitions (rivals hold what they share) */
153
145
  readonly roles: ReadonlyArray<SpaceRoleView>;
154
146
  /** Everyone with a place: the founders, and every account assigned a role */
155
147
  readonly members: ReadonlyArray<{
@@ -163,54 +155,39 @@ export interface SpaceAccess {
163
155
  readonly role: string;
164
156
  readonly open: boolean;
165
157
  }>;
166
- /** Whether this account is a founder of the space, and has not stepped down: it holds every command */
158
+ /** Whether this account is a founder that has not stepped down */
167
159
  readonly founder: boolean;
168
160
  /** `founders` or `none`, as the constitution says */
169
161
  readonly top: 'founders' | 'none';
170
- /**
171
- * No founder is left, and no member may change roles: nobody can run the
172
- * space any more, so a successor is the way on (`spaces.succeed`)
173
- */
162
+ /** No founder is left and no member may change roles: only a successor helps (`spaces.succeed`) */
174
163
  readonly headless: boolean;
175
- /**
176
- * Spaces named as this one's successors, each with the accounts that named
177
- * it. In no order: which to follow is each member's choice, and an app
178
- * must not pick one for them
179
- */
164
+ /** Spaces named as successors, and who named each. In no order: which to follow is each member's choice. */
180
165
  readonly successors: ReadonlyArray<{
181
166
  readonly space: string;
182
167
  readonly by: ReadonlyArray<string>;
183
168
  }>;
184
169
  /** The roles assigned to this account, by name */
185
170
  readonly mine: ReadonlyArray<string>;
186
- /** The latest access changes held — what a record written now names as `seen` */
171
+ /** The latest access changes held: what a record written now names as `seen` */
187
172
  readonly heads: ReadonlyArray<string>;
188
- /** A private space's key: how often it changed, and whether this device holds the current one. Null when public */
173
+ /** A private space's key: how often it changed, and whether this device holds the current one */
189
174
  readonly key: {
190
175
  readonly changes: number;
191
176
  readonly held: boolean;
192
177
  } | null;
193
- /** Where the space's members meet: the relays it names, or until it names some, the ones its invite did */
178
+ /** Where members meet: the relays it names, else the ones its invite did */
194
179
  readonly relays: ReadonlyArray<string>;
195
- /** The nodes that keep the space whole: a host, an extension. Empty until someone who manages it names some. */
180
+ /** The nodes that keep the space whole: a host, an extension */
196
181
  readonly keepers: ReadonlyArray<Keeper>;
197
- /** How many keepers a write should reach before a node holding part of the space lets go of it; null for the default */
182
+ /** How many keepers a write should reach before it may be dropped; null for the default */
198
183
  readonly copies: number | null;
199
- /**
200
- * Keys proven to have signed two versions at one place in their line for a
201
- * collection here: stolen, or copied where they shouldn't be. What they
202
- * signed in that collection from `from` on no longer counts (spec 02 §4.10).
203
- */
184
+ /** Keys proven to have forked their line in a collection; what they signed from `from` on no longer counts (spec 02 §4.10) */
204
185
  readonly forks: ReadonlyArray<{
205
186
  readonly writer: string;
206
187
  readonly collection: string;
207
188
  readonly from: number;
208
189
  }>;
209
- /**
210
- * Accounts proven, by a warrant every peer checked, to have signed something
211
- * the protocol refuses and no honest writer could have (spec 03 §6.6). For
212
- * whoever manages the space to see; nothing is done about it by itself.
213
- */
190
+ /** Accounts a checked warrant proves signed what no honest writer could (spec 03 §6.6), for managers to see */
214
191
  readonly flagged: ReadonlyArray<FlaggedAccount>;
215
192
  }
216
193
  /** A role as the history has it now */
@@ -238,47 +215,39 @@ export interface FlaggedAccount {
238
215
  /** The id of the offending version */
239
216
  readonly offence: string;
240
217
  }
241
- /** A record, opened and checked — its current version, unless listed as history */
218
+ /** A record, opened and checked: its current version, unless listed as history */
242
219
  export interface NodeRecord<T = unknown> {
243
- /** The record's identity. Stays the same across edits; links point here. */
220
+ /** The record's identity, the same across edits; links point here */
244
221
  readonly key: string;
245
- /** This version's id — a content hash, different for every edit */
222
+ /** This version's id: a content hash */
246
223
  readonly version: string;
247
224
  /** 0 for the first version, one more for each edit */
248
225
  readonly seq: number;
249
226
  readonly space: string;
250
227
  readonly collection: string;
251
- /** The key that signed this version — usually a session key */
228
+ /** The key that signed this version, usually a session key */
252
229
  readonly author: string;
253
230
  /** The identity that key was acting for, when its delegation checks out */
254
231
  readonly root: string | null;
255
232
  /** The identity that created the record, when its first version is held */
256
233
  readonly createdBy: string | null;
257
- /** When the record was created, as its creator's clock said — for display; it decides nothing */
234
+ /** When it was created, by its creator's clock: for display only */
258
235
  readonly createdAt: string;
259
- /** When this version was written, likewise for display only */
236
+ /** When this version was written: for display only */
260
237
  readonly updatedAt: string;
261
238
  /** The content, or null when it is encrypted and this node has no key */
262
239
  readonly body: T | null;
263
- /** What this record points at — empty when it points at nothing, or cannot be opened */
240
+ /** What this record points at; empty when it can't be opened */
264
241
  readonly links: ReadonlyArray<Link>;
265
242
  readonly encrypted: boolean;
266
243
  /** Signature, delegation and shape all check out */
267
244
  readonly verified: boolean;
268
- /**
269
- * True when the note this version was signed under grants writing records
270
- * and no more: it could not have defined a collection here. An app that
271
- * runs what a record holds, as code, trusts only versions without it.
272
- */
245
+ /** Signed under a note that grants writing records and no more: an app running records as code trusts only versions without it */
273
246
  readonly recordsOnly?: true;
274
247
  readonly reason?: string;
275
- /** Present, and true, when this version deletes the record (listed only with `includeDeleted`) */
248
+ /** This version deletes the record (listed only with `includeDeleted`) */
276
249
  readonly deleted?: true;
277
- /**
278
- * Whether the body fits its collection's schema; null when there is none or
279
- * it could not be opened. A misfit is still kept and synced: refusing it
280
- * would leave peers that saw different definitions disagreeing forever.
281
- */
250
+ /** Whether the body fits its collection's schema; null when there is none or it can't be opened. A misfit still syncs. */
282
251
  readonly conforms: boolean | null;
283
252
  readonly issues?: ReadonlyArray<SchemaIssue>;
284
253
  }
@@ -290,19 +259,19 @@ export interface NodeCollection {
290
259
  /** Null when records exist but the space has no definition for them */
291
260
  readonly schema: JsonSchema | null;
292
261
  readonly version: number | null;
293
- /** Whether edits keep old versions: `all` for an audit trail, `latest` (the default) for current state only */
262
+ /** Whether edits keep old versions: `all`, or `latest` (the default) */
294
263
  readonly history: 'latest' | 'all';
295
- /** The link roles its records carry, and what each may point at — how the space's things connect */
264
+ /** The link roles its records carry, and what each may point at */
296
265
  readonly links: Readonly<Record<string, LinkDeclaration>>;
297
- /** The identity that first defined it — it, and anyone who can manage the space, may change it */
266
+ /** The identity that first defined it */
298
267
  readonly definedBy: string | null;
299
- /** What must be unique, which fields are fixed — for records created from now on */
268
+ /** What must be unique, which fields are fixed */
300
269
  readonly rules: CollectionRules;
301
270
  /** What a version must be to count, judged by readers; absent when it has none */
302
271
  readonly contract?: CollectionContract;
303
272
  /** Values derived from what links to its records; absent when it has none */
304
273
  readonly computed?: ComputedFields;
305
- /** Fields whose values are topics, tagged on the outside of each record so keepers can match them unread */
274
+ /** Fields whose values are tagged on each record's outside, so keepers can match them unread */
306
275
  readonly topics: ReadonlyArray<string>;
307
276
  readonly records: number;
308
277
  }
@@ -310,31 +279,24 @@ export interface DefineCollection {
310
279
  readonly name: string;
311
280
  readonly title?: string;
312
281
  readonly description?: string;
313
- /** JSON Schema in the supported subset, or a validator that describes itself as one (Standard JSON Schema) */
282
+ /** JSON Schema in the supported subset, or a Standard JSON Schema validator */
314
283
  readonly schema: JsonSchema | StandardJSONSchemaV1;
315
284
  /** Default: one past the current version, or 1 */
316
285
  readonly version?: number;
317
- /** Keep every version of every record in it (`all`), or only the current one (`latest`, the default) */
286
+ /** Keep every version (`all`), or only the current one (`latest`, the default) */
318
287
  readonly history?: 'latest' | 'all';
319
288
  /** The link roles its records may carry, and what each may point at */
320
289
  readonly links?: Readonly<Record<string, LinkDeclaration>>;
321
- /** What must be unique, which fields are fixed, whether records are written once: what every peer checks */
290
+ /** What must be unique, which fields are fixed, whether records are written once: every peer checks */
322
291
  readonly rules?: CollectionRules;
323
- /** Fields whose values are topics — `channel`, `mentions` — so a keeper can match them without reading (`StoredCollection.topics`) */
292
+ /** Fields whose values are topics, like `channel`, so a keeper can match them unread */
324
293
  readonly topics?: ReadonlyArray<string>;
325
- /**
326
- * What a version must be to count, judged by readers: `check`, conditions in CEL or built
327
- * in TypeScript, and `line`, one line per account at `lineKey(account, name)`
328
- * (packages/core/docs/contracts.md)
329
- */
294
+ /** What a version must be to count, judged by readers: `check` conditions and a `line` (packages/core/docs/contracts.md) */
330
295
  readonly contract?: CollectionContract | {
331
296
  readonly check?: ReadonlyArray<Contract> | ((scope: never) => Readonly<Record<string, unknown>>);
332
297
  readonly line?: Line;
333
298
  };
334
- /**
335
- * Values every app derives the same way from what links to its records, in CEL or built in
336
- * TypeScript (packages/core/docs/computed.md)
337
- */
299
+ /** Values derived from what links to its records (packages/core/docs/computed.md) */
338
300
  readonly computed?: ComputedFields | ((scope: never) => ComputedResult);
339
301
  }
340
302
  export interface NodeCollections {
@@ -344,7 +306,7 @@ export interface NodeCollections {
344
306
  define(spaceId: string, definition: DefineCollection): Promise<NodeCollection>;
345
307
  /** Takes a definition out of the space; refused while the collection still has records */
346
308
  delete(spaceId: string, name: string): Promise<void>;
347
- /** The topic tag a record with this value carries on its outside, keyed in a private space so only members can work it out */
309
+ /** The topic tag a record with this value carries; keyed in a private space, so only members can work it out */
348
310
  tag(spaceId: string, collection: string, field: string, value: string | number | boolean): Promise<string>;
349
311
  }
350
312
  /** A version under its collection's contract: `passes` null when it has none, or this node can't judge it */
@@ -355,7 +317,7 @@ export interface RecordContracts {
355
317
  readonly reason?: string;
356
318
  /** A version it cites, or the one before it, hasn't arrived yet */
357
319
  readonly pending?: true;
358
- /** Its collection declares something this library doesn't know: counted by no one here, and failed by no one */
320
+ /** Its collection declares something this library doesn't know, so it is neither counted nor failed */
359
321
  readonly unjudged?: true;
360
322
  }
361
323
  export interface ListOptions {
@@ -378,32 +340,28 @@ export interface SpaceStatus {
378
340
  readonly connection: ConnectionState;
379
341
  /** Peers currently connected in this space */
380
342
  readonly peers: ReadonlyArray<string>;
381
- /** Of `peers`, this account's own other devices and apps — the ones following the account registry too */
343
+ /** Of `peers`, this account's own other devices and apps */
382
344
  readonly own: ReadonlyArray<string>;
383
- /** Of `peers`, carriers the account uses: nodes that keep its spaces online without reading them */
345
+ /** Of `peers`, carriers the account uses */
384
346
  readonly carriers: ReadonlyArray<string>;
385
- /** The account each peer showed it acts for, by the peer's session DID — only peers that showed one */
347
+ /** The account each peer showed it acts for, by session DID */
386
348
  readonly accounts: Readonly<Record<string, string>>;
387
- /** A fingerprint of every version this node keeps here — equal on two nodes means identical data */
349
+ /** A fingerprint of every version kept here: equal on two nodes means identical data */
388
350
  readonly fingerprint: string;
389
351
  /** Records peers sent that failed validation */
390
352
  readonly rejected: number;
391
- /** What this node holds of the space: `all`, or the collections it uses (besides the space's own) */
353
+ /** What this node holds of the space: `all`, or the collections it uses */
392
354
  readonly holds: 'all' | ReadonlyArray<string>;
393
- /** Writes of this node's that haven't reached enough keepers yet, so are kept whatever else is dropped */
355
+ /** Writes of this node's that haven't reached enough keepers yet */
394
356
  readonly pending: number;
395
357
  }
396
358
  /** A live message as it arrives: what was sent, and who sent it */
397
359
  export interface LiveMessage {
398
- /** The account behind the sender, proven by its session's note; null for a peer that showed none */
360
+ /** The sender's account, proven by its note; null for a peer that showed none */
399
361
  readonly from: string | null;
400
- /** The sending device: its session DID, which is also where a reply to that device goes */
362
+ /** The sending device's session DID, where a reply to it goes */
401
363
  readonly peer: string;
402
- /**
403
- * Whether the sender's note writes records in some space but can't define
404
- * collections in this one, judged on the whole note so a key for another
405
- * space is caught too. False for a note that only reads, which writes nothing.
406
- */
364
+ /** Whether the sender's note writes records but can't define collections here (false for a read-only note) */
407
365
  readonly recordsOnly: boolean;
408
366
  readonly message: unknown;
409
367
  }
@@ -436,7 +394,7 @@ export type NodeEvent =
436
394
  readonly type: 'message';
437
395
  readonly space: string;
438
396
  } & LiveMessage)
439
- /** The note this node writes under was revoked in a space — an app disconnected from its account home, say */
397
+ /** The note this node writes under was revoked in a space */
440
398
  | {
441
399
  readonly type: 'revoked';
442
400
  readonly space: string;
@@ -449,16 +407,16 @@ export type NodeEvent =
449
407
  export interface NodeNetwork {
450
408
  /** Where each relay and connection stands. No relays when none are configured. */
451
409
  status(): MeshStatus;
452
- /** Tries every relay that is waiting to reconnect, now, rather than at its next turn */
410
+ /** Tries every relay waiting to reconnect, now */
453
411
  reconnect(): void;
454
412
  }
455
413
  /** Who someone is in a space: the name they gave there, by their identity */
456
414
  export interface SpaceProfile {
457
- /** Their identity — what `root` and `createdBy` on a record name */
415
+ /** Their identity, as `root` and `createdBy` on a record name it */
458
416
  readonly did: string;
459
417
  readonly name: string;
460
418
  readonly updatedAt: string;
461
- /** The public half of their contact key, which a contact request to them is sealed with (`contacts.ask`) */
419
+ /** Their contact key's public half, which a contact request is sealed to */
462
420
  readonly contactKey?: string;
463
421
  /** Their picture, a file in this space: read it with `records.readFile` */
464
422
  readonly avatar?: FileRef;
@@ -467,85 +425,66 @@ export interface NodeSpaces {
467
425
  list(): Promise<ReadonlyArray<SpaceSummary>>;
468
426
  get(spaceId: string): Promise<SpaceSummary | null>;
469
427
  create(params: NewSpace): Promise<SpaceSummary>;
470
- /** An invite string, shown once. For a private space it carries the key, so treat it as a secret */
428
+ /** An invite string. For a private space it carries the key: treat it as a secret */
471
429
  invite(spaceId: string, options?: InviteOptions): Promise<string>;
472
430
  /** What an invite or link is for; a short link is fetched from its mailboxes first */
473
431
  preview(invite: string): Promise<InvitePreview>;
474
- /** Joins a space from an invite. `memberKey`, for a node without the account key, lets a new key of the space reach it */
432
+ /** Joins a space from an invite. `memberKey` lets a node without the account key receive new space keys */
475
433
  join(invite: string, options?: {
476
434
  readonly memberKey?: Uint8Array;
477
435
  }): Promise<SpaceSummary>;
478
- /** Gives up the account's place in a space (its own removal record), then forgets it on this node with its key */
436
+ /** Gives up the account's place in a space, then forgets it and its key here */
479
437
  leave(spaceId: string): Promise<void>;
480
438
  /** Roles, members and invites, as the space's access history says now */
481
439
  access(spaceId: string): Promise<SpaceAccess>;
482
440
  /** Whether this account, or `account`, may invoke a command with these arguments in a space now (spec 03 §2) */
483
441
  may(spaceId: string, cmd: string, args?: Readonly<Record<string, unknown>>, account?: string): Promise<boolean>;
484
- /**
485
- * Whether this account, or `account`, holds every grant a role gives, each as
486
- * wide or wider: what it may hand to a bot or an agent without handing on
487
- * more than it holds. Compares the policies' words, so it may say no where
488
- * they would allow, never yes where they wouldn't.
489
- */
442
+ /** Whether this account, or `account`, holds every grant of a role at least as wide; may say no wrongly, never yes */
490
443
  holdsRole(spaceId: string, role: string, account?: string): Promise<boolean>;
491
- /** Writes a role's definition, replacing the ones this node holds: its grants and the roles it nests. Needs `/role/define` */
444
+ /** Writes a role's definition, replacing the ones held. Needs `/role/define` */
492
445
  defineRole(spaceId: string, role: SpaceRole): Promise<void>;
493
446
  /** Assigns a role to an account. Needs `/role/assign` */
494
447
  assign(spaceId: string, did: string, role: string): Promise<void>;
495
- /** Takes a role from an account; your own, to leave it, needs nothing. Otherwise `/role/unassign` */
448
+ /** Takes a role from an account. Needs `/role/unassign`, unless it is your own */
496
449
  unassign(spaceId: string, did: string, role: string): Promise<void>;
497
- /** Removes an account and every role it holds; yourself, to leave, needs nothing. Otherwise `/member/remove` */
450
+ /** Removes an account and its roles. Needs `/member/remove`, unless it is you */
498
451
  removeMember(spaceId: string, did: string): Promise<void>;
499
- /**
500
- * Stops being a founder and stays, with the roles you hold: given `keep`,
501
- * you take that role first. To go altogether, `leave`. Only a founder steps
502
- * down, and only itself
503
- */
452
+ /** Stops being a founder but stays, taking role `keep` first when given */
504
453
  stepDown(spaceId: string, options?: {
505
454
  readonly keep?: string;
506
455
  }): Promise<void>;
507
- /**
508
- * Names a space that succeeds this one (its constitution's `succeeds`
509
- * naming this one). It changes nothing here. Needs `/space/succeed`, or,
510
- * where no member holds it, a place here
511
- */
456
+ /** Names a space that succeeds this one. Needs `/space/succeed`, or a place here when no one holds it */
512
457
  succeed(spaceId: string, successor: string): Promise<void>;
513
- /** Closes an invite — by the link itself, or by its key from `access().invites`. Who joined with it before stays. */
458
+ /** Closes an invite, by link or by its key from `access().invites`. Who joined with it stays. */
514
459
  closeInvite(spaceId: string, keyOrLink: string): Promise<void>;
515
- /** Gives a private space a new key, as happens when someone is removed: for a lost device. Needs `/key/change` */
460
+ /** Gives a private space a new key, for a lost device. Needs `/key/change` */
516
461
  changeKey(spaceId: string): Promise<void>;
517
- /** Names the relays (wss://, at most 8) the space's members meet on, whatever relays their apps use. Needs `/space/relays` */
462
+ /** Names the relays (wss://, at most 8) the space's members meet on. Needs `/space/relays` */
518
463
  setRelays(spaceId: string, relays: ReadonlyArray<string>): Promise<void>;
519
464
  /** Names the nodes that keep the space whole (at most 16), and how many a write should reach. Needs `/space/keepers` */
520
465
  setKeepers(spaceId: string, keepers: ReadonlyArray<Keeper>, copies?: number | null): Promise<void>;
521
466
  /**
522
- * Revokes one of this account's keys (a session's, an app's, by DID): nothing it writes counts from then on, except what was seen.
523
- * With `waitMs`, waits up to that long for a peer to take the revoke in: true when one did, or with no wait.
467
+ * Revokes one of this account's keys, by DID: nothing it writes counts from then on.
468
+ * With `waitMs`, waits that long for a peer to take it in: true when one did, or with no wait.
524
469
  */
525
470
  revoke(spaceId: string, key: string, options?: RevokeOptions): Promise<boolean>;
526
471
  /** Keeps a space syncing until the function it returns is called; it stops once nothing holds it */
527
472
  hold(spaceId: string): Promise<() => Promise<void>>;
528
- /** A live message to the peers connected now, kept nowhere, at most 64 KB; `to` an account or a session DID. Arrives as a `message` event */
473
+ /** A live message (at most 64 KB) to peers connected now, `to` an account or a session DID; kept nowhere */
529
474
  send(spaceId: string, message: unknown, to?: string): Promise<void>;
530
475
  status(spaceId: string): Promise<SpaceStatus>;
531
- /**
532
- * Waits up to `waitMs` (default 3 s) for one of the account's carriers that
533
- * is connected now to hold everything this node does of a space, so an
534
- * invite to it works with every device of the account away. False at once
535
- * when no carrier is connected, and false when it didn't catch up in time.
536
- */
476
+ /** Waits up to `waitMs` (default 3 s) for a connected carrier to hold all this node does of a space */
537
477
  carried(spaceId: string, options?: {
538
478
  readonly waitMs?: number;
539
479
  }): Promise<boolean>;
480
+ /** Waits up to `waitMs` (at most a minute) for one peer, by its key, to hold all this node does of a space; for a node about to close */
481
+ reached(spaceId: string, peer: string, waitMs: number): Promise<boolean>;
540
482
  /** How a node serving this space checks connecting peers and signs its welcome; null for a space it does not hold */
541
483
  authenticator(spaceId: string): Promise<ServerAuth | null>;
542
- /** The name each person gave in this space, by identity; yours is published from the account's name */
484
+ /** The name each person gave in this space; yours is published from the account's name */
543
485
  profiles(spaceId: string): Promise<ReadonlyArray<SpaceProfile>>;
544
486
  }
545
- /**
546
- * A file a body refers to, as `records.addFile` gives it: what names it on a
547
- * version (`hash`, `size`), what opens it (`key`, `salt`), and what it is.
548
- */
487
+ /** A file a body refers to, as `records.addFile` gives it */
549
488
  export interface FileRef {
550
489
  readonly hash: string;
551
490
  readonly size: number;
@@ -559,63 +498,43 @@ export interface NodeRecords {
559
498
  list<T = unknown>(spaceId: string, options?: ListOptions): Promise<ReadonlyArray<NodeRecord<T>>>;
560
499
  /** A record's current version, or null when there is none or it was deleted */
561
500
  get<T = unknown>(spaceId: string, key: string): Promise<NodeRecord<T> | null>;
562
- /**
563
- * How a record's newest version that stands fares under its collection's
564
- * contract, or the version named. A version that fails is kept and synced
565
- * by every peer, but `get`, `list` and queries count only versions that
566
- * pass (packages/core/docs/contracts.md).
567
- */
501
+ /** How a record's newest standing version, or the one named, fares under its collection's contract */
568
502
  contracts(spaceId: string, key: string, version?: string): Promise<RecordContracts | null>;
569
- /**
570
- * The key `name` has in an account's namespace (this one's unless another
571
- * is named): where `put(…, { key: name })` writes. Keys belong to the
572
- * account that creates them (packages/core/docs/records-and-queries.md#keys).
573
- */
503
+ /** The key `name` has in an account's namespace (this one's by default): where `put(…, { key: name })` writes */
574
504
  keyFor(spaceId: string, name: string, account?: string): Promise<string>;
575
- /**
576
- * The key a record with this body and links has under its collection's
577
- * `onePer`, written by `account` (this one unless named): null when the
578
- * collection has no `onePer`, or the body lacks a part it names.
579
- */
505
+ /** The key a record with this body has under its collection's `onePer`; null when there is none */
580
506
  onePerKey(spaceId: string, collection: string, body: unknown, options?: {
581
507
  links?: ReadonlyArray<Link>;
582
508
  account?: string;
583
509
  }): Promise<string | null>;
584
- /**
585
- * Creates a record, under a fresh key of this account's, or the name given
586
- * as `key` in its namespace. Writing a deleted key brings it back
587
- */
510
+ /** Creates a record under a fresh key, or `key` in this account's namespace. Writing a deleted key brings it back. */
588
511
  put<T = unknown>(spaceId: string, collection: string, body: T, options?: {
589
512
  key?: string;
590
513
  links?: ReadonlyArray<Link>;
591
514
  }): Promise<NodeRecord<T>>;
592
- /** The same, given the collection's definition: the body is checked against its type as you write it */
515
+ /** The same, typed by the collection's definition */
593
516
  put<C extends {
594
517
  readonly name: string;
595
518
  }>(spaceId: string, collection: C, body: BodyOf<C>, options?: {
596
519
  key?: string;
597
520
  links?: ReadonlyArray<Link>;
598
521
  }): Promise<NodeRecord<BodyOf<C>>>;
599
- /** Writes the record's next version. Same key; `seq` one higher. Links carry over unless given. */
522
+ /** Writes the record's next version; links carry over unless given */
600
523
  update<T = unknown>(spaceId: string, key: string, body: T, options?: {
601
524
  links?: ReadonlyArray<Link>;
602
525
  }): Promise<NodeRecord<T>>;
603
- /** The records whose current version points at this one — optionally in one role, or one collection */
526
+ /** The records whose current version points at this one, optionally by role or collection */
604
527
  linked<T = unknown>(spaceId: string, key: string, options?: {
605
528
  rel?: string;
606
529
  collection?: string;
607
530
  }): Promise<ReadonlyArray<NodeRecord<T>>>;
608
531
  /** Deletes a record everywhere, by writing a version marked deleted */
609
532
  delete(spaceId: string, key: string): Promise<void>;
610
- /** The versions of a record kept here, newest first: current and first, and every other with `history: 'all'` */
533
+ /** The versions of a record kept here, newest first */
611
534
  history<T = unknown>(spaceId: string, key: string): Promise<ReadonlyArray<NodeRecord<T>>>;
612
- /** Whether this account may `create` in a collection (`target` its name), or `edit` / `delete` a record (`target` its key) */
535
+ /** Whether this account may `create` in a collection, or `edit` / `delete` a record; `target` names it */
613
536
  can(spaceId: string, action: 'create' | 'edit' | 'delete', target: string): Promise<boolean>;
614
- /**
615
- * Seals a file under a key of its own, keeps it, and gives back the
616
- * reference to put in a body: a version whose body holds it names the file
617
- * on its outside, so peers fetch and keep it (spec 05 §16.6).
618
- */
537
+ /** Seals and keeps a file, giving the reference to put in a body (spec 05 §16.6) */
619
538
  addFile(spaceId: string, bytes: Uint8Array, about: {
620
539
  mime: string;
621
540
  name?: string;
@@ -632,7 +551,7 @@ export interface NodeRecords {
632
551
  }
633
552
  export interface AccountProfileView {
634
553
  readonly name: string;
635
- /** The account's picture, a file in its registry; each space holds its own copy (`SpaceProfile.avatar`) */
554
+ /** The account's picture, a file in its registry */
636
555
  readonly avatar?: FileRef;
637
556
  /** When it was set, on whichever device set it */
638
557
  readonly updatedAt: string;
@@ -649,11 +568,7 @@ export interface CarrierSummary {
649
568
  /** Nodes that keep the account's spaces online without reading them (`space/pass.ts`). Needs the account key */
650
569
  export interface NodeCarriers {
651
570
  list(): Promise<ReadonlyArray<CarrierSummary>>;
652
- /**
653
- * Starts using a carrier: a carry space with a pass for every space, kept
654
- * current by every device. Its invite is the carrier's. The same carrier
655
- * again, by DID, gets the carry space it has.
656
- */
571
+ /** Starts using a carrier: a carry space with a pass for every space, and the invite to give it */
657
572
  add(carrier: {
658
573
  readonly did: string;
659
574
  readonly name: string;
@@ -661,20 +576,9 @@ export interface NodeCarriers {
661
576
  readonly space: string;
662
577
  readonly invite: string;
663
578
  }>;
664
- /**
665
- * Waits up to `waitMs` for the carrier to hold what this node wrote for it:
666
- * level with it in its carry space, then in the account registry. A node
667
- * about to close — the home's window, once it has answered — waits for this,
668
- * or nobody may hand the carrier its passes until the home opens again.
669
- */
579
+ /** Waits up to `waitMs` for the carrier to hold what this node wrote for it; for a node about to close */
670
580
  reached(space: string, waitMs: number): Promise<boolean>;
671
- /**
672
- * Waits up to `waitMs` for every carrier's carry space to hold the passes
673
- * and wakes as they are now, written here, and says whether it does. They
674
- * are written in the background: adding a carrier or an automation doesn't
675
- * wait, so a node about to close waits on this. It covers a refill already
676
- * started, or asked for, and is true at once when there is none.
677
- */
581
+ /** Waits up to `waitMs` for the passes and wakes written in the background to be done; for a node about to close */
678
582
  settled(waitMs: number): Promise<boolean>;
679
583
  /** Stops using a carrier: its passes go, and it is told to forget what it held */
680
584
  remove(space: string): Promise<void>;
@@ -684,11 +588,7 @@ export interface OwnAutomationView extends Automation {
684
588
  /** Its record key in the registry */
685
589
  readonly id: string;
686
590
  }
687
- /**
688
- * "Let me know when…": the account's own automations, across its spaces,
689
- * noticed by its carriers, which get each value as a topic tag. Needs the
690
- * account key.
691
- */
591
+ /** "Let me know when…": the account's own automations, noticed by its carriers. Needs the account key. */
692
592
  export interface NodeAutomations {
693
593
  list(): Promise<ReadonlyArray<OwnAutomationView>>;
694
594
  /** Starts one: `when.query` is a collection and a `where` over each new record, `$me` the account */
@@ -717,66 +617,55 @@ export interface HostingView {
717
617
  /** The subscription — the key the account made for this host */
718
618
  readonly subscription: string;
719
619
  readonly since: string;
720
- /** How the subscription stands, as the host signed it: now when `live`, else the last it said */
721
- readonly status: import('../session/hosting.js').HostStatus | null;
620
+ /** How the subscription stands, as the host signed it: now when `live`, else last heard */
621
+ readonly status: HostStatus | null;
722
622
  /** Whether `status` is what the host said just now */
723
623
  readonly live: boolean;
724
624
  /** Why it could not be reached */
725
625
  readonly error?: string;
726
- /** How the account's balance there is added to, from its description; null when it takes no payments or can't be reached */
727
- readonly fund: import('../session/hosting.js').FundOffer | null;
626
+ /** How the account's balance there is added to; null when it takes no payments or can't be reached */
627
+ readonly fund: FundOffer | null;
728
628
  /** Whether it sends reminders by email (`remind`) */
729
629
  readonly reminds: boolean;
730
630
  }
731
- /**
732
- * Hosts: carriers the account pays for, online when every device is off. A
733
- * device never handles a payment (spec/06-nodes-and-sessions.md, Hosts).
734
- */
631
+ /** Hosts: carriers the account pays for (spec/06-nodes-and-sessions.md, Hosts) */
735
632
  export interface NodeHosting {
736
- /** The hosts the account uses, each asked how it stands. Hands a host the spaces if it was paid since. */
633
+ /** The hosts the account uses, each asked how it stands; a host paid since gets the spaces */
737
634
  list(): Promise<ReadonlyArray<HostingView>>;
738
635
  /** Starts using a host: a subscription key every device signs as, and the spaces once it is paid */
739
636
  use(url: string): Promise<HostingView>;
740
- /** Adds to the account's balance at a host: a `checkout` page to open (`noopener`), or a `request` for a wallet */
741
- pay(url: string, payment: import('../session/hosting.js').FundPayment): Promise<import('../session/hosting.js').PayAnswer>;
742
- /** Asks a host for reminders by email before paid time runs out; it mails a link to confirm first */
637
+ /** Adds to the account's balance at a host: a `checkout` page to open, or a `request` for a wallet */
638
+ pay(url: string, payment: FundPayment): Promise<PayAnswer>;
639
+ /** Asks a host for reminders by email before paid time runs out */
743
640
  remind(url: string, email: string): Promise<void>;
744
- /** Stops using a host: it forgets the spaces, and the subscription is let go. Cancel a card that renews first (`manage`). */
641
+ /** Stops using a host: it forgets the spaces. Cancel a renewing card first (`manage`). */
745
642
  stop(url: string): Promise<void>;
746
- /** The hosts a space pays (`std.host`), each asked how its subscription stands; hands one the pass once paid */
643
+ /** The hosts a space pays (`std.host`), each asked how it stands; one paid gets the pass */
747
644
  space(spaceId: string): Promise<ReadonlyArray<SpaceHostingView>>;
748
- /**
749
- * The account's hosts that last said a space is over their free line
750
- * (spec 08 §1.1), from the statuses they signed: what a member is told
751
- * before those hosts stop carrying it for members. Asks no host.
752
- */
645
+ /** The account's hosts that last said a space is over their free line (spec 08 §1.1). Asks no host. */
753
646
  over(spaceId: string): Promise<ReadonlyArray<{
754
647
  readonly url: string;
755
648
  readonly name: string;
756
- readonly over: import('../session/hosting.js').OverSpace;
649
+ readonly over: OverSpace;
757
650
  }>>;
758
- /** Starts adding to a space's fund at one of the hosts it names: an amount, once or monthly. Anyone in it may. */
759
- payForSpace(spaceId: string, url: string, payment: import('../session/hosting.js').FundPayment): Promise<import('../session/hosting.js').PayAnswer>;
651
+ /** Adds to a space's fund at a host it names, once or monthly. Anyone in it may. */
652
+ payForSpace(spaceId: string, url: string, payment: FundPayment): Promise<PayAnswer>;
760
653
  /** Asks a host a space names for reminders by email before the space's paid time runs out */
761
654
  remindForSpace(spaceId: string, url: string, email: string): Promise<void>;
762
- /**
763
- * Stops a space using a host: its `std.host` record goes, and with `manage`
764
- * its bots are removed and a private space gets a new key. Nothing is asked
765
- * of the host.
766
- */
655
+ /** Stops a space using a host: its `std.host` record goes, and with `manage` its bots and key */
767
656
  stopForSpace(spaceId: string, url: string): Promise<{
768
657
  /** The bots removed from the space, by DID */
769
658
  readonly bots: ReadonlyArray<string>;
770
659
  /** Whether the space's key changes because of it */
771
660
  readonly newKey: boolean;
772
661
  }>;
773
- /** Asks a host the space names to run a bot there, joining with an invite for `role`; removing the bot stops it */
662
+ /** Asks a host the space names to run a bot there with `role`; removing the bot stops it */
774
663
  startBot(spaceId: string, url: string, bot: {
775
664
  readonly name: string;
776
665
  readonly role?: string;
777
666
  }): Promise<{
778
667
  readonly bot: string;
779
- readonly status: import('../session/hosting.js').HostStatus;
668
+ readonly status: HostStatus;
780
669
  }>;
781
670
  }
782
671
  /** A host a space pays for itself, as `hosting.space` sees it */
@@ -787,33 +676,30 @@ export interface SpaceHostingView {
787
676
  /** The host's key; null when it could not be reached */
788
677
  readonly host: string | null;
789
678
  /** How the space's subscription stands there, signed by the host; null when it could not be asked */
790
- readonly status: import('../session/hosting.js').HostStatus | null;
679
+ readonly status: HostStatus | null;
791
680
  /** Whether it keeps spaces for nothing: every subscription counts as paid there */
792
681
  readonly free: boolean;
793
- /** How the space's fund is added to there, by anyone in it; null on a free host, and on one that takes no communities */
794
- readonly fund: import('../session/hosting.js').FundOffer | null;
682
+ /** How the space's fund is added to there; null on a free host, or one that takes no communities */
683
+ readonly fund: FundOffer | null;
795
684
  /** Whether it sends reminders by email (`remindForSpace`) */
796
685
  readonly reminds: boolean;
797
686
  /** Whether it runs bots for the spaces it carries (`startBot`) */
798
687
  readonly runsBots: boolean;
799
- /** The bots it runs in this space, and whether each is running, as its signed status says */
800
- readonly bots: ReadonlyArray<import('../session/hosting.js').HostedBot>;
688
+ /** The bots it runs in this space, as its signed status says */
689
+ readonly bots: ReadonlyArray<HostedBot>;
801
690
  /** The services its bots can be connected to (spec 08 §3.1) */
802
- readonly connectors: ReadonlyArray<import('../session/hosting.js').HostConnectorOffer>;
691
+ readonly connectors: ReadonlyArray<HostConnectorOffer>;
803
692
  /** Why it could not be asked, when it couldn't */
804
693
  readonly error?: string;
805
694
  }
806
695
  export interface NodeAccount {
807
- /** The account's profile as its devices last set it. Null without an account key, or before any is set. */
696
+ /** The account's profile; null without an account key, or before one is set */
808
697
  profile(): Promise<AccountProfileView | null>;
809
- /** Renames the account on every device and app that opens it. Needs an account key. */
698
+ /** Renames the account everywhere. Needs an account key. */
810
699
  setName(name: string): Promise<AccountProfileView>;
811
700
  /**
812
- * Sets the account's picture on every device, and in every space it opens:
813
- * an image, already as small as it should be (the app resizes it). `null`
814
- * takes it away. `name` is the account's name as the app knows it, kept
815
- * with the picture when the registry has none yet (an app just connected,
816
- * before the registry has synced). Needs an account key.
701
+ * Sets the account's picture everywhere, already resized; `null` removes it.
702
+ * `name` is kept with it when the registry has no name yet. Needs an account key.
817
703
  */
818
704
  setAvatar(image: {
819
705
  bytes: Uint8Array;
@@ -826,27 +712,43 @@ export interface NodeAccount {
826
712
  bytes: Uint8Array;
827
713
  mime: string;
828
714
  } | null>;
829
- /** Revokes one of this account's keys, by DID, in the account registry. Needs an account key. `waitMs` as for a space's */
715
+ /** Revokes one of this account's keys in the account registry. Needs an account key. */
830
716
  revoke(key: string, options?: RevokeOptions): Promise<boolean>;
831
717
  }
832
718
  /** Someone in the account's contact list */
833
719
  export interface ContactView {
834
720
  /** Their account */
835
721
  readonly did: string;
836
- /** What you call them — yours to change; they never see it */
722
+ /** What you call them; they never see it */
837
723
  readonly name: string;
838
- /** The id of your space for two, where records wait and live messages reach them. Null when there is none. */
724
+ /** Your space for two with them, or null */
839
725
  readonly space: string | null;
840
726
  readonly note?: string;
841
727
  /** Their knocks are hidden, in every space and in your inbox */
842
728
  readonly blocked: boolean;
729
+ /** Their username, when you found them by it */
730
+ readonly username?: string;
843
731
  readonly updatedAt: string;
844
732
  }
733
+ /** An invite to a space a contact left for you in your space for two */
734
+ export interface SpaceInviteView {
735
+ /** Who left it */
736
+ readonly from: string;
737
+ /** The space it invites you to, and what it is called */
738
+ readonly space: string;
739
+ readonly name: string;
740
+ /** What `spaces.join` takes */
741
+ readonly invite: string;
742
+ /** The space for two it was left in, and its record there: what `join` takes */
743
+ readonly pairSpace: string;
744
+ readonly key: string;
745
+ readonly createdAt: string;
746
+ }
845
747
  /** A knock left for this account in a space both belong to, opened */
846
748
  export interface ContactRequest {
847
749
  /** The space it was left in */
848
750
  readonly space: string;
849
- /** Its record there — what `accept` takes */
751
+ /** Its record there: what `accept` takes */
850
752
  readonly key: string;
851
753
  /** The account asking */
852
754
  readonly from: string;
@@ -857,9 +759,9 @@ export interface ContactRequest {
857
759
  readonly pairSpace: string;
858
760
  readonly createdAt: string;
859
761
  }
860
- /** The account's contacts: each a private space for two, listed in the account's contacts space. Knowing a DID reaches nothing */
762
+ /** The account's contacts: each a private space for two, listed in the contacts space */
861
763
  export interface NodeContacts {
862
- /** The contacts space's id — null for a node not given it */
764
+ /** The contacts space's id, or null for a node not given it */
863
765
  space(): Promise<string | null>;
864
766
  /** Everyone in the list, blocked people too, by name */
865
767
  list(): Promise<ReadonlyArray<ContactView>>;
@@ -876,11 +778,8 @@ export interface NodeContacts {
876
778
  /** Leaves your space for two, and hides their knocks from now on */
877
779
  block(did: string): Promise<void>;
878
780
  /**
879
- * Asks someone in a space you share to add you: a space for two, and a
880
- * knock carrying its invite, sealed to their contact key and left there as
881
- * a `std.contact-request`. `carried` is whether a carrier held the space for two before
882
- * it went out (`spaces.carried`): when false, they can join only while one
883
- * of your devices is online.
781
+ * Asks someone in a shared space to add you: a space for two, its invite sealed
782
+ * to them as a `std.contact-request`. `carried`: whether a carrier held it first.
884
783
  */
885
784
  ask(spaceId: string, did: string, options?: {
886
785
  readonly note?: string;
@@ -889,12 +788,27 @@ export interface NodeContacts {
889
788
  readonly request: string;
890
789
  readonly carried: boolean;
891
790
  }>;
892
- /** Knocks left for this account in a space, opened — not from people blocked, and not ones already accepted */
791
+ /** Knocks left for this account in a space, except blocked and accepted ones */
893
792
  requests(spaceId: string): Promise<ReadonlyArray<ContactRequest>>;
894
793
  /** Joins the space for two a knock invites you to, and puts whoever asked on your list */
895
794
  accept(spaceId: string, requestKey: string): Promise<ContactView>;
896
- /** Accounts in your space for two besides the two of you: whoever the invite was passed on to */
795
+ /** Accounts in your space for two besides the two of you */
897
796
  others(did: string): Promise<ReadonlyArray<string>>;
797
+ /**
798
+ * Invites a contact into one of your spaces: an invite for `role` (as
799
+ * `spaces.invite` makes one), left in your space for two with them. Only a
800
+ * contact who has joined that space can be invited.
801
+ */
802
+ invite(did: string, spaceId: string, options?: {
803
+ readonly role?: string;
804
+ }): Promise<void>;
805
+ /**
806
+ * Invites your contacts left for you, to spaces you don't hold yet, newest
807
+ * first. Also closes invites of yours a contact has used, and deletes them.
808
+ */
809
+ invites(): Promise<ReadonlyArray<SpaceInviteView>>;
810
+ /** Joins the space an invite from a contact is for; its maker closes the invite once they see you there */
811
+ join(pairSpace: string, key: string): Promise<SpaceSummary>;
898
812
  }
899
813
  /** A direct message, opened (`node.direct`) */
900
814
  export interface DirectMessage {
@@ -904,7 +818,7 @@ export interface DirectMessage {
904
818
  readonly from: string;
905
819
  /** Who it is for, sorted, not counting `from` */
906
820
  readonly to: ReadonlyArray<string>;
907
- /** Null when this node can't open it: its member key here isn't the one it was sealed to */
821
+ /** Null when this node can't open it */
908
822
  readonly text: string | null;
909
823
  readonly createdAt: string;
910
824
  /** Written under a note that grants records only here, as `NodeRecord.recordsOnly` */
@@ -912,9 +826,9 @@ export interface DirectMessage {
912
826
  }
913
827
  /** Direct messages: text sealed to some members' member keys, in a private space (`docs/direct-messages.md`) */
914
828
  export interface NodeDirect {
915
- /** Who in the space can be written to: members who have published a member key, not you */
829
+ /** Members who published a member key, besides you */
916
830
  reachable(spaceId: string): Promise<ReadonlyArray<string>>;
917
- /** Seals text for these members and you, and writes it. Defines `std.direct` first when the space lacks it and you may. */
831
+ /** Seals text for these members and you, and writes it, defining `std.direct` when needed */
918
832
  send(spaceId: string, to: ReadonlyArray<string>, text: string): Promise<DirectMessage>;
919
833
  /** Every direct message in the space written by or to this account, oldest first */
920
834
  list(spaceId: string): Promise<ReadonlyArray<DirectMessage>>;
@@ -927,19 +841,22 @@ export interface InboxView {
927
841
  readonly name?: string;
928
842
  /** The inbox key's public half: knocks are sealed to it */
929
843
  readonly key: string;
930
- /** Its signing key's public half: it signs the code, and its hash is the mailbox topic */
844
+ /** Its signing key's public half, which signs the code */
931
845
  readonly sign: string;
932
846
  /** Mailboxes that hold its knocks */
933
847
  readonly places: ReadonlyArray<string>;
934
- /** The inbox code to hand out: put it in a link (`#inbox=…`) or a QR code */
848
+ /** The inbox code to hand out, in a link (`#inbox=…`) or a QR code */
935
849
  readonly code: string;
850
+ /** The username that leads to it, and when it lapses unless claimed again (ms) */
851
+ readonly username?: string;
852
+ readonly usernameUntil?: number;
936
853
  readonly updatedAt: string;
937
854
  }
938
855
  /** Someone knocking on your inbox, checked and opened */
939
856
  export interface KnockView {
940
857
  /** The knock's id, the same on every relay: what `accept` takes */
941
858
  readonly id: string;
942
- /** Their account — proven by their signature and note, not by what they say */
859
+ /** Their account, proven by signature and note */
943
860
  readonly from: string;
944
861
  /** The name they give; nothing vouches for it */
945
862
  readonly name: string;
@@ -955,25 +872,35 @@ export interface SentKnockView {
955
872
  readonly space: string;
956
873
  /** The name their inbox code gave */
957
874
  readonly name: string;
875
+ /** The username you knocked on, when it was one */
876
+ readonly username?: string;
958
877
  readonly at: string;
959
878
  }
960
- /** The inbox: how people you share no space with ask to become your contact, without your DID becoming an address (`spec/07-inbox.md`) */
879
+ /** The inbox: how people you share no space with ask to become your contact (`spec/07-inbox.md`) */
961
880
  export interface NodeInbox {
962
881
  /** Your inbox, or null until it is opened */
963
882
  get(): Promise<InboxView | null>;
964
- /** Opens your inbox, or changes where its knocks wait (1–3 mailboxes) and the name its code gives (default: the account's). Its code stays the same inbox. */
883
+ /** Opens your inbox, or changes its mailboxes (1–3) and the name its code gives */
965
884
  open(options?: {
966
885
  readonly places?: ReadonlyArray<string>;
967
886
  readonly name?: string;
968
887
  }): Promise<InboxView>;
969
- /** Replaces your inbox with a new one: codes for the old one lead nowhere, and nothing ties the two together */
888
+ /** Replaces your inbox: codes for the old one lead nowhere */
970
889
  rotate(): Promise<InboxView>;
971
- /** Clears every knock waiting in your inbox — one someone flooded — and keeps it open */
890
+ /** Clears every knock waiting in your inbox, and keeps it open */
972
891
  clear(): Promise<void>;
973
892
  /**
974
- * Knocks on someone's inbox (a code or a link): a space for two, its invite
975
- * left in their mailboxes until they join or two weeks pass. `carried` as
976
- * for `contacts.ask`.
893
+ * Claims a username (`leif@minca.social`) for your inbox on its domain's
894
+ * name service, opening the inbox first if need be. The name follows the
895
+ * inbox: replacing it, or changing its name or mailboxes, points the name at
896
+ * the new code, and it is renewed before it lapses.
897
+ */
898
+ claim(username: string): Promise<InboxView>;
899
+ /** Gives your username up: it leads nowhere, and anyone may claim it */
900
+ release(): Promise<InboxView>;
901
+ /**
902
+ * Knocks on someone's inbox, by its code, a link, or a username, with a
903
+ * space for two; `carried` as for `contacts.ask`
977
904
  */
978
905
  knock(code: string, options?: {
979
906
  readonly note?: string;
@@ -981,13 +908,13 @@ export interface NodeInbox {
981
908
  readonly space: string;
982
909
  readonly carried: boolean;
983
910
  }>;
984
- /** Knocks waiting in your inbox, checked; also turns knocks of yours that someone joined into contacts */
911
+ /** Knocks waiting in your inbox; also turns your knocks someone joined into contacts */
985
912
  knocks(): Promise<ReadonlyArray<KnockView>>;
986
913
  /** Knocks you left that nobody has joined yet */
987
914
  sent(): Promise<ReadonlyArray<SentKnockView>>;
988
915
  /** Joins the space for two a knock invites you to, and puts whoever knocked on your list */
989
916
  accept(id: string): Promise<ContactView>;
990
- /** Lets a knock go without blocking whoever knocked: cleared from the mailboxes, on every device */
917
+ /** Lets a knock go without blocking whoever knocked */
991
918
  dismiss(id: string): Promise<void>;
992
919
  }
993
920
  export interface P2PNode {
@@ -1014,13 +941,12 @@ export interface P2PNode {
1014
941
  readonly inbox: NodeInbox;
1015
942
  /** The delegation the session key currently writes under (root → session) */
1016
943
  delegation(): Delegation;
1017
- /** ICE servers for the app's own WebRTC, like a call's: the configured ones, and a relay's TURN servers */
944
+ /** ICE servers for the app's own WebRTC: the configured ones, and a relay's TURN servers */
1018
945
  iceServers(): Promise<ReadonlyArray<RTCIceServer>>;
1019
946
  /** Relays and connections, for showing why a peer is or is not there */
1020
947
  readonly network: NodeNetwork;
1021
948
  /**
1022
- * The same node acting as an agent: signed "via agent", only in the spaces
1023
- * its note names, refusing what needs a person (`node/api.ts`).
949
+ * The same node acting as an agent, only in the spaces its note names (`node/api.ts`).
1024
950
  * @throws When the note is not an agent's, has run out, or is not made out to `keys`
1025
951
  */
1026
952
  asAgent(agent: {
@@ -1029,19 +955,13 @@ export interface P2PNode {
1029
955
  }): Promise<P2PNode>;
1030
956
  subscribe(listener: (event: NodeEvent) => void): () => void;
1031
957
  /**
1032
- * Revokes a key of this account, each revoke with a cutoff at what the key
1033
- * wrote: in `spaces`, or by default everywhere the account writes — every
1034
- * space it lists, its carry spaces, its contacts space and its registry.
1035
- * True once a peer has taken each in, or at once without `waitMs`.
958
+ * Revokes a key of this account in `spaces`, or everywhere the account writes.
959
+ * True once a peer took each in, or at once without `waitMs`.
1036
960
  */
1037
961
  revokeKey(key: string, options?: RevokeOptions & {
1038
962
  readonly spaces?: ReadonlyArray<string>;
1039
963
  }): Promise<boolean>;
1040
- /**
1041
- * Revokes this node's own session key everywhere (`revokeKey`); a lasting
1042
- * key is forgotten at once, so the next session signs with a new one. For
1043
- * signing out.
1044
- */
964
+ /** Revokes this node's own key everywhere and forgets a lasting one: for signing out */
1045
965
  revokeSelf(options?: RevokeOptions): Promise<void>;
1046
966
  close(): Promise<void>;
1047
967
  }