@minca/core 0.1.9 → 0.1.11

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 (195) hide show
  1. package/README.md +2 -2
  2. package/dist/identity/abilities.d.ts +3 -3
  3. package/dist/identity/abilities.d.ts.map +1 -1
  4. package/dist/identity/abilities.js +9 -11
  5. package/dist/identity/abilities.js.map +1 -1
  6. package/dist/identity/contact-key.d.ts +15 -15
  7. package/dist/identity/contact-key.d.ts.map +1 -1
  8. package/dist/identity/contact-key.js +21 -28
  9. package/dist/identity/contact-key.js.map +1 -1
  10. package/dist/identity/root-signer.d.ts +0 -5
  11. package/dist/identity/root-signer.d.ts.map +1 -1
  12. package/dist/identity/root-signer.js +0 -1
  13. package/dist/identity/root-signer.js.map +1 -1
  14. package/dist/inbox/inbox.d.ts +140 -0
  15. package/dist/inbox/inbox.d.ts.map +1 -0
  16. package/dist/inbox/inbox.js +212 -0
  17. package/dist/inbox/inbox.js.map +1 -0
  18. package/dist/inbox/index.d.ts +9 -0
  19. package/dist/inbox/index.d.ts.map +1 -0
  20. package/dist/inbox/index.js +7 -0
  21. package/dist/inbox/index.js.map +1 -0
  22. package/dist/index.d.ts +3 -3
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/network/mailbox.d.ts +4 -4
  27. package/dist/network/mailbox.d.ts.map +1 -1
  28. package/dist/network/mailbox.js +5 -5
  29. package/dist/network/mailbox.js.map +1 -1
  30. package/dist/node/actions.d.ts.map +1 -1
  31. package/dist/node/actions.js +28 -18
  32. package/dist/node/actions.js.map +1 -1
  33. package/dist/node/api.d.ts +11 -10
  34. package/dist/node/api.d.ts.map +1 -1
  35. package/dist/node/api.js +11 -10
  36. package/dist/node/api.js.map +1 -1
  37. package/dist/node/carrier.d.ts +11 -5
  38. package/dist/node/carrier.d.ts.map +1 -1
  39. package/dist/node/carrier.js +42 -1
  40. package/dist/node/carrier.js.map +1 -1
  41. package/dist/node/copy.d.ts +1 -1
  42. package/dist/node/copy.d.ts.map +1 -1
  43. package/dist/node/copy.js +10 -4
  44. package/dist/node/copy.js.map +1 -1
  45. package/dist/node/host.d.ts +2 -0
  46. package/dist/node/host.d.ts.map +1 -1
  47. package/dist/node/host.js +2 -0
  48. package/dist/node/host.js.map +1 -1
  49. package/dist/node/index.d.ts +1 -1
  50. package/dist/node/index.d.ts.map +1 -1
  51. package/dist/node/node.d.ts.map +1 -1
  52. package/dist/node/node.js +720 -542
  53. package/dist/node/node.js.map +1 -1
  54. package/dist/node/remote.d.ts +6 -5
  55. package/dist/node/remote.d.ts.map +1 -1
  56. package/dist/node/remote.js +140 -195
  57. package/dist/node/remote.js.map +1 -1
  58. package/dist/node/space-runtime.d.ts +2 -1
  59. package/dist/node/space-runtime.d.ts.map +1 -1
  60. package/dist/node/space-runtime.js +71 -84
  61. package/dist/node/space-runtime.js.map +1 -1
  62. package/dist/node/types.d.ts +84 -47
  63. package/dist/node/types.d.ts.map +1 -1
  64. package/dist/node/worker.d.ts +1 -1
  65. package/dist/node/worker.d.ts.map +1 -1
  66. package/dist/node/worker.js +10 -6
  67. package/dist/node/worker.js.map +1 -1
  68. package/dist/react/use-invite-link.d.ts +1 -1
  69. package/dist/react/use-invite-link.d.ts.map +1 -1
  70. package/dist/react/use-invite-link.js +18 -11
  71. package/dist/react/use-invite-link.js.map +1 -1
  72. package/dist/records/loose.d.ts +52 -0
  73. package/dist/records/loose.d.ts.map +1 -0
  74. package/dist/records/loose.js +86 -0
  75. package/dist/records/loose.js.map +1 -0
  76. package/dist/schema/version.d.ts +2 -0
  77. package/dist/schema/version.d.ts.map +1 -1
  78. package/dist/schema/version.js +2 -1
  79. package/dist/schema/version.js.map +1 -1
  80. package/dist/schemas/choosing.d.ts +19 -0
  81. package/dist/schemas/choosing.d.ts.map +1 -0
  82. package/dist/schemas/choosing.js +69 -0
  83. package/dist/schemas/choosing.js.map +1 -0
  84. package/dist/schemas/contacts.d.ts +34 -87
  85. package/dist/schemas/contacts.d.ts.map +1 -1
  86. package/dist/schemas/contacts.js +32 -76
  87. package/dist/schemas/contacts.js.map +1 -1
  88. package/dist/schemas/index.d.ts +2 -2
  89. package/dist/schemas/index.d.ts.map +1 -1
  90. package/dist/schemas/index.js +1 -1
  91. package/dist/schemas/index.js.map +1 -1
  92. package/dist/schemas/library/annotations.d.ts +17 -285
  93. package/dist/schemas/library/annotations.d.ts.map +1 -1
  94. package/dist/schemas/library/annotations.js +9 -65
  95. package/dist/schemas/library/annotations.js.map +1 -1
  96. package/dist/schemas/library/community.d.ts +9 -17
  97. package/dist/schemas/library/community.d.ts.map +1 -1
  98. package/dist/schemas/library/community.js +5 -5
  99. package/dist/schemas/library/community.js.map +1 -1
  100. package/dist/schemas/library/life.d.ts +3 -3
  101. package/dist/schemas/library/life.d.ts.map +1 -1
  102. package/dist/schemas/library/life.js +2 -2
  103. package/dist/schemas/library/life.js.map +1 -1
  104. package/dist/schemas/library/media.d.ts +148 -541
  105. package/dist/schemas/library/media.d.ts.map +1 -1
  106. package/dist/schemas/library/media.js +28 -64
  107. package/dist/schemas/library/media.js.map +1 -1
  108. package/dist/schemas/library/money.d.ts +8 -8
  109. package/dist/schemas/library/money.d.ts.map +1 -1
  110. package/dist/schemas/library/money.js +4 -4
  111. package/dist/schemas/library/money.js.map +1 -1
  112. package/dist/schemas/library/planning.d.ts +23 -87
  113. package/dist/schemas/library/planning.d.ts.map +1 -1
  114. package/dist/schemas/library/planning.js +10 -26
  115. package/dist/schemas/library/planning.js.map +1 -1
  116. package/dist/schemas/library/publishing.d.ts +14 -14
  117. package/dist/schemas/library/publishing.d.ts.map +1 -1
  118. package/dist/schemas/library/publishing.js +7 -7
  119. package/dist/schemas/library/publishing.js.map +1 -1
  120. package/dist/schemas/library/social.d.ts +2 -2
  121. package/dist/schemas/library/social.d.ts.map +1 -1
  122. package/dist/schemas/library/social.js +1 -1
  123. package/dist/schemas/library/social.js.map +1 -1
  124. package/dist/schemas/standard.d.ts +1 -1
  125. package/dist/schemas/standard.d.ts.map +1 -1
  126. package/dist/schemas/standard.js +3 -3
  127. package/dist/schemas/standard.js.map +1 -1
  128. package/dist/session/auth.d.ts +20 -0
  129. package/dist/session/auth.d.ts.map +1 -1
  130. package/dist/session/auth.js +81 -64
  131. package/dist/session/auth.js.map +1 -1
  132. package/dist/session/connect.d.ts +50 -8
  133. package/dist/session/connect.d.ts.map +1 -1
  134. package/dist/session/connect.js +91 -27
  135. package/dist/session/connect.js.map +1 -1
  136. package/dist/session/connection.d.ts +39 -6
  137. package/dist/session/connection.d.ts.map +1 -1
  138. package/dist/session/connection.js +107 -38
  139. package/dist/session/connection.js.map +1 -1
  140. package/dist/session/hosting.d.ts +15 -0
  141. package/dist/session/hosting.d.ts.map +1 -1
  142. package/dist/session/hosting.js +55 -4
  143. package/dist/session/hosting.js.map +1 -1
  144. package/dist/session/index.d.ts +5 -5
  145. package/dist/session/index.d.ts.map +1 -1
  146. package/dist/session/index.js +2 -2
  147. package/dist/session/index.js.map +1 -1
  148. package/dist/space/account-registry.d.ts +36 -4
  149. package/dist/space/account-registry.d.ts.map +1 -1
  150. package/dist/space/account-registry.js +30 -3
  151. package/dist/space/account-registry.js.map +1 -1
  152. package/dist/space/invitation.d.ts +61 -0
  153. package/dist/space/invitation.d.ts.map +1 -0
  154. package/dist/space/invitation.js +84 -0
  155. package/dist/space/invitation.js.map +1 -0
  156. package/dist/space/invite-link.d.ts +64 -0
  157. package/dist/space/invite-link.d.ts.map +1 -0
  158. package/dist/space/invite-link.js +212 -0
  159. package/dist/space/invite-link.js.map +1 -0
  160. package/dist/space/roles.d.ts +59 -140
  161. package/dist/space/roles.d.ts.map +1 -1
  162. package/dist/space/roles.js +328 -427
  163. package/dist/space/roles.js.map +1 -1
  164. package/dist/space/space-manager.d.ts +21 -6
  165. package/dist/space/space-manager.d.ts.map +1 -1
  166. package/dist/space/space-manager.js +40 -23
  167. package/dist/space/space-manager.js.map +1 -1
  168. package/dist/types.d.ts +2 -0
  169. package/dist/types.d.ts.map +1 -1
  170. package/dist/types.js.map +1 -1
  171. package/docs/README.md +2 -2
  172. package/docs/actions.md +40 -40
  173. package/docs/agents.md +2 -2
  174. package/docs/automations.md +2 -2
  175. package/docs/blueprints-and-guides.md +61 -1
  176. package/docs/bots.md +1 -1
  177. package/docs/building-an-app.md +2 -2
  178. package/docs/contacts.md +48 -69
  179. package/docs/inbox.md +145 -0
  180. package/docs/node.md +135 -76
  181. package/docs/query-format.md +1 -1
  182. package/docs/sign-in.md +16 -9
  183. package/docs/spaces.md +33 -5
  184. package/docs/standard-library.md +111 -86
  185. package/docs/storage.md +1 -1
  186. package/package.json +5 -5
  187. package/dist/doors/doors.d.ts +0 -140
  188. package/dist/doors/doors.d.ts.map +0 -1
  189. package/dist/doors/doors.js +0 -226
  190. package/dist/doors/doors.js.map +0 -1
  191. package/dist/doors/index.d.ts +0 -9
  192. package/dist/doors/index.d.ts.map +0 -1
  193. package/dist/doors/index.js +0 -7
  194. package/dist/doors/index.js.map +0 -1
  195. package/docs/doors.md +0 -151
