@minca/core 0.1.15 → 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 (427) hide show
  1. package/README.md +2 -2
  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/identity/abilities.d.ts +2 -0
  10. package/dist/identity/abilities.d.ts.map +1 -1
  11. package/dist/identity/abilities.js +2 -0
  12. package/dist/identity/abilities.js.map +1 -1
  13. package/dist/identity/account-vault.d.ts +15 -71
  14. package/dist/identity/account-vault.d.ts.map +1 -1
  15. package/dist/identity/account-vault.js +45 -104
  16. package/dist/identity/account-vault.js.map +1 -1
  17. package/dist/identity/channel.d.ts +3 -9
  18. package/dist/identity/channel.d.ts.map +1 -1
  19. package/dist/identity/channel.js +42 -42
  20. package/dist/identity/channel.js.map +1 -1
  21. package/dist/identity/contact-key.d.ts +14 -29
  22. package/dist/identity/contact-key.d.ts.map +1 -1
  23. package/dist/identity/contact-key.js +31 -51
  24. package/dist/identity/contact-key.js.map +1 -1
  25. package/dist/identity/crypto-p256.d.ts.map +1 -1
  26. package/dist/identity/crypto-p256.js +39 -53
  27. package/dist/identity/crypto-p256.js.map +1 -1
  28. package/dist/identity/hpke.d.ts.map +1 -1
  29. package/dist/identity/hpke.js +19 -19
  30. package/dist/identity/hpke.js.map +1 -1
  31. package/dist/identity/identity-manager.d.ts.map +1 -1
  32. package/dist/identity/identity-manager.js +1 -2
  33. package/dist/identity/identity-manager.js.map +1 -1
  34. package/dist/identity/policy.d.ts.map +1 -1
  35. package/dist/identity/policy.js +35 -61
  36. package/dist/identity/policy.js.map +1 -1
  37. package/dist/identity/recovery-code.d.ts +2 -8
  38. package/dist/identity/recovery-code.d.ts.map +1 -1
  39. package/dist/identity/recovery-code.js +4 -11
  40. package/dist/identity/recovery-code.js.map +1 -1
  41. package/dist/identity/root-signer.d.ts +1 -6
  42. package/dist/identity/root-signer.d.ts.map +1 -1
  43. package/dist/identity/root-signer.js +12 -15
  44. package/dist/identity/root-signer.js.map +1 -1
  45. package/dist/identity/ucan.d.ts.map +1 -1
  46. package/dist/identity/ucan.js +48 -39
  47. package/dist/identity/ucan.js.map +1 -1
  48. package/dist/identity/webauthn.d.ts +6 -11
  49. package/dist/identity/webauthn.d.ts.map +1 -1
  50. package/dist/identity/webauthn.js +18 -30
  51. package/dist/identity/webauthn.js.map +1 -1
  52. package/dist/inbox/inbox.d.ts.map +1 -1
  53. package/dist/inbox/inbox.js +40 -30
  54. package/dist/inbox/inbox.js.map +1 -1
  55. package/dist/inbox/index.d.ts +2 -0
  56. package/dist/inbox/index.d.ts.map +1 -1
  57. package/dist/inbox/index.js +1 -0
  58. package/dist/inbox/index.js.map +1 -1
  59. package/dist/inbox/names.d.ts +54 -0
  60. package/dist/inbox/names.d.ts.map +1 -0
  61. package/dist/inbox/names.js +299 -0
  62. package/dist/inbox/names.js.map +1 -0
  63. package/dist/index.d.ts +3 -6
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +9 -12
  66. package/dist/index.js.map +1 -1
  67. package/dist/network/mesh.d.ts +7 -20
  68. package/dist/network/mesh.d.ts.map +1 -1
  69. package/dist/network/mesh.js +267 -245
  70. package/dist/network/mesh.js.map +1 -1
  71. package/dist/network/relay-link.d.ts +31 -0
  72. package/dist/network/relay-link.d.ts.map +1 -0
  73. package/dist/network/relay-link.js +62 -0
  74. package/dist/network/relay-link.js.map +1 -0
  75. package/dist/network/relay-minca.d.ts.map +1 -1
  76. package/dist/network/relay-minca.js +11 -49
  77. package/dist/network/relay-minca.js.map +1 -1
  78. package/dist/network/relay-nostr.d.ts.map +1 -1
  79. package/dist/network/relay-nostr.js +23 -63
  80. package/dist/network/relay-nostr.js.map +1 -1
  81. package/dist/network/relay-socket.d.ts +1 -1
  82. package/dist/network/relay-socket.d.ts.map +1 -1
  83. package/dist/network/relay-socket.js +3 -1
  84. package/dist/network/relay-socket.js.map +1 -1
  85. package/dist/node/actions.d.ts.map +1 -1
  86. package/dist/node/actions.js +50 -38
  87. package/dist/node/actions.js.map +1 -1
  88. package/dist/node/api.d.ts +6 -0
  89. package/dist/node/api.d.ts.map +1 -1
  90. package/dist/node/api.js +6 -0
  91. package/dist/node/api.js.map +1 -1
  92. package/dist/node/carrier.d.ts +5 -0
  93. package/dist/node/carrier.d.ts.map +1 -1
  94. package/dist/node/carrier.js +94 -73
  95. package/dist/node/carrier.js.map +1 -1
  96. package/dist/node/copy.d.ts +8 -7
  97. package/dist/node/copy.d.ts.map +1 -1
  98. package/dist/node/copy.js +54 -56
  99. package/dist/node/copy.js.map +1 -1
  100. package/dist/node/host.d.ts +39 -65
  101. package/dist/node/host.d.ts.map +1 -1
  102. package/dist/node/host.js +362 -379
  103. package/dist/node/host.js.map +1 -1
  104. package/dist/node/index.d.ts +2 -2
  105. package/dist/node/index.d.ts.map +1 -1
  106. package/dist/node/index.js +1 -1
  107. package/dist/node/index.js.map +1 -1
  108. package/dist/node/node-carriers.d.ts +35 -0
  109. package/dist/node/node-carriers.d.ts.map +1 -0
  110. package/dist/node/node-carriers.js +562 -0
  111. package/dist/node/node-carriers.js.map +1 -0
  112. package/dist/node/node-contacts.d.ts +11 -0
  113. package/dist/node/node-contacts.d.ts.map +1 -0
  114. package/dist/node/node-contacts.js +808 -0
  115. package/dist/node/node-contacts.js.map +1 -0
  116. package/dist/node/node-context.d.ts +76 -0
  117. package/dist/node/node-context.d.ts.map +1 -0
  118. package/dist/node/node-context.js +54 -0
  119. package/dist/node/node-context.js.map +1 -0
  120. package/dist/node/node-hosting.d.ts +20 -0
  121. package/dist/node/node-hosting.d.ts.map +1 -0
  122. package/dist/node/node-hosting.js +449 -0
  123. package/dist/node/node-hosting.js.map +1 -0
  124. package/dist/node/node-records.d.ts +18 -0
  125. package/dist/node/node-records.d.ts.map +1 -0
  126. package/dist/node/node-records.js +262 -0
  127. package/dist/node/node-records.js.map +1 -0
  128. package/dist/node/node.d.ts.map +1 -1
  129. package/dist/node/node.js +198 -1990
  130. package/dist/node/node.js.map +1 -1
  131. package/dist/node/remote.d.ts +5 -6
  132. package/dist/node/remote.d.ts.map +1 -1
  133. package/dist/node/remote.js +272 -260
  134. package/dist/node/remote.js.map +1 -1
  135. package/dist/node/space-catalog.d.ts +40 -0
  136. package/dist/node/space-catalog.d.ts.map +1 -0
  137. package/dist/node/space-catalog.js +158 -0
  138. package/dist/node/space-catalog.js.map +1 -0
  139. package/dist/node/space-checks.d.ts +25 -0
  140. package/dist/node/space-checks.d.ts.map +1 -0
  141. package/dist/node/space-checks.js +343 -0
  142. package/dist/node/space-checks.js.map +1 -0
  143. package/dist/node/space-history.d.ts +37 -0
  144. package/dist/node/space-history.d.ts.map +1 -0
  145. package/dist/node/space-history.js +350 -0
  146. package/dist/node/space-history.js.map +1 -0
  147. package/dist/node/space-holding.d.ts +49 -0
  148. package/dist/node/space-holding.d.ts.map +1 -0
  149. package/dist/node/space-holding.js +267 -0
  150. package/dist/node/space-holding.js.map +1 -0
  151. package/dist/node/space-index.d.ts +41 -0
  152. package/dist/node/space-index.d.ts.map +1 -0
  153. package/dist/node/space-index.js +217 -0
  154. package/dist/node/space-index.js.map +1 -0
  155. package/dist/node/space-keys.d.ts +34 -0
  156. package/dist/node/space-keys.d.ts.map +1 -0
  157. package/dist/node/space-keys.js +309 -0
  158. package/dist/node/space-keys.js.map +1 -0
  159. package/dist/node/space-lines.d.ts +33 -0
  160. package/dist/node/space-lines.d.ts.map +1 -0
  161. package/dist/node/space-lines.js +145 -0
  162. package/dist/node/space-lines.js.map +1 -0
  163. package/dist/node/space-membership.d.ts +69 -0
  164. package/dist/node/space-membership.d.ts.map +1 -0
  165. package/dist/node/space-membership.js +242 -0
  166. package/dist/node/space-membership.js.map +1 -0
  167. package/dist/node/space-mirrors.d.ts +43 -0
  168. package/dist/node/space-mirrors.d.ts.map +1 -0
  169. package/dist/node/space-mirrors.js +125 -0
  170. package/dist/node/space-mirrors.js.map +1 -0
  171. package/dist/node/space-peers.d.ts +104 -0
  172. package/dist/node/space-peers.d.ts.map +1 -0
  173. package/dist/node/space-peers.js +595 -0
  174. package/dist/node/space-peers.js.map +1 -0
  175. package/dist/node/space-profiles.d.ts +18 -0
  176. package/dist/node/space-profiles.d.ts.map +1 -0
  177. package/dist/node/space-profiles.js +105 -0
  178. package/dist/node/space-profiles.js.map +1 -0
  179. package/dist/node/space-rules.d.ts +29 -0
  180. package/dist/node/space-rules.d.ts.map +1 -0
  181. package/dist/node/space-rules.js +144 -0
  182. package/dist/node/space-rules.js.map +1 -0
  183. package/dist/node/space-runtime.d.ts +103 -142
  184. package/dist/node/space-runtime.d.ts.map +1 -1
  185. package/dist/node/space-runtime.js +290 -3963
  186. package/dist/node/space-runtime.js.map +1 -1
  187. package/dist/node/space-standing.d.ts +20 -0
  188. package/dist/node/space-standing.d.ts.map +1 -0
  189. package/dist/node/space-standing.js +317 -0
  190. package/dist/node/space-standing.js.map +1 -0
  191. package/dist/node/space-versions.d.ts +104 -0
  192. package/dist/node/space-versions.d.ts.map +1 -0
  193. package/dist/node/space-versions.js +153 -0
  194. package/dist/node/space-versions.js.map +1 -0
  195. package/dist/node/space-warrants.d.ts +25 -0
  196. package/dist/node/space-warrants.d.ts.map +1 -0
  197. package/dist/node/space-warrants.js +214 -0
  198. package/dist/node/space-warrants.js.map +1 -0
  199. package/dist/node/space-writing.d.ts +72 -0
  200. package/dist/node/space-writing.d.ts.map +1 -0
  201. package/dist/node/space-writing.js +440 -0
  202. package/dist/node/space-writing.js.map +1 -0
  203. package/dist/node/stores.d.ts +19 -50
  204. package/dist/node/stores.d.ts.map +1 -1
  205. package/dist/node/stores.js +14 -33
  206. package/dist/node/stores.js.map +1 -1
  207. package/dist/node/types.d.ts +225 -306
  208. package/dist/node/types.d.ts.map +1 -1
  209. package/dist/node/usage.d.ts +2 -24
  210. package/dist/node/usage.d.ts.map +1 -1
  211. package/dist/node/usage.js +118 -102
  212. package/dist/node/usage.js.map +1 -1
  213. package/dist/node/watch-notifications.d.ts.map +1 -1
  214. package/dist/node/watch-notifications.js +32 -29
  215. package/dist/node/watch-notifications.js.map +1 -1
  216. package/dist/node/worker.d.ts +5 -6
  217. package/dist/node/worker.d.ts.map +1 -1
  218. package/dist/node/worker.js +80 -72
  219. package/dist/node/worker.js.map +1 -1
  220. package/dist/node/writer-keys.d.ts +5 -6
  221. package/dist/node/writer-keys.d.ts.map +1 -1
  222. package/dist/node/writer-keys.js +66 -57
  223. package/dist/node/writer-keys.js.map +1 -1
  224. package/dist/node/writers.d.ts +12 -19
  225. package/dist/node/writers.d.ts.map +1 -1
  226. package/dist/node/writers.js +7 -15
  227. package/dist/node/writers.js.map +1 -1
  228. package/dist/privacy/direct.d.ts.map +1 -1
  229. package/dist/privacy/direct.js +31 -27
  230. package/dist/privacy/direct.js.map +1 -1
  231. package/dist/privacy/space-encryption.d.ts.map +1 -1
  232. package/dist/privacy/space-encryption.js +5 -9
  233. package/dist/privacy/space-encryption.js.map +1 -1
  234. package/dist/query/computed.d.ts.map +1 -1
  235. package/dist/query/computed.js +78 -77
  236. package/dist/query/computed.js.map +1 -1
  237. package/dist/query/engine.d.ts +3 -4
  238. package/dist/query/engine.d.ts.map +1 -1
  239. package/dist/query/engine.js +93 -86
  240. package/dist/query/engine.js.map +1 -1
  241. package/dist/query/filter.d.ts +8 -10
  242. package/dist/query/filter.d.ts.map +1 -1
  243. package/dist/query/filter.js +144 -161
  244. package/dist/query/filter.js.map +1 -1
  245. package/dist/records/cel-types.d.ts.map +1 -1
  246. package/dist/records/cel-types.js +13 -27
  247. package/dist/records/cel-types.js.map +1 -1
  248. package/dist/records/cel.d.ts.map +1 -1
  249. package/dist/records/cel.js +177 -242
  250. package/dist/records/cel.js.map +1 -1
  251. package/dist/records/rules.d.ts.map +1 -1
  252. package/dist/records/rules.js +46 -50
  253. package/dist/records/rules.js.map +1 -1
  254. package/dist/records/topics.d.ts.map +1 -1
  255. package/dist/records/topics.js +18 -22
  256. package/dist/records/topics.js.map +1 -1
  257. package/dist/schemas/automations.d.ts +8 -15
  258. package/dist/schemas/automations.d.ts.map +1 -1
  259. package/dist/schemas/automations.js +203 -165
  260. package/dist/schemas/automations.js.map +1 -1
  261. package/dist/schemas/blueprints.d.ts.map +1 -1
  262. package/dist/schemas/blueprints.js +14 -13
  263. package/dist/schemas/blueprints.js.map +1 -1
  264. package/dist/schemas/connectors.d.ts.map +1 -1
  265. package/dist/schemas/connectors.js +16 -11
  266. package/dist/schemas/connectors.js.map +1 -1
  267. package/dist/schemas/contacts.d.ts +57 -0
  268. package/dist/schemas/contacts.d.ts.map +1 -1
  269. package/dist/schemas/contacts.js +32 -0
  270. package/dist/schemas/contacts.js.map +1 -1
  271. package/dist/schemas/cron.d.ts.map +1 -1
  272. package/dist/schemas/cron.js +27 -28
  273. package/dist/schemas/cron.js.map +1 -1
  274. package/dist/schemas/defined.d.ts +6 -0
  275. package/dist/schemas/defined.d.ts.map +1 -0
  276. package/dist/schemas/defined.js +7 -0
  277. package/dist/schemas/defined.js.map +1 -0
  278. package/dist/schemas/guides.d.ts +3 -1
  279. package/dist/schemas/guides.d.ts.map +1 -1
  280. package/dist/schemas/guides.js +13 -12
  281. package/dist/schemas/guides.js.map +1 -1
  282. package/dist/schemas/index.d.ts +2 -2
  283. package/dist/schemas/index.d.ts.map +1 -1
  284. package/dist/schemas/index.js +18 -14
  285. package/dist/schemas/index.js.map +1 -1
  286. package/dist/session/account-hint.d.ts.map +1 -1
  287. package/dist/session/account-hint.js +8 -5
  288. package/dist/session/account-hint.js.map +1 -1
  289. package/dist/session/auth.d.ts +36 -2
  290. package/dist/session/auth.d.ts.map +1 -1
  291. package/dist/session/auth.js +95 -2
  292. package/dist/session/auth.js.map +1 -1
  293. package/dist/session/connect.d.ts +1 -0
  294. package/dist/session/connect.d.ts.map +1 -1
  295. package/dist/session/connect.js +3 -1
  296. package/dist/session/connect.js.map +1 -1
  297. package/dist/session/credentials.d.ts +8 -26
  298. package/dist/session/credentials.d.ts.map +1 -1
  299. package/dist/session/credentials.js +14 -32
  300. package/dist/session/credentials.js.map +1 -1
  301. package/dist/session/index.d.ts +1 -0
  302. package/dist/session/index.d.ts.map +1 -1
  303. package/dist/session/index.js +1 -0
  304. package/dist/session/index.js.map +1 -1
  305. package/dist/session/pairing.d.ts.map +1 -1
  306. package/dist/session/pairing.js +92 -88
  307. package/dist/session/pairing.js.map +1 -1
  308. package/dist/session/password-strength.d.ts.map +1 -1
  309. package/dist/session/password-strength.js +37 -37
  310. package/dist/session/password-strength.js.map +1 -1
  311. package/dist/session/places.d.ts.map +1 -1
  312. package/dist/session/places.js +18 -13
  313. package/dist/session/places.js.map +1 -1
  314. package/dist/session/popup.d.ts +13 -0
  315. package/dist/session/popup.d.ts.map +1 -0
  316. package/dist/session/popup.js +23 -0
  317. package/dist/session/popup.js.map +1 -0
  318. package/dist/space/constitution.d.ts.map +1 -1
  319. package/dist/space/constitution.js +22 -29
  320. package/dist/space/constitution.js.map +1 -1
  321. package/dist/space/grants.d.ts.map +1 -1
  322. package/dist/space/grants.js +37 -39
  323. package/dist/space/grants.js.map +1 -1
  324. package/dist/space/invite-link.d.ts.map +1 -1
  325. package/dist/space/invite-link.js +33 -33
  326. package/dist/space/invite-link.js.map +1 -1
  327. package/dist/space/own-automations.d.ts +13 -24
  328. package/dist/space/own-automations.d.ts.map +1 -1
  329. package/dist/space/own-automations.js +47 -37
  330. package/dist/space/own-automations.js.map +1 -1
  331. package/dist/space/roles.d.ts +56 -80
  332. package/dist/space/roles.d.ts.map +1 -1
  333. package/dist/space/roles.js +448 -441
  334. package/dist/space/roles.js.map +1 -1
  335. package/dist/space/space-access.d.ts +3 -4
  336. package/dist/space/space-access.d.ts.map +1 -1
  337. package/dist/space/space-access.js +3 -8
  338. package/dist/space/space-access.js.map +1 -1
  339. package/dist/storage/blob/directory.d.ts.map +1 -1
  340. package/dist/storage/blob/directory.js +39 -32
  341. package/dist/storage/blob/directory.js.map +1 -1
  342. package/dist/storage/blob/s3.d.ts.map +1 -1
  343. package/dist/storage/blob/s3.js +21 -19
  344. package/dist/storage/blob/s3.js.map +1 -1
  345. package/dist/storage/blob-store.d.ts +0 -9
  346. package/dist/storage/blob-store.d.ts.map +1 -1
  347. package/dist/storage/directory-access.d.ts +8 -32
  348. package/dist/storage/directory-access.d.ts.map +1 -1
  349. package/dist/storage/directory-access.js +11 -36
  350. package/dist/storage/directory-access.js.map +1 -1
  351. package/dist/storage/encrypted-adapter.d.ts +12 -32
  352. package/dist/storage/encrypted-adapter.d.ts.map +1 -1
  353. package/dist/storage/encrypted-adapter.js +31 -54
  354. package/dist/storage/encrypted-adapter.js.map +1 -1
  355. package/dist/storage/folder-adapter.d.ts +12 -26
  356. package/dist/storage/folder-adapter.d.ts.map +1 -1
  357. package/dist/storage/folder-adapter.js +37 -54
  358. package/dist/storage/folder-adapter.js.map +1 -1
  359. package/dist/storage/folder-reconcile.d.ts +12 -26
  360. package/dist/storage/folder-reconcile.d.ts.map +1 -1
  361. package/dist/storage/folder-reconcile.js +39 -48
  362. package/dist/storage/folder-reconcile.js.map +1 -1
  363. package/dist/storage/indexeddb-adapter.d.ts +2 -6
  364. package/dist/storage/indexeddb-adapter.d.ts.map +1 -1
  365. package/dist/storage/indexeddb-adapter.js +60 -114
  366. package/dist/storage/indexeddb-adapter.js.map +1 -1
  367. package/dist/storage/mirror.d.ts +0 -29
  368. package/dist/storage/mirror.d.ts.map +1 -1
  369. package/dist/storage/mirror.js +153 -110
  370. package/dist/storage/mirror.js.map +1 -1
  371. package/dist/storage/segment.d.ts.map +1 -1
  372. package/dist/storage/segment.js +3 -7
  373. package/dist/storage/segment.js.map +1 -1
  374. package/dist/storage/storage-provider.d.ts +6 -11
  375. package/dist/storage/storage-provider.d.ts.map +1 -1
  376. package/dist/storage/storage-provider.js +112 -116
  377. package/dist/storage/storage-provider.js.map +1 -1
  378. package/dist/sync/sync-engine.d.ts +10 -44
  379. package/dist/sync/sync-engine.d.ts.map +1 -1
  380. package/dist/sync/sync-engine.js +245 -247
  381. package/dist/sync/sync-engine.js.map +1 -1
  382. package/dist/sync/sync-messages.d.ts +1 -1
  383. package/dist/sync/sync-messages.d.ts.map +1 -1
  384. package/dist/sync/sync-messages.js +1 -1
  385. package/dist/sync/sync-messages.js.map +1 -1
  386. package/dist/utils/guards.d.ts +1 -0
  387. package/dist/utils/guards.d.ts.map +1 -1
  388. package/dist/utils/guards.js +1 -0
  389. package/dist/utils/guards.js.map +1 -1
  390. package/dist/utils/hmac.d.ts +5 -0
  391. package/dist/utils/hmac.d.ts.map +1 -0
  392. package/dist/utils/hmac.js +20 -0
  393. package/dist/utils/hmac.js.map +1 -0
  394. package/dist/utils/map.d.ts +10 -0
  395. package/dist/utils/map.d.ts.map +1 -0
  396. package/dist/utils/map.js +30 -0
  397. package/dist/utils/map.js.map +1 -0
  398. package/dist/utils/serial.d.ts +2 -0
  399. package/dist/utils/serial.d.ts.map +1 -1
  400. package/dist/utils/serial.js +9 -0
  401. package/dist/utils/serial.js.map +1 -1
  402. package/dist/validation/capability-gate.d.ts +7 -15
  403. package/dist/validation/capability-gate.d.ts.map +1 -1
  404. package/dist/validation/capability-gate.js +32 -36
  405. package/dist/validation/capability-gate.js.map +1 -1
  406. package/dist/validation/crypto-gate.d.ts.map +1 -1
  407. package/dist/validation/crypto-gate.js +12 -21
  408. package/dist/validation/crypto-gate.js.map +1 -1
  409. package/docs/README.md +1 -0
  410. package/docs/actions.md +1 -1
  411. package/docs/automations.md +1 -1
  412. package/docs/blueprints-and-guides.md +17 -1
  413. package/docs/building-an-app.md +7 -4
  414. package/docs/collections.md +3 -3
  415. package/docs/contacts.md +34 -1
  416. package/docs/contracts.md +1 -1
  417. package/docs/direct-messages.md +1 -1
  418. package/docs/inbox.md +5 -11
  419. package/docs/node.md +22 -14
  420. package/docs/records-and-queries.md +1 -1
  421. package/docs/sign-in.md +54 -26
  422. package/docs/spaces.md +6 -6
  423. package/docs/standard-library.md +7 -6
  424. package/docs/storage.md +4 -5
  425. package/docs/usernames.md +161 -0
  426. package/docs/warrants.md +1 -1
  427. package/package.json +1 -1
