@minca/core 0.1.15 → 0.1.17

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 (443) hide show
  1. package/README.md +10 -10
  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 +35 -9
  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 +169 -72
  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/network/ws-transport.d.ts.map +1 -1
  86. package/dist/network/ws-transport.js +3 -0
  87. package/dist/network/ws-transport.js.map +1 -1
  88. package/dist/node/actions.d.ts +2 -0
  89. package/dist/node/actions.d.ts.map +1 -1
  90. package/dist/node/actions.js +89 -58
  91. package/dist/node/actions.js.map +1 -1
  92. package/dist/node/api.d.ts +7 -0
  93. package/dist/node/api.d.ts.map +1 -1
  94. package/dist/node/api.js +7 -0
  95. package/dist/node/api.js.map +1 -1
  96. package/dist/node/carrier.d.ts +5 -0
  97. package/dist/node/carrier.d.ts.map +1 -1
  98. package/dist/node/carrier.js +94 -73
  99. package/dist/node/carrier.js.map +1 -1
  100. package/dist/node/copy.d.ts +8 -7
  101. package/dist/node/copy.d.ts.map +1 -1
  102. package/dist/node/copy.js +54 -56
  103. package/dist/node/copy.js.map +1 -1
  104. package/dist/node/host.d.ts +39 -65
  105. package/dist/node/host.d.ts.map +1 -1
  106. package/dist/node/host.js +362 -379
  107. package/dist/node/host.js.map +1 -1
  108. package/dist/node/index.d.ts +2 -2
  109. package/dist/node/index.d.ts.map +1 -1
  110. package/dist/node/index.js +1 -1
  111. package/dist/node/index.js.map +1 -1
  112. package/dist/node/node-carriers.d.ts +35 -0
  113. package/dist/node/node-carriers.d.ts.map +1 -0
  114. package/dist/node/node-carriers.js +567 -0
  115. package/dist/node/node-carriers.js.map +1 -0
  116. package/dist/node/node-contacts.d.ts +11 -0
  117. package/dist/node/node-contacts.d.ts.map +1 -0
  118. package/dist/node/node-contacts.js +808 -0
  119. package/dist/node/node-contacts.js.map +1 -0
  120. package/dist/node/node-context.d.ts +76 -0
  121. package/dist/node/node-context.d.ts.map +1 -0
  122. package/dist/node/node-context.js +54 -0
  123. package/dist/node/node-context.js.map +1 -0
  124. package/dist/node/node-hosting.d.ts +20 -0
  125. package/dist/node/node-hosting.d.ts.map +1 -0
  126. package/dist/node/node-hosting.js +456 -0
  127. package/dist/node/node-hosting.js.map +1 -0
  128. package/dist/node/node-records.d.ts +18 -0
  129. package/dist/node/node-records.d.ts.map +1 -0
  130. package/dist/node/node-records.js +262 -0
  131. package/dist/node/node-records.js.map +1 -0
  132. package/dist/node/node.d.ts.map +1 -1
  133. package/dist/node/node.js +199 -1990
  134. package/dist/node/node.js.map +1 -1
  135. package/dist/node/remote.d.ts +5 -6
  136. package/dist/node/remote.d.ts.map +1 -1
  137. package/dist/node/remote.js +272 -260
  138. package/dist/node/remote.js.map +1 -1
  139. package/dist/node/space-catalog.d.ts +40 -0
  140. package/dist/node/space-catalog.d.ts.map +1 -0
  141. package/dist/node/space-catalog.js +158 -0
  142. package/dist/node/space-catalog.js.map +1 -0
  143. package/dist/node/space-checks.d.ts +25 -0
  144. package/dist/node/space-checks.d.ts.map +1 -0
  145. package/dist/node/space-checks.js +343 -0
  146. package/dist/node/space-checks.js.map +1 -0
  147. package/dist/node/space-history.d.ts +37 -0
  148. package/dist/node/space-history.d.ts.map +1 -0
  149. package/dist/node/space-history.js +350 -0
  150. package/dist/node/space-history.js.map +1 -0
  151. package/dist/node/space-holding.d.ts +53 -0
  152. package/dist/node/space-holding.d.ts.map +1 -0
  153. package/dist/node/space-holding.js +339 -0
  154. package/dist/node/space-holding.js.map +1 -0
  155. package/dist/node/space-index.d.ts +41 -0
  156. package/dist/node/space-index.d.ts.map +1 -0
  157. package/dist/node/space-index.js +217 -0
  158. package/dist/node/space-index.js.map +1 -0
  159. package/dist/node/space-keys.d.ts +34 -0
  160. package/dist/node/space-keys.d.ts.map +1 -0
  161. package/dist/node/space-keys.js +309 -0
  162. package/dist/node/space-keys.js.map +1 -0
  163. package/dist/node/space-lines.d.ts +33 -0
  164. package/dist/node/space-lines.d.ts.map +1 -0
  165. package/dist/node/space-lines.js +145 -0
  166. package/dist/node/space-lines.js.map +1 -0
  167. package/dist/node/space-membership.d.ts +69 -0
  168. package/dist/node/space-membership.d.ts.map +1 -0
  169. package/dist/node/space-membership.js +242 -0
  170. package/dist/node/space-membership.js.map +1 -0
  171. package/dist/node/space-mirrors.d.ts +43 -0
  172. package/dist/node/space-mirrors.d.ts.map +1 -0
  173. package/dist/node/space-mirrors.js +125 -0
  174. package/dist/node/space-mirrors.js.map +1 -0
  175. package/dist/node/space-peers.d.ts +104 -0
  176. package/dist/node/space-peers.d.ts.map +1 -0
  177. package/dist/node/space-peers.js +629 -0
  178. package/dist/node/space-peers.js.map +1 -0
  179. package/dist/node/space-profiles.d.ts +18 -0
  180. package/dist/node/space-profiles.d.ts.map +1 -0
  181. package/dist/node/space-profiles.js +105 -0
  182. package/dist/node/space-profiles.js.map +1 -0
  183. package/dist/node/space-rules.d.ts +29 -0
  184. package/dist/node/space-rules.d.ts.map +1 -0
  185. package/dist/node/space-rules.js +144 -0
  186. package/dist/node/space-rules.js.map +1 -0
  187. package/dist/node/space-runtime.d.ts +107 -140
  188. package/dist/node/space-runtime.d.ts.map +1 -1
  189. package/dist/node/space-runtime.js +331 -3985
  190. package/dist/node/space-runtime.js.map +1 -1
  191. package/dist/node/space-standing.d.ts +20 -0
  192. package/dist/node/space-standing.d.ts.map +1 -0
  193. package/dist/node/space-standing.js +317 -0
  194. package/dist/node/space-standing.js.map +1 -0
  195. package/dist/node/space-versions.d.ts +104 -0
  196. package/dist/node/space-versions.d.ts.map +1 -0
  197. package/dist/node/space-versions.js +153 -0
  198. package/dist/node/space-versions.js.map +1 -0
  199. package/dist/node/space-warrants.d.ts +25 -0
  200. package/dist/node/space-warrants.d.ts.map +1 -0
  201. package/dist/node/space-warrants.js +214 -0
  202. package/dist/node/space-warrants.js.map +1 -0
  203. package/dist/node/space-writing.d.ts +74 -0
  204. package/dist/node/space-writing.d.ts.map +1 -0
  205. package/dist/node/space-writing.js +442 -0
  206. package/dist/node/space-writing.js.map +1 -0
  207. package/dist/node/stores.d.ts +19 -50
  208. package/dist/node/stores.d.ts.map +1 -1
  209. package/dist/node/stores.js +14 -33
  210. package/dist/node/stores.js.map +1 -1
  211. package/dist/node/types.d.ts +243 -306
  212. package/dist/node/types.d.ts.map +1 -1
  213. package/dist/node/usage.d.ts +2 -24
  214. package/dist/node/usage.d.ts.map +1 -1
  215. package/dist/node/usage.js +118 -102
  216. package/dist/node/usage.js.map +1 -1
  217. package/dist/node/watch-notifications.d.ts.map +1 -1
  218. package/dist/node/watch-notifications.js +32 -29
  219. package/dist/node/watch-notifications.js.map +1 -1
  220. package/dist/node/worker.d.ts +5 -6
  221. package/dist/node/worker.d.ts.map +1 -1
  222. package/dist/node/worker.js +80 -72
  223. package/dist/node/worker.js.map +1 -1
  224. package/dist/node/writer-keys.d.ts +5 -6
  225. package/dist/node/writer-keys.d.ts.map +1 -1
  226. package/dist/node/writer-keys.js +66 -57
  227. package/dist/node/writer-keys.js.map +1 -1
  228. package/dist/node/writers.d.ts +12 -19
  229. package/dist/node/writers.d.ts.map +1 -1
  230. package/dist/node/writers.js +7 -15
  231. package/dist/node/writers.js.map +1 -1
  232. package/dist/privacy/direct.d.ts.map +1 -1
  233. package/dist/privacy/direct.js +31 -27
  234. package/dist/privacy/direct.js.map +1 -1
  235. package/dist/privacy/space-encryption.d.ts.map +1 -1
  236. package/dist/privacy/space-encryption.js +5 -9
  237. package/dist/privacy/space-encryption.js.map +1 -1
  238. package/dist/query/computed.d.ts.map +1 -1
  239. package/dist/query/computed.js +78 -77
  240. package/dist/query/computed.js.map +1 -1
  241. package/dist/query/engine.d.ts +3 -4
  242. package/dist/query/engine.d.ts.map +1 -1
  243. package/dist/query/engine.js +93 -86
  244. package/dist/query/engine.js.map +1 -1
  245. package/dist/query/filter.d.ts +8 -10
  246. package/dist/query/filter.d.ts.map +1 -1
  247. package/dist/query/filter.js +144 -161
  248. package/dist/query/filter.js.map +1 -1
  249. package/dist/records/cel-types.d.ts.map +1 -1
  250. package/dist/records/cel-types.js +13 -27
  251. package/dist/records/cel-types.js.map +1 -1
  252. package/dist/records/cel.d.ts.map +1 -1
  253. package/dist/records/cel.js +177 -242
  254. package/dist/records/cel.js.map +1 -1
  255. package/dist/records/rules.d.ts.map +1 -1
  256. package/dist/records/rules.js +46 -50
  257. package/dist/records/rules.js.map +1 -1
  258. package/dist/records/topics.d.ts.map +1 -1
  259. package/dist/records/topics.js +18 -22
  260. package/dist/records/topics.js.map +1 -1
  261. package/dist/schemas/automations.d.ts +8 -15
  262. package/dist/schemas/automations.d.ts.map +1 -1
  263. package/dist/schemas/automations.js +203 -165
  264. package/dist/schemas/automations.js.map +1 -1
  265. package/dist/schemas/blueprints.d.ts.map +1 -1
  266. package/dist/schemas/blueprints.js +14 -13
  267. package/dist/schemas/blueprints.js.map +1 -1
  268. package/dist/schemas/connectors.d.ts.map +1 -1
  269. package/dist/schemas/connectors.js +16 -11
  270. package/dist/schemas/connectors.js.map +1 -1
  271. package/dist/schemas/contacts.d.ts +57 -0
  272. package/dist/schemas/contacts.d.ts.map +1 -1
  273. package/dist/schemas/contacts.js +32 -0
  274. package/dist/schemas/contacts.js.map +1 -1
  275. package/dist/schemas/cron.d.ts.map +1 -1
  276. package/dist/schemas/cron.js +27 -28
  277. package/dist/schemas/cron.js.map +1 -1
  278. package/dist/schemas/defined.d.ts +6 -0
  279. package/dist/schemas/defined.d.ts.map +1 -0
  280. package/dist/schemas/defined.js +7 -0
  281. package/dist/schemas/defined.js.map +1 -0
  282. package/dist/schemas/guides.d.ts +3 -1
  283. package/dist/schemas/guides.d.ts.map +1 -1
  284. package/dist/schemas/guides.js +13 -12
  285. package/dist/schemas/guides.js.map +1 -1
  286. package/dist/schemas/index.d.ts +2 -2
  287. package/dist/schemas/index.d.ts.map +1 -1
  288. package/dist/schemas/index.js +18 -14
  289. package/dist/schemas/index.js.map +1 -1
  290. package/dist/schemas/library/social.d.ts +258 -0
  291. package/dist/schemas/library/social.d.ts.map +1 -1
  292. package/dist/schemas/library/social.js +28 -1
  293. package/dist/schemas/library/social.js.map +1 -1
  294. package/dist/session/account-hint.d.ts.map +1 -1
  295. package/dist/session/account-hint.js +8 -5
  296. package/dist/session/account-hint.js.map +1 -1
  297. package/dist/session/auth.d.ts +36 -2
  298. package/dist/session/auth.d.ts.map +1 -1
  299. package/dist/session/auth.js +95 -2
  300. package/dist/session/auth.js.map +1 -1
  301. package/dist/session/connect.d.ts +1 -0
  302. package/dist/session/connect.d.ts.map +1 -1
  303. package/dist/session/connect.js +3 -1
  304. package/dist/session/connect.js.map +1 -1
  305. package/dist/session/credentials.d.ts +8 -26
  306. package/dist/session/credentials.d.ts.map +1 -1
  307. package/dist/session/credentials.js +14 -32
  308. package/dist/session/credentials.js.map +1 -1
  309. package/dist/session/hosting.d.ts.map +1 -1
  310. package/dist/session/hosting.js +8 -2
  311. package/dist/session/hosting.js.map +1 -1
  312. package/dist/session/index.d.ts +1 -0
  313. package/dist/session/index.d.ts.map +1 -1
  314. package/dist/session/index.js +1 -0
  315. package/dist/session/index.js.map +1 -1
  316. package/dist/session/pairing.d.ts.map +1 -1
  317. package/dist/session/pairing.js +92 -88
  318. package/dist/session/pairing.js.map +1 -1
  319. package/dist/session/password-strength.d.ts.map +1 -1
  320. package/dist/session/password-strength.js +37 -37
  321. package/dist/session/password-strength.js.map +1 -1
  322. package/dist/session/places.d.ts.map +1 -1
  323. package/dist/session/places.js +18 -13
  324. package/dist/session/places.js.map +1 -1
  325. package/dist/session/popup.d.ts +13 -0
  326. package/dist/session/popup.d.ts.map +1 -0
  327. package/dist/session/popup.js +23 -0
  328. package/dist/session/popup.js.map +1 -0
  329. package/dist/space/constitution.d.ts.map +1 -1
  330. package/dist/space/constitution.js +22 -29
  331. package/dist/space/constitution.js.map +1 -1
  332. package/dist/space/grants.d.ts.map +1 -1
  333. package/dist/space/grants.js +37 -39
  334. package/dist/space/grants.js.map +1 -1
  335. package/dist/space/invite-link.d.ts.map +1 -1
  336. package/dist/space/invite-link.js +33 -33
  337. package/dist/space/invite-link.js.map +1 -1
  338. package/dist/space/own-automations.d.ts +13 -24
  339. package/dist/space/own-automations.d.ts.map +1 -1
  340. package/dist/space/own-automations.js +47 -37
  341. package/dist/space/own-automations.js.map +1 -1
  342. package/dist/space/presets.d.ts +2 -2
  343. package/dist/space/presets.d.ts.map +1 -1
  344. package/dist/space/presets.js +3 -2
  345. package/dist/space/presets.js.map +1 -1
  346. package/dist/space/roles.d.ts +56 -80
  347. package/dist/space/roles.d.ts.map +1 -1
  348. package/dist/space/roles.js +448 -441
  349. package/dist/space/roles.js.map +1 -1
  350. package/dist/space/space-access.d.ts +3 -4
  351. package/dist/space/space-access.d.ts.map +1 -1
  352. package/dist/space/space-access.js +3 -8
  353. package/dist/space/space-access.js.map +1 -1
  354. package/dist/storage/blob/directory.d.ts.map +1 -1
  355. package/dist/storage/blob/directory.js +39 -32
  356. package/dist/storage/blob/directory.js.map +1 -1
  357. package/dist/storage/blob/s3.d.ts.map +1 -1
  358. package/dist/storage/blob/s3.js +21 -19
  359. package/dist/storage/blob/s3.js.map +1 -1
  360. package/dist/storage/blob-store.d.ts +0 -9
  361. package/dist/storage/blob-store.d.ts.map +1 -1
  362. package/dist/storage/directory-access.d.ts +8 -32
  363. package/dist/storage/directory-access.d.ts.map +1 -1
  364. package/dist/storage/directory-access.js +11 -36
  365. package/dist/storage/directory-access.js.map +1 -1
  366. package/dist/storage/encrypted-adapter.d.ts +12 -32
  367. package/dist/storage/encrypted-adapter.d.ts.map +1 -1
  368. package/dist/storage/encrypted-adapter.js +31 -54
  369. package/dist/storage/encrypted-adapter.js.map +1 -1
  370. package/dist/storage/folder-adapter.d.ts +12 -26
  371. package/dist/storage/folder-adapter.d.ts.map +1 -1
  372. package/dist/storage/folder-adapter.js +37 -54
  373. package/dist/storage/folder-adapter.js.map +1 -1
  374. package/dist/storage/folder-reconcile.d.ts +12 -26
  375. package/dist/storage/folder-reconcile.d.ts.map +1 -1
  376. package/dist/storage/folder-reconcile.js +39 -48
  377. package/dist/storage/folder-reconcile.js.map +1 -1
  378. package/dist/storage/indexeddb-adapter.d.ts +2 -6
  379. package/dist/storage/indexeddb-adapter.d.ts.map +1 -1
  380. package/dist/storage/indexeddb-adapter.js +60 -114
  381. package/dist/storage/indexeddb-adapter.js.map +1 -1
  382. package/dist/storage/mirror.d.ts +0 -29
  383. package/dist/storage/mirror.d.ts.map +1 -1
  384. package/dist/storage/mirror.js +153 -110
  385. package/dist/storage/mirror.js.map +1 -1
  386. package/dist/storage/segment.d.ts.map +1 -1
  387. package/dist/storage/segment.js +3 -7
  388. package/dist/storage/segment.js.map +1 -1
  389. package/dist/storage/storage-provider.d.ts +6 -11
  390. package/dist/storage/storage-provider.d.ts.map +1 -1
  391. package/dist/storage/storage-provider.js +112 -116
  392. package/dist/storage/storage-provider.js.map +1 -1
  393. package/dist/sync/sync-engine.d.ts +10 -44
  394. package/dist/sync/sync-engine.d.ts.map +1 -1
  395. package/dist/sync/sync-engine.js +245 -247
  396. package/dist/sync/sync-engine.js.map +1 -1
  397. package/dist/sync/sync-messages.d.ts +1 -1
  398. package/dist/sync/sync-messages.d.ts.map +1 -1
  399. package/dist/sync/sync-messages.js +1 -1
  400. package/dist/sync/sync-messages.js.map +1 -1
  401. package/dist/utils/guards.d.ts +1 -0
  402. package/dist/utils/guards.d.ts.map +1 -1
  403. package/dist/utils/guards.js +1 -0
  404. package/dist/utils/guards.js.map +1 -1
  405. package/dist/utils/hmac.d.ts +5 -0
  406. package/dist/utils/hmac.d.ts.map +1 -0
  407. package/dist/utils/hmac.js +20 -0
  408. package/dist/utils/hmac.js.map +1 -0
  409. package/dist/utils/map.d.ts +10 -0
  410. package/dist/utils/map.d.ts.map +1 -0
  411. package/dist/utils/map.js +30 -0
  412. package/dist/utils/map.js.map +1 -0
  413. package/dist/utils/serial.d.ts +2 -0
  414. package/dist/utils/serial.d.ts.map +1 -1
  415. package/dist/utils/serial.js +9 -0
  416. package/dist/utils/serial.js.map +1 -1
  417. package/dist/validation/capability-gate.d.ts +7 -15
  418. package/dist/validation/capability-gate.d.ts.map +1 -1
  419. package/dist/validation/capability-gate.js +32 -36
  420. package/dist/validation/capability-gate.js.map +1 -1
  421. package/dist/validation/crypto-gate.d.ts.map +1 -1
  422. package/dist/validation/crypto-gate.js +12 -21
  423. package/dist/validation/crypto-gate.js.map +1 -1
  424. package/docs/README.md +1 -0
  425. package/docs/actions.md +32 -25
  426. package/docs/agents.md +28 -16
  427. package/docs/automations.md +1 -1
  428. package/docs/blueprints-and-guides.md +37 -5
  429. package/docs/building-an-app.md +7 -4
  430. package/docs/collections.md +3 -3
  431. package/docs/contacts.md +34 -1
  432. package/docs/contracts.md +1 -1
  433. package/docs/direct-messages.md +6 -2
  434. package/docs/inbox.md +5 -11
  435. package/docs/node.md +54 -22
  436. package/docs/records-and-queries.md +1 -1
  437. package/docs/sign-in.md +54 -26
  438. package/docs/spaces.md +9 -8
  439. package/docs/standard-library.md +37 -14
  440. package/docs/storage.md +5 -6
  441. package/docs/usernames.md +161 -0
  442. package/docs/warrants.md +1 -1
  443. package/package.json +1 -2