package/docs/sign-in.md CHANGED
@@ -386,22 +386,27 @@ lifetime, clamped to [1/24, 365].
386
386
  **Connections.** The home remembers each connection per account in
387
387
  `localStorage` under `<prefix>.connections:<accountId>` (`Connection`:
388
388
  `origin`, `name`, `audience`, `access`, `scope`, `carrySpace?`, `spaces`,
389
- `grantedAt`, `expiresAt`, `via?`, `recordsOnly?`). It keeps no note:
389
+ `grantedAt`, `expiresAt`, `via?`, `recordsOnly?`, `retired?`). It keeps no note:
390
390
  disconnecting revokes the `audience` key, which is all a revoke names. A kept
391
391
  connection with any other field (a `token` from before notes were
392
392
  delegations in the UCAN 1.0 profile, say), or one of these in another
393
393
  shape, is dropped when read, not read in part: its app or program connects
394
394
  again.
395
- Connecting the same origin again replaces its connection; a connection with `via: 'code'` (a
395
+ Connecting the same origin again replaces its connection, revoking nothing:
396
+ the keys it replaced go in `retired`, for disconnecting to revoke. Nothing
397
+ revokes an app on its own, not even once its time has passed: a revoke keeps
398
+ only what this home has seen of the key, and a home that is seldom open has
399
+ seen little ([spec 06 §2.9](https://github.com/leifriksheim/minca/blob/main/spec/06-nodes-and-sessions.md)). A connection with `via: 'code'` (a
396
400
  program connected by code through the app) is keyed by its audience instead,
397
- so each such program is its own. A carrier is kept apart from the app at its
401
+ so each such program is its own (`connectionKey`). A carrier is kept apart from the app at its
398
402
  origin: connecting either replaces only its own kind, and one key is never
399
403
  both. `auth.connections()` lists them.
400
404
 
401
405
  **Disconnecting.** `auth.disconnect(origin, { byCode?, audience? })` removes
402
406
  the app's connections (by default the app and every program connected through
403
407
  it by code; `byCode: true` only those programs; `audience` only that key),
404
- revokes the keys of those with `access: write`, and, unless only programs
408
+ revokes the keys of those with `access: write` and every key in their
409
+ `retired`, and, unless only programs
405
410
  connected by code go, removes the automations the app proposed. A carrier at
406
411
  that origin stays: it goes by its key alone (`audience`), and takes nothing of
407
412
  the app's with it. The app hears of it when the revokes reach it,
@@ -413,10 +418,12 @@ they are still only here, and the app keeps working until this home is next
413
418
  online with another of the account's devices or apps. The account home waits
414
419
  5 s, and says so when nobody took them in.
415
420
 
416
- **Signing out.** `auth.signOut()` forgets the unlocked account on this device,
417
- lets apps whose time has passed go and revokes the home's own session key. An
421
+ **Signing out.** `auth.signOut()` forgets the unlocked account on this device
422
+ and revokes the home's own session key, with a cutoff at what it wrote, so
423
+ nothing it wrote is lost. An
418
424
  app's note doesn't need the home signed in, so the apps connected from here
419
- keep working until it runs out. `auth.signOut({ disconnect: true })`
425
+ keep working; a note running out stops only their live use, and what they
426
+ write counts until they are disconnected. `auth.signOut({ disconnect: true })`
420
427
  disconnects them first, and the programs connected through them, with the
421
428
  automations they proposed; carriers stay. The node sends nothing once it has
422
429
  stopped, so it waits, up to 5 s for them all (`signOutGraceMs` in
@@ -426,7 +433,7 @@ open space as signing out starts, so signing out with nobody else online is
426
433
  quick; `state.signingOut` is true meanwhile. A node with no network
427
434
  configured doesn't wait. With nobody reachable, they leave the next time the account signs in here. A read-only app has no key to revoke: it loses
428
435
  access when its time runs out. The account home asks each time, with
429
- disconnecting ticked, and is not ready to grant anything from the moment
436
+ disconnecting unticked, since revoking is for when something is wrong, and is not ready to grant anything from the moment
430
437
  signing out starts. Choosing another account on the connect page signs out
431
438
  without disconnecting: switching accounts disconnects nothing.
432
439
 
@@ -441,4 +448,4 @@ carrier from the same origin (never an app there), adds the carrier with `node.c
441
448
  returns the `CarryGrant`. Its connection is kept with `expiresAt: 0`, since a
442
449
  carry connection never expires.
443
450
 
444
- _Source: `packages/core/src/session/auth.ts` (`grant`, `grantCarry`, `propose`, `connections`, `disconnect`, `signOut`, `isConnection`), `packages/core/src/session/connect.ts` (`receiveConnectRequest`). Tests: `packages/core/tests/connect.test.ts` ("the home receiving a request", "connecting an app to an account home", "disconnecting …", "connecting a carrier to an account home", "signing out and disconnecting…", "signing out alone…"), `packages/core/tests/records-only.test.ts` ("a connection kept in an older shape is dropped, not read as the app’s own")._
451
+ _Source: `packages/core/src/session/auth.ts` (`grant`, `grantCarry`, `propose`, `connections`, `disconnect`, `signOut`, `isConnection`, `connectionKey`), `apps/home/src/components/Settings.tsx`, `packages/core/src/session/connect.ts` (`receiveConnectRequest`). Tests: `packages/core/tests/connect.test.ts` ("the home receiving a request", "connecting an app to an account home", "disconnecting …", "connecting a carrier to an account home", "signing out and disconnecting…", "signing out alone…"), `packages/core/tests/records-only.test.ts` ("a connection kept in an older shape is dropped, not read as the app’s own")._
package/docs/spaces.md CHANGED
@@ -144,22 +144,50 @@ _Source: `packages/core/src/node/node.ts` (`spaces.succeed`), `packages/core/src
144
144
  - Each role invite gets its own fresh secret and its own `sys.invite` record,
145
145
  so one can be closed without the others.
146
146
  - The invite names the space's relays, or the inviter's own when the space
147
- names none.
148
-
149
- `node.spaces.preview(invite)` decodes an invite without storing anything:
147
+ names none, and the always-on nodes that hold it: the account's hosts and
148
+ the space's own, at most 8, each pinned by its DID. A host that can't be
149
+ described within three seconds is left out rather than hold the invite up.
150
+ - `short: true` makes a short link (spec 03 §7.7), about 85 characters: the
151
+ invite is sealed and left in the mailbox of the account's first host and of
152
+ the first relay that takes it, and the link names those two. Where no
153
+ mailbox takes it, or the space's constitution is too large for one, the
154
+ long invite is returned instead; it works the same. `until` (ms) says when
155
+ to stop sharing it.
156
+
157
+ **Short links the account keeps.** Each short link's sealed invite is kept in
158
+ the account registry (`sys.link`), never its secret, and copied to every
159
+ carrier's carry space, so the account's host serves it while every device is
160
+ away. Every hour, and whenever the registry or a space's key changes, a
161
+ device holding the account key drops each one again where the space's members
162
+ meet. One past its `until`, or carrying a key the space has moved on from, is
163
+ ended: its role invite is closed and the record deleted. `closeInvite` by a
164
+ short link closes its invite and forgets the record. The device that made a
165
+ link holds its secret nowhere: copy the link when it is made.
166
+
167
+ `node.spaces.preview(invite)` reads an invite without storing anything, and
168
+ for a short link fetches it first, which is why it is async:
150
169
 
151
170
  ```
152
171
  { space: { id, name, visibility, founders, createdAt, succeeds? }, invitedBy,
153
- carriesKey, carriesWrite, role } // role is null for a view-only invite
172
+ carriesKey, carriesWrite, role, // role is null for a view-only invite
173
+ until? } // a short link's, when given
154
174
  ```
155
175
 
176
+ `invitedBy` is the account that signed the invitation: `preview` and `join`
177
+ both refuse an invite whose signature or note doesn't check out ([spec 03 §7.4](https://github.com/leifriksheim/minca/blob/main/spec/03-spaces.md)).
178
+ A short link is fetched once and remembered by the node, so a preview and the
179
+ join after it ask the mailboxes once. A link whose invite is nowhere fails
180
+ with "That invite was not found"; it may have expired or its places be down.
181
+ Invite nodes are dialled for the space alongside the hosts the account uses,
182
+ and kept like its invite relays.
183
+
156
184
  On `join`, relays carried by the invite are a hint: the node uses them only
157
185
  when they pass `checkRelays` and it holds no relay list for the space yet.
158
186
  While the invite's record has not reached this device, the space is held with
159
187
  `joining: true` and the node tries again as records arrive
160
188
  ([spec 06 §1.3](https://github.com/leifriksheim/minca/blob/main/spec/06-nodes-and-sessions.md)).
161
189
 
162
- _Source: `packages/core/src/node/node.ts` (`spaces.invite`, `preview`, `join`), `packages/core/src/space/space-manager.ts` (`previewInvite`, `join`). Tests: `packages/core/tests/space.test.ts` ("invites"), `packages/core/tests/roles.test.ts` ("invites")._
190
+ _Source: `packages/core/src/node/node.ts` (`spaces.invite`, `preview`, `join`, `nodesOf`, `shortInvite`, `resolveInvite`, `keepLinks`), `packages/core/src/space/space-manager.ts` (`previewInvite`, `join`), `packages/core/src/space/invite-link.ts`. Tests: `packages/core/tests/space.test.ts` ("invites"), `packages/core/tests/roles.test.ts` ("invites"), `packages/core/tests/invite-link.test.ts`, `packages/cli/tests/host.test.ts` ("someone invited reaches the space through the inviter’s host…", "a short link: the host keeps it…")._
163
191
 
164
192
  ## Keeping a space's keys and relays
165
193
 
@@ -38,6 +38,39 @@ hold rather than by name is [compatible definitions](blueprints-and-guides.md#co
38
38
 
39
39
  _Source: `packages/core/src/schemas/blueprints.ts` (`standardCollections`), `packages/core/src/schemas/standard.ts` (`standardDefinition`, `standardGroups`), `packages/core/src/node/actions.ts` (`collections_standard`, `collections_propose`). Tests: `packages/core/tests/records-only.test.ts` ("a standard collection by name is exactly the library’s; a look-alike std.\* is refused", "collections_standard lists the library by area, and gives definitions in full")._
40
40
 
41
+ ## How the library is shaped
42
+
43
+ People start with a few apps, then change them, add views, and build new
44
+ apps over the same records, often by asking an agent. That only works if
45
+ every app reaches for the same collection for the same thing. These rules
46
+ keep the library small enough to choose from, and each choice obvious:
47
+
48
+ 1. **One collection per kind of thing.** Variants are optional fields, not
49
+ collections of their own: a photo, a video and a PDF are each a
50
+ `std.file`, with `width`, `duration` or none. Two collections an agent
51
+ could reasonably pick for the same thing is a bug in the library.
52
+ 2. **A group is a relation, never a field on what is in it.** There are two
53
+ ways to group, and only two: `std.tag` for loose labels, any number on a
54
+ record, and `std.list` with a `std.list-item` per member for a named,
55
+ ordered group that exists while empty: a folder, an album, a playlist, a
56
+ category, an itinerary (`kind`). Because the group is a record of its
57
+ own, one file can be in a chat, a category and an album, and each app
58
+ arranges it without touching the file. A single facet that nearly every
59
+ app filters by, like an event's or a transaction's `category`, may stay a
60
+ field.
61
+ 3. **What an app adds to a standard record is a record of its own about
62
+ it.** A definition here is exact (`collections_propose` refuses a
63
+ look-alike), so an app that needs more on a `std.file`, say, defines
64
+ `recipes.photo-note` with an `about` link to the file and
65
+ `onePer: [link:about]`. Every other app still reads the file; only the
66
+ recipes app reads the note. Never a parallel `recipes.photo` collection.
67
+ 4. **Links use one vocabulary**, below. A link that says where a record
68
+ sits is `in`, whether that is a channel, a board column or a list.
69
+ 5. **A description says when not to use it.** Agents choose by reading
70
+ descriptions, so where a neighbour could be mistaken for it, the
71
+ description names the neighbour: "To vote on a std.proposal, use
72
+ std.ballot."
73
+
41
74
  ## Conventions
42
75
 
43
76
  - What several people edit is several records, not an array in one body,
@@ -92,20 +125,17 @@ anything, and only moderators and admins write in the collections in
92
125
 
93
126
  **Annotations**
94
127
 
95
- | Name | Body | Links | Rules |
96
- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | -------------------------------------- |
97
- | `std.reaction` | **`emoji`** string 1–16; `respondingTo` DID; topic `respondingTo` | `about` → `*`, one | `onePer: [@author, link:about, emoji]` |
98
- | `std.comment` | **`text`** string 1–10000; `mentions` DID[] (≤ 64); `replyingTo` DID; `respondingTo` DID; topics `mentions`, `replyingTo`, `respondingTo` | `about` → `*`, one; `replyTo` → `std.comment`, one | — |
99
- | `std.tag` | **`label`** string 1–100 | `about` → `*`, many | — |
100
- | `std.attachment` | **`name`** string ≥ 1; **`mime`** string ≥ 1; `size` integer ≥ 0; `url` string; `blob` blob | `about` → `*`, one | — |
101
- | `std.reference` | `note` string | `about` → `*`, one; `to` → `*`, one | — |
102
- | `std.bookmark` | `title` string ≤ 500; `url` string 1–2048; `note` string ≤ 2000 | `about` → `*`, one | — |
103
- | `std.rating` | **`score`** integer 1–5; `review` string ≤ 10000 | `about` → `*`, one | `onePer: [@author, link:about]` |
104
- | `std.highlight` | **`quote`** string 1–10000; `prefix` string ≤ 500; `suffix` string ≤ 500; `note` string ≤ 10000 | `about` → `*`, one | — |
105
- | `std.pin` | `note` string ≤ 500 | `about` → `*`, one | `onePer: [link:about]` |
106
- | `std.report` | **`reason`** `spam`/`abuse`/`sexual`/`misleading`/`illegal`/`other`; `note` string ≤ 2000 | `about` → `*`, one | `onePer: [@author, link:about]` |
107
- | `std.label` | **`value`** string 1–64 | `about` → `*`, one | `onePer: [link:about, value]` |
108
- | `std.claim` | `note` string ≤ 500; `respondingTo` DID; topic `respondingTo` | `about` → `*`, one | `onePer: [link:about]` |
128
+ | Name | Body | Links | Rules |
129
+ | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | -------------------------------------- |
130
+ | `std.reaction` | **`emoji`** string 1–16; `respondingTo` DID; topic `respondingTo` | `about` → `*`, one | `onePer: [@author, link:about, emoji]` |
131
+ | `std.comment` | **`text`** string 1–10000; `mentions` DID[] (≤ 64); `replyingTo` DID; `respondingTo` DID; topics `mentions`, `replyingTo`, `respondingTo` | `about` → `*`, one; `replyTo` → `std.comment`, one | — |
132
+ | `std.tag` | **`label`** string 1–100 | `about` → `*`, one | `onePer: [@author, link:about, label]` |
133
+ | `std.rating` | **`score`** integer 1–5; `review` string ≤ 10000 | `about` → `*`, one | `onePer: [@author, link:about]` |
134
+ | `std.highlight` | **`quote`** string 1–10000; `prefix` string ≤ 500; `suffix` string ≤ 500; `note` string ≤ 10000 | `about` → `*`, one | — |
135
+ | `std.pin` | `note` string ≤ 500 | `about` → `*`, one | `onePer: [link:about]` |
136
+ | `std.report` | **`reason`** `spam`/`abuse`/`sexual`/`misleading`/`illegal`/`other`; `note` string ≤ 2000 | `about` → `*`, one | `onePer: [@author, link:about]` |
137
+ | `std.label` | **`value`** string 1–64 | `about` → `*`, one | `onePer: [link:about, value]` |
138
+ | `std.claim` | `note` string ≤ 500; `respondingTo` DID; topic `respondingTo` | `about` → `*`, one | `onePer: [link:about]` |
109
139
 
110
140
  **People**
111
141
 
@@ -120,20 +150,20 @@ anything, and only moderators and admins write in the collections in
120
150
 
121
151
  **Messaging and publishing**
122
152
 
123
- | Name | Body | Links | Rules |
124
- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | ------------------------------- |
125
- | `std.message` | **`text`** string 1–10000; `mentions` DID[] (≤ 64); `replyingTo` DID; topics `link:channel`, `mentions`, `replyingTo` | `channel` → `std.channel`, one; `replyTo` → `std.message`, one; `shares` → `*`, one | — |
126
- | `std.channel` | **`name`** string 1–100; `topic` string ≤ 500; `position` string 1–200 | — | — |
127
- | `std.direct` | **`to`** DID[] (1–16); **`data`** string ≤ 60000; **`boxes`** `{to, sealed}`[] (≤ 17); topic `to` | — | — |
128
- | `std.post` | `text` string ≤ 10000; `images` image[] (≤ 8); `langs` string 2–35[] (≤ 3); `mentions` DID[] (≤ 64); `replyingTo` DID; topics `mentions`, `replyingTo` | `replyTo` → `std.post`, one; `root` → `std.post`, one; `shares` → `*`, one | — |
129
- | `std.repost` | `respondingTo` DID; topic `respondingTo` | `about` → `*`, one | `onePer: [@author, link:about]` |
130
- | `std.article` | **`title`** string 1–300; `summary` string ≤ 1000; `content` string ≤ 200000; `cover` blob; `slug` string 1–200; `publishedAt` when; `draft` boolean; `mentions` DID[] (≤ 64); topic `mentions` | `in` → `std.publication`, one | — |
131
- | `std.publication` | **`title`** string 1–200; `description` string ≤ 2000; `icon` blob | — | — |
132
- | `std.doc` | **`title`** string 1–500 | — | — |
133
- | `std.doc-block` | **`type`** `paragraph`/`heading1`/`heading2`/`heading3`/`bullet`/`numbered`/`todo`/`quote`/`code`/`image`/`divider`; `text` string ≤ 20000; `checked` boolean; `language` string ≤ 32; `image` image; `position` string 1–200; `mentions` DID[] (≤ 64); topic `mentions` | `in` → `std.doc`, one; `parent` → `std.doc-block`, one | — |
134
- | `std.wiki-page` | **`slug`** string 1–200; **`title`** string 1–300; `content` string ≤ 200000 | — | `onePer: [slug]`; history `all` |
135
- | `std.note` | `title` string ≤ 500; `content` string ≤ 200000; `pinned` boolean; `color` string ≤ 32; `mentions` DID[] (≤ 64); topic `mentions` | — | — |
136
- | `std.call` | **`status`** `missed`/`ended`; `to` string ≤ 256; **`startedAt`** string ≤ 64; `endedAt` string ≤ 64; `people` string ≤ 256[] (≤ 64); topics `to`, `people` | — | — |
153
+ | Name | Body | Links | Rules |
154
+ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------- |
155
+ | `std.message` | **`text`** string 1–10000; `mentions` DID[] (≤ 64); `replyingTo` DID; topics `link:in`, `mentions`, `replyingTo` | `in` → `std.channel`, one; `replyTo` → `std.message`, one; `shares` → `*`, one | — |
156
+ | `std.channel` | **`name`** string 1–100; `topic` string ≤ 500; `position` string 1–200 | — | — |
157
+ | `std.direct` | **`to`** DID[] (1–16); **`data`** string ≤ 60000; **`boxes`** `{to, sealed}`[] (≤ 17); topic `to` | — | — |
158
+ | `std.post` | `text` string ≤ 10000; `images` image[] (≤ 8); `langs` string 2–35[] (≤ 3); `mentions` DID[] (≤ 64); `replyingTo` DID; topics `mentions`, `replyingTo` | `replyTo` → `std.post`, one; `root` → `std.post`, one; `shares` → `*`, one | — |
159
+ | `std.repost` | `respondingTo` DID; topic `respondingTo` | `about` → `*`, one | `onePer: [@author, link:about]` |
160
+ | `std.article` | **`title`** string 1–300; `summary` string ≤ 1000; `content` string ≤ 200000; `cover` blob; `slug` string 1–200; `publishedAt` when; `draft` boolean; `mentions` DID[] (≤ 64); topic `mentions` | `in` → `std.publication`, one | — |
161
+ | `std.publication` | **`title`** string 1–200; `description` string ≤ 2000; `icon` blob | — | — |
162
+ | `std.doc` | **`title`** string 1–500 | — | — |
163
+ | `std.doc-block` | **`type`** `paragraph`/`heading1`/`heading2`/`heading3`/`bullet`/`numbered`/`todo`/`quote`/`code`/`image`/`divider`; `text` string ≤ 20000; `checked` boolean; `language` string ≤ 32; `image` image; `position` string 1–200; `mentions` DID[] (≤ 64); topic `mentions` | `in` → `std.doc`, one; `parent` → `std.doc-block`, one | — |
164
+ | `std.wiki-page` | **`slug`** string 1–200; **`title`** string 1–300; `content` string ≤ 200000 | — | `onePer: [slug]`; history `all` |
165
+ | `std.note` | `title` string ≤ 500; `content` string ≤ 200000; `pinned` boolean; `color` string ≤ 32; `mentions` DID[] (≤ 64); topic `mentions` | — | — |
166
+ | `std.call` | **`status`** `missed`/`ended`; `to` string ≤ 256; **`startedAt`** string ≤ 64; `endedAt` string ≤ 64; `people` string ≤ 256[] (≤ 64); topics `to`, `people` | — | — |
137
167
 
138
168
  **Lists**
139
169
 
@@ -144,32 +174,27 @@ anything, and only moderators and admins write in the collections in
144
174
 
145
175
  **Files and media**
146
176
 
147
- | Name | Body | Links | Rules |
148
- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | ----- |
149
- | `std.folder` | **`name`** string 1–255 | `parent` → `std.folder`, one | — |
150
- | `std.file` | **`name`** string 1–255; **`blob`** blob | `parent` → `std.folder`, one | — |
151
- | `std.photo` | **`blob`** blob; `alt` string ≤ 2000; `width` integer ≥ 1; `height` integer ≥ 1; `takenAt` when; `place` place | `in` → `std.album`, many | — |
152
- | `std.album` | **`title`** string 1–200; `description` string ≤ 2000 | `cover` → `std.photo`, one | — |
153
- | `std.video` | **`blob`** blob; `thumbnail` blob; `duration` number ≥ 0; `captions` blob; `alt` string ≤ 2000; `title` string ≤ 300 | `in` → `*`, many | — |
154
- | `std.track` | **`title`** string 1–300; `artists` string 1–200[] (≤ 20); `album` string ≤ 300; `duration` number ≥ 0; `isrc` string ≤ 12; `mbid` string ≤ 36; `blob` blob | `in` → `std.list`, many | — |
155
- | `std.play` | **`title`** string 1–300; `artists` string 1–200[] (≤ 20); `album` string ≤ 300; `duration` number ≥ 0; `isrc` string ≤ 12; `mbid` string ≤ 36; **`playedAt`** when | — | — |
177
+ | Name | Body | Links | Rules |
178
+ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | ----- |
179
+ | `std.file` | **`name`** string 1–255; **`mime`** string 1–255; `size` integer ≥ 0; `blob` blob; `url` string 1–2048; `alt` string ≤ 2000; `width` integer ≥ 1; `height` integer ≥ 1; `duration` number ≥ 0; `takenAt` when; `place` place; `thumbnail` blob; `captions` blob | `about` → `*`, one | — |
180
+ | `std.track` | **`title`** string 1–300; `artists` string 1–200[] (≤ 20); `album` string ≤ 300; `duration` number ≥ 0; `isrc` string ≤ 12; `mbid` string ≤ 36 | `file` → `std.file`, one | — |
181
+ | `std.play` | **`title`** string 1–300; `artists` string 1–200[] (≤ 20); `album` string ≤ 300; `duration` number ≥ 0; `isrc` string ≤ 12; `mbid` string ≤ 36; **`playedAt`** when | `about` → `std.track`, one | — |
156
182
 
157
183
  **Time and planning**
158
184
 
159
- | Name | Body | Links | Rules |
160
- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------- |
161
- | `std.calendar` | **`name`** string 1–200; `color` string ≤ 32 | — | — |
162
- | `std.event` | **`title`** string 1–500; `description` string ≤ 10000; `category` string ≤ 100; **`start`** when; `end` when; `tz` string 1–64; `allDay` boolean; `place` place; `url` string 1–2048; `rrule` string 1–1000; `status` `confirmed`/`tentative`/`cancelled`; topic `place.cells` | `in` → `std.calendar`, one | — |
163
- | `std.rsvp` | **`status`** `going`/`maybe`/`no`; `guests` integer 0–100; `note` string ≤ 500; `respondingTo` DID; topic `respondingTo` | `about` → `std.event`, one | `onePer: [@author, link:about]` |
164
- | `std.slot` | **`start`** when; **`end`** when; `tz` string 1–64; `note` string ≤ 1000 | `in` → `std.calendar`, one | — |
165
- | `std.booking` | `note` string ≤ 1000; `respondingTo` DID; topic `respondingTo` | `about` → `std.slot`, one | `onePer: [link:about]` |
166
- | `std.column` | **`name`** string 1–200; `position` string 1–200 | — | — |
167
- | `std.task` | **`title`** string 1–500; `notes` string ≤ 10000; `position` string 1–200; `due` when; `status` `todo`/`doing`/`done`/`cancelled`; `assignees` DID[] (≤ 20); `priority` integer 0–4; topic `assignees` | `column` → `std.column`, one; `parent` → `std.task`, one; `project` → `std.project`, one | — |
168
- | `std.project` | **`name`** string 1–200; `description` string ≤ 10000; `status` `planned`/`active`/`paused`/`done`/`cancelled`; `due` when | — | — |
169
- | `std.time-entry` | **`start`** when; `end` when; `note` string ≤ 1000 | `about` → `*`, one | — |
170
- | `std.reminder` | **`at`** when; `note` string ≤ 1000; `done` boolean | `about` → `*`, one | — |
171
- | `std.habit` | **`name`** string 1–200; `schedule` string ≤ 1000; `target` number ≥ 0; `unit` string ≤ 32; `position` string 1–200 | — | — |
172
- | `std.checkin` | **`date`** day; `value` number; `note` string ≤ 1000 | `about` → `std.habit`, one | `onePer: [@author, link:about, date]` |
185
+ | Name | Body | Links | Rules |
186
+ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------- |
187
+ | `std.calendar` | **`name`** string 1–200; `color` string ≤ 32 | — | — |
188
+ | `std.event` | **`title`** string 1–500; `description` string ≤ 10000; `category` string ≤ 100; **`start`** when; `end` when; `tz` string 1–64; `allDay` boolean; `place` place; `url` string 1–2048; `rrule` string 1–1000; `status` `confirmed`/`tentative`/`cancelled`; topic `place.cells` | `in` → `std.calendar`, one | — |
189
+ | `std.rsvp` | **`status`** `going`/`maybe`/`no`; `guests` integer 0–100; `note` string ≤ 500; `respondingTo` DID; topic `respondingTo` | `about` → `std.event`, one | `onePer: [@author, link:about]` |
190
+ | `std.slot` | **`start`** when; **`end`** when; `tz` string 1–64; `note` string ≤ 1000 | `in` → `std.calendar`, one | — |
191
+ | `std.column` | **`name`** string 1–200; `position` string 1–200 | `in` → `std.project`, one | — |
192
+ | `std.task` | **`title`** string 1–500; `notes` string ≤ 10000; `position` string 1–200; `due` when; `status` `todo`/`doing`/`done`/`cancelled`; `assignees` DID[] (≤ 20); `priority` integer 0–4; topic `assignees` | `in` → `std.column`, `std.project`, one; `parent` → `std.task`, one | — |
193
+ | `std.project` | **`name`** string 1–200; `description` string ≤ 10000; `status` `planned`/`active`/`paused`/`done`/`cancelled`; `due` when | — | — |
194
+ | `std.time-entry` | **`start`** when; `end` when; `note` string ≤ 1000 | `about` → `*`, one | — |
195
+ | `std.reminder` | **`at`** when; `note` string ≤ 1000; `done` boolean | `about` → `*`, one | — |
196
+ | `std.habit` | **`name`** string 1–200; `schedule` string ≤ 1000; `target` number ≥ 0; `unit` string ≤ 32; `position` string 1–200 | — | — |
197
+ | `std.checkin` | **`date`** day; `value` number; `note` string ≤ 1000 | `about` → `std.habit`, one | `onePer: [@author, link:about, date]` |
173
198
 
174
199
  **Places and travel**
175
200
 
@@ -206,19 +231,19 @@ anything, and only moderators and admins write in the collections in
206
231
 
207
232
  **Community and governance**
208
233
 
209
- | Name | Body | Links | Rules |
210
- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | -------------------------------------------------- |
211
- | `std.poll` | **`question`** string 1–500; **`options`** string 1–200[]; `closed` boolean | — | `fixed: [options]` |
212
- | `std.vote` | **`choice`** integer ≥ 0; `choices` integer ≥ 0[] (≤ 100); `respondingTo` DID; topic `respondingTo` | `about` → `std.poll`, `std.proposal`, one | `onePer: [@author, link:about]` |
213
- | `std.proposal` | **`title`** string 1–300; `body` string ≤ 20000; **`options`** string 1–200[] (1–20); `closesAt` when; `status` `open`/`passed`/`rejected`/`withdrawn`; `quorum` integer 1–10000 | — | `fixed: [options]` |
214
- | `std.ballot` | **`choice`** integer ≥ 0; `respondingTo` DID; topic `respondingTo` | `about` → `std.proposal`, one | `onePer: [@author, link:about]`; `fixed: [choice]` |
215
- | `std.decision` | **`outcome`** integer ≥ 0; **`proposal`** string 1–128 (a version id); **`ballots`** string 1–128[] (≤ 256) | `about` → `std.proposal`, one | `onePer: [link:about]`; `check` (below) |
216
- | `std.goal` | **`title`** string 1–300; `body` string ≤ 20000; **`target`** integer 1–10⁹; **`unit`** string 1–50; `closesAt` when | — | `fixed: [target, unit]` |
217
- | `std.pledge` | **`amount`** integer 1–10⁹; `note` string ≤ 1000; `respondingTo` DID; topic `respondingTo` | `about` → `std.goal`, one | `onePer: [@author, link:about]`; `fixed: [amount]` |
218
- | `std.goal-reached` | **`goal`** string 1–128 (a version id); **`pledges`** string 1–128[] (≤ 256) | `about` → `std.goal`, one | `onePer: [link:about]`; `check` (below) |
219
- | `std.announcement` | **`title`** string 1–300; `text` string ≤ 20000 | — | — |
220
- | `std.badge` | **`name`** string 1–100; `description` string ≤ 1000; `image` blob | — | — |
221
- | `std.award` | **`did`** DID; `note` string ≤ 1000; topic `did` | `about` → `std.badge`, one | `onePer: [link:about, did]` |
234
+ | Name | Body | Links | Rules |
235
+ | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -------------------------------------------------- |
236
+ | `std.poll` | **`question`** string 1–500; **`options`** string 1–200[]; `closed` boolean | — | `fixed: [options]` |
237
+ | `std.vote` | **`choice`** integer ≥ 0; `choices` integer ≥ 0[] (≤ 100); `respondingTo` DID; topic `respondingTo` | `about` → `std.poll`, one | `onePer: [@author, link:about]` |
238
+ | `std.proposal` | **`title`** string 1–300; `body` string ≤ 20000; **`options`** string 1–200[] (1–20); `closesAt` when; `status` `open`/`passed`/`rejected`/`withdrawn`; `quorum` integer 1–10000 | — | `fixed: [options]` |
239
+ | `std.ballot` | **`choice`** integer ≥ 0; `respondingTo` DID; topic `respondingTo` | `about` → `std.proposal`, one | `onePer: [@author, link:about]`; `fixed: [choice]` |
240
+ | `std.decision` | **`outcome`** integer ≥ 0; **`proposal`** string 1–128 (a version id); **`ballots`** string 1–128[] (≤ 256) | `about` → `std.proposal`, one | `onePer: [link:about]`; `check` (below) |
241
+ | `std.goal` | **`title`** string 1–300; `body` string ≤ 20000; **`target`** integer 1–10⁹; **`unit`** string 1–50; `closesAt` when | — | `fixed: [target, unit]` |
242
+ | `std.pledge` | **`amount`** integer 1–10⁹; `note` string ≤ 1000; `respondingTo` DID; topic `respondingTo` | `about` → `std.goal`, one | `onePer: [@author, link:about]`; `fixed: [amount]` |
243
+ | `std.goal-reached` | **`goal`** string 1–128 (a version id); **`pledges`** string 1–128[] (≤ 256) | `about` → `std.goal`, one | `onePer: [link:about]`; `check` (below) |
244
+ | `std.announcement` | **`title`** string 1–300; `text` string ≤ 20000 | — | — |
245
+ | `std.badge` | **`name`** string 1–100; `description` string ≤ 1000; `image` blob | — | — |
246
+ | `std.award` | **`did`** DID; `note` string ≤ 1000; topic `did` | `about` → `std.badge`, one | `onePer: [link:about, did]` |
222
247
 
223
248
  **Proven outcomes.** A `std.decision` and a `std.goal-reached` are not
224
249
  declared by anyone: each cites the records that prove it, by version id, and
@@ -356,8 +381,8 @@ _Source: `packages/core/src/schemas/library/publishing.ts` (`message`, `post`),
356
381
 
357
382
  **Responses.** A record written in answer to someone's record names them in
358
383
  `respondingTo`: a `std.reaction`, `std.comment` or `std.repost` the author of
359
- what it is about, a `std.rsvp` the event's, a `std.booking` the slot's, a
360
- `std.vote` or `std.ballot` the poll's or proposal's, a `std.pledge` the
384
+ what it is about, a `std.rsvp` the event's, a
385
+ `std.vote` the poll's, a `std.ballot` the proposal's, a `std.pledge` the
361
386
  goal's, a `std.claim` the claimed record's, a `std.order` the listing's, and a
362
387
  `std.order-update` the order's. It is their topic, so "someone reacted to,
363
388
  commented on, or answered what I wrote" is `where: { "respondingTo":
@@ -387,10 +412,10 @@ most 63 so that with `paidBy` every one is tagged: a record carries at most
387
412
  _Source: `packages/core/src/schemas/library/annotations.ts`, `packages/core/src/schemas/library/publishing.ts`, `packages/core/src/schemas/library/planning.ts`, `packages/core/src/schemas/library/community.ts`, `packages/core/src/schemas/library/money.ts`, `packages/core/src/schemas/library/social.ts`, `packages/core/src/schemas/library/media.ts`; `apps/example/src/derive/people.ts` (`respondingTo`), `apps/example/src/components/std/Reactions.tsx`, `apps/example/src/components/std/Comments.tsx`, `apps/example/src/components/apps/Polls.tsx`, `apps/example/src/components/apps/Decisions.tsx`, `apps/example/src/components/apps/Events.tsx`, `apps/example/src/components/apps/Marketplace.tsx`. Tests: `packages/core/tests/topics.test.ts` ("every standard collection that names people has them as topics…", "a report names nobody…", "a std.reaction is tagged for the person in its respondingTo…" and the rest of that list)._
388
413
 
389
414
  **Channels.** A space with more than one conversation lists `std.channel`
390
- records, by `position` then name, and a message links its channel as
391
- `channel`: `where: { 'link:channel': key }` finds a channel's messages, and
392
- `include: { messages: { rel: 'channel', from: 'std.message', count: true } }`
393
- counts them. A message with no `channel` link is in the space's own room,
415
+ records, by `position` then name, and a message is `in` its channel:
416
+ `where: { 'link:in': key }` finds a channel's messages, and
417
+ `include: { messages: { rel: 'in', from: 'std.message', count: true } }`
418
+ counts them. A message in no channel is in the space's own room,
394
419
  which a chat shows first, as "general". In the `community` template only
395
420
  moderators and admins make or rename a channel. A channel is a label, not a boundary: every member reads
396
421
  every channel. Something only some members may read is a space of its own, or
@@ -405,18 +430,19 @@ keeper can match unread.
405
430
 
406
431
  _Source: `packages/core/src/schemas/library/publishing.ts` (`channel`, `direct`), `packages/core/src/privacy/direct.ts`, `apps/example/src/components/apps/Chat.tsx`. Tests: `packages/core/tests/direct.test.ts`._
407
432
 
408
- **Changes to earlier definitions.** `std.attachment`, `std.task`,
409
- `std.message`, `std.vote` and `std.proposal` existed before the library grew. Each gained
410
- only optional fields and link roles: `std.attachment` a `blob`; `std.task`
411
- `due`, `status`, `assignees`, `priority` and the `parent` and `project` links;
412
- `std.message` a `channel`, the `root` link, `mentions`, `replyingTo`, and its
413
- first topics ([spec 02 §8](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)); `std.vote` `choices` (every
414
- choice, most preferred first, with `choice` the first of them); `std.proposal`
415
- `quorum`, for `std.decision`. A space that
416
- holds an earlier definition keeps it until someone applies a blueprint that
417
- carries the new one, which its review shows as a change. One of them is not additive in the sense of
418
- [spec 02 §6.5](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md): `std.vote`'s `about` may now also point at a `std.proposal`, so an app
419
- that reads votes may meet one on something that is not a poll.
433
+ **Changes to earlier definitions.** Before v1 the library is reshaped
434
+ without migrations, to keep to the rules above. The last such change merged
435
+ `std.attachment`, `std.photo`, `std.video`, `std.folder` and `std.album` into
436
+ one `std.file` (groups of files are `std.list`s); removed `std.booking` (a
437
+ booking is a `std.claim` about a `std.slot`), `std.reference` (any link
438
+ refers) and `std.bookmark` (a saved thing is a `std.list-item`); renamed
439
+ `std.message`'s `channel` link and `std.task`'s `column` link to `in`, and
440
+ dropped the task's `project` link (a task is `in` a project when it has no
441
+ column, and a column is `in` its project); made `std.tag` one record per
442
+ person, record and label; gave `std.track` a `file` link and `std.play` an
443
+ `about` link to its track; and narrowed `std.vote` to polls, since a proposal
444
+ is decided by `std.ballot`s. A space that holds an earlier definition keeps
445
+ it until someone applies a blueprint that carries the new one.
420
446
 
421
447
  Since then ([#105](https://github.com/leifriksheim/minca/issues/105)), `std.comment` and `std.post` gained the same optional
422
448
  `mentions` and `replyingTo` as a message, and `std.note`, `std.doc-block` and
@@ -433,10 +459,9 @@ so "mentions me" and "assigned to me" match from then on.
433
459
  | Name | Body | Rules | Where |
434
460
  | --------------------- | --------------------------------------------------------------------------------------- | ----------------- | ----------------------- |
435
461
  | `std.contact` | `did` ≤ 256 and `name` ≤ 200, required; `space` ≤ 256; `note` ≤ 2000; `blocked` boolean | `onePer: [did]` | [contacts](contacts.md) |
436
- | `std.contact-request` | `to` ≤ 256 and `sealed` ≤ 16000, required | — | [contacts](contacts.md) |
437
- | `std.door` | `id` 16–64 and `relays` (1–3, each ≤ 200), required; `name` ≤ 64; `label` ≤ 64 | `onePer: [id]` | [doors.md](doors.md) |
438
- | `std.knock` | `space` ≤ 256, `name` ≤ 64, `door` ≤ 64, `sign` ≤ 64 and `invite` ≤ 8000, all required | `onePer: [space]` | [doors.md](doors.md) |
439
- | `std.knock-answer` | `sig` ≤ 200, required | — | [doors.md](doors.md) |
462
+ | `std.contact-request` | `to` ≤ 64 and `sealed` ≤ 16000, required | — | [contacts](contacts.md) |
463
+ | `std.inbox` | `gen` ≥ 0 and `places` (1–3, each ≤ 200), required; `name` ≤ 64 | — | [inbox.md](inbox.md) |
464
+ | `std.knock` | `space` ≤ 256, `name` ≤ 64 and `invite` ≤ 12000, all required | `onePer: [space]` | [inbox.md](inbox.md) |
440
465
 
441
466
  **Positions.** `position` is a string that sorts (by plain string comparison)
442
467
  where a record goes in a hand-made order. Digits are `0–9a–z`; a position
package/docs/storage.md CHANGED
@@ -55,7 +55,7 @@ When another writer changed the same store, the node re-reads all of it
55
55
  (`invalidate`). Other tabs of one browser are told through a
56
56
  `BroadcastChannel` named `minca-node:<root DID>:<space id>`. Where a browser
57
57
  has shared workers that work, the apps in this repository run one node for all
58
- of a site's tabs in a `SharedWorker`, so those tabs share one store and have
58
+ of a site's tabs in a `SharedWorker` (one per account and key), so those tabs share one store and have
59
59
  nothing to tell each other; the channel remains for the rest (Chrome on
60
60
  Android has none; WebKit drops a message to one that holds a `CryptoKey`),
61
61
  where each tab's node runs in a worker of its own
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minca/core",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "type": "module",
5
5
  "description": "Self-sovereign P2P protocol for the browser — identity, schemas, storage, networking, and gossip sync",
6
6
  "repository": {
@@ -61,10 +61,10 @@
61
61
  "types": "./dist/calls/index.d.ts",
62
62
  "import": "./dist/calls/index.js"
63
63
  },
64
- "./doors": {
65
- "@minca/source": "./src/doors/index.ts",
66
- "types": "./dist/doors/index.d.ts",
67
- "import": "./dist/doors/index.js"
64
+ "./inbox": {
65
+ "@minca/source": "./src/inbox/index.ts",
66
+ "types": "./dist/inbox/index.d.ts",
67
+ "import": "./dist/inbox/index.js"
68
68
  }
69
69
  },
70
70
  "scripts": {