@minca/core 0.2.0 → 0.4.0

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 (420) hide show
  1. package/README.md +2 -2
  2. package/dist/{session → hosting}/hosting.d.ts +2 -8
  3. package/dist/hosting/hosting.d.ts.map +1 -0
  4. package/dist/{session → hosting}/hosting.js +3 -3
  5. package/dist/hosting/hosting.js.map +1 -0
  6. package/dist/identity/abilities.d.ts +0 -2
  7. package/dist/identity/abilities.d.ts.map +1 -1
  8. package/dist/identity/abilities.js +2 -2
  9. package/dist/identity/abilities.js.map +1 -1
  10. package/dist/identity/account-vault.d.ts +0 -2
  11. package/dist/identity/account-vault.d.ts.map +1 -1
  12. package/dist/identity/account-vault.js +1 -1
  13. package/dist/identity/account-vault.js.map +1 -1
  14. package/dist/identity/crypto-p256.d.ts +1 -1
  15. package/dist/identity/crypto-p256.d.ts.map +1 -1
  16. package/dist/identity/ucan.d.ts +2 -1
  17. package/dist/identity/ucan.d.ts.map +1 -1
  18. package/dist/identity/ucan.js +1 -1
  19. package/dist/identity/ucan.js.map +1 -1
  20. package/dist/inbox/inbox.d.ts +0 -21
  21. package/dist/inbox/inbox.d.ts.map +1 -1
  22. package/dist/inbox/inbox.js +4 -4
  23. package/dist/inbox/inbox.js.map +1 -1
  24. package/dist/inbox/index.d.ts +4 -5
  25. package/dist/inbox/index.d.ts.map +1 -1
  26. package/dist/inbox/index.js +2 -3
  27. package/dist/inbox/index.js.map +1 -1
  28. package/dist/inbox/names.d.ts +0 -4
  29. package/dist/inbox/names.d.ts.map +1 -1
  30. package/dist/inbox/names.js +2 -2
  31. package/dist/inbox/names.js.map +1 -1
  32. package/dist/index.d.ts +50 -84
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +38 -60
  35. package/dist/index.js.map +1 -1
  36. package/dist/network/mesh.d.ts.map +1 -1
  37. package/dist/network/mesh.js +23 -3
  38. package/dist/network/mesh.js.map +1 -1
  39. package/dist/network/network-manager.d.ts +5 -0
  40. package/dist/network/network-manager.d.ts.map +1 -1
  41. package/dist/network/network-manager.js +3 -0
  42. package/dist/network/network-manager.js.map +1 -1
  43. package/dist/network/peer-auth.d.ts +17 -5
  44. package/dist/network/peer-auth.d.ts.map +1 -1
  45. package/dist/network/peer-auth.js +19 -9
  46. package/dist/network/peer-auth.js.map +1 -1
  47. package/dist/network/rendezvous.d.ts +2 -0
  48. package/dist/network/rendezvous.d.ts.map +1 -1
  49. package/dist/network/rendezvous.js +5 -0
  50. package/dist/network/rendezvous.js.map +1 -1
  51. package/dist/network/rtc-transport.d.ts.map +1 -1
  52. package/dist/network/rtc-transport.js +9 -3
  53. package/dist/network/rtc-transport.js.map +1 -1
  54. package/dist/network/transport.d.ts +12 -0
  55. package/dist/network/transport.d.ts.map +1 -1
  56. package/dist/network/ws-transport.d.ts +1 -1
  57. package/dist/network/ws-transport.d.ts.map +1 -1
  58. package/dist/network/ws-transport.js +14 -4
  59. package/dist/network/ws-transport.js.map +1 -1
  60. package/dist/node/carrier.d.ts +1 -33
  61. package/dist/node/carrier.d.ts.map +1 -1
  62. package/dist/node/carrier.js +38 -68
  63. package/dist/node/carrier.js.map +1 -1
  64. package/dist/node/index.d.ts +5 -16
  65. package/dist/node/index.d.ts.map +1 -1
  66. package/dist/node/index.js +2 -9
  67. package/dist/node/index.js.map +1 -1
  68. package/dist/node/node-carriers.d.ts.map +1 -1
  69. package/dist/node/node-carriers.js +21 -52
  70. package/dist/node/node-carriers.js.map +1 -1
  71. package/dist/node/node-context.d.ts +0 -2
  72. package/dist/node/node-context.d.ts.map +1 -1
  73. package/dist/node/node-context.js.map +1 -1
  74. package/dist/node/node-hosting.d.ts.map +1 -1
  75. package/dist/node/node-hosting.js +14 -5
  76. package/dist/node/node-hosting.js.map +1 -1
  77. package/dist/node/node-records.js +2 -2
  78. package/dist/node/node-records.js.map +1 -1
  79. package/dist/node/node.d.ts.map +1 -1
  80. package/dist/node/node.js +152 -36
  81. package/dist/node/node.js.map +1 -1
  82. package/dist/node/space-checks.d.ts +3 -1
  83. package/dist/node/space-checks.d.ts.map +1 -1
  84. package/dist/node/space-checks.js +7 -3
  85. package/dist/node/space-checks.js.map +1 -1
  86. package/dist/node/space-holding.d.ts +5 -0
  87. package/dist/node/space-holding.d.ts.map +1 -1
  88. package/dist/node/space-holding.js +90 -5
  89. package/dist/node/space-holding.js.map +1 -1
  90. package/dist/node/space-lines.d.ts +3 -0
  91. package/dist/node/space-lines.d.ts.map +1 -1
  92. package/dist/node/space-lines.js +13 -1
  93. package/dist/node/space-lines.js.map +1 -1
  94. package/dist/node/space-membership.js +4 -4
  95. package/dist/node/space-membership.js.map +1 -1
  96. package/dist/node/space-mirrors.d.ts +1 -1
  97. package/dist/node/space-mirrors.d.ts.map +1 -1
  98. package/dist/node/space-mirrors.js +17 -5
  99. package/dist/node/space-mirrors.js.map +1 -1
  100. package/dist/node/space-peers.d.ts +7 -2
  101. package/dist/node/space-peers.d.ts.map +1 -1
  102. package/dist/node/space-peers.js +44 -10
  103. package/dist/node/space-peers.js.map +1 -1
  104. package/dist/node/space-runtime.d.ts +7 -3
  105. package/dist/node/space-runtime.d.ts.map +1 -1
  106. package/dist/node/space-runtime.js +32 -10
  107. package/dist/node/space-runtime.js.map +1 -1
  108. package/dist/node/space-standing.d.ts +1 -1
  109. package/dist/node/space-standing.d.ts.map +1 -1
  110. package/dist/node/space-standing.js +23 -42
  111. package/dist/node/space-standing.js.map +1 -1
  112. package/dist/node/space-warrants.js +1 -1
  113. package/dist/node/space-warrants.js.map +1 -1
  114. package/dist/node/space-writing.d.ts.map +1 -1
  115. package/dist/node/space-writing.js +21 -32
  116. package/dist/node/space-writing.js.map +1 -1
  117. package/dist/node/stores.d.ts +9 -57
  118. package/dist/node/stores.d.ts.map +1 -1
  119. package/dist/node/stores.js +1 -72
  120. package/dist/node/stores.js.map +1 -1
  121. package/dist/node/types.d.ts +19 -8
  122. package/dist/node/types.d.ts.map +1 -1
  123. package/dist/node/writer-keys.d.ts +15 -14
  124. package/dist/node/writer-keys.d.ts.map +1 -1
  125. package/dist/node/writer-keys.js +3 -115
  126. package/dist/node/writer-keys.js.map +1 -1
  127. package/dist/privacy/direct.d.ts +0 -7
  128. package/dist/privacy/direct.d.ts.map +1 -1
  129. package/dist/privacy/direct.js +2 -2
  130. package/dist/privacy/direct.js.map +1 -1
  131. package/dist/query/filter.d.ts +0 -2
  132. package/dist/query/filter.d.ts.map +1 -1
  133. package/dist/query/filter.js +1 -1
  134. package/dist/query/filter.js.map +1 -1
  135. package/dist/query/types.d.ts +2 -6
  136. package/dist/query/types.d.ts.map +1 -1
  137. package/dist/query/types.js.map +1 -1
  138. package/dist/records/key.d.ts +18 -19
  139. package/dist/records/key.d.ts.map +1 -1
  140. package/dist/records/key.js +55 -43
  141. package/dist/records/key.js.map +1 -1
  142. package/dist/records/links.js +1 -1
  143. package/dist/records/rules.d.ts +1 -1
  144. package/dist/records/rules.d.ts.map +1 -1
  145. package/dist/records/rules.js +6 -4
  146. package/dist/records/rules.js.map +1 -1
  147. package/dist/schemas/direct.d.ts +70 -0
  148. package/dist/schemas/direct.d.ts.map +1 -0
  149. package/dist/schemas/direct.js +39 -0
  150. package/dist/schemas/direct.js.map +1 -0
  151. package/dist/schemas/index.d.ts +10 -73
  152. package/dist/schemas/index.d.ts.map +1 -1
  153. package/dist/schemas/index.js +8 -66
  154. package/dist/schemas/index.js.map +1 -1
  155. package/dist/space/account-registry.d.ts +0 -3
  156. package/dist/space/account-registry.d.ts.map +1 -1
  157. package/dist/space/account-registry.js.map +1 -1
  158. package/dist/space/own-automations.d.ts +51 -95
  159. package/dist/space/own-automations.d.ts.map +1 -1
  160. package/dist/space/own-automations.js +100 -295
  161. package/dist/space/own-automations.js.map +1 -1
  162. package/dist/space/pass.d.ts +8 -3
  163. package/dist/space/pass.d.ts.map +1 -1
  164. package/dist/space/pass.js +4 -3
  165. package/dist/space/pass.js.map +1 -1
  166. package/dist/space/space-manager.d.ts +1 -3
  167. package/dist/space/space-manager.d.ts.map +1 -1
  168. package/dist/space/space-manager.js +5 -7
  169. package/dist/space/space-manager.js.map +1 -1
  170. package/dist/storage/body-cache.d.ts +29 -0
  171. package/dist/storage/body-cache.d.ts.map +1 -0
  172. package/dist/storage/body-cache.js +64 -0
  173. package/dist/storage/body-cache.js.map +1 -0
  174. package/dist/storage/encrypted-adapter.d.ts +0 -5
  175. package/dist/storage/encrypted-adapter.d.ts.map +1 -1
  176. package/dist/storage/encrypted-adapter.js +1 -1
  177. package/dist/storage/encrypted-adapter.js.map +1 -1
  178. package/dist/storage/mirror.d.ts.map +1 -1
  179. package/dist/storage/mirror.js +35 -16
  180. package/dist/storage/mirror.js.map +1 -1
  181. package/dist/storage/segment.d.ts +6 -2
  182. package/dist/storage/segment.d.ts.map +1 -1
  183. package/dist/storage/segment.js +8 -4
  184. package/dist/storage/segment.js.map +1 -1
  185. package/dist/storage/shared-store.d.ts +32 -0
  186. package/dist/storage/shared-store.d.ts.map +1 -0
  187. package/dist/storage/{folder-reconcile.js → shared-store.js} +15 -15
  188. package/dist/storage/shared-store.js.map +1 -0
  189. package/dist/storage/storage-provider.d.ts +19 -9
  190. package/dist/storage/storage-provider.d.ts.map +1 -1
  191. package/dist/storage/storage-provider.js +155 -62
  192. package/dist/storage/storage-provider.js.map +1 -1
  193. package/dist/sync/sync-engine.d.ts +17 -4
  194. package/dist/sync/sync-engine.d.ts.map +1 -1
  195. package/dist/sync/sync-engine.js +298 -84
  196. package/dist/sync/sync-engine.js.map +1 -1
  197. package/dist/sync/sync-messages.d.ts +5 -1
  198. package/dist/sync/sync-messages.d.ts.map +1 -1
  199. package/dist/sync/sync-messages.js +1 -1
  200. package/dist/sync/sync-messages.js.map +1 -1
  201. package/dist/types.d.ts +19 -7
  202. package/dist/types.d.ts.map +1 -1
  203. package/dist/types.js +4 -1
  204. package/dist/types.js.map +1 -1
  205. package/dist/utils/index.d.ts +5 -5
  206. package/dist/utils/index.d.ts.map +1 -1
  207. package/dist/utils/index.js +5 -5
  208. package/dist/utils/index.js.map +1 -1
  209. package/dist/utils/step.d.ts +8 -0
  210. package/dist/utils/step.d.ts.map +1 -0
  211. package/dist/utils/step.js +15 -0
  212. package/dist/utils/step.js.map +1 -0
  213. package/docs/README.md +4 -3
  214. package/docs/actions.md +41 -2
  215. package/docs/agents.md +13 -10
  216. package/docs/automations.md +16 -48
  217. package/docs/blueprints-and-guides.md +2 -2
  218. package/docs/bots.md +3 -3
  219. package/docs/building-an-app.md +2 -2
  220. package/docs/collections.md +2 -4
  221. package/docs/computed.md +1 -2
  222. package/docs/node.md +108 -40
  223. package/docs/proposing-collections.md +3 -3
  224. package/docs/query-format.md +6 -5
  225. package/docs/records-and-queries.md +12 -13
  226. package/docs/sign-in.md +16 -16
  227. package/docs/spaces.md +0 -5
  228. package/docs/standard-library.md +6 -8
  229. package/docs/storage.md +114 -22
  230. package/docs/usernames.md +1 -1
  231. package/package.json +15 -25
  232. package/dist/identity/account-store.d.ts +0 -83
  233. package/dist/identity/account-store.d.ts.map +0 -1
  234. package/dist/identity/account-store.js +0 -234
  235. package/dist/identity/account-store.js.map +0 -1
  236. package/dist/identity/device-key.d.ts +0 -26
  237. package/dist/identity/device-key.d.ts.map +0 -1
  238. package/dist/identity/device-key.js +0 -48
  239. package/dist/identity/device-key.js.map +0 -1
  240. package/dist/identity/idb.d.ts +0 -19
  241. package/dist/identity/idb.d.ts.map +0 -1
  242. package/dist/identity/idb.js +0 -56
  243. package/dist/identity/idb.js.map +0 -1
  244. package/dist/node/actions.d.ts +0 -85
  245. package/dist/node/actions.d.ts.map +0 -1
  246. package/dist/node/actions.js +0 -921
  247. package/dist/node/actions.js.map +0 -1
  248. package/dist/node/host.d.ts +0 -187
  249. package/dist/node/host.d.ts.map +0 -1
  250. package/dist/node/host.js +0 -818
  251. package/dist/node/host.js.map +0 -1
  252. package/dist/node/usage.d.ts +0 -32
  253. package/dist/node/usage.d.ts.map +0 -1
  254. package/dist/node/usage.js +0 -217
  255. package/dist/node/usage.js.map +0 -1
  256. package/dist/node/watch-notifications.d.ts +0 -25
  257. package/dist/node/watch-notifications.d.ts.map +0 -1
  258. package/dist/node/watch-notifications.js +0 -166
  259. package/dist/node/watch-notifications.js.map +0 -1
  260. package/dist/node/worker.d.ts +0 -83
  261. package/dist/node/worker.d.ts.map +0 -1
  262. package/dist/node/worker.js +0 -305
  263. package/dist/node/worker.js.map +0 -1
  264. package/dist/node-worker.d.ts +0 -2
  265. package/dist/node-worker.d.ts.map +0 -1
  266. package/dist/node-worker.js +0 -16
  267. package/dist/node-worker.js.map +0 -1
  268. package/dist/schemas/automations.d.ts +0 -390
  269. package/dist/schemas/automations.d.ts.map +0 -1
  270. package/dist/schemas/automations.js +0 -619
  271. package/dist/schemas/automations.js.map +0 -1
  272. package/dist/schemas/blueprints.d.ts +0 -122
  273. package/dist/schemas/blueprints.d.ts.map +0 -1
  274. package/dist/schemas/blueprints.js +0 -337
  275. package/dist/schemas/blueprints.js.map +0 -1
  276. package/dist/schemas/choosing.d.ts +0 -19
  277. package/dist/schemas/choosing.d.ts.map +0 -1
  278. package/dist/schemas/choosing.js +0 -69
  279. package/dist/schemas/choosing.js.map +0 -1
  280. package/dist/schemas/connectors.d.ts +0 -202
  281. package/dist/schemas/connectors.d.ts.map +0 -1
  282. package/dist/schemas/connectors.js +0 -140
  283. package/dist/schemas/connectors.js.map +0 -1
  284. package/dist/schemas/cron.d.ts +0 -14
  285. package/dist/schemas/cron.d.ts.map +0 -1
  286. package/dist/schemas/cron.js +0 -75
  287. package/dist/schemas/cron.js.map +0 -1
  288. package/dist/schemas/geo.d.ts +0 -63
  289. package/dist/schemas/geo.d.ts.map +0 -1
  290. package/dist/schemas/geo.js +0 -131
  291. package/dist/schemas/geo.js.map +0 -1
  292. package/dist/schemas/guides.d.ts +0 -26
  293. package/dist/schemas/guides.d.ts.map +0 -1
  294. package/dist/schemas/guides.js +0 -33
  295. package/dist/schemas/guides.js.map +0 -1
  296. package/dist/schemas/library/annotations.d.ts +0 -616
  297. package/dist/schemas/library/annotations.d.ts.map +0 -1
  298. package/dist/schemas/library/annotations.js +0 -156
  299. package/dist/schemas/library/annotations.js.map +0 -1
  300. package/dist/schemas/library/collections.d.ts +0 -211
  301. package/dist/schemas/library/collections.d.ts.map +0 -1
  302. package/dist/schemas/library/collections.js +0 -57
  303. package/dist/schemas/library/collections.js.map +0 -1
  304. package/dist/schemas/library/community.d.ts +0 -1136
  305. package/dist/schemas/library/community.d.ts.map +0 -1
  306. package/dist/schemas/library/community.js +0 -315
  307. package/dist/schemas/library/community.js.map +0 -1
  308. package/dist/schemas/library/life.d.ts +0 -1440
  309. package/dist/schemas/library/life.d.ts.map +0 -1
  310. package/dist/schemas/library/life.js +0 -202
  311. package/dist/schemas/library/life.js.map +0 -1
  312. package/dist/schemas/library/media.d.ts +0 -1002
  313. package/dist/schemas/library/media.d.ts.map +0 -1
  314. package/dist/schemas/library/media.js +0 -110
  315. package/dist/schemas/library/media.js.map +0 -1
  316. package/dist/schemas/library/money.d.ts +0 -1221
  317. package/dist/schemas/library/money.d.ts.map +0 -1
  318. package/dist/schemas/library/money.js +0 -168
  319. package/dist/schemas/library/money.js.map +0 -1
  320. package/dist/schemas/library/planning.d.ts +0 -1107
  321. package/dist/schemas/library/planning.d.ts.map +0 -1
  322. package/dist/schemas/library/planning.js +0 -214
  323. package/dist/schemas/library/planning.js.map +0 -1
  324. package/dist/schemas/library/publishing.d.ts +0 -1499
  325. package/dist/schemas/library/publishing.d.ts.map +0 -1
  326. package/dist/schemas/library/publishing.js +0 -285
  327. package/dist/schemas/library/publishing.js.map +0 -1
  328. package/dist/schemas/library/social.d.ts +0 -1257
  329. package/dist/schemas/library/social.d.ts.map +0 -1
  330. package/dist/schemas/library/social.js +0 -147
  331. package/dist/schemas/library/social.js.map +0 -1
  332. package/dist/schemas/standard.d.ts +0 -21
  333. package/dist/schemas/standard.d.ts.map +0 -1
  334. package/dist/schemas/standard.js +0 -39
  335. package/dist/schemas/standard.js.map +0 -1
  336. package/dist/session/account-hint.d.ts +0 -13
  337. package/dist/session/account-hint.d.ts.map +0 -1
  338. package/dist/session/account-hint.js +0 -54
  339. package/dist/session/account-hint.js.map +0 -1
  340. package/dist/session/auth.d.ts +0 -411
  341. package/dist/session/auth.d.ts.map +0 -1
  342. package/dist/session/auth.js +0 -1529
  343. package/dist/session/auth.js.map +0 -1
  344. package/dist/session/channel-room.d.ts +0 -26
  345. package/dist/session/channel-room.d.ts.map +0 -1
  346. package/dist/session/channel-room.js +0 -56
  347. package/dist/session/channel-room.js.map +0 -1
  348. package/dist/session/connect-code.d.ts +0 -127
  349. package/dist/session/connect-code.d.ts.map +0 -1
  350. package/dist/session/connect-code.js +0 -408
  351. package/dist/session/connect-code.js.map +0 -1
  352. package/dist/session/connect.d.ts +0 -386
  353. package/dist/session/connect.d.ts.map +0 -1
  354. package/dist/session/connect.js +0 -583
  355. package/dist/session/connect.js.map +0 -1
  356. package/dist/session/connection.d.ts +0 -135
  357. package/dist/session/connection.d.ts.map +0 -1
  358. package/dist/session/connection.js +0 -215
  359. package/dist/session/connection.js.map +0 -1
  360. package/dist/session/credentials.d.ts +0 -30
  361. package/dist/session/credentials.d.ts.map +0 -1
  362. package/dist/session/credentials.js +0 -63
  363. package/dist/session/credentials.js.map +0 -1
  364. package/dist/session/hosting.d.ts.map +0 -1
  365. package/dist/session/hosting.js.map +0 -1
  366. package/dist/session/index.d.ts +0 -29
  367. package/dist/session/index.d.ts.map +0 -1
  368. package/dist/session/index.js +0 -21
  369. package/dist/session/index.js.map +0 -1
  370. package/dist/session/pairing.d.ts +0 -97
  371. package/dist/session/pairing.d.ts.map +0 -1
  372. package/dist/session/pairing.js +0 -251
  373. package/dist/session/pairing.js.map +0 -1
  374. package/dist/session/password-strength.d.ts +0 -22
  375. package/dist/session/password-strength.d.ts.map +0 -1
  376. package/dist/session/password-strength.js +0 -130
  377. package/dist/session/password-strength.js.map +0 -1
  378. package/dist/session/places.d.ts +0 -71
  379. package/dist/session/places.d.ts.map +0 -1
  380. package/dist/session/places.js +0 -130
  381. package/dist/session/places.js.map +0 -1
  382. package/dist/session/popup.d.ts +0 -13
  383. package/dist/session/popup.d.ts.map +0 -1
  384. package/dist/session/popup.js +0 -23
  385. package/dist/session/popup.js.map +0 -1
  386. package/dist/session/stay-signed-in.d.ts +0 -49
  387. package/dist/session/stay-signed-in.d.ts.map +0 -1
  388. package/dist/session/stay-signed-in.js +0 -141
  389. package/dist/session/stay-signed-in.js.map +0 -1
  390. package/dist/storage/blob/directory.d.ts +0 -14
  391. package/dist/storage/blob/directory.d.ts.map +0 -1
  392. package/dist/storage/blob/directory.js +0 -87
  393. package/dist/storage/blob/directory.js.map +0 -1
  394. package/dist/storage/blob/memory.d.ts +0 -6
  395. package/dist/storage/blob/memory.d.ts.map +0 -1
  396. package/dist/storage/blob/memory.js +0 -20
  397. package/dist/storage/blob/memory.js.map +0 -1
  398. package/dist/storage/blob/s3.d.ts +0 -16
  399. package/dist/storage/blob/s3.d.ts.map +0 -1
  400. package/dist/storage/blob/s3.js +0 -91
  401. package/dist/storage/blob/s3.js.map +0 -1
  402. package/dist/storage/directory-access.d.ts +0 -36
  403. package/dist/storage/directory-access.d.ts.map +0 -1
  404. package/dist/storage/directory-access.js +0 -89
  405. package/dist/storage/directory-access.js.map +0 -1
  406. package/dist/storage/folder-adapter.d.ts +0 -94
  407. package/dist/storage/folder-adapter.d.ts.map +0 -1
  408. package/dist/storage/folder-adapter.js +0 -215
  409. package/dist/storage/folder-adapter.js.map +0 -1
  410. package/dist/storage/folder-reconcile.d.ts +0 -33
  411. package/dist/storage/folder-reconcile.d.ts.map +0 -1
  412. package/dist/storage/folder-reconcile.js.map +0 -1
  413. package/dist/storage/index.d.ts +0 -6
  414. package/dist/storage/index.d.ts.map +0 -1
  415. package/dist/storage/index.js +0 -5
  416. package/dist/storage/index.js.map +0 -1
  417. package/dist/storage/indexeddb-adapter.d.ts +0 -8
  418. package/dist/storage/indexeddb-adapter.d.ts.map +0 -1
  419. package/dist/storage/indexeddb-adapter.js +0 -103
  420. package/dist/storage/indexeddb-adapter.js.map +0 -1
