@minca/core 0.1.18 → 0.3.1

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 (335) hide show
  1. package/README.md +1 -1
  2. package/dist/identity/abilities.d.ts +0 -2
  3. package/dist/identity/abilities.d.ts.map +1 -1
  4. package/dist/identity/abilities.js +2 -2
  5. package/dist/identity/abilities.js.map +1 -1
  6. package/dist/identity/account-vault.d.ts +0 -2
  7. package/dist/identity/account-vault.d.ts.map +1 -1
  8. package/dist/identity/account-vault.js +1 -1
  9. package/dist/identity/account-vault.js.map +1 -1
  10. package/dist/identity/crypto-p256.d.ts +1 -1
  11. package/dist/identity/crypto-p256.d.ts.map +1 -1
  12. package/dist/identity/ucan.d.ts +2 -1
  13. package/dist/identity/ucan.d.ts.map +1 -1
  14. package/dist/identity/ucan.js +1 -1
  15. package/dist/identity/ucan.js.map +1 -1
  16. package/dist/inbox/inbox.d.ts +0 -21
  17. package/dist/inbox/inbox.d.ts.map +1 -1
  18. package/dist/inbox/inbox.js +4 -4
  19. package/dist/inbox/inbox.js.map +1 -1
  20. package/dist/inbox/index.d.ts +4 -5
  21. package/dist/inbox/index.d.ts.map +1 -1
  22. package/dist/inbox/index.js +2 -3
  23. package/dist/inbox/index.js.map +1 -1
  24. package/dist/inbox/names.d.ts +0 -4
  25. package/dist/inbox/names.d.ts.map +1 -1
  26. package/dist/inbox/names.js +2 -2
  27. package/dist/inbox/names.js.map +1 -1
  28. package/dist/index.d.ts +45 -71
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +34 -53
  31. package/dist/index.js.map +1 -1
  32. package/dist/network/mesh.d.ts.map +1 -1
  33. package/dist/network/mesh.js +10 -0
  34. package/dist/network/mesh.js.map +1 -1
  35. package/dist/network/rendezvous.d.ts +2 -0
  36. package/dist/network/rendezvous.d.ts.map +1 -1
  37. package/dist/network/rendezvous.js +5 -0
  38. package/dist/network/rendezvous.js.map +1 -1
  39. package/dist/network/rtc-transport.d.ts.map +1 -1
  40. package/dist/network/rtc-transport.js +8 -3
  41. package/dist/network/rtc-transport.js.map +1 -1
  42. package/dist/node/carrier.d.ts +1 -33
  43. package/dist/node/carrier.d.ts.map +1 -1
  44. package/dist/node/carrier.js +38 -68
  45. package/dist/node/carrier.js.map +1 -1
  46. package/dist/node/index.d.ts +7 -14
  47. package/dist/node/index.d.ts.map +1 -1
  48. package/dist/node/index.js +4 -8
  49. package/dist/node/index.js.map +1 -1
  50. package/dist/node/node-carriers.d.ts.map +1 -1
  51. package/dist/node/node-carriers.js +21 -52
  52. package/dist/node/node-carriers.js.map +1 -1
  53. package/dist/node/node-context.d.ts +0 -2
  54. package/dist/node/node-context.d.ts.map +1 -1
  55. package/dist/node/node-context.js.map +1 -1
  56. package/dist/node/node-hosting.d.ts.map +1 -1
  57. package/dist/node/node-hosting.js +13 -4
  58. package/dist/node/node-hosting.js.map +1 -1
  59. package/dist/node/node-records.js +1 -1
  60. package/dist/node/node-records.js.map +1 -1
  61. package/dist/node/node.d.ts.map +1 -1
  62. package/dist/node/node.js +134 -36
  63. package/dist/node/node.js.map +1 -1
  64. package/dist/node/space-checks.d.ts +3 -1
  65. package/dist/node/space-checks.d.ts.map +1 -1
  66. package/dist/node/space-checks.js +7 -3
  67. package/dist/node/space-checks.js.map +1 -1
  68. package/dist/node/space-holding.d.ts +5 -0
  69. package/dist/node/space-holding.d.ts.map +1 -1
  70. package/dist/node/space-holding.js +90 -5
  71. package/dist/node/space-holding.js.map +1 -1
  72. package/dist/node/space-lines.d.ts +3 -0
  73. package/dist/node/space-lines.d.ts.map +1 -1
  74. package/dist/node/space-lines.js +13 -1
  75. package/dist/node/space-lines.js.map +1 -1
  76. package/dist/node/space-membership.js +4 -4
  77. package/dist/node/space-membership.js.map +1 -1
  78. package/dist/node/space-peers.d.ts +5 -2
  79. package/dist/node/space-peers.d.ts.map +1 -1
  80. package/dist/node/space-peers.js +3 -2
  81. package/dist/node/space-peers.js.map +1 -1
  82. package/dist/node/space-runtime.d.ts +3 -1
  83. package/dist/node/space-runtime.d.ts.map +1 -1
  84. package/dist/node/space-runtime.js +29 -8
  85. package/dist/node/space-runtime.js.map +1 -1
  86. package/dist/node/space-standing.d.ts +1 -1
  87. package/dist/node/space-standing.d.ts.map +1 -1
  88. package/dist/node/space-standing.js +11 -4
  89. package/dist/node/space-standing.js.map +1 -1
  90. package/dist/node/space-writing.d.ts.map +1 -1
  91. package/dist/node/space-writing.js +9 -0
  92. package/dist/node/space-writing.js.map +1 -1
  93. package/dist/node/stores.d.ts +9 -1
  94. package/dist/node/stores.d.ts.map +1 -1
  95. package/dist/node/stores.js +4 -2
  96. package/dist/node/stores.js.map +1 -1
  97. package/dist/node/types.d.ts +16 -5
  98. package/dist/node/types.d.ts.map +1 -1
  99. package/dist/node/worker.d.ts +14 -6
  100. package/dist/node/worker.d.ts.map +1 -1
  101. package/dist/node/worker.js +59 -20
  102. package/dist/node/worker.js.map +1 -1
  103. package/dist/node/writer-keys.d.ts +2 -2
  104. package/dist/node/writer-keys.d.ts.map +1 -1
  105. package/dist/node/writer-keys.js +12 -14
  106. package/dist/node/writer-keys.js.map +1 -1
  107. package/dist/privacy/direct.d.ts +0 -7
  108. package/dist/privacy/direct.d.ts.map +1 -1
  109. package/dist/privacy/direct.js +2 -2
  110. package/dist/privacy/direct.js.map +1 -1
  111. package/dist/query/filter.d.ts +0 -2
  112. package/dist/query/filter.d.ts.map +1 -1
  113. package/dist/query/filter.js +1 -1
  114. package/dist/query/filter.js.map +1 -1
  115. package/dist/query/types.d.ts +2 -6
  116. package/dist/query/types.d.ts.map +1 -1
  117. package/dist/query/types.js.map +1 -1
  118. package/dist/records/key.d.ts +2 -0
  119. package/dist/records/key.d.ts.map +1 -1
  120. package/dist/records/key.js +4 -0
  121. package/dist/records/key.js.map +1 -1
  122. package/dist/records/links.js +1 -1
  123. package/dist/schemas/direct.d.ts +70 -0
  124. package/dist/schemas/direct.d.ts.map +1 -0
  125. package/dist/schemas/direct.js +39 -0
  126. package/dist/schemas/direct.js.map +1 -0
  127. package/dist/schemas/index.d.ts +10 -73
  128. package/dist/schemas/index.d.ts.map +1 -1
  129. package/dist/schemas/index.js +8 -66
  130. package/dist/schemas/index.js.map +1 -1
  131. package/dist/session/account-hint.d.ts +2 -2
  132. package/dist/session/account-hint.d.ts.map +1 -1
  133. package/dist/session/account-hint.js +3 -3
  134. package/dist/session/account-hint.js.map +1 -1
  135. package/dist/session/connect.d.ts +12 -5
  136. package/dist/session/connect.d.ts.map +1 -1
  137. package/dist/session/connect.js +25 -21
  138. package/dist/session/connect.js.map +1 -1
  139. package/dist/session/connection.d.ts +26 -2
  140. package/dist/session/connection.d.ts.map +1 -1
  141. package/dist/session/connection.js +151 -11
  142. package/dist/session/connection.js.map +1 -1
  143. package/dist/session/hosting.d.ts +1 -7
  144. package/dist/session/hosting.d.ts.map +1 -1
  145. package/dist/session/hosting.js +3 -3
  146. package/dist/session/hosting.js.map +1 -1
  147. package/dist/session/index.d.ts +9 -14
  148. package/dist/session/index.d.ts.map +1 -1
  149. package/dist/session/index.js +8 -11
  150. package/dist/session/index.js.map +1 -1
  151. package/dist/session/stay-signed-in.d.ts +0 -1
  152. package/dist/session/stay-signed-in.d.ts.map +1 -1
  153. package/dist/session/stay-signed-in.js +1 -1
  154. package/dist/session/stay-signed-in.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 +26 -0
  171. package/dist/storage/body-cache.d.ts.map +1 -0
  172. package/dist/storage/body-cache.js +41 -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/folder-adapter.d.ts +8 -2
  179. package/dist/storage/folder-adapter.d.ts.map +1 -1
  180. package/dist/storage/folder-adapter.js +43 -26
  181. package/dist/storage/folder-adapter.js.map +1 -1
  182. package/dist/storage/indexeddb-adapter.js +27 -2
  183. package/dist/storage/indexeddb-adapter.js.map +1 -1
  184. package/dist/storage/sqlite-adapter.d.ts +57 -0
  185. package/dist/storage/sqlite-adapter.d.ts.map +1 -0
  186. package/dist/storage/sqlite-adapter.js +213 -0
  187. package/dist/storage/sqlite-adapter.js.map +1 -0
  188. package/dist/storage/storage-provider.d.ts +21 -2
  189. package/dist/storage/storage-provider.d.ts.map +1 -1
  190. package/dist/storage/storage-provider.js +149 -56
  191. package/dist/storage/storage-provider.js.map +1 -1
  192. package/dist/sync/sync-engine.d.ts +10 -4
  193. package/dist/sync/sync-engine.d.ts.map +1 -1
  194. package/dist/sync/sync-engine.js +120 -38
  195. package/dist/sync/sync-engine.js.map +1 -1
  196. package/dist/sync/sync-messages.d.ts +4 -0
  197. package/dist/sync/sync-messages.d.ts.map +1 -1
  198. package/dist/sync/sync-messages.js.map +1 -1
  199. package/dist/types.d.ts +0 -7
  200. package/dist/types.d.ts.map +1 -1
  201. package/dist/types.js +0 -1
  202. package/dist/types.js.map +1 -1
  203. package/dist/utils/step.d.ts +8 -0
  204. package/dist/utils/step.d.ts.map +1 -0
  205. package/dist/utils/step.js +15 -0
  206. package/dist/utils/step.js.map +1 -0
  207. package/docs/README.md +1 -1
  208. package/docs/actions.md +41 -2
  209. package/docs/agents.md +13 -10
  210. package/docs/automations.md +16 -48
  211. package/docs/blueprints-and-guides.md +2 -2
  212. package/docs/bots.md +3 -3
  213. package/docs/building-an-app.md +16 -0
  214. package/docs/collections.md +2 -4
  215. package/docs/computed.md +1 -2
  216. package/docs/node.md +112 -39
  217. package/docs/proposing-collections.md +3 -3
  218. package/docs/sign-in.md +45 -52
  219. package/docs/spaces.md +0 -5
  220. package/docs/standard-library.md +20 -8
  221. package/docs/storage.md +78 -12
  222. package/docs/usernames.md +3 -3
  223. package/package.json +7 -13
  224. package/dist/elements/auth-styles.d.ts +0 -18
  225. package/dist/elements/auth-styles.d.ts.map +0 -1
  226. package/dist/elements/auth-styles.js +0 -206
  227. package/dist/elements/auth-styles.js.map +0 -1
  228. package/dist/elements/dom.d.ts +0 -29
  229. package/dist/elements/dom.d.ts.map +0 -1
  230. package/dist/elements/dom.js +0 -91
  231. package/dist/elements/dom.js.map +0 -1
  232. package/dist/elements/index.d.ts +0 -13
  233. package/dist/elements/index.d.ts.map +0 -1
  234. package/dist/elements/index.js +0 -11
  235. package/dist/elements/index.js.map +0 -1
  236. package/dist/elements/minca-auth.d.ts +0 -55
  237. package/dist/elements/minca-auth.d.ts.map +0 -1
  238. package/dist/elements/minca-auth.js +0 -768
  239. package/dist/elements/minca-auth.js.map +0 -1
  240. package/dist/node/actions.d.ts +0 -85
  241. package/dist/node/actions.d.ts.map +0 -1
  242. package/dist/node/actions.js +0 -921
  243. package/dist/node/actions.js.map +0 -1
  244. package/dist/node/host.d.ts +0 -187
  245. package/dist/node/host.d.ts.map +0 -1
  246. package/dist/node/host.js +0 -818
  247. package/dist/node/host.js.map +0 -1
  248. package/dist/node/usage.d.ts +0 -32
  249. package/dist/node/usage.d.ts.map +0 -1
  250. package/dist/node/usage.js +0 -217
  251. package/dist/node/usage.js.map +0 -1
  252. package/dist/node/watch-notifications.d.ts +0 -19
  253. package/dist/node/watch-notifications.d.ts.map +0 -1
  254. package/dist/node/watch-notifications.js +0 -128
  255. package/dist/node/watch-notifications.js.map +0 -1
  256. package/dist/schemas/automations.d.ts +0 -390
  257. package/dist/schemas/automations.d.ts.map +0 -1
  258. package/dist/schemas/automations.js +0 -619
  259. package/dist/schemas/automations.js.map +0 -1
  260. package/dist/schemas/blueprints.d.ts +0 -122
  261. package/dist/schemas/blueprints.d.ts.map +0 -1
  262. package/dist/schemas/blueprints.js +0 -337
  263. package/dist/schemas/blueprints.js.map +0 -1
  264. package/dist/schemas/choosing.d.ts +0 -19
  265. package/dist/schemas/choosing.d.ts.map +0 -1
  266. package/dist/schemas/choosing.js +0 -69
  267. package/dist/schemas/choosing.js.map +0 -1
  268. package/dist/schemas/connectors.d.ts +0 -202
  269. package/dist/schemas/connectors.d.ts.map +0 -1
  270. package/dist/schemas/connectors.js +0 -140
  271. package/dist/schemas/connectors.js.map +0 -1
  272. package/dist/schemas/cron.d.ts +0 -14
  273. package/dist/schemas/cron.d.ts.map +0 -1
  274. package/dist/schemas/cron.js +0 -75
  275. package/dist/schemas/cron.js.map +0 -1
  276. package/dist/schemas/geo.d.ts +0 -63
  277. package/dist/schemas/geo.d.ts.map +0 -1
  278. package/dist/schemas/geo.js +0 -131
  279. package/dist/schemas/geo.js.map +0 -1
  280. package/dist/schemas/guides.d.ts +0 -26
  281. package/dist/schemas/guides.d.ts.map +0 -1
  282. package/dist/schemas/guides.js +0 -33
  283. package/dist/schemas/guides.js.map +0 -1
  284. package/dist/schemas/library/annotations.d.ts +0 -616
  285. package/dist/schemas/library/annotations.d.ts.map +0 -1
  286. package/dist/schemas/library/annotations.js +0 -156
  287. package/dist/schemas/library/annotations.js.map +0 -1
  288. package/dist/schemas/library/collections.d.ts +0 -211
  289. package/dist/schemas/library/collections.d.ts.map +0 -1
  290. package/dist/schemas/library/collections.js +0 -57
  291. package/dist/schemas/library/collections.js.map +0 -1
  292. package/dist/schemas/library/community.d.ts +0 -1136
  293. package/dist/schemas/library/community.d.ts.map +0 -1
  294. package/dist/schemas/library/community.js +0 -315
  295. package/dist/schemas/library/community.js.map +0 -1
  296. package/dist/schemas/library/life.d.ts +0 -1440
  297. package/dist/schemas/library/life.d.ts.map +0 -1
  298. package/dist/schemas/library/life.js +0 -202
  299. package/dist/schemas/library/life.js.map +0 -1
  300. package/dist/schemas/library/media.d.ts +0 -1002
  301. package/dist/schemas/library/media.d.ts.map +0 -1
  302. package/dist/schemas/library/media.js +0 -110
  303. package/dist/schemas/library/media.js.map +0 -1
  304. package/dist/schemas/library/money.d.ts +0 -1221
  305. package/dist/schemas/library/money.d.ts.map +0 -1
  306. package/dist/schemas/library/money.js +0 -168
  307. package/dist/schemas/library/money.js.map +0 -1
  308. package/dist/schemas/library/planning.d.ts +0 -1107
  309. package/dist/schemas/library/planning.d.ts.map +0 -1
  310. package/dist/schemas/library/planning.js +0 -214
  311. package/dist/schemas/library/planning.js.map +0 -1
  312. package/dist/schemas/library/publishing.d.ts +0 -1499
  313. package/dist/schemas/library/publishing.d.ts.map +0 -1
  314. package/dist/schemas/library/publishing.js +0 -285
  315. package/dist/schemas/library/publishing.js.map +0 -1
  316. package/dist/schemas/library/social.d.ts +0 -1257
  317. package/dist/schemas/library/social.d.ts.map +0 -1
  318. package/dist/schemas/library/social.js +0 -147
  319. package/dist/schemas/library/social.js.map +0 -1
  320. package/dist/schemas/standard.d.ts +0 -21
  321. package/dist/schemas/standard.d.ts.map +0 -1
  322. package/dist/schemas/standard.js +0 -39
  323. package/dist/schemas/standard.js.map +0 -1
  324. package/dist/session/auth.d.ts +0 -411
  325. package/dist/session/auth.d.ts.map +0 -1
  326. package/dist/session/auth.js +0 -1529
  327. package/dist/session/auth.js.map +0 -1
  328. package/dist/session/credentials.d.ts +0 -30
  329. package/dist/session/credentials.d.ts.map +0 -1
  330. package/dist/session/credentials.js +0 -63
  331. package/dist/session/credentials.js.map +0 -1
  332. package/dist/session/password-strength.d.ts +0 -22
  333. package/dist/session/password-strength.d.ts.map +0 -1
  334. package/dist/session/password-strength.js +0 -130
  335. package/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AO;;;8BAGL,QAAQ;;;;;;;;;;;;;;;;;;0BAHV,OAAO;;;8BAGL,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA2CA,GAAG;;;;;;;gBAA6B,KAAK;;;;;;;;;;;;;;;;;;;;;;gBAenC,GAAG;;;;;;;gBAAY,KAAK;;;;;;;;;;;;;;;;;;;;;;;gBAuBtB,IAAI;;;;;gBAAa,KAAK;;;;;gBAAY,KAAK;;;;;;;;;;;;;;;;;CASxD,CAAC"}