@@ -0,0 +1,161 @@
1
+ # Usernames
2
+
3
+ A username, `leif@minca.social`, is a name at a domain that leads to an
4
+ inbox code, so someone can find you by a name they can say aloud. What a
5
+ username is, how it is looked up and what a reader checks are protocol
6
+ ([spec 07 §9](https://github.com/leifriksheim/minca/blob/main/spec/07-inbox.md)):
7
+ every reader must agree on them.
8
+
9
+ How a name is claimed at a domain is not. A domain can answer from a file it
10
+ edits by hand, or from anything else. This page describes the **Minca name
11
+ service** (`packages/names`), which minca.social runs and anyone can run for a
12
+ domain of their own, and how the library claims a name on one.
13
+
14
+ ## Looking a name up
15
+
16
+ ```ts
17
+ import { resolveUsername } from '@minca/core/inbox';
18
+
19
+ const { code, inbox } = await resolveUsername('leif@minca.social', provider);
20
+ ```
21
+
22
+ It asks `https://minca.social/.well-known/minca.json?name=leif`, refuses a
23
+ redirect, and checks the code it gets as any other. The code then works
24
+ wherever one does: knock on it.
25
+
26
+ ## On the node
27
+
28
+ `node.inbox.claim('leif@minca.social')` does all of the below for the
29
+ account's inbox, and keeps the name in `std.inbox` so every device knows it:
30
+ replacing the inbox, or changing its name or mailboxes, points the name at
31
+ the new code, and reading knocks renews it a month before its year is up.
32
+ `node.inbox.release()` gives it up. `node.inbox.knock('anna@minca.social')`
33
+ knocks by username, and the contact it becomes keeps the username
34
+ (`ContactView.username`). See [node.md](node.md#the-inbox).
35
+
36
+ **At sign-up.** `createMincaAuth({ usernames: 'minca.social' })` makes the
37
+ create screen of `<minca-auth>` one field: the username, with a tick once the
38
+ service says it is free and a cross once it is taken. A bare name is at that
39
+ domain, and is how it is shown and handed out (`leif`); a whole username,
40
+ `leif@example.org`, is checked and claimed at its own domain, and one that
41
+ gives out no Minca usernames says so, with a link to running a service. The account's name
42
+ starts as the username's (`nameFromUsername`: `leif.r` is Leif R) and is
43
+ changed on the account page. "Continue without a username" makes the account with none, so nobody
44
+ finds it by one, and a made-up name to show until it is given one
45
+ (`adHocName`: Swift Otter). `createAccount(name,
46
+ { username })` claims it in the background while the recovery code and
47
+ password screens are up, and those screens say how it went: `state.username`
48
+ is `claiming`, `claimed`, or `failed` with an `error`, when it was taken
49
+ meanwhile or the service was down. The account is made either way.
50
+
51
+ The claim is made on the home's node, which may be the only one holding the
52
+ inbox: a connect page that closes once it answers keeps the window open
53
+ until the app's node holds the contacts space too (`spaces.reached`, keyed
54
+ by the app's key from its request), or else the app would read no knocks
55
+ until the two next met. The account home waits for what setup began in
56
+ the background (`auth.settled()`: the claim, and the host's handover) to
57
+ finish, however long, so neither is cut off halfway; then up to 30 s for the app,
58
+ and only for an account that claimed a name there. If the claim failed, the
59
+ app's contacts screen asks for a name again.
60
+
61
+ _Source: `packages/core/src/session/auth.ts` (`createAccount`, `claimInBackground`), `packages/core/src/elements/minca-auth.ts` (`#create`), `packages/core/src/inbox/names.ts` (`adHocName`, `nameFromUsername`, `usernameFree`), `apps/home/src/components/ConnectPage.tsx` (`handOver`). Tests: `packages/core/tests/usernames.test.ts` ("a username at sign-up")._
62
+
63
+ Renewing claims the code of the inbox this device knows. A device that
64
+ hasn't yet synced a replacement made on another one points the name back at
65
+ the old inbox until the inbox next changes; renewal starts only within a
66
+ month of the name lapsing, so this is rare.
67
+
68
+ ## Claiming a name
69
+
70
+ ```ts
71
+ import { claimUsername } from '@minca/core/inbox';
72
+
73
+ const until = await claimUsername('leif@minca.social', contactKey, inboxCode);
74
+ ```
75
+
76
+ `claimUsername` looks the name up first. A Minca name service says, in every
77
+ answer, where claims go and how much work one needs:
78
+
79
+ ```json
80
+ { "names": {}, "claim": "https://usernames.minca.social/.well-known/minca.json", "work": 20 }
81
+ ```
82
+
83
+ Then it posts the claim there:
84
+
85
+ ```json
86
+ {
87
+ "name": "leif",
88
+ "key": "<name key public half>",
89
+ "at": 1790000000000,
90
+ "work": 731042,
91
+ "code": "<inbox code>",
92
+ "bind": "<base64url>",
93
+ "sig": "<base64url>"
94
+ }
95
+ ```
96
+
97
+ | Field | |
98
+ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
99
+ | `key` | The **name key**'s public half, compressed P-256, base64url |
100
+ | `at` | When the claim was made, ms. It must be within 10 minutes of the service's clock, and later than the claim it follows |
101
+ | `work` | A counter: SHA-256 of `minca/name-work/v1\|<name>@<domain>\|<key>\|<at>\|<work>` starts with `work` zero bits |
102
+ | `code` | The inbox code, at most 4,096 characters. None gives the name up |
103
+ | `bind` | With a code: the inbox signing key's signature over `minca/name-bind/v1\|<name>@<domain>`, so a name leads only to an inbox whose owner chose it |
104
+ | `sig` | The name key's ECDSA P-256 signature over `minca/name-claim/v1\|<name>@<domain>\|<at>\|<code, or empty>` |
105
+
106
+ The answer is `{ "until": <ms> }`, when the name lapses, or
107
+ `{ "error": "…" }` with a 4xx status.
108
+
109
+ **The name key** is derived from the contact key, one per username:
110
+ `HKDF-SHA-256(contact key, info = "minca/p256-name-key/v1|" + name@domain)`,
111
+ with the username as `formatUsername` writes it, so every spelling a reader takes gives one key. `claimUsername` derives it itself. Every device that holds the contact key
112
+ derives the same one; it is not an inbox key, so replacing the inbox keeps
113
+ the name, and nothing ties it to the account. Only the key that holds a name
114
+ can point it elsewhere, renew it or give it up.
115
+
116
+ **Who may.** A name leads to the account's inbox, so only what may run the
117
+ inbox may claim one: a node whose note grants `/account/write` for the whole
118
+ account, holding the contact key. An app given the contact key could claim
119
+ the account's names too, and its hold outlasts revoking it, since a name key
120
+ has no generation to move on to
121
+ ([#313](https://github.com/leifriksheim/minca/issues/313)).
122
+
123
+ ## What the service keeps to
124
+
125
+ | Rule | On minca.social |
126
+ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
127
+ | How long a claim holds | A year. Claiming again, with the same code or a new one, renews it |
128
+ | New names from one address | 3 a day (an IPv4 address, or an IPv6 /48). Changing or renewing a name is free |
129
+ | Work | 18 bits: a fraction of a second on a laptop, about a second on a phone |
130
+ | Names held | 50,000: each is a file of up to 8 KB, so a 1 GB volume holds them, inodes included |
131
+ | Reserved | `admin`, `support`, `security`, `minca` and a few more that pass for the service. A lookup of one answers `"reserved": true`, so `usernameFree` says it isn't |
132
+ | Given up | Free again after 10 minutes, so no earlier claim can be replayed to take it back |
133
+
134
+ The work is a speed bump for bots, not a gate: a server does it ten times
135
+ faster than a phone. The address budget and the year are what keep squatting
136
+ in check; a name nobody renews comes back. The budget is kept in memory, so a
137
+ restart forgets it; nothing a client sends can make the service stop, since
138
+ whatever goes wrong with one request answers that request.
139
+
140
+ Each name is a file of its own on the service's disk, so nothing grows in
141
+ memory and no large file is rewritten. Lookups are open to any page
142
+ (`Access-Control-Allow-Origin: *`).
143
+
144
+ ## Running one for your domain
145
+
146
+ The service is `packages/names/server.mjs`, with no dependencies:
147
+
148
+ ```bash
149
+ NAMES_DOMAIN=example.org \
150
+ NAMES_CLAIM_URL=https://names.example.org/.well-known/minca.json \
151
+ NAMES_DIR=/data/names \
152
+ node packages/names/server.mjs 8080
153
+ ```
154
+
155
+ Then answer `https://example.org/.well-known/minca.json` from it, by serving
156
+ the domain from it or proxying that one path (minca.social's site does this,
157
+ in `apps/site/public/_redirects`). Claims go to `NAMES_CLAIM_URL` directly, so
158
+ the service sees each client's address. `packages/names/fly.toml` deploys it
159
+ on Fly.
160
+
161
+ _Source: `packages/core/src/inbox/names.ts` (`claimUsername`, `claimMessage`), `packages/core/src/identity/contact-key.ts` (`deriveNameKeyBytes`), `packages/names/names.mjs` (`createNames`, `NAMES_LIMITS`), `packages/names/server.mjs`, `apps/site/public/_redirects`. Tests: `packages/names/tests/names.test.ts`._
package/docs/warrants.md CHANGED
@@ -76,4 +76,4 @@ Like any record, a warrant is withdrawn when its writer is removed by a
76
76
  change whose cutoff doesn't cover it, or revokes the key that signed it ([#166](https://github.com/leifriksheim/minca/issues/166)). More kinds are planned after v1, in
77
77
  [#148](https://github.com/leifriksheim/minca/issues/148).
78
78
 
79
- _Source: `packages/core/src/records/warrant.ts` (`readWarrant`, `knownKind`), `packages/core/src/node/space-runtime.ts` (`ownView`, `warrantShape`, `warrantVerdict`, `evidenceHolds`, `violationIn`, `warrantIfDue`, `flagged`), `packages/core/src/space/space-access.ts` (`WARRANT_COLLECTION`). Tests: `packages/core/tests/warrants.test.ts`._
79
+ _Source: `packages/core/src/records/warrant.ts` (`readWarrant`, `knownKind`), `packages/core/src/node/space-history.ts` (`ownView`), `packages/core/src/node/space-warrants.ts` (`warrantShape`, `warrantVerdict`, `evidenceHolds`, `violationIn`, `warrantIfDue`, `flagged`), `packages/core/src/space/space-access.ts` (`WARRANT_COLLECTION`). Tests: `packages/core/tests/warrants.test.ts`._
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minca/core",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "description": "Self-sovereign P2P protocol for the browser — identity, schemas, storage, networking, and gossip sync",
6
6
  "repository": {
@@ -67,7 +67,6 @@
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/ws": "^8.18.2",
70
- "esbuild": "^0.28.2",
71
70
  "tsx": "^4.19.0",
72
71
  "typescript": "^7.0.2",
73
72
  "ws": "^8.22.0",