@banou/social 0.0.7 → 0.0.9

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.
package/README.md CHANGED
@@ -1,383 +1,87 @@
1
- # @banou/social
2
-
3
- Identity and friends across FKN apps.
4
-
5
- One signing key per person, one name they claim, an announcement any participant can verify, a
6
- friend list that travels with the FKN account, and a page apps post to once the person allows them.
7
- Apps import the library; every key and the whole roster stay inside the social package's own origin.
8
-
9
- ## How it ships
10
-
11
- One Cloudflare Pages deploy at social.fkn.app is both the site and the FKN package
12
- `https:social.fkn.app`: FKN reads `package.json` there and imports its `main` into the package's
13
- frame. The build makes two bundles that share nothing: `index.html` loads the site's own, which
14
- installs its own package and shows the package's frame over the page, and `index.js` is the package,
15
- the manager included, which the site never loads itself. The package draws its
16
- manager, and runs its load, only once a host shows its frame, so a name's page that asks it for your
17
- key loads nothing else. The published npm package `@banou/social` carries both entry points (`main` at
18
- `build/index.js` for FKN's package loader, and `exports` `.` and `./names` at `dist/` for host apps).
19
-
20
- ## Names
21
-
22
- A name is plain and first come: lowercase letters and digits with single underscores between them,
23
- 3 to 20 characters. Each name is a room the account claims in social's own scope, holding one
24
- signed record of which key holds it, so anyone can check a name against its key. The room's schema,
25
- at version 2, takes one type of message, `page`, which only the account holding the name sends, and
26
- only through FKN Social. A room at version 1 (whose one type was `record`), or claimed before milestone
27
- 6 with none, takes version 2 at its holder's next load, and its record stays as it was until the
28
- record next changes. Version 2 is what keeps a tab still on an older bundle from writing a record
29
- without the layout: the room refuses its `record`.
30
-
31
- The record is the only copy of what it carries beyond the list: up to 50 activity entries in the clear,
32
- and up to 50 more inside its Friends part (below). Every write of it (a claim, a claim again, a sync, a
33
- rename) keeps the entries it finds, edits the room's one `page` row in place, so the seq stays and a
34
- visitor never reads two messages, and reads the room back; when another device wrote in between, it
35
- applies its change to what it read and writes once more. A `record` row, or an untyped room, still goes
36
- by a send then an erase. A rename carries the entries to the new name's record, and keeps the old name
37
- when it cannot read the old record or write the new one. Apps post them once
38
- the person allows each one ([below](#posting-from-an-app)). Each entry names its kind (Started, Watched,
39
- Finished or Rated), a title of up to 150 code points, a detail of up to 40, an https link and picture of
40
- up to 300 characters each, the app's own id for the thing (up to 64 printable ASCII characters), the app
41
- and the time, with app text written as NFC. The record's body stays at most 131,072 bytes, what every
42
- reader takes, and its whole text at most 196,568, what the room's `page` type takes once sealed: past
43
- either, the oldest Friends entry goes first, then the Friends part itself, then the oldest Public
44
- entry.
45
-
46
- ## What a verified badge means
47
-
48
- This key produced a signature over this room id and this member id, as the host app reported them.
49
- It does not mean the person is who they say they are, and the copy must not say that it does.
50
-
51
- ## Default names
52
-
53
- Someone with no FKN Social name shows as a default name worked out from their room member id, two
54
- capitalised words, an adjective then an animal:
1
+ # FKN Social
2
+
3
+ Identity, customizable profile pages, friends, and encrypted chat across FKN apps. One claimed handle
4
+ and Ed25519 signing key works everywhere on FKN, while your friend list, panels, permissions, and
5
+ conversations stay end-to-end encrypted in your FKN account with no Social server and no analytics.
6
+
7
+ - Live at [social.fkn.app](https://social.fkn.app), and inside FKN at
8
+ [fkn.app/app/npm:@banou/social](https://fkn.app/app/npm:@banou/social)
9
+ - Published on npm as [`@banou/social`](https://www.npmjs.com/package/@banou/social)
10
+
11
+ ## Features
12
+
13
+ - **Claimed handles and room verification.** Pick a lowercase handle (`3` to `20` characters, letters,
14
+ digits, and underscores) backed by your own Ed25519 key and room proof so participants in any FKN
15
+ room can verify who you are. People without a handle get a deterministic two-word name from
16
+ `@banou/social/names`.
17
+ - **Customizable profile pages.** Every handle serves a standalone page at
18
+ `social.fkn.app/<handle>` with a display name, bio, links, avatar, backdrop image, six color
19
+ themes (`Steel`, `Midnight`, `Forest`, `Crimson`, `Slate`, `Daylight`), eight accent colors,
20
+ reorderable sections, and per-section visibility (`Public`, `Friends`, or `Off`).
21
+ - **Custom Markdown and artwork panels.** Add up to six custom panels to your profile: formatted
22
+ Markdown notes or image galleries (up to four pictures per panel), each scoped to `Public`,
23
+ `Friends`, or `Off`.
24
+ - **Friends without a central directory.** Add friends with 15-minute live invite links and QR
25
+ codes or send encrypted friend requests by handle. Local nicknames and your full roster sync across
26
+ devices through FKN encrypted storage.
27
+ - **Encrypted 1:1 and group messages.** Chat directly with friends or create private group threads in
28
+ a single claimed `<messages>` room with epoch-rotated group keys and local unread indicators.
29
+ - **Cross-app activity and Favourites.** Connected FKN apps such as [Stub](https://stub.fkn.app) can
30
+ ask to post what you started, watched, finished, or rated, and control per-app `Room identity`
31
+ sharing right from the **Apps** tab. Pin up to eight items as profile Favourites.
32
+ - **Moderated comments.** Friends can leave comments that wait in your Inbox for approval before
33
+ appearing on your profile page.
34
+ - **Portable recovery key.** Back up and restore your FKN Social key (`FKNS...`) across accounts or
35
+ reset your local Social data cleanly if an account key resets.
36
+
37
+ ## Using the library
38
+
39
+ Apps on FKN import `@banou/social` to verify room presence and request activity publishing, or
40
+ `@banou/social/names` for deterministic fallback display names with zero extra runtime dependencies:
55
41
 
56
42
  ```ts
43
+ import { social } from '@banou/social'
57
44
  import { defaultName } from '@banou/social/names'
58
45
 
59
- defaultName(member.id) // 'Warm Colugo' for '7yXc9-Sh4rWO01VE45KfTw'
60
- ```
61
-
62
- The same id gives the same name in every app, and nothing is stored or sent. A member id is new in each
63
- room, so the default name is too. That entry imports nothing. The word lists and the hash are
64
- fixed: changing either renames everyone, which its tests catch.
65
-
66
- ## Friends
67
-
68
- A friend is added by a link: Invite a friend makes a room of two seats and a link to it, which works
69
- while the tab that made it stays open (at most 15 minutes). Whoever opens it asks the room's owner who
70
- they are, and shows their own name only once the owner proves it. The inviter adds them, they
71
- accept, and each list then holds the other with the profile they shared, sealed in each person's own
72
- FKN storage. A hello in that room carries the name alone; the profile goes in the offer and the
73
- accept.
74
-
75
- ## Reset Social
76
-
77
- An FKN key reset keeps the account and changes its key. The recovery key brings the identity back, but
78
- the friend list stays sealed under the old key, and every write to the list reads it first, so nothing
79
- can be added, saved or published. Beside the line that says the list will not open, Reset Social asks
80
- once ("Your friend list, profile, page layout, favourites and app permissions will be deleted for
81
- good."), then deletes the pictures Social published, which nothing names any more, and every file in
82
- Social's FKN storage but the identity: the list and each device's own cell. Deleting needs no key. The
83
- next load starts the list from nothing and makes a new inbox. A delete that fails leaves the list
84
- sealed, so the reset is offered again and finishes; a picture that does not go costs only its bytes.
85
- Reset reads the list first and deletes nothing once it opens, so a tab left on the line after another
86
- device reset it deletes nothing. Nothing is cleared unless the person asks, and a key reset clears
87
- nothing.
88
-
89
- No room needs clearing by then. A key reset also gives the account a new member id in every room, and a
90
- name's record signs the claim's owner member id, so the old record stops proving anything, and the name
91
- picked again after the recovery key writes a record of its own: the name alone, at version 0. The name
92
- stays the account's, since a claim belongs to the account and not to the key.
93
-
94
- What the reset cannot reach, since only the sealed list and the old record named them: the old inbox,
95
- which stays claimed with whatever waits there until it is unclaimed under Rooms in the FKN settings, and
96
- the old name, with its page, when another name is picked instead.
97
-
98
- Friends who list the person keep them, in lists only their own keys open, with the profile they last
99
- received, and read the page as anyone does. A party invite they send still goes to the old inbox. A
100
- request or an invite either way makes them friends again, and points their list at the new inbox.
101
-
102
- ## Who sees your profile
103
-
104
- Only me (friends you add get your name only), Friends (the default: they get the profile when you add
105
- each other, and read it on your page), or Public. Your page is your name: `social.fkn.app/<name>`,
106
- which the site draws at top level for anyone, signed in or not, and keeps nothing. It joins the name
107
- room as a guest, so the room is shown no account, even a signed-in visitor's. It reads the name room's
108
- one record, which always says which key holds the name, and carries the profile (display name, bio,
109
- links and the pictures) in the clear only while it is Public. So Publish claims no room of its own: it
110
- writes the profile into that record, and Unpublish writes it out again and deletes the pictures, while
111
- the name stays claimed. A held name whose profile is not Public (Only me, Friends, a record from before
112
- milestone 4b, or one whose milestone 4 page still stands) shows the name and its identicon with Private
113
- profile, except to a friend its Friends part opens for (below), and every page whose record names an
114
- inbox shows Request friend, whatever the level, except to its holder and to such a friend. The record
115
- signs the claim's owner member id, so once a name is released and claimed by anyone else, a record its
116
- old holder signed, sent again, shows nothing. The owner keeps sending closed to everyone else, at each
117
- claim and each sync, since a join that passes no defaults leaves it open. A name room's key is derived
118
- from the name, so anyone who knows or guesses a name can open its page, FKN included; the manager says
119
- so before Publish.
120
-
121
- At Friends, the record carries the profile in its Friends part: sealed under a key only the holder
122
- derives, from their agreement seed, the room, the active friends and the entries that are not active
123
- (removed, or a request still waiting), and that key sealed again to each active friend in a slot of its
124
- own, from the two agreement keys and the room. Slots are padded to a power of two, at least 8, from a
125
- secret only the holder derives, so their count shows only a range, even to a friend, and every value is
126
- derived from what the record holds, so an unchanged list writes the same bytes and any change gives
127
- every slot a new id. Adding or removing a friend changes the key and writes the record at once; an
128
- invite or an accepted request that adds one writes it too. Signed in, a friend's page, or your own,
129
- asks the package to open the part once the page has drawn, holding back Private profile and Request
130
- friend until it answers, and shows the display name, About and the sections in the order friends
131
- see them, with a Friends label on your own page; anyone else sees the page as before. Pictures stay
132
- Public only. A friend's slot is found from their own list, so they see the part only while signed in
133
- with FKN Social's key open.
46
+ defaultName(member.id) // e.g. 'Warm Colugo'
134
47
 
135
- Page layout, in the manager, sets the page's colour, one of eight (Blue, Purple, Pink, Red, Orange,
136
- Green, Teal, Grey, each with a light and a dark value, each at least 4.5 to 1 against the page), and
137
- the order of its sections, About (the bio and the links), Activity, Favourites and Comments, with Move
138
- up and Move down. About shows at the level above; Activity, Favourites and Comments are each Public,
139
- Friends or Off, Off until set, whatever the level above. At Off the next record write drops every entry, since an entry is
140
- shown or deleted, never hidden, so Save layout asks "Delete all activity?" first; at Friends the Public
141
- entries move into the Friends part, and stay there back at Public. Save layout writes the layout into
142
- the list and the record's `page` (the accent, and the sections anyone sees, in order), at every level,
143
- Only me included; the record leaves `page` out until
144
- the first save, so every record written before is the same bytes. A reader takes a body of up to 128
145
- KiB, and reads a `page` it cannot make sense of as Blue with About. From 840 px wide the card sits in a
146
- side column and the sections beside it, in the person's order; one column on a phone, and wherever no
147
- section draws. Your own page reads as anyone's, with Edit where a visitor sees Request friend: `/e`,
148
- where the site asks the package to open Page layout, which takes the focus.
149
-
150
- Activity lists the entries apps posted (below) that the reader may see, newest first: a visitor the
151
- Public ones, a friend and the holder those and the Friends part's. Each line is the thing's picture, the
152
- verb and its title linked to the app's page, in a new tab, its details, the app and the time; one app's
153
- entries about one thing of one kind within a day are one line ("Watched Frieren", "Episode 3, Episode 4,
154
- Episode 5"). On your own page each line has Delete, after "Delete this entry?", and Favourite while
155
- Favourites is not Off; at Public, only a line whose entries are all in the clear has it. Favourites
156
- shows up to 8 things you marked, each its picture and its title linked, in the order marked, with Remove
157
- on your own page; it is a copy kept in your list, so it stays when its entry goes, and the record
158
- carries it in the clear at Public and in the Friends part at Friends. An entry's picture is drawn with
159
- no referrer and loads after the page draws.
160
-
161
- Pictures are resized in the browser before they are published, to at most 512 pixels on the longest
162
- side for an avatar and 1,920 for a background, and saved again as WebP (JPEG where the browser cannot
163
- write WebP) under 256 KB and 2 MB; the manager shows what will be published first. Saving again drops
164
- the camera's metadata, such as where a photo was taken.
165
-
166
- A page published under milestone 4, in a room of its own at `/u#<tag>.<key>.<room>`, is taken down at
167
- its owner's next visit, and its owner publishes again at the name. `/u` links say that pages moved.
168
-
169
- Known limits:
170
-
171
- - A name room seats 100 at once, so a page with that many readers at the same moment reads busy, for
172
- visitors and for the owner's own writes alike. A visitor leaving frees its seat at once; one whose
173
- connection drops holds it 20 s.
174
- - A visitor opening a name nobody holds brings its room into being for a moment (20 s if its
175
- connection drops), and a claim of that name meanwhile reads taken.
176
- - A tab open across milestone 6's deploy runs the old bundle. Once its holder's name room has its
177
- schema, the tab's record writes are refused: its card says the record is missing until a reload, and
178
- the page keeps the record it had. A level moved there from Public to Only me or Friends is saved and
179
- the pictures are deleted, but the page keeps showing the profile's text until the holder's next load
180
- on the new bundle.
181
- - A tab open across the page layout's deploy runs the older bundle. Once its holder's name room is at
182
- version 2, each record write it tries is refused, so its card says the record is missing, with Write
183
- it again, until a reload, even with nothing changed there. The page keeps the record it had, layout
184
- included, and a profile edit made there reaches the page at the next load on the new bundle. A level
185
- moved there from Public to Only me or Friends is saved and the pictures are deleted, but the page
186
- keeps showing the profile's text until the holder's next load on the new bundle. For the same reason
187
- this deploy is fixed forward: a build older than it, served again, is such a tab for every holder
188
- whose room is at version 2.
189
- - A holder who has not loaded FKN Social since that deploy keeps a version 1 name room, and their page
190
- is as it was. A record unchanged since then stays a `record` row in a version 2 room until it next
191
- changes.
192
- - A visitor who loaded a page keeps what they saw; a saved layout shows at their next load.
193
- - The friend list moved to version 2 with this deploy, for the grants apps will hold. A tab on a bundle
194
- from before it can still write the record without the Friends part, after an edit it makes before the
195
- list reaches version 2; the next load on this bundle writes the part again. Once the list is at
196
- version 2, at the first edit on this bundle, such a tab refuses every edit until a reload.
197
- - A device editing at the moment another device removes a friend can write that friend a slot once
198
- more; it goes at the next load of either device.
199
- - Two devices writing within the same moment can lose one change; a change made from the list is
200
- written again at the next load.
201
- - Past 1,024 friends the Friends part never fits and is left out, and from 513 it is left out when
202
- long Public entries fill the record.
203
- - A visitor on a bundle from before the page layout, whose reader takes 16 KiB, sees nothing once a
204
- record grows past that.
205
- - Two devices writing the page in the same second can each erase the other's record, and the page then
206
- shows nothing until the next load or Write it again.
207
- - Until its holder's first load since milestone 6, a name room has no schema, and another app of the
208
- same account can still send there: a second message, which the page shows as nothing until the
209
- owner's next load, or an older record of the same claim into a name room that was emptied (Clear,
210
- or Messages kept off and on, in fkn.app's Rooms tab), which the page shows until then.
211
- - A record written before milestone 4b (version 1) binds no owner, so after a release it still
212
- confirms the old key under anyone's claim, though never a profile. Milestone 3 stops reading it.
213
-
214
- ## Posting from an app
215
-
216
- An app posts to the person's page through four calls, each of which answers and never throws:
217
-
218
- ```ts
219
- await social.publishing() // { state: 'allowed', kinds } | { state: 'asked' } | { state: 'off' } | { state: refusal }
220
- await social.allowPublishing({ kinds: ['started', 'watched', 'completed'] }) // asked, or allowed when it already is
221
- await social.publish({ kind: 'watched', title, detail: 'Episode 5', link, image, subject }) // { ok: true, id } | { ok: false, reason }
222
- await social.stopPublishing() // off
48
+ await social.allowPublishing({ kinds: ['started', 'watched', 'completed'] })
49
+ await social.publish({ kind: 'watched', title, detail: 'Episode 14', link, image, subject })
223
50
  ```
224
51
 
225
- Only `allowPublishing`, called from the person's own press, installs the package, which shows fkn.app's
226
- notice then; with nothing installed the others answer `off` and `not-allowed`. The app is the `from`
227
- of the connection fkn.app's broker made, never what it claims, and a connection the broker did not
228
- make is told `not-here`. The ask is recorded and draws nothing in the app: the person answers it on
229
- social.fkn.app, at the top of the manager ("anime.fkn.app asks to post when you start, watch or finish
230
- something.", Allow and Not now). The site never runs inside another page's frame, and the manager
231
- draws the asks and Apps only where the site itself shows it, so no other app draws over Allow. Allow
232
- while Activity is Off turns Activity on at the app's level. Allow grants the kinds its card showed, even
233
- when the app has asked for more since.
234
-
235
- Apps, at the end of the manager, lists each app that was answered: what it posts (Started, Watched,
236
- Finished, Rated), who sees its posts (Public or Friends, Friends until set), Stop or Allow, and Delete
237
- everything it posted, after "Delete everything anime.fkn.app posted?". Not now and Stop are one state,
238
- so an app may ask again. A post lands only while its app is Allowed, its kind allowed and Activity not
239
- Off, at the stricter of the app's level and Activity's; moving an app to Friends moves its Public
240
- entries into the Friends part. The package checks a post as an entry (above), its link on the app's
241
- own origin when the app is an https origin. `publish` answers `not-allowed`, `invalid`, `too-many` (10
242
- entries from the app in the record within the hour), `no-name`, `locked` (nothing read, no card
243
- raised), `unavailable`, `outdated` or `unsupported`. A refused post is dropped.
244
-
245
- An app imports `social` from the package, whose posting calls go through `packageTransport` over
246
- `@fkn/lib/packages`.
52
+ All signing keys, friend records, and approval prompts remain inside Social's own isolated origin;
53
+ calling apps never see private keys and cannot approve their own permissions.
247
54
 
248
- Known limits:
55
+ ## How it is built
249
56
 
250
- - A tab open across this deploy runs the older bundle: its record writes keep the entries but drop
251
- Favourites, and its Page layout save turns Favourites Off, until a load on the new bundle writes them
252
- again. An app's frame opened before the deploy answers `unsupported` until that page reloads.
253
- - An ask shows at the manager's next load, not while it is open. Apps lists every app that was ever
254
- answered; there is no Remove.
255
- - The hour's limit counts what the record still holds, so deleting entries lets an app post again
256
- sooner, and two devices writing in the same moment can lose a post.
257
- - An entry's picture is fetched by the visitor's browser from the host the app named.
57
+ - **Dual bundle:** `npm run build` produces two standalone outputs under `build/`: the standalone
58
+ visitor and profile site (`index.html` + client bundle) and the FKN sandbox package entry
59
+ (`build/index.js`), while `vp pack` builds `@banou/social` and `@banou/social/names` into `dist/`.
60
+ - **UI:** Preact, injected architectural CSS (`src/app/styles.ts`), QR generation via `uqr`, and
61
+ strict zero-HTML Markdown rendering (`src/site/markdown.tsx`).
62
+ - **Cryptography and transport:** Ed25519 signatures, X25519 agreement, HKDF-SHA256, and
63
+ XChaCha20-Poly1305 (`@noble/curves`, `@noble/ciphers`, `@noble/hashes`) running strictly in the
64
+ browser over `@fkn/lib` storage, rooms, and packages.
258
65
 
259
- ## Requests that wait
66
+ ## Development
260
67
 
261
- Each account has an inbox: a room of its own at a random name, claimed with the description "Your
262
- inbox on FKN Social" and made by itself at the first load once a name is picked. Any signed-in FKN
263
- account holding its address may send there, a visitor without one nothing, and nobody but its owner
264
- receives, so senders never read each other: the rooms Worker fans a message out only to members that
265
- may receive and refuses them a backlog. Its schema takes one type of message, `request`, for friend
266
- requests, acceptances, party invites and comments alike, so the kind stays sealed. Each message is at most 64
267
- KiB, one account has at most 16 messages and 128 KiB waiting in one inbox among those it sent in the
268
- last 30 days, and the inbox keeps at most 4 MB, or the Rooms tab's cap when that is lower, counted
269
- against the owner's storage. A sender past either reads
270
- that the inbox is full. An inbox made before milestone 6 takes the schema at its owner's next load.
68
+ Use Node 24+ and npm.
271
69
 
272
- The address goes to friends in an invite's offer and accept, and sits in the name record at every
273
- level, so every held name's page shows Request friend, Private profile or not. Request friend goes to
274
- `/a#<name>`, where the site hands the name to the package, which reads that name's room itself and
275
- draws the Send card. Signed out, `/a` says who it adds and offers Sign in, which goes through fkn.app's
276
- connect card and its window without leaving the page, then on to the Send card. A name typed under the
277
- Friends list, with Request friend, opens the same card, with no link and no page, and the card takes
278
- the focus, so it comes into view from wherever the field was. Your own page shows no Request friend:
279
- signed in, the site asks your package for your key, and leaves the button off when the record names
280
- it, and the Send card for your own name says it is you; a name already in your list says so, and
281
- still offers Send. A request is sealed to the owner's agreement key and signed for the inbox's room
282
- id, so only the owner opens it, in no other inbox. The sender keeps it as a hidden entry holding its
283
- nonce, which the acceptance must carry back: an acceptance adds a friend only over that entry, or
284
- refreshes an active one, so a removal stands against every acceptance. The friend keeps the name the
285
- entry holds (the one their name record proved, or the one agreed at an invite), never the one an
286
- acceptance carries.
287
-
288
- The owner's manager collects at each load: it joins, reads at most 100 messages, deletes what does
289
- not open, what came from a stranger as a party invite or a comment, and the acceptances it took, then leaves. A
290
- friend request or a party invite waits in the inbox until it is answered. A party invite carries the
291
- party's link, pasted in a friend's view until milestone 3; Open hands it to the site, which opens it
292
- at top level, and the card stays until Dismiss, since a window the browser blocked looks the same.
293
-
294
- An inbox claimed under another account (an Unclaim, then someone holding the address claimed it
295
- before the next load) is not forgotten on its own, since a join that went out without the account
296
- reads its own claim the same way. The manager says someone else holds it, hands that address to
297
- nobody new and names it in no record it writes, so the page shows no Request friend, and Make an
298
- inbox stops pointing at it, then makes a new one, which the record names again. When the taken was
299
- such a join, the next load that reads the inbox ready names it in the record again.
300
-
301
- Known limits:
302
-
303
- - About 30 accounts at their 128 KiB fill an inbox's 4 MB, and every sender then reads it as full
304
- until the owner's next load deletes what does not open, 100 messages at a time. Valid requests from
305
- throwaway accounts wait as cards until declined, and while 100 of them wait, a load reads nothing
306
- newer, acceptances and party invites included, until some are declined.
307
- - An inbox whose owner has not loaded FKN Social since milestone 6 has no schema: anyone, a visitor
308
- without an account included, can still fill it to the Rooms tab's cap.
309
- - A message the broker cannot open, which only a client written against the rooms Worker directly can
310
- store, is deleted at a load only when it ends a page of the backlog. Such messages can stay and count
311
- against the 4 MB; one account leaves at most 16 at a time, and each stops counting toward its 16 after
312
- 30 days.
313
- - fkn.app's Rooms tab reads the inbox as having no size limit unless the account set one, while the
314
- inbox keeps at most 4 MB.
315
- - Whoever has read the address keeps it, and the record names it at every level. Unclaim under Rooms
316
- stops requests at the owner's next load, which names no inbox in the record, and none is made again
317
- on its own; Make an inbox gives a new address. Until that load the record still names the unclaimed
318
- room, and anyone holding the address can claim it: a request sent there then reaches nobody, and the
319
- next load reads it as taken and takes it out of the record. Friends keep the old address until their
320
- next friend request or invite link with you, so their party invites do not reach you until then.
321
- - Two devices making the first inbox at the same moment can each keep a claim, one of which nothing
322
- points at. It shows in the Rooms tab with the inbox's description, and Unclaim there frees it.
323
- - A tab open across milestone 6's deploy runs the old bundle. Into an inbox that has its schema, its
324
- friend requests and party invites read that FKN rooms did not answer, and its Accept that the answer
325
- did not reach them, with Send again, until a reload. Nothing is lost: the request still waits.
326
- - A holder who has not opened FKN Social since milestone 5b's deploy, or has no inbox, shows Private
327
- profile with no Request friend.
328
- - In a browser where you have not opened FKN Social, your own page shows Request friend: a page
329
- installs nothing, so it asks the package only where the site installed it.
330
- - Requests are collected only on social.fkn.app until milestone 3 connects other apps.
331
-
332
- ## Comments
333
-
334
- A friend leaves a comment on your page, and it shows there only once you approve it. While Comments is
335
- not Off, a friend signed in reads your page with a Comment field and Send comment: up to 500
336
- characters, line breaks allowed, no control or text direction characters. The package sends it only
337
- to a name its own list holds as an active friend, into the inbox that name's record names, as one more
338
- kind of request, so the inbox's limits per account hold for it. Your next load keeps it as a card
339
- ("bob commented on your page.", the text, Approve and Delete) only from an active friend while Comments
340
- is not Off, and deletes anything else unseen. Approve writes it into the record, then deletes it from
341
- the inbox; its id is a digest of the sealed message, so a second Approve, from another device or after
342
- a tab closed in between, writes it once. The record keeps the id, the name your list holds the friend
343
- by, the text and when you approved it, and nothing else.
344
-
345
- Comments are placed as Activity's entries are: in the clear at Public, in the Friends part at Friends,
346
- only ever moving to a stricter place, at most 20 at each level, the oldest dropped past that, and a
347
- level's entries go before its comments when the record is past its size. Off deletes them all, so Save
348
- layout asks "Delete all comments?" first. While Comments is on the record always carries a Friends
349
- part, so a friend's page offers the field before the first comment. On your own page each comment has
350
- Delete, after "Delete this comment?".
351
-
352
- Known limits:
353
-
354
- - A tab open across this deploy runs the older bundle: its record writes drop the approved comments,
355
- and its manager deletes waiting comments unseen, until a reload.
356
- - A comment shows the name your list held for its author when you approved it, as plain text, so a
357
- friend who renames later still shows by the older name.
358
- - Removing a friend keeps the comments they left, until you delete them.
70
+ ```sh
71
+ npm ci
72
+ npm run dev # http://localhost:4570
73
+ npm run typecheck # tsc --noEmit
74
+ npm test # unit tests (vitest)
75
+ npm run build # builds site + package into build/
76
+ ```
359
77
 
360
- ## Status
78
+ End-to-end journeys against a local FKN rig live under `tests/journey/run.sh`.
361
79
 
362
- Milestone 6: your name, an identicon, a recovery key and its restore, the same card on every device, a
363
- profile, friends added by a link or by name, your page at your name, Private profile and Request friend
364
- on every held name's page, and requests that wait in an inbox, from signed-in accounts only. Each room
365
- takes only what FKN Social sends there. Then the page layout: a colour, sections in your order with a
366
- level each, the wider page and Edit on your own. Then the record's entries and its Friends part, with
367
- Friends as a level for About and Activity, and the friend list at version 2. Then posting from apps,
368
- the yes on social.fkn.app and Apps, the feed on the page, and Favourites. Then comments from friends,
369
- each shown once you approve it, and Reset Social for a friend list a key reset left sealed. Parties come
370
- in milestone 3.
80
+ ## Store artwork
371
81
 
372
- ## Tests
82
+ ```sh
83
+ npm run store-art
84
+ ```
373
85
 
374
- `npm test` runs the unit suite. `tests/journey/run.sh` runs the journeys on the local FKN rig
375
- (`one-name`, `invite`, `public`, `requests`, `friends`, `post`, `comments`, then `reset`), as the local gate's
376
- `GATE_RIG_CMD`; `requests`, `friends`, `post`, `comments` and `reset` also serve a probe page, built only for the rig, that
377
- asks the rooms Worker what a sender may read and send, and reads a name's record as a guest. `reset` resets
378
- an account's FKN key on fkn.app, reading its mail from the rig's mail sink, then walks Reset Social. `post` also
379
- serves a host app, an app on an origin of its own built only for the rig, that posts through
380
- `src/lib`, shows the package's frame over its own page and frames the site. `upgrade` crosses the deploy
381
- of posting, Apps, the feed and Favourites: with `SOCIAL_BEFORE_TREE` naming a checkout from before it
382
- (`89fd39b`) that has no `node_modules`, run.sh builds it too, the journey starts on it, then moves the
383
- served build to this one.
86
+ Rebuilds `public/icons/icon-192.png`, `public/icons/icon-512.png`, `public/favicon.ico`, and the
87
+ `store/*.webp` listing assets using headless Chromium and `ffmpeg`.