@@ -163,6 +163,12 @@ define collections wrote it under a note that isn't records-only
163
163
  (`NodeRecord.recordsOnly`). It writes a guide on `launcher.app` saying how to
164
164
  propose one.
165
165
 
166
+ **Where a space opens.** The launcher is in one order for everyone in the
167
+ space (each record's `position`). The example app opens a space into the
168
+ first app on it, so a group chooses where it opens by moving an app to the
169
+ top. A new group starts with Chat, and so does a new space for two, which
170
+ the one asking makes, so both people open it into a conversation.
171
+
166
172
  A screen reaches the page around it only through `window.minca`, and only for
167
173
  its app's collections and the people in its space: it lists and writes
168
174
  records as the person looking, asks what they may do (`can`), gets someone's
@@ -176,6 +182,16 @@ and reads a picture that one of the app's own records refers to (`file`),
176
182
  or the whole file (`blob`), taking its type from the record rather than from
177
183
  the screen.
178
184
 
185
+ **Settings and the network.** An app may ask for `settings`, like an API
186
+ key. Someone who may add apps fills them in once, from the open app, for
187
+ everyone in the space, and its screen reads them as `minca.settings`; nobody
188
+ else is asked. They live on the app's own record, so they stand only as it
189
+ does: a new version proposed without values keeps the ones the app has, and a
190
+ copy to another space carries none. The origins an app names in `network` are
191
+ allowed for everyone once it is added, as a workspace's admin adds an
192
+ integration: adding it is the consent. The ready-made Chat asks for a GIPHY
193
+ key, and shows its GIF button only once it has one.
194
+
179
195
  **Opening a record where it belongs.** A `launcher.app` may name, among its
180
196
  `collections`, the ones it `shows`: the ones whose records it is the place
181
197
  to open (`shows: ["std.message"]` for a chat). Whatever asks the example app
@@ -251,7 +267,7 @@ defines its collections and writes a copy of it, naming where it came from
251
267
  (`template: "kanban"`), and from then on the space changes its copy like any
252
268
  other app.
253
269
 
254
- _Source: `apps/example/src/components/apps/launcher.ts` (`addTemplate`), `apps/example/src/components/apps/screens.ts`, `apps/example/src/components/apps/ScreenFrame.tsx`, `apps/example/src/components/apps/templates/`, `apps/example/public/screen.html`, `packages/ui/src/frame/`, `packages/ui/src/guide.ts`. Tests: `apps/example/tests/launcher.test.ts` ("adding a ready-made app copies it into the space once, with its collections and first records"), `apps/example/tests/screens.test.ts` ("a screen checks, shows faces and opens things only within its app and its space", "what the page does for a screen, it does only as asked properly", "a screen can’t point a link out of its app, so it can’t probe for keys or reach what no one shared", "a record someone shared is read through the link to it, and only through that", "a screen links out only to what the person picked for it, and is handed what they picked", "the space’s own records are never picked for a screen", "a screen hears the same app's screens on other devices, as who sent it, and no other app's")._
270
+ _Source: `apps/example/src/components/apps/launcher.ts` (`addTemplate`, `firstApp`, `saveSettings`, `settingsOf`), `apps/example/src/components/apps/entries.ts` (`landingApp`, `addChat`), `apps/example/src/contacts.ts` (`withChat`), `apps/example/src/components/apps/screens.ts`, `apps/example/src/components/apps/ScreenFrame.tsx`, `apps/example/src/components/apps/AppSettings.tsx`, `apps/example/src/components/apps/templates/`, `apps/example/public/screen.html`, `packages/ui/src/frame/`, `packages/ui/src/guide.ts`. Tests: `apps/example/tests/launcher.test.ts` ("a space opens with the first app on its launcher, the same for everyone in it, and moving one changes it", "adding a ready-made app copies it into the space once, with its collections and first records", "settings filled in once stand for everyone, survive a new version of the app, and stay in their space"), `apps/example/tests/screens.test.ts` ("an app's settings come with the screen, and the screen can't change them", "a screen checks, shows faces and opens things only within its app and its space", "what the page does for a screen, it does only as asked properly", "a screen can’t point a link out of its app, so it can’t probe for keys or reach what no one shared", "a record someone shared is read through the link to it, and only through that", "a screen links out only to what the person picked for it, and is handed what they picked", "the space’s own records are never picked for a screen", "a screen hears the same app's screens on other devices, as who sent it, and no other app's")._
255
271
 
256
272
  ## Describing a collection
257
273
 
@@ -22,7 +22,7 @@ const connection = createMincaConnection({
22
22
  scope: 'spaces', // or 'account', for every space
23
23
  create: [{ name: 'Todos', visibility: 'private' }],
24
24
  },
25
- network: { relays: ['wss://minca.fly.dev'] },
25
+ network: { relays: ['wss://relay.minca.social'] },
26
26
  });