@@ -22,7 +22,7 @@ A blueprint is the only way such a key gets a collection. Every peer refuses a
22
22
  definition from a key whose note doesn't grant `/collection/define`.
23
23
 
24
24
  ```typescript
25
- import { proposeCollections, reviewBlueprint, applyBlueprint } from '@minca/core/schemas';
25
+ import { proposeCollections, reviewBlueprint, applyBlueprint } from '@minca/std';
26
26
 
27
27
  const proposal = await proposeCollections(node, space.id, {
28
28
  title: 'Chores',
@@ -98,7 +98,7 @@ Each collection comes back as one of three:
98
98
  Each also has a `summary`: what it allows, in sentences worked out from its
99
99
  rules ([describing a collection](#describing-a-collection)). A change also
100
100
  says what would be different, and which applied blueprints it could break.
101
- The rest is on [`CollectionReview`](https://minca.dev/api/schemas/interfaces/CollectionReview/).
101
+ The rest is on [`CollectionReview`](https://minca.dev/api/std/interfaces/CollectionReview/).
102
102
 
103
103
  A blueprint is `applied` once every collection in it is `same`.
104
104
 
package/docs/bots.md CHANGED
@@ -19,7 +19,7 @@ hold the grant.
19
19
  Ask with `mayConfigure`:
20
20
 
21
21
  ```ts