@@ -1,147 +0,0 @@
1
- /**
2
- * People: who someone is, who they follow, block and mute, what they are up to.
3
- * Blocks and mutes are one person's choice, so they belong in that person's
4
- * own space rather than in a space others read.
5
- */
6
- import { address, blob, day, person, text, define, url, when, words } from '../fragments.js';
7
- /**
8
- * How someone presents themselves: more than the name every space keeps for
9
- * them (`sys.profile`). One per person, and only theirs to write.
10
- *
11
- * `bot` is the account saying it is software someone runs, not a person, so
12
- * apps can show it. It is the account's own word, like the rest: an honest
13
- * operator discloses with it, and it proves nothing about anyone who doesn't.
14
- */
15
- export const profile = define({
16
- name: 'std.profile',
17
- title: 'Profile',
18
- description: 'How someone presents themselves: one per person.',
19
- schema: {
20
- type: 'object',
21
- properties: {
22
- name: text(100),
23
- bio: text(2000),
24
- avatar: blob(),
25
- banner: blob(),
26
- pronouns: text(50),
27
- links: {
28
- type: 'array',
29
- maxItems: 16,
30
- items: {
31
- type: 'object',
32
- properties: { title: text(100), url: url() },
33
- required: ['url'],
34
- },
35
- },
36
- bot: { type: 'boolean', description: 'The account is software someone runs, not a person' },
37
- },
38
- },
39
- rules: { onePer: ['@author'] },
40
- });
41
- /**
42
- * How the space presents itself, as `std.profile` is how someone does: what
43
- * apps show in place of the name its constitution was founded with, and a
44
- * picture. One record per space: it names the space it is of, and `onePer`
45
- * that gives every writer the same shared key, so changing it is editing it,
46
- * and which edit stands is the versions' order, never a writer's clock. A
47
- * reader takes only the one whose `space` is the space it is in. Who may
48
- * write it is the space's grants, so the presets leave it to those who keep
49
- * order (`STAFF_COLLECTIONS`).
50
- */
51
- export const spaceProfile = define({
52
- name: 'std.space-profile',
53
- title: 'Space profile',
54
- description: 'How the space presents itself: its name, a line about it and its picture. One per space: "space" is its id.',
55
- schema: {
56
- type: 'object',
57
- properties: {
58
- space: { type: 'string', minLength: 1, maxLength: 256, description: 'The space it presents: its id' },
59
- name: text(100),
60
- bio: text(2000),
61
- avatar: blob(),
62
- banner: blob(),
63
- },
64
- required: ['space'],
65
- },
66
- rules: { onePer: ['space'] },
67
- });
68
- const labelled = (value, required) => ({
69
- type: 'array',
70
- maxItems: 16,
71
- items: {
72
- type: 'object',
73
- properties: { ...value, label: text(50, 'Like "work" or "home"') },
74
- required: [required],
75
- },
76
- });
77
- /**
78
- * A person who may not be on Minca: a subset of JSContact (RFC 9553). For
79
- * people who are, `std.contact` keeps their DID.
80
- */
81
- export const card = define({
82
- name: 'std.card',
83
- title: 'Contact card',
84
- description: 'An address-book entry for anyone, on Minca or not. Your own public self is std.profile; a Minca account you can message is std.contact.',
85
- schema: {
86
- type: 'object',
87
- properties: {
88
- name: {
89
- type: 'object',
90
- properties: { full: text(200), given: text(100), family: text(100) },
91
- },
92
- emails: labelled({ address: words(320) }, 'address'),
93
- phones: labelled({ number: words(64) }, 'number'),
94
- addresses: labelled({ address: address() }, 'address'),
95
- organization: text(200),
96
- jobTitle: text(200),
97
- birthday: day(),
98
- photo: blob(),
99
- urls: { type: 'array', maxItems: 16, items: url() },
100
- note: text(10000),
101
- },
102
- },
103
- });
104
- /** Following someone: their DID, and the space they publish in if known. */
105
- export const follow = define({
106
- name: 'std.follow',
107
- title: 'Follow',
108
- description: 'Following a person: one per person followed.',
109
- schema: {
110
- type: 'object',
111
- properties: { did: person('Who is followed'), space: text(256, 'The space they publish in') },
112
- required: ['did'],
113
- },
114
- rules: { onePer: ['@author', 'did'] },
115
- topics: ['did'],
116
- });
117
- const avoided = (name, title, description) => define({
118
- name,
119
- title,
120
- description,
121
- schema: {
122
- type: 'object',
123
- properties: { did: person(), until: when('Until when; forever without one') },
124
- required: ['did'],
125
- },
126
- rules: { onePer: ['@author', 'did'] },
127
- });
128
- /** Someone whose records an app hides and whose invitations it refuses. Keep it in your own space. */
129
- export const block = avoided('std.block', 'Block', 'Someone to hide and keep away. Keep it in your own space.');
130
- /** Someone whose records an app quiets but still shows when asked. Keep it in your own space. */
131
- export const mute = avoided('std.mute', 'Mute', 'Someone to quiet for a while. Keep it in your own space.');
132
- /** What someone is up to right now: one per person, gone after `until`. */
133
- export const status = define({
134
- name: 'std.status',
135
- title: 'Status',
136
- description: 'What someone is up to now: one per person.',
137
- schema: {
138
- type: 'object',
139
- properties: { text: text(280), emoji: text(16), until: when('When it stops showing') },
140
- },
141
- rules: { onePer: ['@author'] },
142
- });
143
- /** This file's part of `standardGroups` */
144
- export const socialGroups = {
145
- People: [profile, spaceProfile, card, follow, block, mute, status],
146
- };
147
- //# sourceMappingURL=social.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"social.js","sourceRoot":"","sources":["../../../src/schemas/library/social.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG7F;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC;IAC5B,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,kDAAkD;IAC/D,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC;Y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,4CAA4C;IACzD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,uBAAuB,CAAC,EAAE;KACvF;IACD,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE;CAC/B,CAAC,CAAC;AAGH,2CAA2C;AAC3C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC;CACnE,CAAC"}
@@ -1,21 +0,0 @@
1
- /**
2
- * The standard library as one list, by area: what `collections_standard`
3
- * shows an agent, and what a `std.*` name means.
4
- */
5
- import type { DefineCollection } from '../node/types.js';
6
- type Definitions = ReadonlyArray<DefineCollection>;
7
- /** Shapes that attach to anything: the annotations, and files, which may be about a record */
8
- export declare const standardAnnotations: Definitions;
9
- /**
10
- * The library by area, in the order it is listed: what `collections_standard`
11
- * shows an agent, and the tables in `packages/core/docs/standard-library.md`.
12
- */
13
- export declare const standardGroups: Readonly<Record<string, Definitions>>;
14
- /** Common nouns apps share: everything but the annotations */
15
- export declare const standardNouns: Definitions;
16
- /** Everything in the library */
17
- export declare const standardSchemas: Definitions;
18
- /** The library's definition of a `std.*` name, or undefined when it has none */
19
- export declare function standardDefinition(name: string): DefineCollection | undefined;
20
- export {};
21
- //# sourceMappingURL=standard.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"standard.d.ts","sourceRoot":"","sources":["../../src/schemas/standard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAazD,KAAK,WAAW,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAAC;AAEnD,8FAA8F;AAC9F,eAAO,MAAM,mBAAmB,EAAE,WAAqD,CAAC;AAExF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAY/D,CAAC;AAEH,8DAA8D;AAC9D,eAAO,MAAM,aAAa,EAAE,WAA2D,CAAC;AACxF,gCAAgC;AAChC,eAAO,MAAM,eAAe,EAAE,WAAkD,CAAC;AAEjF,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAE7E"}
@@ -1,39 +0,0 @@
1
- import { annotationGroups } from './library/annotations.js';
2
- import { socialGroups } from './library/social.js';
3
- import { publishingGroups } from './library/publishing.js';
4
- import { file, mediaGroups } from './library/media.js';
5
- import { planningGroups } from './library/planning.js';
6
- import { lifeGroups } from './library/life.js';
7
- import { moneyGroups } from './library/money.js';
8
- import { communityGroups } from './library/community.js';
9
- import { activity, automation, automationRun } from '../schemas/automations.js';
10
- import { collectionsGroups } from './library/collections.js';
11
- import { botSettings, connect, connector } from './connectors.js';
12
- /** Shapes that attach to anything: the annotations, and files, which may be about a record */
13
- export const standardAnnotations = [...annotationGroups.Annotations, file];
14
- /**
15
- * The library by area, in the order it is listed: what `collections_standard`
16
- * shows an agent, and the tables in `packages/core/docs/standard-library.md`.
17
- */
18
- export const standardGroups = Object.freeze({
19
- ...annotationGroups,
20
- ...socialGroups,
21
- ...publishingGroups,
22
- ...mediaGroups,
23
- ...planningGroups,
24
- ...lifeGroups,
25
- ...moneyGroups,
26
- ...communityGroups,
27
- Rules: [automation, automationRun, activity],
28
- Bots: [botSettings, connect, connector],
29
- ...collectionsGroups,
30
- });
31
- /** Common nouns apps share: everything but the annotations */
32
- export const standardNouns = Object.values(standardGroups).slice(1).flat();
33
- /** Everything in the library */
34
- export const standardSchemas = Object.values(standardGroups).flat();
35
- /** The library's definition of a `std.*` name, or undefined when it has none */
36
- export function standardDefinition(name) {
37
- return standardSchemas.find((definition) => definition.name === name);
38
- }
39
- //# sourceMappingURL=standard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"standard.js","sourceRoot":"","sources":["../../src/schemas/standard.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIlE,8FAA8F;AAC9F,MAAM,CAAC,MAAM,mBAAmB,GAAgB,CAAC,GAAG,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAExF;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAA0C,MAAM,CAAC,MAAM,CAAC;IACjF,GAAG,gBAAgB;IACnB,GAAG,YAAY;IACf,GAAG,gBAAgB;IACnB,GAAG,WAAW;IACd,GAAG,cAAc;IACjB,GAAG,UAAU;IACb,GAAG,WAAW;IACd,GAAG,eAAe;IAClB,KAAK,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,QAAQ,CAAC;IAC5C,IAAI,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC;IACvC,GAAG,iBAAiB;CACrB,CAAC,CAAC;AAEH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,aAAa,GAAgB,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACxF,gCAAgC;AAChC,MAAM,CAAC,MAAM,eAAe,GAAgB,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,CAAC;AAEjF,gFAAgF;AAChF,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACxE,CAAC"}
@@ -1,411 +0,0 @@
1
- import type { AccountStore, AccountSummary } from '../identity/account-store.js';
2
- import { type AccountVault, type DeviceWrap } from '../identity/account-vault.js';
3
- import type { PairingTicket } from '../identity/pairing.js';
4
- import { type WorkerLike } from '../node/worker.js';
5
- import type { StoreFactory } from '../node/stores.js';
6
- import type { NodeNetworkConfig, P2PNode } from '../node/types.js';
7
- import { type ProtocolErrorCode } from '../utils/errors.js';
8
- import { type Place, type PodContents } from './places.js';
9
- import { type KeyValueStore, type StaySignedIn } from './stay-signed-in.js';
10
- import { type CarryGrant, type ConnectRequest, type Grant, type ProposeRequest, type Proposed } from './connect.js';
11
- import type { PeerTransport } from '../network/transport.js';
12
- import { type PairingOffer, type PairingStage } from './pairing.js';
13
- export interface MincaAuthConfig {
14
- /** What passkey prompts call this app. Default "Minca". */
15
- readonly appName?: string;
16
- /** Relays, always-on nodes and hosts the signed-in node connects to. Omit to stay offline. */
17
- readonly network?: NodeNetworkConfig;
18
- /** The site passkeys belong to. Default: this page's hostname. */
19
- readonly rpId?: string;
20
- /** Where small choices are remembered — which account, stay signed in. Default `localStorage`. */
21
- readonly storage?: KeyValueStore | null;
22
- /** Namespaces those choices, so two apps on one origin keep their own. Default "minca". */
23
- readonly storageKey?: string;
24
- /** The page a phone-pairing QR opens. Default: this page. */
25
- readonly pairingLink?: string;
26
- /** How the two sides of a pairing reach each other, given a throwaway DID. Default: the relay. For tests, or a host with its own. */
27
- readonly pairingTransport?: (did: string) => PeerTransport;
28
- /** How long signing out waits, at most, for a peer to take its revokes in. Default 5 s. */
29
- readonly signOutGraceMs?: number;
30
- /**
31
- * Accounts kept in this browser, and their data. Defaults to IndexedDB;
32
- * swap both for tests or for a host with no IndexedDB.
33
- */
34
- readonly browser?: {
35
- readonly accounts: () => Promise<AccountStore>;
36
- readonly stores: (account: AccountSummary) => StoreFactory;
37
- };
38
- /**
39
- * Runs the node in a worker, off the page's main thread
40
- * (`@minca/core/node-worker`). Called once per sign-in; the worker
41
- * ends when the node closes. Not with `browser.stores`, which a worker
42
- * can't be handed. Default: the node runs on the page.
43
- */
44
- readonly worker?: () => WorkerLike;
45
- /**
46
- * Whether a new account is offered a pod before it goes in (`pod`). Default
47
- * true. Turn it off where the page closes once signed in, as when an app
48
- * opened it to connect: the pod is only kept up to date while this page
49
- * runs, so it is better offered where the person comes back.
50
- */
51
- readonly offerPod?: boolean;
52
- /**
53
- * Where a new account takes its username, as `minca.social`: creating one
54
- * offers `<name>@<this>`, claimed in the background
55
- * (`packages/core/docs/usernames.md`). Default: none offered.
56
- */
57
- readonly usernames?: string;
58
- }
59
- /** The username a new account asked for, while it is claimed and after */
60
- export interface UsernameClaim {
61
- readonly username: string;
62
- /** `claiming` while it runs, then `claimed` once the name is the account's, or `failed` */
63
- readonly status: 'claiming' | 'claimed' | 'failed';
64
- /** Why it failed: the name was taken meanwhile, or the service was down */
65
- readonly error?: string;
66
- }
67
- /**
68
- * Which screen the flow is on.
69
- *
70
- * `starting` — looking for accounts and a kept sign-in, until `start()` is done.
71
- * `welcome` — the place holds no accounts: new here, or not?
72
- * `existing` — "I already have one": open a pod, use the recovery code, or add this device from another.
73
- * `signIn` — choose an account and unlock it.
74
- * `restore` — type the recovery code.
75
- * `create` — name a new account.
76
- * `recovery` — signed in, and `freshCode` is the recovery code to keep safe.
77
- * `unlock` — signed in, choosing a passkey or a password for every day. Required.
78
- * `pod` — signed in, a new account with no host to keep it online is offered a pod. Optional.
79
- * `pair` — opened from a phone-pairing QR code.
80
- * `ready` — signed in; `session` is set.
81
- *
82
- * `recovery`, `unlock` and `pod` already have a session, but the flow is not
83
- * finished: a screen that waits for `ready` does not show the app halfway.
84
- */
85
- export type AuthStage = 'starting' | 'welcome' | 'existing' | 'signIn' | 'restore' | 'create' | 'recovery' | 'unlock' | 'pod' | 'pair' | 'ready';
86
- /**
87
- * Why the flow is setting an account up: made just now, opened with its
88
- * recovery code where it had no everyday way in, or arrived from a pairing
89
- * link. Decides which of the setup screens are shown.
90
- */
91
- export type AuthSetup = 'new' | 'restored' | 'paired';
92
- /** A failure, in the shape a screen needs to explain it */
93
- export interface AuthError {
94
- readonly message: string;
95
- /** What the person can do about it, when that is known */
96
- readonly hint?: string;
97
- readonly code?: ProtocolErrorCode;
98
- }
99
- /** Which ways into an account exist on this site */
100
- export interface AccountEntry {
101
- readonly summary: AccountSummary;
102
- readonly vault: AccountVault;
103
- /**
104
- * Passkey shortcuts this device can actually use. A wrap names a key in this
105
- * site's storage, so one made on another site — or before storage was
106
- * cleared — is listed by the vault but unopenable here.
107
- */
108
- readonly shortcuts: ReadonlyArray<DeviceWrap>;
109
- /** Whether a password unlocks it here */
110
- readonly hasPassword: boolean;
111
- }
112
- /** An open account: who it is, and the node doing its work */
113
- export interface MincaSession {
114
- readonly account: AccountSummary;
115
- /** The account's identity */
116
- readonly did: string;
117
- /** The session key's DID — what peers see */
118
- readonly sessionDid: string;
119
- readonly node: P2PNode;
120
- }
121
- /** What the last move into a pod did */
122
- export interface MovedToPod {
123
- /** The pod already held this account, and the two copies were combined */
124
- readonly merged: boolean;
125
- readonly spacesAdded: number;
126
- readonly recordsAdded: number;
127
- /** The old pod's name, or null when the old place was this browser */
128
- readonly from: string | null;
129
- }
130
- /** An app this account gave access to, as the home remembers it */
131
- export interface Connection {
132
- /** Where the app lives — as the browser reported it, not as the app named itself */
133
- readonly origin: string;
134
- /** What the app called itself */
135
- readonly name: string | null;
136
- /** The app's key */
137
- readonly audience: string;
138
- /** `carry` for a carrier, which holds passes and no keys */
139
- readonly access: 'read' | 'write' | 'carry';
140
- /** `account` when the app was given the whole account, not chosen spaces */
141
- readonly scope: 'spaces' | 'account';
142
- /** A carrier's carry space — what disconnecting takes away */
143
- readonly carrySpace?: string;
144
- /** The spaces it was given, by id and name */
145
- readonly spaces: ReadonlyArray<{
146
- readonly id: string;
147
- readonly name: string;
148
- }>;
149
- /** When it was connected, ISO */
150
- readonly grantedAt: string;
151
- /** When its grant runs out, Unix seconds; 0 for a carrier, which never expires */
152
- readonly expiresAt: number;
153
- /** `code` for a program connected by code, at the home's own `origin`: kept by its key */
154
- readonly via?: 'code';
155
- /** Present, and true, when its note grants records only */
156
- readonly recordsOnly?: true;
157
- /**
158
- * Keys that wrote, which this connection replaced, left unrevoked: revoking
159
- * from what this home has seen would withdraw what they wrote that it
160
- * hasn't. Disconnecting revokes each where it was granted.
161
- */
162
- readonly retired?: ReadonlyArray<RetiredKey>;
163
- }
164
- /**
165
- * Which kept connection this is: an app by its origin, and a program
166
- * connected by code or a carrier by its key, since one origin has several.
167
- */
168
- export declare const connectionKey: (known: Connection) => string;
169
- /** A key a connection replaced, and where it could write */
170
- export interface RetiredKey {
171
- readonly audience: string;
172
- readonly scope: 'spaces' | 'account';
173
- readonly spaces: ReadonlyArray<{
174
- readonly id: string;
175
- readonly name: string;
176
- }>;
177
- }
178
- /** What the person chose on the approval screen */
179
- export interface GrantChoice {
180
- readonly origin: string;
181
- readonly request: ConnectRequest;
182
- /** Existing spaces to give the app */
183
- readonly spaceIds: ReadonlyArray<string>;
184
- /** How long the note lasts, overriding what the request asked for. Default: the request's `days`, or 7. */
185
- readonly days?: number;
186
- }
187
- /** What the person chose on the screen for a later proposal */
188
- export interface ProposeChoice {
189
- readonly origin: string;
190
- readonly request: ProposeRequest;
191
- /** Which proposals they said yes to, by index. Default: all of them. */
192
- readonly kept?: ReadonlyArray<number>;
193
- }
194
- export interface AuthState {
195
- readonly stage: AuthStage;
196
- /** Where accounts are being read from */
197
- readonly place: Place | null;
198
- readonly accounts: ReadonlyArray<AccountSummary>;
199
- readonly selectedId: string | null;
200
- /** Ways into the selected account */
201
- readonly entry: AccountEntry | null;
202
- readonly session: MincaSession | null;
203
- /** The recovery code, while the `recovery` screen shows it; cleared by `codeSaved()` */
204
- readonly freshCode: string | null;
205
- /** Set while the account is being set up (`recovery`, `unlock`, `pod`) */
206
- readonly setup: AuthSetup | null;
207
- /** Something is in progress; buttons should wait */
208
- readonly busy: boolean;
209
- readonly error: AuthError | null;
210
- /** Whether this browser can open a pod at all */
211
- readonly folderAvailable: boolean;
212
- /** The phone-pairing link this page was opened with */
213
- readonly pairing: PairingTicket | null;
214
- readonly pairingStage: PairingStage | null;
215
- /**
216
- * The account a pairing brought to a device signed in to another, waiting
217
- * for the person: `account` is set when this place already keeps it.
218
- */
219
- readonly pairingArrival: {
220
- readonly did: string;
221
- readonly account: AccountSummary | null;
222
- } | null;
223
- /** A pod picked while signed in, waiting on what should happen to the data */
224
- readonly podChoice: {
225
- readonly pod: Place;
226
- readonly contents: PodContents;
227
- readonly from: Place;
228
- } | null;
229
- readonly moved: MovedToPod | null;
230
- /** Signing out now: `starting` is this, not a look for accounts */
231
- readonly signingOut: boolean;
232
- /**
233
- * The pod this site used last, by name, when the browser wants a click
234
- * before opening it again: `reopenPod` from that click.
235
- */
236
- readonly podToReopen: string | null;
237
- /** The username the account made here asked for; null when it asked for none */
238
- readonly username: UsernameClaim | null;
239
- }
240
- export interface MincaAuth {
241
- getState(): AuthState;
242
- /** Called after every change. Returns a function that stops it. */
243
- subscribe(listener: (state: AuthState) => void): () => void;
244
- /** Looks for accounts and resumes a kept sign-in. Safe to call more than once. */
245
- start(): Promise<void>;
246
- /** Opens again the pod named in `podToReopen`, signed in if it was kept so. Needs a click. */
247
- reopenPod(): Promise<void>;
248
- /** Opens a pod. Needs a click. Signed in, it asks what should happen to the data first (`podChoice`). */
249
- choosePod(): Promise<void>;
250
- /** Keeps accounts in this browser, and stops using a pod if one was open */
251
- useBrowser(): Promise<void>;
252
- select(accountId: string): Promise<void>;
253
- /** Opens an account with its recovery code. Where it has no passkey or password yet, sets one up next. */
254
- signInWithCode(code: string): Promise<void>;
255
- /** Opens the selected account with its password. A recovery code typed or filled here works too. */
256
- signInWithPassword(password: string): Promise<void>;
257
- signInWithPasskey(): Promise<void>;
258
- startCreating(): void;
259
- showSignIn(): void;
260
- /** Back to "new here, or not?" */
261
- showWelcome(): void;
262
- /** "I already have an account": the ways to reach one from here */
263
- showExisting(): void;
264
- /** The recovery code form, for the selected account if there is one */
265
- showRestore(): void;
266
- /** Where new accounts take usernames (`usernames` in the config); null when none are offered */
267
- readonly usernames: string | null;
268
- /**
269
- * Makes an account. With `username`, it is claimed for the account in the
270
- * background while the rest of setup goes on, and `username` in the state
271
- * says how that went.
272
- */
273
- createAccount(name: string, options?: {
274
- readonly username?: string;
275
- }): Promise<void>;
276
- /** The recovery code has been kept somewhere safe; on to choosing a way in */
277
- codeSaved(): void;
278
- /** Leaves the optional `pod` step with the data in this browser */
279
- finishSetup(): void;
280
- /** Resolves once the work setup began in the background is done: the username's claim, the host's handover */
281
- settled(): Promise<void>;
282
- /**
283
- * Meets the computer the pairing link names. Signed in to another account,
284
- * it stops once the account arrives and sets `pairingArrival`: answer with
285
- * `answerPairing`.
286
- */
287
- acceptPairing(): Promise<void>;
288
- /** Takes the account a pairing brought (added, or switched to if already here), or lets it go */
289
- answerPairing(take: boolean): Promise<void>;
290
- dismissPairing(): void;
291
- clearError(): void;
292
- rename(name: string): Promise<boolean>;
293
- /** Adds a passkey for this site. During setup, moves the flow on; otherwise needs `confirm` first. */
294
- addPasskey(): Promise<boolean>;
295
- /** Sets or replaces the account's password. During setup, moves the flow on; otherwise needs `confirm` first. */
296
- setPassword(password: string): Promise<boolean>;
297
- removeShortcut(kind: 'passkey' | 'passphrase'): Promise<boolean>;
298
- confirmPod(how: 'combine' | 'switch'): Promise<void>;
299
- cancelPod(): void;
300
- /** Removes the copy this browser kept after a move into a pod */
301
- forgetBrowserCopy(): Promise<void>;
302
- /**
303
- * Removes the open account from this browser, after `confirm` and once no
304
- * app is connected from here: signs out, then deletes the account and its
305
- * spaces' data from this browser, as clearing its site data would. Copies elsewhere, on
306
- * other devices, carriers or hosts, stay; without one, its private spaces
307
- * are gone. Not for an account kept in a folder: that folder is its copy.
308
- */
309
- removeAccount(): Promise<boolean>;
310
- dismissMoved(): void;
311
- /**
312
- * Asks the person to prove it is them, with the account's password, a
313
- * passkey on this device or the recovery code, even though they are signed
314
- * in: a page left open, or a sign-in kept for days, is no proof anyone is
315
- * there. For a few minutes after, the recovery code can be read and the
316
- * account offered to a phone. A wrong answer sets `error`.
317
- */
318
- confirm(proof: {
319
- readonly password: string;
320
- } | {
321
- readonly passkey: true;
322
- } | {
323
- readonly code: string;
324
- }): Promise<boolean>;
325
- /** Whether `confirm` succeeded in the last few minutes */
326
- isConfirmed(): boolean;
327
- /**
328
- * Whether `grant` and `grantCarry` may run now: `isConfirmed`, or a sign-in
329
- * with a password, passkey or the recovery code in the last few minutes.
330
- */
331
- mayGrant(): boolean;
332
- /** The recovery code of the open account, for a few minutes after `confirm`. Null otherwise. */
333
- recoveryCode(): string | null;
334
- /** Starts offering this account to a phone */
335
- offerToPhone(onStage: (stage: PairingStage) => void): Promise<PairingOffer>;
336
- /**
337
- * Gives an app access, as the account home: makes any spaces it asked for,
338
- * signs a note from the account to the app's key for these spaces, and
339
- * remembers the app as connected. The seed signs here and goes nowhere.
340
- */
341
- grant(choice: GrantChoice): Promise<Omit<Grant, 'home'>>;
342
- /**
343
- * Starts using a carrier, as the account home: makes its carry space, fills
344
- * it with a pass for every space, and remembers it as connected. The
345
- * carrier gets no key that reads or writes a space.
346
- */
347
- grantCarry(choice: {
348
- readonly origin: string;
349
- readonly request: ConnectRequest;
350
- }): Promise<Omit<CarryGrant, 'home'>>;
351
- /**
352
- * Adds the subscriptions an app connected from this home proposed, as the
353
- * account home — the ones the person kept, naming it, looking only at
354
- * spaces it may reach.
355
- * @throws When no app from `origin` is connected here (a carrier or a program connected by code doesn't count), or a proposal names a space it wasn't given
356
- */
357
- propose(choice: ProposeChoice): Promise<Proposed>;
358
- /** Apps this account is connected to from this home, newest first */
359
- connections(): ReadonlyArray<Connection>;
360
- /**
361
- * Other accounts in this place that a carrier at `origin` is connected to from this home.
362
- * One browser extension carries one account, so connecting it here moves it
363
- * off theirs — worth saying before it happens.
364
- */
365
- connectedElsewhere(origin: string): ReadonlyArray<{
366
- readonly id: string;
367
- readonly name: string;
368
- }>;
369
- /**
370
- * Disconnects an app: revokes its note in every space it could write in —
371
- * and, for a whole-account app, in the account registry — so nothing it
372
- * writes from now on counts, and forgets it. What this home had
373
- * seen it write stays. What it could already read, it keeps — reading is
374
- * holding a space's key, and that is not taken back.
375
- *
376
- * Disconnecting by origin disconnects every connection made from it but a
377
- * carrier, which goes only by `{ audience }`, its own key. Programs
378
- * connected by code are at the home's own origin; `{ audience }`
379
- * disconnects one.
380
- *
381
- * The app hears of it when the revokes reach it: from this node, or a
382
- * device that has them. `{ waitMs }` waits up to that long for a peer to
383
- * take them in, and the answer says whether one did. False means they are
384
- * still only here: the app keeps working until this home is next online
385
- * with another of the account's devices or apps.
386
- */
387
- disconnect(origin: string, options?: {
388
- readonly audience?: string;
389
- readonly waitMs?: number;
390
- }): Promise<boolean>;
391
- readonly staySignedIn: {
392
- choice(): StaySignedIn;
393
- setChoice(choice: StaySignedIn): Promise<void>;
394
- until(): Date | null;
395
- };
396
- /**
397
- * Signs this home out on this device: it forgets the unlocked account, lets
398
- * apps whose time has passed go, and revokes its own session key. The apps
399
- * connected from here keep their notes until they run out, as apps stay
400
- * signed in when you sign out of where you signed in to them.
401
- * `{ disconnect: true }` disconnects them first, and the programs connected
402
- * through them: their keys are revoked, and each sees it and asks to connect
403
- * again. Carriers stay: they hold nothing that writes.
404
- */
405
- signOut(options?: {
406
- readonly disconnect?: boolean;
407
- }): Promise<void>;
408
- }
409
- /** Creates the sign-in flow for this page. */
410
- export declare function createMincaAuth(config?: MincaAuthConfig): MincaAuth;
411
- //# sourceMappingURL=auth.d.ts.map