27
27
 
28
28
  createRoot(root).render(
@@ -55,7 +55,7 @@ account, password or passkey, creating one, pairing a phone) ships as an
55
55
  element and as a React component.
56
56
 
57
57
  ```html
58
- <minca-auth app-name="Todo" relays="wss://minca.fly.dev"></minca-auth>
58
+ <minca-auth app-name="Todo" relays="wss://relay.minca.social"></minca-auth>
59
59
  <script type="module">
60
60
  import '@minca/core/elements';
61
61
  document.querySelector('minca-auth').addEventListener('minca-session', (event) => {
@@ -69,7 +69,7 @@ element and as a React component.
69
69
  import { createMincaAuth } from '@minca/core/session';
70
70
  import { MincaProvider, MincaAuth, useMinca } from '@minca/react';
71
71
 
72
- const auth = createMincaAuth({ appName: 'Todo', network: { relays: ['wss://minca.fly.dev'] } });
72
+ const auth = createMincaAuth({ appName: 'Todo', network: { relays: ['wss://relay.minca.social'] } });
73
73
 
74
74
  function App() {
75
75
  const { state } = useMinca();
@@ -103,7 +103,7 @@ const me = await manager.fromRecoveryCode(code);
103
103
  const node = await createNode({
104
104
  signer: createLocalRootSigner(me, manager.getProvider()),
105
105
  stores: indexedDBStores('my-app'),
106
- network: { relays: ['wss://minca.fly.dev'] },
106
+ network: { relays: ['wss://relay.minca.social'] },
107
107
  });
108
108
  ```