22
- import { mayConfigure } from '@minca/core/schemas';
22
+ import { mayConfigure } from '@minca/std';
23
23
 
24
24
  async function openSettings(bot: string, person: string) {
25
25
  if (await mayConfigure(node, space.id, bot, person)) {
@@ -93,7 +93,7 @@ needs each service's id and name.
93
93
 
94
94
  ```ts
95
95
  import type { SpaceHostingView } from '@minca/core';
96
- import { askToConnect, connectPage } from '@minca/core/schemas';
96
+ import { askToConnect, connectPage } from '@minca/std';
97
97
 
98
98
  async function connect(host: SpaceHostingView, bot: string) {
99
99
  // Opened in the click, before any await, or the browser blocks it.
@@ -114,7 +114,7 @@ and the bot deletes its `std.connector`.
114
114
 
115
115
  ```ts
116
116
  import type { SpaceHostingView } from '@minca/core';
117
- import { askToConnect, askToDisconnect } from '@minca/core/schemas';
117
+ import { askToConnect, askToDisconnect } from '@minca/std';
118
118
 
119
119
  async function disconnect(host: SpaceHostingView, bot: string) {
120
120
  const ask = await askToConnect(node, space.id, bot, 'github', { disconnect: true });
@@ -14,7 +14,7 @@ Every app starts by asking the person for access, with
14
14
  declare function Todos(): React.JSX.Element;
15
15
  // ---cut---
16
16
  import { createRoot } from 'react-dom/client';
17
- import { createMincaConnection } from '@minca/core/session';
17
+ import { createMincaConnection } from '@minca/session';
18
18
  import { MincaProvider, useConnection } from '@minca/react';
19
19
 
20
20
  const connection = createMincaConnection({
@@ -58,7 +58,7 @@ The person's account, its settings and its other apps live at their home, not
58
58
  in your app. Open it from a click, for the account your app acts for:
59
59
 
60
60
  ```ts
61
- import type { MincaConnection } from '@minca/core/session';
61
+ import type { MincaConnection } from '@minca/session';
62
62
  declare const connection: MincaConnection;
63
63
  // ---cut---
64
64
  connection.openHome(); // the account page
@@ -278,9 +278,7 @@ record's first version is, when the rules have `onePer` or `fixed`, since
278
278
  those rules are checked against it. With a `contract`, every version is, so
279
279
  the contract can read and cite them.
280
280
 
281
- The account's wakes match records by their `topics`
282
- ([automations](automations.md#the-accounts-own)). How `version` is numbered
283
- is [below](#versions-of-a-definition).
281
+ How `version` is numbered is [below](#versions-of-a-definition).
284
282
 
285
283
  ## Versions of a definition
286
284
 
@@ -318,7 +316,7 @@ one is how two apps agree: a poll asked in one app can be voted on in
318
316
  another.
319
317
 
320
318
  ```typescript
321
- import { reaction, comment, poll, vote, useSchemas } from '@minca/core/schemas';
319
+ import { reaction, comment, poll, vote, useSchemas } from '@minca/std';
322
320
 
323
321
  await useSchemas(node, space.id, [poll, vote, reaction, comment]); // defines only what the space is missing
324
322
  ```
package/docs/computed.md CHANGED
@@ -157,8 +157,7 @@ watches what it reads:
157
157
 
158
158
  - an [automation](automations.md) sets off when the 👍 is written (after its
159
159
  `since`);
160
- - an app's own notifications say so then, once;
161
- - a carrier wakes the app on a new 👍 as well as on a new to-do.
160
+ - an app's own notifications say so then, once.
162
161
 
163
162
  ## Cost
164
163
 
package/docs/node.md CHANGED
@@ -7,7 +7,8 @@ sync. Most apps never make one: the connection starts it for you
7
7
  that holds the account's keys, such as a script, a server or a test.
8
8
 
9
9
  ```ts
10
- import { createNode, deriveAccountKey, generateSeed, indexedDBStores, rootFromSeed } from '@minca/core';
10
+ import { createNode, deriveAccountKey, generateSeed, rootFromSeed } from '@minca/core';
11
+ import { indexedDBStores } from '@minca/storage/indexeddb';
11
12
 
12
13
  const seed = generateSeed();
13
14
  const { signer } = await rootFromSeed(seed);
@@ -53,7 +54,10 @@ the signer refuses, `createNode` fails.
53
54
 
54
55
  With an account key, the node also opens the account registry and makes its
55
56
  spaces match it before `createNode` returns
56
- ([following the account](#following-the-account)).
57
+ ([following the account](#following-the-account)). That waits on nothing
58
+ from the network: a node starts from what it holds, with no host answering.
59
+ Recording in the registry a space it holds but the registry doesn't name asks
60
+ the account's hosts for an invite, so it happens in the background.
57
61
 
58
62
  A node acts for one account (`node.did`) and signs with one key for its whole
59
63
  life. To act for another account, start another node.
@@ -99,6 +103,15 @@ There are three kinds:
99
103
  only session notes (command `/`, no subject, no policy) and refuses anything
100
104
  else without asking the signer behind it.
101
105
 
106
+ An app's node signs as its session with the app's key. A node in a worker is
107
+ handed the seed the key is derived from and signs with it there. No
108
+ `CryptoKey` is ever sent to a worker, since WebKit drops a message to a shared
109
+ worker that holds one.
110
+
111
+ When several tabs share the node, a session note is asked of one tab at a
112
+ time, the one that signed last first, then the newest, each for up to five
113
+ minutes, long enough for a passkey prompt.
114
+
102
115
  ### The session note
103
116
 
104
117
  This is the note a node asks for when it starts:
@@ -165,19 +178,23 @@ A node asks its `StoreFactory` for stores by path:
165
178
  It also opens `mirrors/<spaceId>/<n>` for a [mirror](storage.md#mirrors),
166
179
  `folder/<spaceId>` for a data folder, and `host` for a host's subscriptions.
167
180
 
168
- What a path means is up to the factory:
169
-
170
- - `indexedDBStores(prefix)` makes one IndexedDB database per path, named
171
- `<prefix>:<path with / replaced by :>`. It never seals, since the browser
172
- profile already guards it.
173
- - `folderStores(directory, { basePath?, localKey?, local? })` uses a
174
- [data folder](storage.md#data-folders). The `registry` goes in the folder
175
- under `basePath`, sealed under `localKey` (`deriveLocalKey(seed)`) when
176
- given. Every other path goes in `local`, and each space is mirrored to the
177
- folder's segments.
178
- - `directoryStores(directory, { localKey? })` uses a directory on this
179
- device, one file per entry and per version, sealing the `registry` the same
180
- way.
181
+ What a path means is up to the factory. Each comes from its own entry point
182
+ of `@minca/storage`, so an app bundles only the one it uses:
183
+
184
+ - `indexedDBStores(prefix)` (`@minca/storage/indexeddb`) makes one
185
+ IndexedDB database per path, named `<prefix>:<path with / replaced by :>`.
186
+ It never seals, since the browser profile already guards it.
187
+ - `folderStores(directory, { basePath?, localKey?, local? })`
188
+ (`@minca/storage/folder`) uses a [data folder](storage.md#data-folders).
189
+ The `registry` goes in the folder under `basePath`, sealed under
190
+ `localKey` (`deriveLocalKey(seed)`) when given. Every other path goes in
191
+ `local`, and each space is mirrored to the folder's segments.
192
+ - `directoryStores(directory, { localKey? })` (`@minca/storage/folder`) uses
193
+ a directory on this device, one file per entry and per version, sealing
194
+ the `registry` the same way.
195
+ - `sqliteStores(db, { localKey? })` (`@minca/storage/sqlite`) keeps every
196
+ path in one SQLite database, given its connection
197
+ ([SQLite](storage.md#sqlite)), sealing the `registry` the same way.
181
198
 
182
199
  [Sign-in](sign-in.md) picks stores with `storesFor(account)`: IndexedDB with
183
200
  prefix `minca:<dataPath with : for />` in the browser, or `folderStores(pod,
@@ -231,8 +248,8 @@ or none can be locked, the node makes a key for this run instead.
231
248
  In the browser, `browserWriterKeys(name)` keeps up to 32 keys in IndexedDB,
232
249
  one database per slot (`<name>:writer:<slot>`), each claimed under a Web Lock
233
250
  of the same name. A tab that finds a slot taken tries the next. A tab that
234
- closes or crashes frees its slot. The private key can't be extracted: a
235
- script in the page can sign with it while it runs, but can't take it away.
251
+ closes or crashes frees its slot. A slot keeps the seed its key is derived
252
+ from, so a shared worker can read it in every browser.
236
253
  Without IndexedDB or Web Locks there are no writer keys.
237
254
 
238
255
  A node started from a store description, such as `startPageNode` or a node in
@@ -323,7 +340,8 @@ by default.
323
340
  ```ts
324
341
  declare const signer: RootSigner;
325
342
  // ---cut---
326
- import { createNode, indexedDBStores, type RootSigner } from '@minca/core';
343
+ import { createNode, type RootSigner } from '@minca/core';
344
+ import { indexedDBStores } from '@minca/storage/indexeddb';
327
345
 
328
346
  const node = await createNode({
329
347
  signer,
@@ -399,6 +417,29 @@ when it was first level with a whole-space peer, and `missing` to the version
399
417
  ids a writer's line names that aren't here.
400
418
  [Spec 05 §9](https://github.com/leifriksheim/minca/blob/main/spec/05-sync-and-storage.md).
401
419
 
420
+ ### Syncing shallow
421
+
422
+ A record edited thousands of times has thousands of versions, and an agent
423
+ answering one question doesn't need them. With `shallow: true`, a node syncs
424
+ a space with its keepers by **shallow sets**: each record's current and
425
+ first versions, what its writer retained, and every version in a line, not
426
+ every superseded stub.
427
+
428
+ It is for a node that lives for a session and can't work without the
429
+ space's always-on nodes anyway, as a remote MCP session's. Apps and devices
430
+ leave it off and hold every version, so they work the same with no host.
431
+
432
+ A shallow node takes its keepers' word for the history it skips. A keeper
433
+ can hold a record back or show an older edit, but it can't forge one:
434
+ signatures, standing and first versions are checked as always. With no
435
+ keeper connected the node syncs whole from its other peers, and a space
436
+ that names no keepers syncs whole.
437
+
438
+ Removing someone, or taking a role away (`unassign`, `removeMember`,
439
+ `stepDown`), needs everything they wrote, which a shallow node doesn't
440
+ hold: it refuses. `revoke` always goes through.
441
+ [Spec 05 §5.1](https://github.com/leifriksheim/minca/blob/main/spec/05-sync-and-storage.md).
442
+
402
443
  ### Planned: caches that widen and trim
403
444
 
404
445
  > **Planned.** A node holding part of a space would hold all of it when too
@@ -435,16 +476,33 @@ one run at a time:
435
476
 
436
477
  1. It joins every space a `sys.joined` record names that it doesn't hold,
437
478
  with the view-only invite in the record.
438
- 2. It leaves every space whose `sys.joined` record was deleted.
479
+ 2. It leaves every space whose `sys.joined` record was deleted, all at once.
480
+ The space leaves the list right away. If the account still holds a place
481
+ there, giving it up runs in the background, as [leaving](#leaving-a-space)
482
+ describes.
439
483
  3. It writes a `sys.joined` record for a space it holds that the registry
440
- doesn't know.
441
- 4. It brings every carrier's passes and wakes up to date.
442
- 5. It names the account's carriers as keepers of the open spaces it manages.
484
+ doesn't know. That asks the account's hosts for the space's invite, so it
485
+ runs in the background, one run at a time apart from reconciling, reading
486
+ afresh each run what the registry still lacks. A space left meanwhile
487
+ stays left.
488
+ 4. It brings every carrier's passes up to date.
489
+ 5. It names the account's carriers as keepers of the open spaces it manages,
490
+ the account registry and contacts space among them: a carrier keeps the
491
+ account's personal space. Carry spaces name none.
443
492
  6. It asks each host the account uses how it stands, without waiting, and
444
493
  hands it the spaces if it was paid ([hosting](#carriers-hosting-and-notifications)).
494
+ A host whose signed status says the account's subscription lapsed, or has
495
+ none, and that it won't carry for it as things stand, stops being a carrier,
496
+ and so a keeper. A host that doesn't answer stays one.
445
497
 
446
498
  Creating or joining a space writes its `sys.joined` record. Leaving deletes it.
447
499
 
500
+ The account's own spaces (the table above) are never in the list: joining a
501
+ carry space's invite writes no record, and a record that names one is passed
502
+ over in every step, neither joined nor left. A device that hadn't heard of the
503
+ carrier yet may have written one, and may have joined the space from the list;
504
+ it opens the space directly once it hears.
505
+
448
506
  ### Profiles
449
507
 
450
508
  The node publishes the account's profile, `{ name, contactKey? }`, in a space
@@ -776,10 +834,12 @@ says what the app and the home send each other.
776
834
 
777
835
  ### The app's key
778
836
 
779
- `appKey(name = 'default')` makes the app's P-256 key once and keeps it,
780
- non-extractable, in the IndexedDB database `minca-app-key`, store `keys`,
837
+ `appKey(name = 'default')` makes the app's P-256 key once and keeps the seed
838
+ it is derived from in the IndexedDB database `minca-app-key`, store `keys`,
781
839
  under `name`. `forgetAppKey` deletes it, and the next connection makes a new
782
- one.
840
+ one. A script running in the app's origin can read the seed, as it can the
841
+ session of any web app: the grant runs out, and the person can disconnect the
842
+ app at their account home.
783
843
 
784
844
  ### An app's node outside the page
785
845
 
@@ -815,7 +875,7 @@ starts again unconnected.
815
875
  `homeAddress(input)` turns what a person typed into the home's connect page:
816
876
 
817
877
  ```ts
818
- import { homeAddress } from '@minca/core/session';
878
+ import { homeAddress } from '@minca/session';
819
879
 
820
880
  homeAddress('minca.example.com'); // 'https://minca.example.com/connect'
821
881
  ```
@@ -861,6 +921,21 @@ and its status is a [`ConnectionStatus`](https://minca.dev/api/session/type-alia
861
921
  - With `worker`, the node runs in a worker. If the worker fails to load or
862
922
  doesn't start the node within 30 seconds (`WorkerNotStarted`), the node runs
863
923
  in the page instead. A worker that started and refused passes its reason on.
924
+ - Opening an account that takes more than 10 seconds says so in `error`,
925
+ while the status stays `starting`: what is likely wrong (another tab
926
+ holding the browser's storage) and what to try (closing other tabs,
927
+ reloading). A store in IndexedDB that won't open within 15 seconds fails
928
+ with the same advice, rather than waiting for ever. An account that can't
929
+ be opened is `disconnected`, its `error` saying why.
930
+ - A tab whose node is its own (a dedicated worker's, or the page's) runs it
931
+ only in view, one at a time per account (a Web Lock,
932
+ `minca-node:<account DID>`): two nodes on one site's stores get in each
933
+ other's way, and a browser that freezes background tabs, as an iPhone
934
+ does, would freeze one holding them. Put away, the tab closes its node
935
+ (`starting`, with no node) and opens it again on coming back. A node the
936
+ tabs share, in a shared worker, stays.
937
+ - `keepAwake()` keeps the node open while the tab is put away, as a call
938
+ must, and returns what lets it go.
864
939
  - It turns `expired` when the grant's `expiresAt` passes.
865
940
  - When the node sees its note revoked (`revoked`), the connection forgets that
866
941
  account's grant and key.
@@ -900,7 +975,8 @@ Each tab acts for its own account, and sees other tabs' changes to
900
975
  `state.accounts`. A tab whose account was connected again elsewhere keeps
901
976
  its key until it restarts, then takes the newer grant. One whose key was
902
977
  revoked takes up a newer grant rather than forgetting it. A shared worker
903
- runs a node per key. Switching again before a node has started closes it.
978
+ runs a node per key. Switching again before a node has started closes it,
979
+ or stops it waiting for its turn.
904
980
  [Spec 06 §2.10](https://github.com/leifriksheim/minca/blob/main/spec/06-nodes-and-sessions.md).
905
981
 
906
982
  ### Showing notifications
@@ -909,7 +985,9 @@ An app shows its own notifications with
909
985
  `watchNotifications(node, { origin?, onNotify })`. It needs the account key,
910
986
  so an app with `scope: account`. It reads the account's automations for the
911
987
  app's origin, and calls `onNotify({ automation, record })` for each record
912
- that arrives matching one.
988
+ that arrives matching one. With `origin: null` it reads every app's
989
+ automations and the person's own: for something that speaks for every app
990
+ while none is open, as the Chrome extension does.
913
991
 
914
992
  A record matches when the automation isn't paused, and the record is in its
915
993
  collection and one of its spaces, created after `since` and within the last
@@ -961,8 +1039,7 @@ returns that one.
961
1039
  Carry spaces aren't kept in the node's list. Each is derived again from its
962
1040
  record. When the node starts, or the registry changes, it refills every carry
963
1041
  space in the background. That opens every space the account holds, which is
964
- slow from a data folder, so signing in doesn't wait for it, and nor does
965
- adding an automation. Adding a carrier writes its passes before it returns.
1042
+ slow from a data folder, so signing in doesn't wait for it. Adding a carrier writes its passes before it returns.
966
1043
 
967
1044
  - `carriers.settled(waitMs)` waits for the refill under way, and says whether
968
1045
  it finished. Use it before a window closes.
@@ -995,19 +1072,10 @@ wrote.
995
1072
 
996
1073
  `node.automations` needs the account key. It lists, adds, updates (`name`,
997
1074
  `paused`) and removes the account's own
998
- [automations](automations.md#the-accounts-own), kept in its registry, and
999
- copies a wake for each into every carry space. The reference home adds them
1075
+ [automations](automations.md#the-accounts-own), kept in its registry. The reference home adds them
1000
1076
  when a person keeps an app's proposal, and lists them by app to pause or
1001
1077
  remove ([the account home's side](sign-in.md#the-account-homes-side)).
1002
1078
 
1003
- ### A carrier's matches
1004
-
1005
- When a version wakes one of the account's wakes, a `CarrierNode` sends a
1006
- `wake` event with only the wake, the space, and the record's key, collection
1007
- and `createdAt`. `wakes()` lists the wakes it holds. The desktop app shows
1008
- these as notifications. The browser
1009
- extension doesn't yet.
1010
-
1011
1079
  ### Hosting
1012
1080
 
1013
1081
  `node.hosting` pays a host and hands it the account's spaces. Its calls are
@@ -11,7 +11,7 @@ A proposal is a **blueprint**: one `std.blueprint` record listing the
11
11
  collections. Nothing is defined yet, so it can't break anything.
12
12
 
13
13
  ```typescript
14
- import { proposeCollections } from '@minca/core/schemas';
14
+ import { proposeCollections } from '@minca/std';
15
15
 
16
16
  const proposal = await proposeCollections(node, space.id, {
17
17
  title: 'Chores',
@@ -43,7 +43,7 @@ the same, with a summary in sentences worked out from its rules:
43
43
 
44
44
  ```typescript
45
45
  import type { NodeRecord } from '@minca/core';
46
- import { reviewBlueprint, applyBlueprint, type Blueprint } from '@minca/core/schemas';
46
+ import { reviewBlueprint, applyBlueprint, type Blueprint } from '@minca/std';
47
47
 
48
48
  async function apply(proposal: NodeRecord<Blueprint>) {
49
49
  const review = reviewBlueprint(proposal.body!, await node.collections.list(space.id));
@@ -113,7 +113,7 @@ A definition can't say "write one rota for each week, and say in it who does
113
113
  what". A guide can, and an agent finds it through `collections_list`:
114
114
 
115
115
  ```typescript
116
- import { writeGuide } from '@minca/core/schemas';
116
+ import { writeGuide } from '@minca/std';
117
117
 
118
118
  await writeGuide(node, space.id, {
119
119
  name: 'chores.how',
@@ -83,11 +83,12 @@ open are left out, here and in every include, so a result's `body` is never
83
83
  `null`. What "stands" means is in
84
84
  [spec 02 §9.5](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md).
85
85
 
86
- > **Planned: leaving out records that do not conform.** Today a record whose
87
- > body or links don't fit the definition is flagged `conforms: false` but
88
- > still counted by queries, includes and counts. The plan is to leave such
89
- > records out unless the query asks for them, with a new optional member such
90
- > as `"nonconforming": true`.
86
+ A record whose body or links don't fit its collection's definition is still
87
+ counted, here, in every include and in every count, and comes flagged
88
+ `conforms: false`. Whether it fits depends on the definition in force and on
89
+ the records it links to, which other people write. Leaving it out would let
90
+ whoever defines the collection, or owns a record others link to, hide those
91
+ records from everyone. Show the flag instead.
91
92
 
92
93
  ## Field values
93
94
 
@@ -204,8 +204,10 @@ signed, not the person. `node.spaces.profiles(space)` maps accounts to names.
204
204
 
205
205
  ## Keys
206
206
 
207
- A record's key says whose it is. Every key starts with its owner's part, a
208
- hash of the account, so no one else can create a record there.
207
+ A record's key says whose it is and which collection it is in. Every key
208
+ starts with its owner's part, a hash of the account and the collection, so no
209
+ one else can create a record there, and no record of another collection can
210
+ take it.
209
211
 
210
212
  Most records just take the fresh key `put` gives them. Some records there is
211
213
  one of per account, like settings. For those, pass a name:
@@ -213,34 +215,31 @@ one of per account, like settings. For those, pass a name:
213
215
  ```typescript
214
216
  await node.records.put(space.id, 'app.settings', { theme: 'dark' }, { key: 'settings' });
215
217
 
216
- const mine = await node.records.keyFor(space.id, 'settings'); // 'akthxqofxox3iszhpi5j3zhl6a.settings'
217
- const theirs = await node.records.keyFor(space.id, 'settings', did); // someone else's, if they wrote one
218
+ const mine = await node.records.keyFor(space.id, 'app.settings', 'settings'); // 'mj6bhbzx5m7tqmu35fjtg4wo4u.settings'
219
+ const theirs = await node.records.keyFor(space.id, 'app.settings', 'settings', did); // someone else's, if they wrote one
218
220
  await node.records.get(space.id, theirs);
219
221
  ```
220
222
 
221
- - The name goes in your account's namespace, so two accounts that both
222
- choose `settings` get two records.
223
+ - The name goes in your account's namespace for that collection, so two
224
+ accounts that both choose `settings` get two records, and so do two
225
+ collections.
223
226
  - Names are 1–101 characters of `a`–`z`, `0`–`9` and `: . _ -`.
224
227
  - Read and link records by their whole `key`, as `put` gives it, not by the
225
228
  name.
226
- - A name is the same key in every collection, and a record keeps its
227
- collection for life. So `put` refuses a name you already hold in another
228
- collection, deleted or not. Put the collection in the name
229
- (`app.todo.settings`) so two of your apps never clash.
230
229
  - Writing a deleted key brings the record back. Pass the whole key when it is
231
230
  already yours.
232
- - A name of the form `one:<hex>` is refused outside a `onePer` collection.
233
231
 
234
232
  In a collection with a `onePer` rule, the node works out the key for you
235
233
  from the parts the rule names, and `node.records.onePerKey` tells you what it
236
234
  is. With `@author` the key is the writer's. Without, it is a shared `one:…`
237
- key ([Collections](collections.md#rules)). In a private space it is keyed with
235
+ key of the collection's ([Collections](collections.md#rules)). In a private space it is keyed with
238
236
  the space's key, so it says nothing to someone who can't read the space.
239
237
 
240
238
  An account's line in a collection, for contracts, has the key
241
239
  `lineKey(account, collection)`, exported by `@minca/core`.
242
240
 
243
- Every peer refuses a first version at a key the writer doesn't own. The rule
241
+ Every peer refuses a first version at a key the writer doesn't own in that
242
+ collection. The rule
244
243
  is in [spec 02 §4.1](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md).
245
244
 
246
245
  ## When two devices edit at once
package/docs/sign-in.md CHANGED
@@ -12,7 +12,7 @@ The flow is state and actions: draw a screen for each `stage`, and call an
12
12
  action from its buttons. `subscribe` calls back after every change.
13
13
 
14
14
  ```js
15
- import { createMincaAuth } from '@minca/core/session';
15
+ import { createMincaAuth } from '@minca/auth';
16
16
 
17
17
  const auth = createMincaAuth({ appName: 'Todo', network: { relays: ['wss://relay.minca.social'] } });
18
18
 
@@ -28,7 +28,7 @@ In React, hand the flow to `MincaProvider`, and read it with `useMinca`:
28
28
 
29
29
  ```tsx
30
30
  import { createRoot } from 'react-dom/client';
31
- import { createMincaAuth } from '@minca/core/session';
31
+ import { createMincaAuth } from '@minca/auth';
32
32
  import { MincaProvider, useMinca } from '@minca/react';
33
33
 
34
34
  const auth = createMincaAuth({ appName: 'Todo', network: { relays: ['wss://relay.minca.social'] } });
@@ -71,13 +71,13 @@ them most recently used first.
71
71
  The flow is a state to read and actions to call. `auth.getState().stage`
72
72
  says which screen it is on. It goes from `starting` through the screens of signing in or setting up,
73
73
  to `ready`. What each stage means is in
74
- [`AuthStage`](https://minca.dev/api/session/type-aliases/AuthStage/).
74
+ [`AuthStage`](https://minca.dev/api/auth/type-aliases/AuthStage/).
75
75
 
76
76
  Where data lives is asked at `existing`, not up front. A page that waits for
77
77
  `ready` doesn't see the session during `recovery`, `unlock` or `pod`.
78
78
 
79
79
  A failed action sets `error`, an
80
- [`AuthError`](https://minca.dev/api/session/interfaces/AuthError/), and stays
80
+ [`AuthError`](https://minca.dev/api/auth/interfaces/AuthError/), and stays
81
81
  on the same stage. A dismissed passkey or folder prompt sets no error.
82
82
 
83
83
  ### Moving between stages
@@ -179,7 +179,7 @@ doesn't ask again. The choices are `never`, `1d`, `7d` and `30d`. The default
179
179
  is `7d`, and each use pushes the expiry forward.
180
180
 
181
181
  ```ts
182
- import { createMincaAuth } from '@minca/core/session';
182
+ import { createMincaAuth } from '@minca/auth';
183
183
 
184
184
  const auth = createMincaAuth();
185
185
  await auth.staySignedIn.setChoice('30d');
@@ -225,7 +225,7 @@ sign-in kept for days. So anything that hands out the whole account, or
225
225
  changes how it signs in, asks again first:
226
226
 
227
227
  ```ts
228
- import { createMincaAuth } from '@minca/core/session';
228
+ import { createMincaAuth } from '@minca/auth';
229
229
 
230
230
  const auth = createMincaAuth();
231
231
  const ok = await auth.confirm({ password: 'correct horse battery staple' });
@@ -233,7 +233,7 @@ const ok = await auth.confirm({ password: 'correct horse battery staple' });
233
233
 
234
234
  The proof is the password, the passkey's own check (a fingerprint, a face or
235
235
  a PIN), or the recovery code itself
236
- ([`MincaAuth.confirm`](https://minca.dev/api/session/interfaces/MincaAuth/)).
236
+ ([`MincaAuth.confirm`](https://minca.dev/api/auth/interfaces/MincaAuth/)).
237
237
  A wrong answer resolves false and sets `error`. A passkey with nothing behind
238
238
  it is no proof.
239
239
 
@@ -342,10 +342,9 @@ the person chooses:
342
342
  `forgetBrowserCopy()` then deletes the browser's copy. Other accounts in the
343
343
  pod are never touched.
344
344
 
345
- The page writes to the pod only while it is open. A carrier given the same
346
- folder, such as the Chrome extension, keeps it up to date while the page is
347
- closed. It learns of the pod when it connects, so one that connected before
348
- the move must connect again.
345
+ The page writes to the pod only while it is open. The Chrome extension, given
346
+ the same folder, keeps it up to date while the page is closed: the person
347
+ picks the folder there, and it finds the account in it.
349
348
 
350
349
  ## Removing an account
351
350
 
@@ -384,7 +383,7 @@ no proof. [Threat model §3.1](https://github.com/leifriksheim/minca/blob/main/s
384
383
  ## Options
385
384
 
386
385
  `createMincaAuth(config)` takes the options in
387
- [`MincaAuthConfig`](https://minca.dev/api/session/interfaces/MincaAuthConfig/).
386
+ [`MincaAuthConfig`](https://minca.dev/api/auth/interfaces/MincaAuthConfig/).
388
387
  Every one has a default, so `createMincaAuth()` alone signs in offline, in
389
388
  this browser.
390
389
 
@@ -448,7 +447,7 @@ Device keys in the vault are in
448
447
 
449
448
  A sign-in starts a node with the account's keys, the place's stores for that
450
449
  account ([stores](node.md#stores)) and the configured network. The session is a
451
- [`MincaSession`](https://minca.dev/api/session/interfaces/MincaSession/).
450
+ [`MincaSession`](https://minca.dev/api/auth/interfaces/MincaSession/).
452
451
 
453
452
  The seed stays inside the auth object. `recoveryCode()` returns it as a
454
453
  recovery code. The page also holds the local key, which seals a pod's
@@ -481,7 +480,7 @@ chose, from 1/24 to 365.
481
480
  ### Connections
482
481
 
483
482
  `auth.connections()` lists what the home has connected, each a
484
- [`Connection`](https://minca.dev/api/session/interfaces/Connection/). They are kept
483
+ [`Connection`](https://minca.dev/api/auth/interfaces/Connection/). They are kept
485
484
  per account in `localStorage` under `<prefix>.connections:<accountId>`. A kept
486
485
  connection in any other shape is dropped when read, and its app connects
487
486
  again.
@@ -492,8 +491,9 @@ revokes an app just because its time has passed.
492
491
 
493
492
  A program connected by code at the home's own origin (`via: 'code'`) is kept
494
493
  by its key instead, so each such program is its own (`connectionKey`). A
495
- carrier is kept apart from the app at its origin, and connecting one never
496
- replaces the other.
494
+ carrier is kept by its key too. One connecting leaves the app at its origin;
495
+ an app connecting from a carrier's origin is that program now holding keys,
496
+ and the home removes the carrier.
497
497
 
498
498
  ### Disconnecting
499
499
 
package/docs/spaces.md CHANGED
@@ -327,8 +327,3 @@ await connection.propose([
327
327
  `checkOwnAutomation` says whether one can be kept. `matches(record, filter)`
328
328
  says whether a filter holds, so you can show what it would have matched
329
329
  before proposing it.
330
-
331
- A carrier wakes the app only on a condition on a topic field, at the top of
332
- `where` or in an `$and` there. The app judges the rest. With no such
333
- condition, a carrier wakes the app for every new record of the collection,
334
- and the app turns down the rest.
@@ -9,7 +9,7 @@ records, and you read theirs.
9
9
  import type { NodeRecord } from '@minca/core';
10
10
  declare const post: NodeRecord;
11
11
  // ---cut---
12
- import { reaction, comment, useSchemas } from '@minca/core/schemas';
12
+ import { reaction, comment, useSchemas } from '@minca/std';
13
13
 
14
14
  await useSchemas(node, space.id, [reaction, comment]);
15
15
  await node.records.put(
@@ -148,7 +148,7 @@ the space's grants. In the `community` template, members change only what
148
148
  they made, moderators change anything, and only moderators and admins write
149
149
  in the collections in `STAFF_COLLECTIONS` ([spaces](permissions.md#presets)).
150
150
 
151
- The tables are made from the definitions in `@minca/core/schemas` each time
151
+ The tables are made from the definitions in `@minca/std` each time
152
152
  [minca.dev](https://minca.dev/collections/standard-library/#the-definitions)
153
153
  is built, so they always match the code.
154
154
 
@@ -249,7 +249,7 @@ the one it had.
249
249
  import type { NodeRecord } from '@minca/core';
250
250
  declare const message: NodeRecord;
251
251
  // ---cut---
252
- import { setActivity, activeNow } from '@minca/core/schemas';
252
+ import { setActivity, activeNow } from '@minca/std';
253
253
 
254
254
  await setActivity(node, space.id, message.key, 'working', 'Reading the thread');
255
255
  ```
@@ -338,7 +338,7 @@ message they replied to. Never fill them by matching text.
338
338
 
339
339
  They are topics, as is a message's `in` link. So an automation of the
340
340
  account's own can ask for only what mentions it, replies to it, or is in one
341
- channel, and a carrier's wake can match these unread:
341
+ channel:
342
342
 
343
343
  ```json
344
344
  { "where": { "mentions": { "$contains": "$me" } } }
@@ -368,9 +368,7 @@ A record written in answer to someone's record names them in
368
368
  | `std.order`, `std.order-update` | the listing's or the order's author |
369
369
 
370
370
  It's a topic, so "someone answered what I wrote" is
371
- `where: { "respondingTo": { "$contains": "$me" } }`, and a carrier's wake can
372
- match it unread. The link says the same to a node that can read, but a
373
- carrier can't read a private space's links, so the account is written out.
371
+ `where: { "respondingTo": { "$contains": "$me" } }`.
374
372
  Fill it from the author of the linked record, and leave it out when that's
375
373
  the writer.
376
374
 
@@ -446,7 +444,7 @@ import type { NodeRecord } from '@minca/core';
446
444
  declare const above: NodeRecord<{ position: string }> | undefined;
447
445
  declare const below: NodeRecord<{ position: string }> | undefined;
448
446
  // ---cut---
449
- import { positionBetween } from '@minca/core/schemas';
447
+ import { positionBetween } from '@minca/std';
450
448
 
451
449
  positionBetween(above?.body?.position, below?.body?.position);
452
450
  ```