@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
package/docs/node.md CHANGED
@@ -239,13 +239,13 @@ node makes a key for this run as it would without a source.
239
239
  write fails until the page reloads, since signing on would fork the line
240
240
  and withdraw what the key wrote. A slot whose connection the browser
241
241
  closed opens again only while it still holds the key.
242
- - The CLI keeps them outside its home, in `<local>/writers/slot-<n>/` (`localPath` in `packages/cli/src/home.ts`, [sync and storage](storage.md#data-folders)): the key as
242
+ - The CLI keeps them outside its home, in `<local>/writer-keys/slot-<n>/` (`localPath` in `packages/cli/src/home.ts`, [sync and storage](storage.md#data-folders)): the key as
243
243
  JWK in an envelope (spec 01 §9.1) under the account's local key, with label
244
244
  `minca/writer-key/v1` and bound `{ did: <account DID>, slot: <n> }`
245
245
  (`key.sealed`, mode 600), so a copy of the files can't sign, and a key file
246
246
  moved to another slot or account is refused rather than used; its places in
247
- `heads/`; and a `lock` file naming the process that holds it, taken over
248
- once that process is gone.
247
+ `heads/`; and numbered `lock.<n>` files naming the process that holds the
248
+ highest, taken over once that process is gone.
249
249
 
250
250
  _Source: `packages/core/src/node/writer-keys.ts` (`browserWriterKeys`), `packages/core/src/node/writers.ts` (`createWriters`), `packages/core/src/node/node.ts` (`createNode`, `revokeSelf`), `packages/core/src/node/stores.ts` (`writerKeysFor`), `packages/core/src/node/worker.ts` (`withWriterKey`), `packages/cli/src/writer-keys.ts` (`fileWriterKeys`), `packages/cli/src/home.ts` (`unlock`, `nodeFor`). Tests: `packages/core/tests/writer-logs.test.ts` ("a writer key that outlives the node"), `packages/cli/tests/writer-keys.test.ts` ("a key file moved to another slot, or to another account, does not open")._
251
251
 
@@ -328,7 +328,7 @@ spaces cannot be left.
328
328
 
329
329
  `contacts.remove` and `contacts.block` leave the space for two this way.
330
330
 
331
- _Source: `packages/core/src/node/node.ts` (`spaces.leave`, `giveUpPlace`, `forget`, `LEAVE_WAIT_MS`), `packages/core/src/node/space-runtime.ts` (`giveUpPlace`). Tests: `packages/core/tests/key-change.test.ts` ("leaving a private space"), `packages/core/tests/contacts.test.ts` ("removing a contact gives up your place"), `packages/core/tests/node.test.ts` ("the account registry"), `packages/core/tests/carrier.test.ts` ("its carry space cannot be left…")._
331
+ _Source: `packages/core/src/node/node.ts` (`spaces.leave`, `giveUpPlace`, `forget`, `LEAVE_WAIT_MS`), `packages/core/src/node/space-membership.ts` (`giveUpPlace`), `packages/core/src/node/space-peers.ts` (`writeUntilStored`). Tests: `packages/core/tests/key-change.test.ts` ("leaving a private space"), `packages/core/tests/contacts.test.ts` ("removing a contact gives up your place"), `packages/core/tests/node.test.ts` ("the account registry"), `packages/core/tests/carrier.test.ts` ("its carry space cannot be left…")._
332
332
 
333
333
  ## Holding part of a space
334
334
 
@@ -381,7 +381,7 @@ with to do it.
381
381
  The account registry, the contacts space and carry spaces are always held
382
382
  whole. Apps connected to an account home use `cache: {}` by default ([the app-side client](#the-app-side-client)).
383
383
 
384
- _Source: `packages/core/src/node/space-runtime.ts` ("Holding part of the space"), `packages/core/src/node/types.ts` (`CacheConfig`). Tests: `packages/core/tests/caches.test.ts`, `packages/core/tests/reconcile.test.ts` ("holding part of a space")._
384
+ _Source: `packages/core/src/node/space-holding.ts` (`openSpaceHolding`), `packages/core/src/node/types.ts` (`CacheConfig`). Tests: `packages/core/tests/caches.test.ts`, `packages/core/tests/reconcile.test.ts` ("holding part of a space")._
385
385
 
386
386
  ### Planned: caches that widen and trim
387
387
 
@@ -461,7 +461,7 @@ invite record has not reached this device yet, the space is held with
461
461
  then deletes the `sys.joined` record, closes the space and forgets it with its
462
462
  key ([leaving a space](#leaving-a-space)).
463
463
 
464
- _Source: `packages/core/src/node/node.ts` (`reconcileOnce`, `remember`, `forget`, `finishJoining`, `publishProfile`, `spaces`), `packages/core/src/space/space-manager.ts`. Tests: `packages/core/tests/node.test.ts` ("the account registry"), `packages/core/tests/profiles.test.ts`, `packages/core/tests/space-access.test.ts`._
464
+ _Source: `packages/core/src/node/node.ts` (`reconcileOnce`, `remember`, `forget`, `finishJoining`, `spaces`), `packages/core/src/node/node-contacts.ts` (`publishProfile`), `packages/core/src/space/space-manager.ts`. Tests: `packages/core/tests/node.test.ts` ("the account registry"), `packages/core/tests/profiles.test.ts`, `packages/core/tests/space-access.test.ts`._
465
465
 
466
466
  ## Events
467
467
 
@@ -552,7 +552,7 @@ A received live message is emitted as a `message` event,
552
552
  > Rationale: a peer's key does not say whose it is, but only the account's own
553
553
  > devices and apps can read its registry, so a peer there is one of ours.
554
554
 
555
- _Source: `packages/core/src/node/node.ts` (`spaces.send`, `spaces.status`), `packages/core/src/node/space-runtime.ts` ("Live messages", `status`, `send`). Tests: `packages/core/tests/live.test.ts`._
555
+ _Source: `packages/core/src/node/node.ts` (`spaces.send`, `spaces.status`), `packages/core/src/node/space-peers.ts` (`send`, `onLive`), `packages/core/src/node/space-runtime.ts` (`status`). Tests: `packages/core/tests/live.test.ts`._
556
556
 
557
557
  ## The rest of the node's surface
558
558
 
@@ -616,7 +616,7 @@ successors, mine, heads, key, relays, keepers, copies, forks, flagged }`
616
616
  accepting also need whole-account access.
617
617
  - `node.carriers`, `node.hosting`, `node.notifications` — [carriers and hosting](#carriers-hosting-and-notifications), [spec 06 §4](https://github.com/leifriksheim/minca/blob/main/spec/06-nodes-and-sessions.md).
618
618
  - `node.iceServers()` — the configured ICE servers plus TURN servers a relay
619
- offers ([the network](#the-network)); what [calls](calls.md#connections) use.
619
+ offers ([the network](#the-network)); what [calls](../../calls/README.md#connections) use.
620
620
  - `node.network` — `status()`: each relay's state (open, or waiting to redial,
621
621
  when and why), the connections open and those still being made, and whether
622
622
  a relay offered TURN; `reconnect()` redials a waiting relay now
@@ -624,7 +624,7 @@ successors, mine, heads, key, relays, keepers, copies, forks, flagged }`
624
624
  Local only: nothing here goes over the wire.
625
625
  - `node.asAgent({ keys, note })` — [acting as an agent](#a-node-acting-as-an-agent).
626
626
 
627
- _Source: `packages/core/src/node/types.ts`, `packages/core/src/node/node.ts` (`spaces`), `packages/core/src/node/space-runtime.ts` (`access`, `may`, `holdsRole`, `defineRole`, `assign`, `removeAccount`), `packages/core/src/space/roles.ts` (`holdsRole`). Tests: `packages/core/tests/roles.test.ts` ("holding what a role gives"), `packages/core/tests/node.test.ts`, `packages/core/tests/space-access.test.ts`, `packages/core/tests/contacts.test.ts`, `packages/core/tests/direct.test.ts`, `packages/core/tests/profiles.test.ts`._
627
+ _Source: `packages/core/src/node/types.ts`, `packages/core/src/node/node.ts` (`spaces`), `packages/core/src/node/space-membership.ts` (`access`, `may`, `holdsRole`, `defineRole`, `assign`, `removeAccount`), `packages/core/src/space/roles.ts` (`holdsRole`). Tests: `packages/core/tests/roles.test.ts` ("holding what a role gives"), `packages/core/tests/node.test.ts`, `packages/core/tests/space-access.test.ts`, `packages/core/tests/contacts.test.ts`, `packages/core/tests/direct.test.ts`, `packages/core/tests/profiles.test.ts`._
628
628
 
629
629
  ## The network
630
630
 
@@ -655,11 +655,12 @@ says hello back in a room at most once every 10 s; one due sooner waits
655
655
  for the 10 s, once for everyone who said hello meanwhile. Each socket
656
656
  sends at most 20 messages a second, in bursts of 40, and queues the rest. A
657
657
  connection attempt that times out is retried on the peer's next hello. `requestIce`
658
- asks every connected relay for TURN. Each WebRTC offer or answer waits for
659
- ICE gathering to finish, or 2 s, and carries what it found.
658
+ asks every connected relay whose kind can hand out TURN passwords. Each WebRTC
659
+ offer or answer waits for ICE gathering to finish, or 2 s, and carries what it
660
+ found.
660
661
 
661
662
  **Kinds of relay** (spec 04 §1.2). `network.relays` may mix kinds:
662
- `['wss://minca.fly.dev', 'nostr+wss://relay.damus.io']`. A relay of a kind
663
+ `['wss://relay.minca.social', 'nostr+wss://relay.damus.io']`. A relay of a kind
663
664
  this library doesn't speak is left out of `network.status()`. On a Nostr
664
665
  relay, each event is signed with a key made for it and forgotten.
665
666
 
@@ -695,12 +696,12 @@ configured servers plus the TURN servers relays offered, the latter only while
695
696
  `expiresAt` is in the future. `node.iceServers()` returns the same list for
696
697
  the application's own connections (a call's). Before answering it refreshes:
697
698
  if any relay is connected and the TURN passwords held are missing or expire
698
- within 10 minutes, and it has not asked in the last 10 minutes, it sends `ice`
699
- to every connected relay and waits up to 1.5 s for an answer (relays without
699
+ within 10 minutes, and it has not asked in the last 10 minutes, it asks every
700
+ connected relay that can and waits up to 1.5 s for an answer (relays without
700
701
  TURN never answer), then returns what it has. A node with no relays returns
701
702
  the configured servers.
702
703
 
703
- _Source: `packages/core/src/network/relay-socket.ts` (`createRelaySocket`, `RelayStatus`), `packages/core/src/network/rendezvous.ts` (`createRendezvous`, `HELLO_MS`, `release`), `packages/core/src/network/relay-nostr.ts`, `packages/core/src/network/rtc-transport.ts` (`GATHER_MS`), `packages/core/src/network/ws-transport.ts`, `packages/core/src/network/local-transport.ts` (`createLocalHub`), `packages/core/src/node/carrier.ts` (`carry`), `packages/core/src/network/mesh.ts` (`CONNECT_TIMEOUT_MS`, `closeIfIdle`, `iceServers`, `ICE_REFRESH_MS`, `ICE_WAIT_MS`), `packages/core/src/network/introductions.ts` (`createSeenSignals`), `packages/core/src/network/rtc-transport.ts` (`DEFAULT_ICE_SERVERS`), `packages/core/src/node/space-runtime.ts` (`nameRelays`), `packages/core/src/node/node.ts` (`iceServers`), `packages/cli/src/serve.ts` (`onPeer`). Tests: `packages/core/tests/relay-socket.test.ts`, `packages/core/tests/rendezvous.test.ts`, `packages/core/tests/relay-nostr.test.ts`, `packages/core/tests/introductions.test.ts`, `packages/core/tests/space-relays.test.ts`, `packages/core/tests/ws-transport.test.ts`, `packages/core/tests/carrier.test.ts`; the client-side ICE refresh is untested._
704
+ _Source: `packages/core/src/network/relay-socket.ts` (`createRelaySocket`, `RelayStatus`), `packages/core/src/network/rendezvous.ts` (`createRendezvous`, `HELLO_MS`, `release`), `packages/core/src/network/relay-nostr.ts`, `packages/core/src/network/rtc-transport.ts` (`GATHER_MS`), `packages/core/src/network/ws-transport.ts`, `packages/core/src/network/local-transport.ts` (`createLocalHub`), `packages/core/src/node/carrier.ts` (`carry`), `packages/core/src/network/mesh.ts` (`CONNECT_TIMEOUT_MS`, `closeIfIdle`, `iceServers`, `ICE_REFRESH_MS`, `ICE_WAIT_MS`), `packages/core/src/network/introductions.ts` (`createSeenSignals`), `packages/core/src/network/rtc-transport.ts` (`DEFAULT_ICE_SERVERS`), `packages/core/src/node/space-keys.ts` (`nameRelays`), `packages/core/src/node/node.ts` (`iceServers`), `packages/cli/src/serve.ts` (`onPeer`). Tests: `packages/core/tests/relay-socket.test.ts`, `packages/core/tests/rendezvous.test.ts`, `packages/core/tests/relay-nostr.test.ts`, `packages/core/tests/introductions.test.ts`, `packages/core/tests/space-relays.test.ts`, `packages/core/tests/ws-transport.test.ts`, `packages/core/tests/carrier.test.ts`; the client-side ICE refresh is untested._
704
705
 
705
706
  ## A node acting as an agent
706
707
 
@@ -734,7 +735,7 @@ account's knocks, in shared spaces and in its inbox ([inbox.md](inbox.md)).
734
735
 
735
736
  Which of these each method of the node is — passed through, held to the note's spaces, or refused — is one table, `API` in `packages/core/src/node/api.ts`; a new method does not type-check until it is decided there. The same table lists what `remoteNode` forwards.
736
737
 
737
- _Source: `packages/core/src/node/node.ts` (`asAgent`), `packages/core/src/node/api.ts` (`API`). Tests: `packages/core/tests/records-only.test.ts` ("an agent acting for a person"), `packages/core/tests/remote.test.ts` ("no agent is started across the port…")._
738
+ _Source: `packages/core/src/node/node-records.ts` (`startAgent`), `packages/core/src/node/api.ts` (`API`). Tests: `packages/core/tests/records-only.test.ts` ("an agent acting for a person"), `packages/core/tests/remote.test.ts` ("no agent is started across the port…")._
738
739
 
739
740
  ## The app-side client
740
741
 
@@ -908,7 +909,13 @@ genesis and any invite opened before the call. It says whether it was: false
908
909
  at once when no carrier is connected. `contacts.ask` and `inbox.knock` wait on it before the knock goes
909
910
  out, and pass what it said on as `carried`, for the app to tell the person.
910
911
 
911
- _Source: `packages/core/src/node/node.ts` (`spaces.carried`, `makePair`). Tests: `packages/core/tests/carrier.test.ts` ("a space made just now, carried before its invite goes out…", "carried is false at once with no carrier…")._
912
+ `node.spaces.reached(spaceId, peer, waitMs)` is the same wait for one peer
913
+ named by its key, such as an app's key from the request it connected with:
914
+ true once that peer holds all this node does of the space, false when
915
+ `waitMs` (at most a minute) passed first or the peer never came. For a node about to close,
916
+ like a connect page waiting for the app to have what it wrote.
917
+
918
+ _Source: `packages/core/src/node/node.ts` (`spaces.carried`, `spaces.reached`), `packages/core/src/node/node-contacts.ts` (`makePair`). Tests: `packages/core/tests/carrier.test.ts` ("a space made just now, carried before its invite goes out…", "carried is false at once with no carrier…"), `packages/core/tests/usernames.test.ts` ("spaces.reached is true once a peer holds the space…")._
912
919
 
913
920
  **The account's own automations.** `node.automations` (needs the account
914
921
  key) lists, adds, updates (`name`, `paused`) and removes the account's own
@@ -974,7 +981,7 @@ hour (`evaluate`) holds each to the free line. Past a space's `until`, every
974
981
  account's carry space stops carrying it (`skip`, in `createCarryCore`), while
975
982
  its own subscription still may. Each change is a line in the host's log.
976
983
 
977
- _Source: `packages/core/src/node/node.ts` (`carriers`, `notifications`, `hosting`), `packages/core/src/node/carrier.ts` (`arrived`, `skip`, `onArrived`), `packages/core/src/node/host.ts` (`evaluate`), `packages/core/src/session/hosting.ts`, `packages/cli/src/host.ts`. Tests: `packages/core/tests/carrier.test.ts`, `packages/core/tests/host-limits.test.ts`, `packages/cli/tests/host.test.ts`._
984
+ _Source: `packages/core/src/node/node-carriers.ts` (`carriers`), `packages/core/src/node/node-hosting.ts` (`hosting`), `packages/core/src/node/carrier.ts` (`arrived`, `skip`, `onArrived`), `packages/core/src/node/host.ts` (`evaluate`), `packages/core/src/session/hosting.ts`, `packages/cli/src/host.ts`. Tests: `packages/core/tests/carrier.test.ts`, `packages/core/tests/host-limits.test.ts`, `packages/cli/tests/host.test.ts`._
978
985
 
979
986
  ### A space paying for itself
980
987
 
@@ -1016,7 +1023,7 @@ has, so it keeps that, unreadable, for as long as the space's subscription is
1016
1023
  paid, and what is in the fund stays there
1017
1024
  ([#220](https://github.com/leifriksheim/minca/issues/220)).
1018
1025
 
1019
- _Source: `packages/core/src/node/node.ts` (`keepSpaceHosts`, `askSpaceHost`, `hosting.space`), `packages/core/src/session/hosting.ts` (`describeHost`, `HostError`). Tests: `packages/cli/tests/host.test.ts` ("a space paying for itself", "an address that is not a host, or one that is down", "bots a host runs": the two on stopping a space's host)._
1026
+ _Source: `packages/core/src/node/node-hosting.ts` (`keepSpaceHosts`, `askSpaceHost`, `hosting.space`), `packages/core/src/session/hosting.ts` (`describeHost`, `HostError`). Tests: `packages/cli/tests/host.test.ts` ("a space paying for itself", "an address that is not a host, or one that is down", "bots a host runs": the two on stopping a space's host)._
1020
1027
 
1021
1028
  ## The inbox
1022
1029
 
@@ -1024,19 +1031,21 @@ _Source: `packages/core/src/node/node.ts` (`keepSpaceHosts`, `askSpaceHost`, `ho
1024
1031
 
1025
1032
  | Call | Does |
1026
1033
  | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1027
- | `get()` | Your inbox, or null until opened: `{ gen, name?, key, sign, places, code, updatedAt }`. `code` is signed afresh each time; what it says stays the same |
1034
+ | `get()` | Your inbox, or null until opened: `{ gen, name?, key, sign, places, code, username?, usernameUntil?, updatedAt }`. `code` is signed afresh each time; what it says stays the same |
1028
1035
  | `open({ places?, name? })` | Opens your inbox, or changes where its knocks wait and the name it gives. Places default to the current ones, else this node's relays (up to 3); name to the current one, else the account's |
1029
1036
  | `rotate()` | Clears the inbox and replaces it with `gen + 1`: the old code leads nowhere |
1030
1037
  | `clear()` | Purges every knock waiting, from every mailbox it names |
1031
- | `knock(code, { note? })` | [the exchange](inbox.md#the-exchange), returns `{ space, carried }` |
1038
+ | `claim(username)` | Claims a username for your inbox on its domain's name service ([usernames.md](usernames.md)), opening the inbox if need be; one at a time. It follows the inbox: `rotate` and `open` point it at the new code, and `knocks` renews it a month before it lapses |
1039
+ | `release()` | Gives the username up: it leads nowhere |
1040
+ | `knock(code, { note? })` | by a code, a link or a username: [the exchange](inbox.md#the-exchange), returns `{ space, carried }` |
1032
1041
  | `knocks()` | Fetches the inbox's topic from every mailbox it names, opens and checks ([spec 07 §6](https://github.com/leifriksheim/minca/blob/main/spec/07-inbox.md); opened results are cached by id), settles sent knocks; returns `{ id, from, name, note?, pairSpace, at }`, newest first |
1033
- | `sent()` | Your knocks nobody has joined yet: `{ space, name, at }` |
1042
+ | `sent()` | Your knocks nobody has joined yet: `{ space, name, username?, at }` |
1034
1043
  | `accept(id)` | [the exchange](inbox.md#the-exchange), returns the new `ContactView` |
1035
1044
  | `dismiss(id)` | Purges one knock |
1036
1045
 
1037
1046
  ## Client conveniences
1038
1047
 
1039
- These are not protocol; another client may draw sign-in and [calls](calls.md) however it
1048
+ These are not protocol; another client may draw sign-in and [calls](../../calls/README.md) however it
1040
1049
  likes.
1041
1050
 
1042
1051
  - **`<minca-auth>`** draws the flow of [sign-in](sign-in.md) into its own light DOM (so password
@@ -1046,11 +1055,12 @@ likes.
1046
1055
  `element.auth = createMincaAuth(…)`. It sizes to its container, so it fits a
1047
1056
  page, a modal or a side panel, and draws nothing once someone is in. Colours,
1048
1057
  font and radius are custom properties (`--minca-accent`, `--minca-font`, …).
1049
- - **React** (`@minca/core/react`): `MincaProvider`, `useMinca`,
1058
+ - **React** (`@minca/react`): `MincaProvider`, `useMinca`,
1050
1059
  `useAuth`, `useSession`, `useConnection`, `useAccount`, `useNode`,
1051
1060
  `<MincaAuth>`, `useQuery`, `useLive`, `useSpaces`,
1052
1061
  `useHoldSpace` (holds a space while mounted, releasing it a few seconds late),
1053
1062
  `useRecord`, `useLinked`, `useCollections`, `useProfiles`, `useAccess`,
1054
- `useSpaceStatus`, `useCan`, `CallsProvider`, `useCalls`.
1063
+ `useSpaceStatus`, `useCan`. Calls' `CallsProvider` and `useCalls` are in
1064
+ `@minca/calls/react`.
1055
1065
 
1056
- _Source: `packages/core/src/elements/minca-auth.ts`, `packages/core/src/react/`. Tests: none._
1066
+ _Source: `packages/core/src/elements/minca-auth.ts`, `packages/react/src/`. Tests: none._
@@ -68,7 +68,7 @@ await node.records.get(space.id, hers);
68
68
  `lineKey(account, collection)` (exported by `@minca/core`), an
69
69
  owned key of the account's.
70
70
 
71
- _Source: `packages/core/src/records/key.ts`, `packages/core/src/node/space-runtime.ts` (`keyToWrite`, `keepsCollection`, `put`, `keyFor`, `onePerKey`). Tests: `packages/core/tests/record-keys.test.ts`, `packages/core/tests/versions.test.ts` ("a deleted key can be written again…")._
71
+ _Source: `packages/core/src/records/key.ts`, `packages/core/src/node/space-writing.ts` (`keyToWrite`, `keepsCollection`, `put`, `onePerKey`), `packages/core/src/node/space-runtime.ts` (`keyFor`). Tests: `packages/core/tests/record-keys.test.ts`, `packages/core/tests/versions.test.ts` ("a deleted key can be written again…")._
72
72
 
73
73
  ## Links
74
74
 
package/docs/sign-in.md CHANGED
@@ -54,34 +54,34 @@ _Source: `packages/core/src/identity/account-store.ts`. Tests: `packages/core/te
54
54
  | `create` | Name a new account. |
55
55
  | `recovery` | Signed in; `freshCode` is the recovery code to keep safe. |
56
56
  | `unlock` | Signed in; choose a passkey or a password. Required. |
57
- | `pod` | Signed in; a new account is offered a pod. Optional, and skipped with `offerPod: false`. |
57
+ | `pod` | Signed in; a new account with no host is offered a pod. Optional, and skipped with `offerPod: false`. |
58
58
  | `pair` | Opened from a phone-pairing link ([01](https://github.com/leifriksheim/minca/blob/main/spec/01-identity.md)). |
59
59
  | `ready` | Signed in; `session` is set. |
60
60
 
61
61
  Transitions:
62
62
 
63
- | From | Action | To |
64
- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
65
- | `starting` | `start()`, a kept sign-in for an account in the place ([the session a sign-in starts](#the-session-a-sign-in-starts)) | `ready`, or `pair` (signed in) with a pairing ticket in the URL |
66
- | `starting` | `start()`, no kept sign-in and a pairing ticket in the URL | `pair` |
67
- | `starting` | `start()`, otherwise | `signIn` if the place has accounts, else `welcome` |
68
- | `starting` | `start()` fails | `welcome` (with `error`) |
69
- | any | `showWelcome()` / `showExisting()` / `showRestore()` / `showSignIn()` | `welcome` / `existing` / `restore` / `signIn` |
70
- | `welcome`, `existing`, `signIn` | `choosePod()` / `useBrowser()` while signed out | `signIn` or `welcome` |
71
- | `welcome` | `reopenPod()`, from a click, with `podToReopen` set | `ready` with a kept sign-in for an account there, else `signIn` or `welcome` |
72
- | `ready` | `choosePod()` while signed in | `ready`, with `podChoice` set; `confirmPod('combine' \| 'switch')` restarts the session in the pod |
73
- | `pod` | `choosePod()` | `ready`: the new account moves into the pod without asking, and its browser copy is removed |
74
- | `pod` | `finishSetup()` | `ready` |
75
- | `welcome`, `existing`, `signIn` | `startCreating()` | `create` |
76
- | `signIn` | `signInWithPassword` / `signInWithPasskey` succeeds | `ready` |
77
- | `signIn`, `restore` | `signInWithCode` (or a recovery code given to `signInWithPassword`) succeeds | `ready` if the account has a usable passkey or a password here; else `unlock` with `setup: 'restored'` |
78
- | `create` | `createAccount(name)` | `recovery`, with `session`, `freshCode` and `setup: 'new'` set |
79
- | `recovery` | `codeSaved()` | `unlock` |
80
- | `unlock` | `addPasskey()` / `setPassword(p)` succeeds | `pod` for a new account in a browser that can open folders, unless `offerPod` is false; else `ready` |
81
- | `pair` | `acceptPairing()` | once the computer confirms the code, `unlock` with `setup: 'paired'` if the account has no way in here, else `ready`; signed in to another, `pair` with `pairingArrival` |
82
- | `pair` | `answerPairing(true)` / `answerPairing(false)` | as `acceptPairing()` signed out / `ready`, the account signed in kept |
83
- | `pair` | `dismissPairing()` | `ready` if signed in, else `signIn` / `welcome` |
84
- | `ready` | `signOut()` | `starting`, then `signIn` / `welcome` |
63
+ | From | Action | To |
64
+ | ------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
65
+ | `starting` | `start()`, a kept sign-in for an account in the place ([the session a sign-in starts](#the-session-a-sign-in-starts)) | `ready`, or `pair` (signed in) with a pairing ticket in the URL |
66
+ | `starting` | `start()`, no kept sign-in and a pairing ticket in the URL | `pair` |
67
+ | `starting` | `start()`, otherwise | `signIn` if the place has accounts, else `welcome` |
68
+ | `starting` | `start()` fails | `welcome` (with `error`) |
69
+ | any | `showWelcome()` / `showExisting()` / `showRestore()` / `showSignIn()` | `welcome` / `existing` / `restore` / `signIn` |
70
+ | `welcome`, `existing`, `signIn` | `choosePod()` / `useBrowser()` while signed out | `signIn` or `welcome` |
71
+ | `welcome` | `reopenPod()`, from a click, with `podToReopen` set | `ready` with a kept sign-in for an account there, else `signIn` or `welcome` |
72
+ | `ready` | `choosePod()` while signed in | `ready`, with `podChoice` set; `confirmPod('combine' \| 'switch')` restarts the session in the pod |
73
+ | `pod` | `choosePod()` | `ready`: the new account moves into the pod without asking, and its browser copy is removed |
74
+ | `pod` | `finishSetup()` | `ready` |
75
+ | `welcome`, `existing`, `signIn` | `startCreating()` | `create` |
76
+ | `signIn` | `signInWithPassword` / `signInWithPasskey` succeeds | `ready` |
77
+ | `signIn`, `restore` | `signInWithCode` (or a recovery code given to `signInWithPassword`) succeeds | `ready` if the account has a usable passkey or a password here; else `unlock` with `setup: 'restored'` |
78
+ | `create` | `createAccount(name, { username? })` | `recovery`, with `session`, `freshCode` and `setup: 'new'` set |
79
+ | `recovery` | `codeSaved()` | `unlock` |
80
+ | `unlock` | `addPasskey()` / `setPassword(p)` succeeds | `ready` for a new account with a host (the first of `network.hosts`), which is handed the spaces in the background (`settled()`); else `pod` in a browser that can open folders, unless `offerPod` is false; else `ready` |
81
+ | `pair` | `acceptPairing()` | once the computer confirms the code, `unlock` with `setup: 'paired'` if the account has no way in here, else `ready`; signed in to another, `pair` with `pairingArrival` |
82
+ | `pair` | `answerPairing(true)` / `answerPairing(false)` | as `acceptPairing()` signed out / `ready`, the account signed in kept |
83
+ | `pair` | `dismissPairing()` | `ready` if signed in, else `signIn` / `welcome` |
84
+ | `ready` | `signOut()` | `starting`, then `signIn` / `welcome` |
85
85
 
86
86
  A pod this site used last opens at `start()` only while the browser still
87
87
  grants it. Chrome keeps the folder's handle between visits, but not the
@@ -99,6 +99,17 @@ while it runs, or a carrier given the folder. A page that closes once signed
99
99
  in, such as an account home's connect page, passes `offerPod: false`, and
100
100
  offers the pod where the person comes back instead.
101
101
 
102
+ With `usernames: '<domain>'`, the create screen asks for a username alone,
103
+ the account's name taken from it, and `createAccount` claims it in the
104
+ background ([usernames.md](usernames.md#on-the-node)).
105
+
106
+ With `network.hosts`, a new account is kept online with the first of them as
107
+ it is made, with nothing to choose: `hosting.use` in the background, only
108
+ when the host keeps accounts with nothing paid (`free`, or `limits`), tried
109
+ once more if it doesn't answer. Failing that, the account stays in this
110
+ browser, and is kept online from the account page later. `settled()`
111
+ resolves once this and any username claim are done.
112
+
102
113
  _Source: `packages/core/src/session/auth.ts` (`start`, `reopenPod`), `packages/core/src/session/places.ts` (`podToReopen`). Tests: `packages/core/tests/auth.test.ts`, `packages/core/tests/take-up.test.ts` ("a pod the browser wants a click to open again")._
103
114
 
104
115
  ## Ways in
@@ -145,8 +156,8 @@ _Source: `packages/core/src/session/auth.ts`, `packages/core/src/session/credent
145
156
  Being signed in is no proof anyone is there: a page may be left open, and a
146
157
  sign-in kept for days. So whatever hands out the whole account, or changes how
147
158
  it signs in, asks again. `auth.recoveryCode()` returns the code,
148
- `auth.offerToPhone()` starts, `setPassword`, `addPasskey` and
149
- `removeShortcut` work (outside the first setup of an account just made,
159
+ `auth.offerToPhone()` starts, `setPassword`, `addPasskey`,
160
+ `removeShortcut` and `removeAccount` work (outside the first setup of an account just made,
150
161
  restored or paired, which only landing a session opens), only within five
151
162
  minutes of `auth.confirm(proof)` succeeding for the account signed in now
152
163
  (`isConfirmed()` says whether it has), where `proof` is
@@ -270,6 +281,18 @@ into the pod, copies every space into it (`copyAccountData`, [stores](node.md#st
270
281
  restarts the session there. `forgetBrowserCopy()` then deletes the browser's
271
282
  copy. Other accounts in the pod are never touched.
272
283
 
284
+ `removeAccount()` takes an account out of the browser altogether, as clearing
285
+ its site data would. It refuses while an app is connected from here: only this
286
+ home can disconnect an app, so the apps go first, from the list where
287
+ `disconnect` says whether each has heard. Then it signs out and deletes the
288
+ account's vault, its spaces' data and what the home remembered of it. A
289
+ revoke no peer but the app has taken in goes with them, as after a disconnect
290
+ nobody heard. Its passkey keys stay, since a pod's vault may name the same
291
+ one; with the vault gone they open nothing.
292
+ Copies on other devices, carriers and hosts stay; with none, its private
293
+ spaces are gone, and so is whatever reached no other copy. An account kept in a pod is not removed this way: the pod is
294
+ its copy.
295
+
273
296
  The page writes to the pod only while it is open. A carrier given the same
274
297
  folder, such as the Chrome extension, keeps it up to date while the page is
275
298
  closed: it learns of the pod from its grant (`CarryGrant.pod`), so one that
@@ -366,7 +389,12 @@ account the home keeps is named by the name it filed, never one from the
366
389
  link; its avatar helps recognise it, but is no proof, since a look-alike
367
390
  takes seconds to find.
368
391
 
369
- _Source: `packages/core/src/session/account-hint.ts`, `apps/home/src/components/AccountHint.tsx`, `apps/example/src/components/AccountMenu.tsx`, `apps/example/src/notifications.ts`. Tests: `packages/core/tests/account-hint.test.ts`._
392
+ Open it as a popup with `popupFeatures(width, height)`, the third argument to
393
+ `window.open`: a window that size, centred on the one it opens from, as
394
+ connecting does. Given a size alone, a browser puts it where it likes, often
395
+ the screen's top left.
396
+
397
+ _Source: `packages/core/src/session/account-hint.ts`, `packages/core/src/session/popup.ts`, `apps/home/src/components/AccountHint.tsx`, `apps/example/src/components/AccountMenu.tsx`, `apps/example/src/notifications.ts`. Tests: `packages/core/tests/account-hint.test.ts`, `packages/core/tests/popup.test.ts`._
370
398
 
371
399
  ## The account home's side
372
400
 
package/docs/spaces.md CHANGED
@@ -92,7 +92,7 @@ but nobody can change roles, and nothing in the constitution can change. An
92
92
  app says so plainly ("No one can change roles here any more") and offers the
93
93
  way on: naming a successor (below), which any member may do once no member holds `/space/succeed`.
94
94
 
95
- _Source: `packages/core/src/node/space-runtime.ts` (`stepDown`, `access`), `packages/core/src/space/roles.ts` (`headless`). Tests: `packages/core/tests/constitution.test.ts` ("stepping down", "a founder steps down, keeping a role…")._
95
+ _Source: `packages/core/src/node/space-membership.ts` (`stepDown`, `access`), `packages/core/src/space/roles.ts` (`headless`). Tests: `packages/core/tests/constitution.test.ts` ("stepping down", "a founder steps down, keeping a role…")._
96
96
 
97
97
  ## Successors
98
98
 
@@ -125,7 +125,7 @@ What an app shows:
125
125
  invite to a space that claims to succeed another, with no succeed for it
126
126
  there, is a copy, and is shown as one.
127
127
 
128
- _Source: `packages/core/src/node/node.ts` (`spaces.succeed`), `packages/core/src/node/space-runtime.ts` (`succeed`, `access`), `packages/core/src/space/space-manager.ts` (`previewInvite`). Tests: `packages/core/tests/constitution.test.ts` ("/space/succeed", "a successor: made with succeeds…")._
128
+ _Source: `packages/core/src/node/node.ts` (`spaces.succeed`), `packages/core/src/node/space-membership.ts` (`succeed`, `access`), `packages/core/src/space/space-manager.ts` (`previewInvite`). Tests: `packages/core/tests/constitution.test.ts` ("/space/succeed", "a successor: made with succeeds…")._
129
129
 
130
130
  ## Invites
131
131
 
@@ -187,7 +187,7 @@ While the invite's record has not reached this device, the space is held with
187
187
  `joining: true` and the node tries again as records arrive
188
188
  ([spec 06 §1.3](https://github.com/leifriksheim/minca/blob/main/spec/06-nodes-and-sessions.md)).
189
189
 
190
- _Source: `packages/core/src/node/node.ts` (`spaces.invite`, `preview`, `join`, `nodesOf`, `shortInvite`, `resolveInvite`, `keepLinks`), `packages/core/src/space/space-manager.ts` (`previewInvite`, `join`), `packages/core/src/space/invite-link.ts`. Tests: `packages/core/tests/space.test.ts` ("invites"), `packages/core/tests/roles.test.ts` ("invites"), `packages/core/tests/invite-link.test.ts`, `packages/cli/tests/host.test.ts` ("someone invited reaches the space through the inviter’s host…", "a short link: the host keeps it…")._
190
+ _Source: `packages/core/src/node/node.ts` (`spaces.invite`, `preview`, `join`), `packages/core/src/node/node-hosting.ts` (`nodesOf`), `packages/core/src/node/node-carriers.ts` (`inviteTo`, `shortInvite`, `resolveInvite`, `keepLinks`), `packages/core/src/space/space-manager.ts` (`previewInvite`, `join`), `packages/core/src/space/invite-link.ts`. Tests: `packages/core/tests/space.test.ts` ("invites"), `packages/core/tests/roles.test.ts` ("invites"), `packages/core/tests/invite-link.test.ts`, `packages/cli/tests/host.test.ts` ("someone invited reaches the space through the inviter’s host…", "a short link: the host keeps it…")._
191
191
 
192
192
  ## Keeping a space's keys and relays
193
193
 
@@ -201,7 +201,7 @@ The node does the protocol's key upkeep by itself, in each space it opens:
201
201
  - In a space with no relays named yet, a node whose account may invoke
202
202
  `/space/relays` names its own.
203
203
 
204
- _Source: `packages/core/src/node/space-runtime.ts` (`upkeep`, `rotateKey`, `nameRelays`). Tests: `packages/core/tests/key-change.test.ts`, `packages/core/tests/space-relays.test.ts`._
204
+ _Source: `packages/core/src/node/space-keys.ts` (`upkeep`, `rotateKey`, `nameRelays`). Tests: `packages/core/tests/key-change.test.ts`, `packages/core/tests/space-relays.test.ts`._
205
205
 
206
206
  ## Flagged accounts
207
207
 
@@ -263,7 +263,7 @@ publishes nothing
263
263
  > whether nicknames for people who are not contacts get a collection of their
264
264
  > own. `profile:` keys may also change (spec 03 §8.6).
265
265
 
266
- _Source: `packages/core/src/node/space-runtime.ts` (`loadProfiles`, `publishProfile`), `packages/core/src/node/node.ts` (`publishProfile`, `ownName`, `account.setName`), `packages/core/src/space/account-registry.ts` (`PROFILE_COLLECTION`, `PROFILE_KEY`). Tests: `packages/core/tests/profiles.test.ts`, `packages/core/tests/contacts.test.ts` ("the contact key"), `packages/core/tests/account.test.ts` ("the account name")._
266
+ _Source: `packages/core/src/node/space-profiles.ts` (`loadProfiles`), `packages/core/src/node/space-runtime.ts` (`publishProfile`), `packages/core/src/node/node-contacts.ts` (`publishProfile`, `ownName`, `account.setName`), `packages/core/src/space/account-registry.ts` (`PROFILE_COLLECTION`, `PROFILE_KEY`). Tests: `packages/core/tests/profiles.test.ts`, `packages/core/tests/contacts.test.ts` ("the contact key"), `packages/core/tests/account.test.ts` ("the account name")._
267
267
 
268
268
  ## The space manager
269
269
 
@@ -315,4 +315,4 @@ is what a carrier's wake matches; the rest is judged only by the app. Without
315
315
  one, a carrier wakes the app for every new record of the collection, and the
316
316
  app turns down the rest.
317
317
 
318
- _Source: `packages/core/src/space/own-automations.ts` (`checkOwnAutomation`, `notifyOn`, `matchesRecord`), `packages/core/src/query/filter.ts` (`checkFilter`, `matches`), `packages/core/src/node/node.ts` (`automations`), `apps/example/src/notifications.ts`. Tests: `packages/core/tests/carrier.test.ts` ("notifications through a carrier"), `packages/core/tests/topics.test.ts` ("an automation of the account’s own: its where")._
318
+ _Source: `packages/core/src/space/own-automations.ts` (`checkOwnAutomation`, `notifyOn`, `matchesRecord`), `packages/core/src/query/filter.ts` (`checkFilter`, `matches`), `packages/core/src/node/node-carriers.ts` (`automations`), `apps/example/src/notifications.ts`. Tests: `packages/core/tests/carrier.test.ts` ("notifications through a carrier"), `packages/core/tests/topics.test.ts` ("an automation of the account’s own: its where")._
@@ -90,18 +90,19 @@ keep the library small enough to choose from, and each choice obvious:
90
90
  out in each definition, built by the library's `fragments` so they are
91
91
  identical everywhere:
92
92
 
93
- | Fragment | Shape |
94
- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
95
- | `when` | string 10–64: RFC 3339 date-time (`2026-03-01T18:30:00+01:00`), or `YYYY-MM-DD` for a whole day |
96
- | `day` | string of 10: `YYYY-MM-DD` |
97
- | `timeZone` | string 1–64: an IANA zone, `Europe/Oslo` |
98
- | DID | string 1–256: an account DID (built by `person`) |
99
- | `money` | `{ amount, currency }`, both required: `amount` a decimal string 1–32 (`"12.50"`), never a number; `currency` ISO 4217, 3 characters |
100
- | `address` | `{ street, locality, region, postcode, country }`, each optional; `country` ISO 3166-1 alpha-2 |
101
- | `place` | `{ name, address, lat, lon, cells }` (built by `placeRef`), each optional; `lat` −90–90, `lon` −180–180, WGS 84; `cells` string 1–12[] (≤ 8), the geohash cells of `lat` and `lon` (see Places and areas) |
102
- | `blob` | `{ hash, size, mime, name?, key?, salt? }`: what `records.addFile` gives: `hash` the file's id (64 hex characters), `size` bytes as stored, `mime` required; `key` and `salt` open it (22 base64url characters each) |
103
- | `image` | `{ blob, alt? }`: `alt` ≤ 2000, what it shows |
104
- | `position` | string 1–200 that sorts where a record goes (Positions, below) |
93
+ | Fragment | Shape |
94
+ | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
95
+ | `when` | string 10–64, `x-kind: "when"`: RFC 3339 date-time (`2026-03-01T18:30:00+01:00`), or `YYYY-MM-DD` for a whole day |
96
+ | `day` | string of 10, `x-kind: "day"`: `YYYY-MM-DD` |
97
+ | `url` | string 1–2048, `x-kind: "url"`: a web address |
98
+ | `timeZone` | string 1–64: an IANA zone, `Europe/Oslo` |
99
+ | DID | string 1–256, `x-kind: "did"`: an account DID (built by `person`) |
100
+ | `money` | `{ amount, currency }`, `x-kind: "money"`, both required: `amount` a decimal string 1–32 (`"12.50"`), never a number; `currency` ISO 4217, 3 characters |
101
+ | `address` | `{ street, locality, region, postcode, country }`, each optional; `country` ISO 3166-1 alpha-2 |
102
+ | `place` | `{ name, address, lat, lon, cells }` (built by `placeRef`), each optional; `lat` −90–90, `lon` −180–180, WGS 84; `cells` string 1–12[] (≤ 8), the geohash cells of `lat` and `lon` (see Places and areas) |
103
+ | `blob` | `{ hash, size, mime, name?, key?, salt? }`, `x-kind: "file"`: what `records.addFile` gives: `hash` the file's id (64 hex characters), `size` bytes as stored, `mime` required; `key` and `salt` open it (22 base64url characters each) |
104
+ | `image` | `{ blob, alt? }`, `x-kind: "image"`: `alt` ≤ 2000, what it shows |
105
+ | `position` | string 1–200, `x-kind: "position"`, that sorts where a record goes (Positions, below) |
105
106
 
106
107
  Until the dialect has `format` ([spec 02 §6.2](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)), `when` and `day` are checked only for
107
108
  length. A `blob` is what `records.addFile` gives
@@ -125,17 +126,17 @@ anything, and only moderators and admins write in the collections in
125
126
 
126
127
  **Annotations**
127
128
 
128
- | Name | Body | Links | Rules |
129
- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | -------------------------------------- |
130
- | `std.reaction` | **`emoji`** string 1–16; `respondingTo` DID; topic `respondingTo` | `about` → `*`, one | `onePer: [@author, link:about, emoji]` |
131
- | `std.comment` | **`text`** string 1–10000; `mentions` DID[] (≤ 64); `replyingTo` DID; `respondingTo` DID; topics `mentions`, `replyingTo`, `respondingTo` | `about` → `*`, one; `replyTo` → `std.comment`, one | — |
132
- | `std.tag` | **`label`** string 1–100 | `about` → `*`, one | `onePer: [@author, link:about, label]` |
133
- | `std.rating` | **`score`** integer 1–5; `review` string ≤ 10000 | `about` → `*`, one | `onePer: [@author, link:about]` |
134
- | `std.highlight` | **`quote`** string 1–10000; `prefix` string ≤ 500; `suffix` string ≤ 500; `note` string ≤ 10000 | `about` → `*`, one | — |
135
- | `std.pin` | `note` string ≤ 500 | `about` → `*`, one | `onePer: [link:about]` |
136
- | `std.report` | **`reason`** `spam`/`abuse`/`sexual`/`misleading`/`illegal`/`other`; `note` string ≤ 2000 | `about` → `*`, one | `onePer: [@author, link:about]` |
137
- | `std.label` | **`value`** string 1–64 | `about` → `*`, one | `onePer: [link:about, value]` |
138
- | `std.claim` | `note` string ≤ 500; `respondingTo` DID; topic `respondingTo` | `about` → `*`, one | `onePer: [link:about]` |
129
+ | Name | Body | Links | Rules |
130
+ | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | -------------------------------------- |
131
+ | `std.reaction` | **`emoji`** string 1–16; `respondingTo` DID; topic `respondingTo` | `about` → `*`, one | `onePer: [@author, link:about, emoji]` |
132
+ | `std.comment` | **`text`** string 1–10000; `mentions` DID[] (≤ 64); `replyingTo` DID; `respondingTo` DID; topics `mentions`, `replyingTo`, `respondingTo` | `about` → `*`, one; `replyTo` → `std.comment`, one; `shares` → `*`, one | — |
133
+ | `std.tag` | **`label`** string 1–100 | `about` → `*`, one | `onePer: [@author, link:about, label]` |
134
+ | `std.rating` | **`score`** integer 1–5; `review` string ≤ 10000 | `about` → `*`, one | `onePer: [@author, link:about]` |
135
+ | `std.highlight` | **`quote`** string 1–10000; `prefix` string ≤ 500; `suffix` string ≤ 500; `note` string ≤ 10000 | `about` → `*`, one | — |
136
+ | `std.pin` | `note` string ≤ 500 | `about` → `*`, one | `onePer: [link:about]` |
137
+ | `std.report` | **`reason`** `spam`/`abuse`/`sexual`/`misleading`/`illegal`/`other`; `note` string ≤ 2000 | `about` → `*`, one | `onePer: [@author, link:about]` |
138
+ | `std.label` | **`value`** string 1–64 | `about` → `*`, one | `onePer: [link:about, value]` |
139
+ | `std.claim` | `note` string ≤ 500; `respondingTo` DID; topic `respondingTo` | `about` → `*`, one | `onePer: [link:about]` |
139
140
 
140
141
  **People**
141
142
 
@@ -456,12 +457,13 @@ so "mentions me" and "assigned to me" match from then on.
456
457
 
457
458
  **Also exported** from the same module (specified with their features):
458
459
 
459
- | Name | Body | Rules | Where |
460
- | --------------------- | --------------------------------------------------------------------------------------- | ----------------- | ----------------------- |
461
- | `std.contact` | `did` ≤ 256 and `name` ≤ 200, required; `space` ≤ 256; `note` ≤ 2000; `blocked` boolean | `onePer: [did]` | [contacts](contacts.md) |
462
- | `std.contact-request` | `to` ≤ 64 and `sealed` ≤ 16000, required | — | [contacts](contacts.md) |
463
- | `std.inbox` | `gen` ≥ 0 and `places` (1–3, each ≤ 200), required; `name` ≤ 64 | — | [inbox.md](inbox.md) |
464
- | `std.knock` | `space` ≤ 256, `name` ≤ 64 and `invite` ≤ 12000, all required | `onePer: [space]` | [inbox.md](inbox.md) |
460
+ | Name | Body | Rules | Where |
461
+ | --------------------- | --------------------------------------------------------------------------------------------------------- | ----------------- | ----------------------- |
462
+ | `std.contact` | `did` ≤ 256 and `name` ≤ 200, required; `space` ≤ 256; `note` ≤ 2000; `blocked` boolean; `username` ≤ 320 | `onePer: [did]` | [contacts](contacts.md) |
463
+ | `std.contact-request` | `to` ≤ 64 and `sealed` ≤ 16000, required | — | [contacts](contacts.md) |
464
+ | `std.inbox` | `gen` ≥ 0 and `places` (1–3, each ≤ 200), required; `name` ≤ 64; `username` ≤ 320; `usernameUntil` | — | [inbox.md](inbox.md) |
465
+ | `std.knock` | `space` ≤ 256, `name` ≤ 64 and `invite` ≤ 12000, all required; `username` ≤ 320 | `onePer: [space]` | [inbox.md](inbox.md) |
466
+ | `std.space-invite` | `space` ≤ 256 and `invite` ≤ 12000, required | `onePer: [space]` | [contacts](contacts.md) |
465
467
 
466
468
  **Positions.** `position` is a string that sorts (by plain string comparison)
467
469
  where a record goes in a hand-made order. Digits are `0–9a–z`; a position
@@ -519,7 +521,7 @@ _Source: `packages/core/src/schemas/geo.ts` (`geohash`, `cellsOf`, `cellsAround`
519
521
 
520
522
  ## `std.call`
521
523
 
522
- Calls themselves are kept nowhere ([calls](calls.md)). Their history is a
524
+ Calls themselves are kept nowhere ([calls](../../calls/README.md)). Their history is a
523
525
  `std.call` record in the space, written only if the space defines `std.call`:
524
526
 
525
527
  | Field | Type | Meaning |
@@ -545,4 +547,4 @@ _Implementation detail:_ the call a device is in is kept in `sessionStorage`
545
547
  under `minca-call` as `{ space, call }`, so after a reload the page can offer to
546
548
  rejoin while the call is still going on.
547
549
 
548
- _Source: `packages/core/src/calls/calls.ts`, `packages/core/src/schemas/library/publishing.ts` (`call`). Tests: `packages/core/tests/calls.test.ts`._
550
+ _Source: `packages/calls/src/calls.ts`, `packages/core/src/schemas/library/publishing.ts` (`call`). Tests: `packages/calls/tests/calls.test.ts`._