109
109
 
@@ -148,6 +148,9 @@ All from `@minca/react`, below a `MincaProvider`:
148
148
  | `useCan(space, action, target)` | Whether to show an edit or delete button |
149
149
  | `useHoldSpace(space)` | Keeps a space syncing while the view is on screen |
150
150
  | `useLive(space, load, deps)` | Anything else, reloaded as the space changes |
151
+ | `useWatched(load, deps, { when, settle, every })` | Anything else, reloaded after the node events you pick |
152
+ | `useAsync(load, deps)` | One answer: `loading`, `done` with its value, or `failed` |
153
+ | `useAccountPicture()` | The account's picture as a URL, or null |
151
154
  | `useNames(space)` | `name(did)`: what someone is called there, never passing for another |
152
155
  | `useMyName()` | The account's name, to ask for when making or joining a space |
153
156
  | `useInviteLink()` | The invite this page was opened with, what it is for, and `dismiss` |
@@ -105,7 +105,7 @@ enforced on arrival, because two peers may have seen different versions of a
105
105
  definition ([spec 02 §9.6](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)).
106
106
  Rules, below, are enforced everywhere.
107
107
 
108
- _Source: `packages/core/src/schema/collection-def.ts` (`validateJsonSchema`, `toJsonSchema`, `asStandardSchema`), `packages/core/src/node/space-runtime.ts` (`contentIssues`). Tests: `packages/core/tests/space-catalog.test.ts` ("validate and reject within the supported subset", "an unknown keyword is ignored when validating, so newer spaces stay readable", "choices can carry labels, or come from a linked record", "an x-\* keyword is an annotation: any one publishes, and no value is checked against it", "a record that does not fit is kept and flagged when it arrives, never rejected"), `packages/core/tests/attacks.test.ts` ("a definition the validator can't use can't break reading the collection, or the space"), `packages/core/tests/schemas.test.ts` ("schemas from a validator you already use")._
108
+ _Source: `packages/core/src/schema/collection-def.ts` (`validateJsonSchema`, `toJsonSchema`, `asStandardSchema`), `packages/core/src/node/space-catalog.ts` (`contentIssues`). Tests: `packages/core/tests/space-catalog.test.ts` ("validate and reject within the supported subset", "an unknown keyword is ignored when validating, so newer spaces stay readable", "choices can carry labels, or come from a linked record", "an x-\* keyword is an annotation: any one publishes, and no value is checked against it", "a record that does not fit is kept and flagged when it arrives, never rejected"), `packages/core/tests/attacks.test.ts` ("a definition the validator can't use can't break reading the collection, or the space"), `packages/core/tests/schemas.test.ts` ("schemas from a validator you already use")._
109
109
 
110
110
  ## Links
111
111
 
@@ -135,7 +135,7 @@ Like a schema, link declarations are checked when you write: the node refuses
135
135
  to sign links that don't conform. A record that arrives with links that
136
136
  don't conform is kept and comes back with `conforms: false`.
137
137
 
138
- _Source: `packages/core/src/records/links.ts` (`checkLinks`), `packages/core/src/node/space-runtime.ts` (`linkIssues`, `write`). Tests: `packages/core/tests/links.test.ts` ("refused on write when they break the declaration; flagged, never rejected, when they arrive")._
138
+ _Source: `packages/core/src/records/links.ts` (`checkLinks`), `packages/core/src/node/space-catalog.ts` (`linkIssues`), `packages/core/src/node/space-writing.ts` (`write`). Tests: `packages/core/tests/links.test.ts` ("refused on write when they break the declaration; flagged, never rejected, when they arrive")._
139
139
 
140
140
  ## Rules
141
141
 
@@ -399,7 +399,7 @@ differ, `collections.list` leaves it out and its records are judged by no
399
399
  rules
400
400
  ([spec 02 §6.3](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)).
401
401
 
402
- _Source: `packages/core/src/node/space-runtime.ts` (`define`, `undefine`, `unseenRules`, `write`), `packages/core/src/node/types.ts` (`NodeCollections`). Tests: `packages/core/tests/space-catalog.test.ts`, `packages/core/tests/rules.test.ts` ("grants: changing them")._
402
+ _Source: `packages/core/src/node/space-runtime.ts` (`define`, `undefine`), `packages/core/src/node/space-writing.ts` (`write`), `packages/core/src/node/types.ts` (`NodeCollections`). Tests: `packages/core/tests/space-catalog.test.ts`, `packages/core/tests/rules.test.ts` ("grants: changing them")._
403
403
 
404
404
  ## The standard library
405
405
 
package/docs/contacts.md CHANGED
@@ -88,13 +88,46 @@ theirs to leave, and opens as nothing.
88
88
  `blocked: true`.
89
89
  - `others(did)` lists accounts other than the two seen in the space for two
90
90
  (members, profiles, connected peers).
91
+ - `invite(did, spaceId, { role? })` invites a contact into a space you hold:
92
+ it makes an invite for `role` and leaves it as a `std.space-invite` in your
93
+ space for two with them. The contact must have joined the space for two: a
94
+ knock nobody answered yet is refused, so a space is never opened to whoever
95
+ a username happens to lead to before you have seen who they are. A blocked
96
+ contact is refused.
97
+ - `invites()` lists the invites a contact left for you in your space for two
98
+ with them, to spaces you don't hold yet, newest first:
99
+ `{ from, space, name, invite, pairSpace, key, createdAt }`. Only the
100
+ contact's own records count, and each invite is checked as joining checks
101
+ it: signed by the contact, for the space whose constitution it carries,
102
+ which is where `space` and `name` come from. Invites from someone blocked are
103
+ not shown. It also closes, and deletes, invites of yours the contact has
104
+ joined with.
105
+ - `join(pairSpace, key)` joins the space an invite from that contact is for.
106
+
107
+ ## `std.space-invite`
108
+
109
+ An invite to a space, left in a space for two: `{ space, invite }`,
110
+ `onePer: ['space']`, so inviting again to the same space replaces it.
111
+
112
+ It is open until its maker's node sees the contact in the space and closes
113
+ it, the next time it reads `invites()`. A contact removed before then can
114
+ rejoin with it, as with any open role invite
115
+ ([#170](https://github.com/leifriksheim/minca/issues/170)), and whoever else
116
+ holds a place in the space for two reads it
117
+ ([#313](https://github.com/leifriksheim/minca/issues/313)). An invite with no
118
+ role, to view, carries the space key and can't be closed
119
+ ([#172](https://github.com/leifriksheim/minca/issues/172)).
120
+
121
+ A contact's `username` is what their domain answered when you found them by
122
+ it. Nothing checks it again: once a name lapses and someone else claims it, a
123
+ lookup leads to them, and the contact keeps the old one.
91
124
 
92
125
  `ask` and `accept` need a session note that grants `/account/write` for the
93
126
  whole account, as a knock does. An app granted `contacts` sees the list and
94
127
  requests, but may not ask or accept
95
128
  ([spec 06 §2.5](https://github.com/leifriksheim/minca/blob/main/spec/06-nodes-and-sessions.md)).
96
129
 
97
- _Source: `packages/core/src/schemas/contacts.ts` (`contact`), `packages/core/src/identity/contact-key.ts` (`deriveContactKeyBytes`), `packages/core/src/inbox/inbox.ts` (`sealKnock`, `openKnock`), `packages/core/src/node/node.ts` (contacts section: `openMail`, `makePair`, `contacts`), `packages/core/src/schemas/contacts.ts` (`contactRequest`), `packages/core/src/node/types.ts` (`NodeContacts`), `packages/core/src/space/account-registry.ts` (`deriveContactsSpace`). Tests: `packages/core/tests/contacts.test.ts`, `packages/core/tests/attacks.test.ts` ("a knock re-posted by someone else…")._
130
+ _Source: `packages/core/src/schemas/contacts.ts` (`contact`), `packages/core/src/identity/contact-key.ts` (`deriveContactKeyBytes`), `packages/core/src/inbox/inbox.ts` (`sealKnock`, `openKnock`), `packages/core/src/node/node-contacts.ts` (`openMail`, `makePair`, `contacts`), `packages/core/src/schemas/contacts.ts` (`contactRequest`), `packages/core/src/node/types.ts` (`NodeContacts`), `packages/core/src/space/account-registry.ts` (`deriveContactsSpace`). Tests: `packages/core/tests/contacts.test.ts`, `packages/core/tests/attacks.test.ts` ("a knock re-posted by someone else…"), `packages/core/tests/usernames.test.ts` ("node.contacts.invite")._
98
131
 
99
132
  ## Planned: requests that can be taken back
100
133
 
package/docs/contracts.md CHANGED
@@ -196,4 +196,4 @@ A line is checked by walking its counted chain for each version judged, so a
196
196
  very long line costs time in proportion to its length squared, once; the
197
197
  verdicts are cached.
198
198
 
199
- _Source: `packages/core/src/records/contract-builder.ts` (`contract`, `buildChecks`, `storedContract`), `packages/core/src/records/cel-types.ts` (`typeCheckCel`, `typeOfSchema`), `packages/core/src/records/contracts.ts` (`checkContracts`, `checkContractShape`, `checkContractTypes`, `runContracts`, `contractCostHints`, `checkLine`), `packages/core/src/node/space-runtime.ts` (`checksOf`, `lineBreak`, `contractsFor`, `counts`, `recordsChanged`, `after`, `write`, `define`), `packages/core/src/node/node.ts` (`records.contracts`). Tests: `packages/core/tests/contract-builder.test.ts`, `packages/core/tests/contracts.test.ts`, `packages/core/tests/contracts-shape.test.ts`, `packages/core/tests/contracts-line.test.ts`, `packages/core/tests/contracts-pending.test.ts`, `packages/core/tests/contracts-reads.test.ts`, `scenarios/tests/fame.test.ts` and `scenarios/tests/credit.test.ts` (each case with the built contract and the hand-written one)._
199
+ _Source: `packages/core/src/records/contract-builder.ts` (`contract`, `buildChecks`, `storedContract`), `packages/core/src/records/cel-types.ts` (`typeCheckCel`, `typeOfSchema`), `packages/core/src/records/contracts.ts` (`checkContracts`, `checkContractShape`, `checkContractTypes`, `runContracts`, `contractCostHints`, `checkLine`), `packages/core/src/node/space-checks.ts` (`checksOf`, `lineBreak`, `counts`), `packages/core/src/node/space-writing.ts` (`contractsFor`, `after`, `write`), `packages/core/src/node/space-runtime.ts` (`recordsChanged`, `define`), `packages/core/src/node/node-records.ts` (`contracts`). Tests: `packages/core/tests/contract-builder.test.ts`, `packages/core/tests/contracts.test.ts`, `packages/core/tests/contracts-shape.test.ts`, `packages/core/tests/contracts-line.test.ts`, `packages/core/tests/contracts-pending.test.ts`, `packages/core/tests/contracts-reads.test.ts`, `scenarios/tests/fame.test.ts` and `scenarios/tests/credit.test.ts` (each case with the built contract and the hand-written one)._
@@ -107,7 +107,7 @@ _Source:_ `packages/core/src/node/actions.ts` (`direct_list`, `direct_send`),
107
107
  (`openTrigger`, `ruleContext`). Tests: `packages/core/tests/direct.test.ts`
108
108
  ("the direct message actions"), `packages/cli/tests/agent-automations.test.ts`.
109
109
 
110
- _Source: `packages/core/src/privacy/direct.ts` (`sealDirect`, `openDirect`, `directBound`), `packages/core/src/schemas/library/publishing.ts` (`direct`), `packages/core/src/node/node.ts` (`direct`, `directView`), `packages/core/src/node/space-runtime.ts` (`memberKeys`, `ownMemberKey`), `apps/example/src/components/apps/Chat.tsx`. Tests: `packages/core/tests/direct.test.ts`, `packages/core/tests/records-only.test.ts` ("neither sends nor reads direct messages")._
110
+ _Source: `packages/core/src/privacy/direct.ts` (`sealDirect`, `openDirect`, `directBound`), `packages/core/src/schemas/library/publishing.ts` (`direct`), `packages/core/src/node/node-records.ts` (`createNodeDirect`, `directView`), `packages/core/src/node/space-profiles.ts` (`memberKeys`), `packages/core/src/node/space-runtime.ts` (`ownMemberKey`), `apps/example/src/components/apps/Chat.tsx`. Tests: `packages/core/tests/direct.test.ts`, `packages/core/tests/records-only.test.ts` ("neither sends nor reads direct messages")._
111
111
 
112
112
  ## Planned: direct messages in public spaces
113
113
 
package/docs/inbox.md CHANGED
@@ -32,7 +32,7 @@ keys stay, so a code already handed out keeps working once it is read again.
32
32
  `gen + 1`: the old code leads to a topic nobody reads, and nothing ties the
33
33
  new keys to the old.
34
34
 
35
- _Source: `packages/core/src/schemas/contacts.ts` (`inbox`), `packages/core/src/node/node.ts` (The inbox: `inboxRecord`, `writeInbox`, `inbox.rotate`). Tests: `packages/core/tests/inbox.test.ts` ("node.inbox")._
35
+ _Source: `packages/core/src/schemas/contacts.ts` (`inbox`), `packages/core/src/node/node-contacts.ts` (`inboxRecord`, `writeInbox`, `inbox.rotate`). Tests: `packages/core/tests/inbox.test.ts` ("node.inbox")._
36
36
 
37
37
  ## The exchange
38
38
 
@@ -113,7 +113,7 @@ and the contact key. The inbox is the person's: a node whose note lacks
113
113
  knock, accept or dismiss. A home never gives an agent the contact key in the
114
114
  first place ([spec 06 §2.8](https://github.com/leifriksheim/minca/blob/main/spec/06-nodes-and-sessions.md)).
115
115
 
116
- _Source: `packages/core/src/node/node.ts` (The inbox: `makePair`, `settleSent`, `readKnocks`, `inbox`), `packages/core/src/node/types.ts` (`NodeInbox`), `packages/core/src/schemas/contacts.ts` (`inbox`, `knock`), `packages/core/src/inbox/inbox.ts`, `packages/core/src/session/auth.ts` (`grant`). Tests: `packages/core/tests/inbox.test.ts` ("node.inbox"), `packages/core/tests/carrier.test.ts` ("a space made just now, carried before its invite goes out…"), `packages/core/tests/records-only.test.ts`._
116
+ _Source: `packages/core/src/node/node-contacts.ts` (`makePair`, `settleSent`, `readKnocks`, `inbox`), `packages/core/src/node/types.ts` (`NodeInbox`), `packages/core/src/schemas/contacts.ts` (`inbox`, `knock`), `packages/core/src/inbox/inbox.ts`, `packages/core/src/session/auth.ts` (`grant`). Tests: `packages/core/tests/inbox.test.ts` ("node.inbox"), `packages/core/tests/carrier.test.ts` ("a space made just now, carried before its invite goes out…"), `packages/core/tests/records-only.test.ts`._
117
117
 
118
118
  ## `node.inbox`
119
119
 
@@ -133,13 +133,7 @@ _Source: `packages/core/src/network/relays.ts` (`createMailboxClient`)._
133
133
  - **Mailboxes that last.** A host that keeps its accounts' inbox topics
134
134
  across restarts, as it keeps short links.
135
135
 
136
- ## Planned: names
136
+ ## Usernames
137
137
 
138
- The protocol side of names (a handle resolving to an inbox code) is planned in
139
- [spec 07 §9](https://github.com/leifriksheim/minca/blob/main/spec/07-inbox.md).
140
- On this side:
141
-
142
- - `node.inbox.knock` accepts a handle wherever it takes a code.
143
- - **Who may knock.** The inbox gains a policy in its `std.inbox` record (never
144
- published): `anyone` (default), `follows` or `mutuals` on the handle's
145
- network. Knocks that don't match are kept but shown apart.
138
+ A username (`leif@minca.social`) leads to an inbox code: see
139
+ [usernames.md](usernames.md).
package/docs/node.md CHANGED
@@ -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
 
@@ -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
 
@@ -660,7 +660,7 @@ offer or answer waits for ICE gathering to finish, or 2 s, and carries what it
660
660
  found.
661
661
 
662
662
  **Kinds of relay** (spec 04 §1.2). `network.relays` may mix kinds:
663
- `['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
664
664
  this library doesn't speak is left out of `network.status()`. On a Nostr
665
665
  relay, each event is signed with a key made for it and forgotten.
666
666
 
@@ -701,7 +701,7 @@ connected relay that can and waits up to 1.5 s for an answer (relays without
701
701
  TURN never answer), then returns what it has. A node with no relays returns
702
702
  the configured servers.
703
703
 
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-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._
705
705
 
706
706
  ## A node acting as an agent
707
707
 
@@ -735,7 +735,7 @@ account's knocks, in shared spaces and in its inbox ([inbox.md](inbox.md)).
735
735
 
736
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.
737
737
 
738
- _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…")._
739
739
 
740
740
  ## The app-side client
741
741
 
@@ -909,7 +909,13 @@ genesis and any invite opened before the call. It says whether it was: false
909
909
  at once when no carrier is connected. `contacts.ask` and `inbox.knock` wait on it before the knock goes
910
910
  out, and pass what it said on as `carried`, for the app to tell the person.
911
911
 
912
- _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…")._
913
919
 
914
920
  **The account's own automations.** `node.automations` (needs the account
915
921
  key) lists, adds, updates (`name`, `paused`) and removes the account's own
@@ -975,7 +981,7 @@ hour (`evaluate`) holds each to the free line. Past a space's `until`, every
975
981
  account's carry space stops carrying it (`skip`, in `createCarryCore`), while
976
982
  its own subscription still may. Each change is a line in the host's log.
977
983
 
978
- _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`._
979
985
 
980
986
  ### A space paying for itself
981
987
 
@@ -1017,7 +1023,7 @@ has, so it keeps that, unreadable, for as long as the space's subscription is
1017
1023
  paid, and what is in the fund stays there
1018
1024
  ([#220](https://github.com/leifriksheim/minca/issues/220)).
1019
1025
 
1020
- _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)._
1021
1027
 
1022
1028
  ## The inbox
1023
1029
 
@@ -1025,13 +1031,15 @@ _Source: `packages/core/src/node/node.ts` (`keepSpaceHosts`, `askSpaceHost`, `ho
1025
1031
 
1026
1032
  | Call | Does |
1027
1033
  | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1028
- | `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 |
1029
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 |
1030
1036
  | `rotate()` | Clears the inbox and replaces it with `gen + 1`: the old code leads nowhere |
1031
1037
  | `clear()` | Purges every knock waiting, from every mailbox it names |
1032
- | `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 }` |
1033
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 |
1034
- | `sent()` | Your knocks nobody has joined yet: `{ space, name, at }` |
1042
+ | `sent()` | Your knocks nobody has joined yet: `{ space, name, username?, at }` |
1035
1043
  | `accept(id)` | [the exchange](inbox.md#the-exchange), returns the new `ContactView` |
1036
1044
  | `dismiss(id)` | Purges one knock |
1037
1045
 
@@ -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")._