@estiva-app/interop 0.85.0 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/listedConversations.d.ts +122 -0
- package/dist/listedConversations.d.ts.map +1 -0
- package/dist/listedConversations.js +352 -0
- package/dist/listedConversations.js.map +1 -0
- package/dist/projection.d.ts +6 -0
- package/dist/projection.d.ts.map +1 -1
- package/dist/projection.js +1 -1
- package/dist/projection.js.map +1 -1
- package/dist/topics.d.ts +39 -15
- package/dist/topics.d.ts.map +1 -1
- package/dist/topics.js +84 -43
- package/dist/topics.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +15 -0
- package/src/listedConversations.ts +425 -0
- package/src/projection.ts +1 -1
- package/src/topics.ts +110 -49
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,51 @@ how a declaration is read, is a MAJOR — in `0.x`, a MINOR — even when no
|
|
|
6
6
|
TypeScript signature moved. A consumer upgrading must be able to tell whether
|
|
7
7
|
manifests already published still mean what they meant.
|
|
8
8
|
|
|
9
|
+
## 0.87.0 — 2026-11-06
|
|
10
|
+
|
|
11
|
+
**Manifest: nothing new. Wire: reads only, nothing written; the reads are the ones 0.86.0 made** (SPEC §11.8 *Places and following*, *What is unread on a place*).
|
|
12
|
+
|
|
13
|
+
- `readTopics`: whose a topic is now comes from conversation's shared fold,
|
|
14
|
+
`followingOf`, over the topic's root and the changes naming the viewer:
|
|
15
|
+
made it, chose a level, joined or was added since their last leave. Writing
|
|
16
|
+
in a topic is no longer one (record writing-in-a-place-never-follows-it), so
|
|
17
|
+
a topic someone only commented in moves from their "Your topics" to the
|
|
18
|
+
others. Each `ReadTopic` carries that `following` (level, since, ways,
|
|
19
|
+
`addedBy`); `yours` is `following.in`. A space's team default is not read
|
|
20
|
+
here: Ship's Topics draws no space.
|
|
21
|
+
- `TopicsRead` gains `mentionedIn` (the topics where a message inside the
|
|
22
|
+
horizon names the viewer) and `inConversations` (each conversation the viewer
|
|
23
|
+
wrote in or was named in, by root id, with the second they first did).
|
|
24
|
+
- `topicConversations`: the dot and `fresh` are §11.8's place rule
|
|
25
|
+
(`isUnreadOnPlace`) at the viewer's level: at Important a new conversation,
|
|
26
|
+
or a reply in one they are in; at All every message since they chose All; a
|
|
27
|
+
mention at any level and on a topic they are not in. Replies are read for
|
|
28
|
+
the open topics they are in or are named in, from the reply floor or the
|
|
29
|
+
thread rule's cut-over.
|
|
30
|
+
- Needs `@estiva-app/conversation` 0.34.0.
|
|
31
|
+
|
|
32
|
+
## 0.86.0 — 2026-11-06
|
|
33
|
+
|
|
34
|
+
**Manifest: nothing new; an owner's `emits.alsoRead` is read as before. Wire: reads and a live REQ, nothing written** (SPEC §11.8, §6.4, §6.6).
|
|
35
|
+
|
|
36
|
+
- `listedConversations(query, topic)` / `listedConversationsOf(query, listed)`:
|
|
37
|
+
the conversations of every file a topic lists, each file's events ready for
|
|
38
|
+
`foldThreads` — comments and replies by `#A` and `#O` (both, always), an
|
|
39
|
+
owner's older comment kinds by `#a`, then one `#e` read for edits, resolve and
|
|
40
|
+
reopen, deletions, older-kind replies, and reactions on each file's newest
|
|
41
|
+
100 messages, the cut reported per file. Nothing under a listed file: a listed
|
|
42
|
+
project's issues are not read. A listed id the reader cannot resolve is left
|
|
43
|
+
out. Two requests for a topic's files, whatever their number.
|
|
44
|
+
- `watchListedConversations(relay, read, onEvent)`: the same files, live, each
|
|
45
|
+
new event handed to its file once. One REQ, asked again from the newest second
|
|
46
|
+
seen when a new message or reaction adds an id to listen for — never from past
|
|
47
|
+
the reader's own clock, so an event dated ahead cannot make the watch deaf. Until our relay
|
|
48
|
+
delivers a team's event live to a subscription by file alone, each filter
|
|
49
|
+
also names the files' teams (`namesTeams`, on by default).
|
|
50
|
+
- `MAX_FILTERS_PER_REQ` (10): our relay answers a REQ of more filters with a
|
|
51
|
+
NOTICE only, so the watch never sends one.
|
|
52
|
+
- `ListedFile.folder`: a listed file's team, from its root.
|
|
53
|
+
|
|
9
54
|
## 0.85.0 — 2026-11-04
|
|
10
55
|
|
|
11
56
|
**Manifest: nothing. Wire: a read, nothing written** (ALO-6; SPEC §6.5, §6.13).
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,11 @@ export { planCreateFolder, planRenameFolder, planDeleteFolder, planPlaceFile, pl
|
|
|
49
49
|
* list a file (`#o`); a file's own changes (`#O`) never hold an entry.
|
|
50
50
|
*/
|
|
51
51
|
export { planListInTopic, planRemoveFromTopic, topicsOfFile, topicList, topicLists, readTopics, addableTopics, topicConversations, type ReadTopic, type TopicsRead, type TopicConversation, topicsOfFileFilter, topicListFilter, listEntries, listsField, LISTED_FILE_KINDS, type ListHolder, type ListEntry, type FileTopic, type ListedFile, } from './topics.js';
|
|
52
|
+
/**
|
|
53
|
+
* A topic's All: the conversations of every file on its list, read in one go
|
|
54
|
+
* and kept live, each file's events ready for the shared fold (SPEC §11.8).
|
|
55
|
+
*/
|
|
56
|
+
export { listedConversations, listedConversationsOf, watchListedConversations, LISTED_WATCH_REBUILD_MS, MAX_FILTERS_PER_REQ, type ListedConversation, type ListedConversations, type ListedWatch, } from './listedConversations.js';
|
|
52
57
|
/**
|
|
53
58
|
* A file as its fields, each kept in order by the relay (SPEC §6.2, §6.13):
|
|
54
59
|
* the list and open reads, and the change writer that answers `conflict:`.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBA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AQ,GACd,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,4BAA4B,EAC5B,KAAK,WAAW,GACjB,MAAM,eAAe,CAAA;AAEtB;;;;;;;GAOG;AACH,OAAO,EACL,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,UAAU,EACV,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,sBAAsB,EACtB,OAAO,EACP,KAAK,MAAM,EACX,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,KAAK,mBAAmB,EACxB,SAAS,EACT,KAAK,OAAO,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,eAAe,EACpB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,aAAa,EAClB,cAAc,EACd,qBAAqB,E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,EAClB,eAAe,EACf,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,aAAa,CAAA;AAEpB;;;GAGG;AACH,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,0BAA0B,CAAA;AAEjC;;;GAGG;AACH,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACX,OAAO,EACP,SAAS,EACT,QAAQ,EACR,MAAM,EACN,UAAU,EACV,cAAc,EACd,WAAW,EACX,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,aAAa,CAAA;AAEpB;;;;GAIG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,OAAO,EACP,eAAe,EACf,MAAM,EACN,eAAe,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,QAAQ,GACd,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,4BAA4B,EAC5B,KAAK,WAAW,GACjB,MAAM,eAAe,CAAA;AAEtB;;;;;;;GAOG;AACH,OAAO,EACL,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,UAAU,EACV,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -49,6 +49,11 @@ export { planCreateFolder, planRenameFolder, planDeleteFolder, planPlaceFile, pl
|
|
|
49
49
|
* list a file (`#o`); a file's own changes (`#O`) never hold an entry.
|
|
50
50
|
*/
|
|
51
51
|
export { planListInTopic, planRemoveFromTopic, topicsOfFile, topicList, topicLists, readTopics, addableTopics, topicConversations, topicsOfFileFilter, topicListFilter, listEntries, listsField, LISTED_FILE_KINDS, } from './topics.js';
|
|
52
|
+
/**
|
|
53
|
+
* A topic's All: the conversations of every file on its list, read in one go
|
|
54
|
+
* and kept live, each file's events ready for the shared fold (SPEC §11.8).
|
|
55
|
+
*/
|
|
56
|
+
export { listedConversations, listedConversationsOf, watchListedConversations, LISTED_WATCH_REBUILD_MS, MAX_FILTERS_PER_REQ, } from './listedConversations.js';
|
|
52
57
|
/**
|
|
53
58
|
* A file as its fields, each kept in order by the relay (SPEC §6.2, §6.13):
|
|
54
59
|
* the list and open reads, and the change writer that answers `conflict:`.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,aAAa,EAIb,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,sBAAsB,EACtB,OAAO,EAEP,cAAc,EACd,oBAAoB,EACpB,eAAe,EAEf,SAAS,EAET,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAEjB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,sBAAsB,EACtB,cAAc,EACd,eAAe,E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ACP,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,UAAU,GAGX,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,aAAa,EAIb,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,sBAAsB,EACtB,OAAO,EAEP,cAAc,EACd,oBAAoB,EACpB,eAAe,EAEf,SAAS,EAET,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAEjB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EAErB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EAmBnB,cAAc,GAEf,MAAM,iBAAiB,CAAA;AAExB;;;GAGG;AACH,OAAO,EAAE,SAAS,EAA+B,MAAM,cAAc,CAAA;AACrE,OAAO,EAAE,eAAe,EAAyB,MAAM,gBAAgB,CAAA;AAEvE;;;GAGG;AACH,OAAO,EACL,cAAc,EACd,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,oBAAoB,GAGrB,MAAM,iBAAiB,CAAA;AAExB;;;;;GAKG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,aAAa,GAMd,MAAM,cAAc,CAAA;AAErB;;;;GAIG;AACH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,UAAU,EACV,UAAU,EACV,aAAa,EACb,kBAAkB,EAIlB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,UAAU,EACV,iBAAiB,GAKlB,MAAM,aAAa,CAAA;AAEpB;;;GAGG;AACH,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,GAIpB,MAAM,0BAA0B,CAAA;AAEjC;;;GAGG;AACH,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACX,OAAO,EACP,SAAS,EACT,QAAQ,EACR,MAAM,EACN,UAAU,EACV,cAAc,EACd,WAAW,EACX,YAAY,GAQb,MAAM,aAAa,CAAA;AAEpB;;;;GAIG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,OAAO,EACP,eAAe,EACf,MAAM,EACN,eAAe,GAKhB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,4BAA4B,GAE7B,MAAM,eAAe,CAAA;AAEtB;;;;;;;GAOG;AACH,OAAO,EACL,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,UAAU,GAGX,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The conversations of every file a topic lists, read in one go and kept live
|
|
3
|
+
* — the read behind a topic's All (SPEC §11.8).
|
|
4
|
+
*
|
|
5
|
+
* All reads the files on the topic's list and nothing under them: a listed
|
|
6
|
+
* project's issues, a listed Folder's files and a listed page's sub-pages are
|
|
7
|
+
* not here (Miky, 2026-11-06). Each file's events are returned as the shared
|
|
8
|
+
* fold's input (`foldThreads`, `@estiva-app/conversation`), so the app folds
|
|
9
|
+
* each file as its own pane would and every app draws the same threads.
|
|
10
|
+
*
|
|
11
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-topic-keeps-its-own-list-of-files.md
|
|
12
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/what-belongs-to-a-file-is-stored-with-it.md
|
|
13
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-conversation-is-one-shared-thing-and-only-its-colours-are-the-apps.md
|
|
14
|
+
*
|
|
15
|
+
* ## The cold read
|
|
16
|
+
*
|
|
17
|
+
* 1. Every listed file's comments and replies: `kind:1111` by `#A` (its
|
|
18
|
+
* address) and by `#O` (its id), always both (§6.4: a comment may carry
|
|
19
|
+
* either form). The A/O rules decide which file each one is about
|
|
20
|
+
* (`isAbout`), so a comment whose `A` and `O` name different files is about
|
|
21
|
+
* neither. An owning app's older comment kinds (`emits.alsoRead`, Ship's
|
|
22
|
+
* `kind:9`) are read by `#a` when its manifest resolves; a file whose
|
|
23
|
+
* manifest does not resolve still has its `1111`s read.
|
|
24
|
+
* 2. One `#e` read on what those name: edits (`40003`), resolve and reopen
|
|
25
|
+
* (`9101`), deletions (`5`), the older kinds' replies, and reactions (`7`)
|
|
26
|
+
* on each file's newest 100 messages (`REACTION_HORIZON`), as each file's
|
|
27
|
+
* own pane asks (§6.6) — the cut is reported per file.
|
|
28
|
+
*
|
|
29
|
+
* About three requests for a topic of eight files, whatever their number up to
|
|
30
|
+
* `MAX_FILTERS_PER_QUERY / 2`. A listed id the reader cannot resolve is left
|
|
31
|
+
* out, not returned as an unreachable entry: the count is the disclosure
|
|
32
|
+
* (§6.14, §3.2).
|
|
33
|
+
*/
|
|
34
|
+
import { type LiveRelay, type SignedEvent } from '@estiva-app/protocol';
|
|
35
|
+
import { type ProjectionCache, type QueryFn } from './projection.js';
|
|
36
|
+
import { type ListedFile } from './topics.js';
|
|
37
|
+
/** One listed file's conversation, as the shared fold takes it. */
|
|
38
|
+
export interface ListedConversation {
|
|
39
|
+
/** The listed file's id. */
|
|
40
|
+
file: string;
|
|
41
|
+
address: string;
|
|
42
|
+
/** Its Folder, from its root, or `null` when the root names none. */
|
|
43
|
+
folder: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Every event its threads need, unordered: its comments and their replies,
|
|
46
|
+
* and what the `#e` read returned on them. Pass to `foldThreads`.
|
|
47
|
+
*/
|
|
48
|
+
events: SignedEvent[];
|
|
49
|
+
/** A comment read for it came back at the relay's page ceiling: its oldest comments may be missing. */
|
|
50
|
+
commentsCut: boolean;
|
|
51
|
+
/** Its messages past the reaction horizon, not asked about reactions (§6.6: a cap is reported). */
|
|
52
|
+
reactionTargetsOmitted: number;
|
|
53
|
+
/** Its reaction read came back at the page ceiling, so some reactions may be missing. */
|
|
54
|
+
reactionEventsCut: boolean;
|
|
55
|
+
/** Its edit, resolution and deletion read came back at the page ceiling. */
|
|
56
|
+
editEventsCut: boolean;
|
|
57
|
+
/** @internal The comment kinds its owning app used to publish, read by `#a` (`emits.alsoRead`). */
|
|
58
|
+
olderKinds: readonly number[];
|
|
59
|
+
}
|
|
60
|
+
/** What {@link listedConversations} read. */
|
|
61
|
+
export interface ListedConversations {
|
|
62
|
+
/** The listed files the reader can resolve, in the list's order. */
|
|
63
|
+
files: ListedConversation[];
|
|
64
|
+
}
|
|
65
|
+
/** The conversations of every file the topic at `topic` lists: its list read, then {@link listedConversationsOf}. */
|
|
66
|
+
export declare function listedConversations(query: QueryFn, topic: string, options?: {
|
|
67
|
+
cache?: ProjectionCache;
|
|
68
|
+
fileKinds?: readonly number[];
|
|
69
|
+
}): Promise<ListedConversations>;
|
|
70
|
+
/**
|
|
71
|
+
* The conversations of `listed`, a topic's list already read (`topicList`,
|
|
72
|
+
* `readTopics`). Files left unresolved are left out. A refused read is
|
|
73
|
+
* whatever `query` does with one.
|
|
74
|
+
*/
|
|
75
|
+
export declare function listedConversationsOf(query: QueryFn, listed: readonly ListedFile[], options?: {
|
|
76
|
+
cache?: ProjectionCache;
|
|
77
|
+
}): Promise<ListedConversations>;
|
|
78
|
+
/** A live watch's handle. */
|
|
79
|
+
export interface ListedWatch {
|
|
80
|
+
/** Idempotent. Closes its subscriptions. */
|
|
81
|
+
stop(): void;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The most filters one live `REQ` may carry on our relay. Over it, the relay
|
|
85
|
+
* answers only a `NOTICE` ("REQ contains 14 filters, maximum is 10", measured
|
|
86
|
+
* 6 Nov) — no `CLOSED`, no `EOSE` — so a watch past it hears nothing and says
|
|
87
|
+
* nothing. `POST /query` takes 128 (`MAX_FILTERS_PER_QUERY`); a socket does not.
|
|
88
|
+
*/
|
|
89
|
+
export declare const MAX_FILTERS_PER_REQ = 10;
|
|
90
|
+
/** Wait before a watch that has learnt a new id asks again, so a burst of messages costs one new REQ. */
|
|
91
|
+
export declare const LISTED_WATCH_REBUILD_MS = 250;
|
|
92
|
+
/**
|
|
93
|
+
* Hear, live, every new event on the files `read` holds, each handed to its
|
|
94
|
+
* file: a new comment or reply about one (`#A`, `#O`, and `#a` for an owner's
|
|
95
|
+
* older kinds), and an edit, resolution, reaction or deletion naming any
|
|
96
|
+
* message the watch knows (`#e`). One REQ for all of them (another per
|
|
97
|
+
* {@link MAX_FILTERS_PER_REQ} filters, past about 700 messages), asked again — a
|
|
98
|
+
* moment later, from the newest second it has seen — whenever a new message
|
|
99
|
+
* or reaction gives it another id to listen for, so a reaction to a comment
|
|
100
|
+
* written a second ago is heard. Each event is handed over once; the cold
|
|
101
|
+
* read's are never handed over.
|
|
102
|
+
*
|
|
103
|
+
* ## Naming the files' teams (`namesTeams`, on by default)
|
|
104
|
+
*
|
|
105
|
+
* The decided shape asks by file alone (Miky, 2026-11-06). Our relay does not
|
|
106
|
+
* yet deliver a team's event live to a subscription that names no team
|
|
107
|
+
* (buzz `fan_out_scoped`; measured 6 Nov: by `#A` or `#e` alone, nothing), so
|
|
108
|
+
* until it does every filter also carries the `#h` of each listed file's team
|
|
109
|
+
* and of every team a comment on them was filed in. Turn it off once the
|
|
110
|
+
* relay delivers by file — the Ship issue on the relay in "Topics: Main and
|
|
111
|
+
* All" — and the filters are the decided ones unchanged.
|
|
112
|
+
*/
|
|
113
|
+
export declare function watchListedConversations(relay: Pick<LiveRelay, 'subscribe'>, read: ListedConversations, onEvent: (file: string, event: SignedEvent) => void, options?: {
|
|
114
|
+
/** Unix seconds to hear from. Defaults to the newest event the read holds, else now. */
|
|
115
|
+
since?: number;
|
|
116
|
+
namesTeams?: boolean;
|
|
117
|
+
onClosed?: (reason: string) => void;
|
|
118
|
+
now?: () => number;
|
|
119
|
+
setTimer?: (run: () => void, ms: number) => unknown;
|
|
120
|
+
clearTimer?: (timer: unknown) => void;
|
|
121
|
+
}): ListedWatch;
|
|
122
|
+
//# sourceMappingURL=listedConversations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listedConversations.d.ts","sourceRoot":"","sources":["../src/listedConversations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAiE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAiBtI,OAAO,EAAmC,KAAK,eAAe,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACrG,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAOxD,mEAAmE;AACnE,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,qEAAqE;IACrE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB;;;OAGG;IACH,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,uGAAuG;IACvG,WAAW,EAAE,OAAO,CAAA;I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,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACnD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CACjC,GACL,WAAW,CA2Fb"}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The conversations of every file a topic lists, read in one go and kept live
|
|
3
|
+
* — the read behind a topic's All (SPEC §11.8).
|
|
4
|
+
*
|
|
5
|
+
* All reads the files on the topic's list and nothing under them: a listed
|
|
6
|
+
* project's issues, a listed Folder's files and a listed page's sub-pages are
|
|
7
|
+
* not here (Miky, 2026-11-06). Each file's events are returned as the shared
|
|
8
|
+
* fold's input (`foldThreads`, `@estiva-app/conversation`), so the app folds
|
|
9
|
+
* each file as its own pane would and every app draws the same threads.
|
|
10
|
+
*
|
|
11
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-topic-keeps-its-own-list-of-files.md
|
|
12
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/what-belongs-to-a-file-is-stored-with-it.md
|
|
13
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-conversation-is-one-shared-thing-and-only-its-colours-are-the-apps.md
|
|
14
|
+
*
|
|
15
|
+
* ## The cold read
|
|
16
|
+
*
|
|
17
|
+
* 1. Every listed file's comments and replies: `kind:1111` by `#A` (its
|
|
18
|
+
* address) and by `#O` (its id), always both (§6.4: a comment may carry
|
|
19
|
+
* either form). The A/O rules decide which file each one is about
|
|
20
|
+
* (`isAbout`), so a comment whose `A` and `O` name different files is about
|
|
21
|
+
* neither. An owning app's older comment kinds (`emits.alsoRead`, Ship's
|
|
22
|
+
* `kind:9`) are read by `#a` when its manifest resolves; a file whose
|
|
23
|
+
* manifest does not resolve still has its `1111`s read.
|
|
24
|
+
* 2. One `#e` read on what those name: edits (`40003`), resolve and reopen
|
|
25
|
+
* (`9101`), deletions (`5`), the older kinds' replies, and reactions (`7`)
|
|
26
|
+
* on each file's newest 100 messages (`REACTION_HORIZON`), as each file's
|
|
27
|
+
* own pane asks (§6.6) — the cut is reported per file.
|
|
28
|
+
*
|
|
29
|
+
* About three requests for a topic of eight files, whatever their number up to
|
|
30
|
+
* `MAX_FILTERS_PER_QUERY / 2`. A listed id the reader cannot resolve is left
|
|
31
|
+
* out, not returned as an unreachable entry: the count is the disclosure
|
|
32
|
+
* (§6.14, §3.2).
|
|
33
|
+
*/
|
|
34
|
+
import { MAX_FILTERS_PER_QUERY, RELAY_PAGE_CEILING, referenceToPointer } from '@estiva-app/protocol';
|
|
35
|
+
import { editTargetOf, groupThreads, isAbout, isCommentOn, isReply, KIND_ASSERTION, KIND_COMMENT, KIND_DELETION, KIND_EDIT, KIND_REACTION, parentOf, reactionHorizon, reactionTargetOf, resolutionTargetOf, } from '@estiva-app/conversation';
|
|
36
|
+
import { commentKindsOf, resolveManifest } from './projection.js';
|
|
37
|
+
import { topicList } from './topics.js';
|
|
38
|
+
/** The bare file has no owner, so no older comment kinds: its comments are `kind:1111` (§6.4). */
|
|
39
|
+
const KIND_BARE_FILE = 30840;
|
|
40
|
+
/** Ids per `#e` filter: a comfortable fraction of the relay's page, as `decorationsOf` asks. */
|
|
41
|
+
const IDS_PER_FILTER = 100;
|
|
42
|
+
/** The conversations of every file the topic at `topic` lists: its list read, then {@link listedConversationsOf}. */
|
|
43
|
+
export async function listedConversations(query, topic, options = {}) {
|
|
44
|
+
return listedConversationsOf(query, await topicList(query, topic, options.fileKinds ? { fileKinds: options.fileKinds } : {}), options);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The conversations of `listed`, a topic's list already read (`topicList`,
|
|
48
|
+
* `readTopics`). Files left unresolved are left out. A refused read is
|
|
49
|
+
* whatever `query` does with one.
|
|
50
|
+
*/
|
|
51
|
+
export async function listedConversationsOf(query, listed, options = {}) {
|
|
52
|
+
const unique = new Map();
|
|
53
|
+
for (const entry of listed)
|
|
54
|
+
if (entry.address && !unique.has(entry.address))
|
|
55
|
+
unique.set(entry.address, { ...entry, address: entry.address });
|
|
56
|
+
const files = [...unique.values()];
|
|
57
|
+
if (files.length === 0)
|
|
58
|
+
return { files: [] };
|
|
59
|
+
const olderKinds = await olderKindsOf(files.map((f) => f.address), query, options.cache);
|
|
60
|
+
// 1. Comments and replies, two filters per file (three with older kinds), so one busy file cannot starve another.
|
|
61
|
+
const filters = files.flatMap((f) => {
|
|
62
|
+
const older = olderKinds.get(f.address) ?? [];
|
|
63
|
+
return [
|
|
64
|
+
{ kinds: [KIND_COMMENT], '#A': [f.address], limit: RELAY_PAGE_CEILING },
|
|
65
|
+
{ kinds: [KIND_COMMENT], '#O': [f.file], limit: RELAY_PAGE_CEILING },
|
|
66
|
+
...(older.length > 0 ? [{ kinds: older, '#a': [f.address], limit: RELAY_PAGE_CEILING }] : []),
|
|
67
|
+
];
|
|
68
|
+
});
|
|
69
|
+
const comments = await readAll(query, filters);
|
|
70
|
+
const out = files.map((f) => ({
|
|
71
|
+
file: f.file,
|
|
72
|
+
address: f.address,
|
|
73
|
+
folder: f.folder,
|
|
74
|
+
events: [],
|
|
75
|
+
commentsCut: false,
|
|
76
|
+
reactionTargetsOmitted: 0,
|
|
77
|
+
reactionEventsCut: false,
|
|
78
|
+
editEventsCut: false,
|
|
79
|
+
olderKinds: olderKinds.get(f.address) ?? [],
|
|
80
|
+
}));
|
|
81
|
+
for (const conversation of out) {
|
|
82
|
+
const byA = comments.filter((e) => e.kind === KIND_COMMENT && e.tags.some((t) => t[0] === 'A' && t[1] === conversation.address));
|
|
83
|
+
const byO = comments.filter((e) => e.kind === KIND_COMMENT && e.tags.some((t) => t[0] === 'O' && t[1] === conversation.file));
|
|
84
|
+
const byOlder = comments.filter((e) => conversation.olderKinds.includes(e.kind) && e.tags.some((t) => t[0] === 'a' && t[1] === conversation.address));
|
|
85
|
+
conversation.commentsCut = [byA, byO, byOlder].some((answer) => answer.length >= RELAY_PAGE_CEILING);
|
|
86
|
+
conversation.events = comments.filter((e) => belongsAsComment(e, conversation));
|
|
87
|
+
}
|
|
88
|
+
// 2. What names them by `#e`, one request for every file.
|
|
89
|
+
const targetsOf = out.map((conversation) => {
|
|
90
|
+
const { missingRoots, replies } = groupThreads(conversation.events);
|
|
91
|
+
return [
|
|
92
|
+
...conversation.events.map((e) => ({ id: e.id, at: e.created_at })),
|
|
93
|
+
...missingRoots.map((id) => ({ id, at: replies[id]?.[0]?.created_at ?? 0 })),
|
|
94
|
+
];
|
|
95
|
+
});
|
|
96
|
+
const fileOf = new Map();
|
|
97
|
+
targetsOf.forEach((targets, i) => targets.forEach((t) => fileOf.set(t.id, i)));
|
|
98
|
+
const inHorizon = new Set();
|
|
99
|
+
targetsOf.forEach((targets, i) => {
|
|
100
|
+
const { asked, omitted } = reactionHorizon(targets);
|
|
101
|
+
out[i].reactionTargetsOmitted = omitted;
|
|
102
|
+
for (const id of asked)
|
|
103
|
+
inHorizon.add(id);
|
|
104
|
+
});
|
|
105
|
+
const allOlder = [...new Set(out.flatMap((c) => c.olderKinds))];
|
|
106
|
+
const editChunks = chunked([...fileOf.keys()]);
|
|
107
|
+
const reactionChunks = chunked([...inHorizon]);
|
|
108
|
+
const named = await readAll(query, [
|
|
109
|
+
...editChunks.map((ids) => ({ kinds: [KIND_EDIT, KIND_ASSERTION, KIND_DELETION, ...allOlder], '#e': ids, limit: RELAY_PAGE_CEILING })),
|
|
110
|
+
...reactionChunks.map((ids) => ({ kinds: [KIND_REACTION], '#e': ids, limit: RELAY_PAGE_CEILING })),
|
|
111
|
+
]);
|
|
112
|
+
const have = out.map((c) => new Set(c.events.map((e) => e.id)));
|
|
113
|
+
const answered = { edit: new Array(editChunks.length).fill(0), reaction: new Array(reactionChunks.length).fill(0) };
|
|
114
|
+
const chunkOf = (chunks) => new Map(chunks.flatMap((ids, i) => ids.map((id) => [id, i])));
|
|
115
|
+
const editChunkOf = chunkOf(editChunks);
|
|
116
|
+
const reactionChunkOf = chunkOf(reactionChunks);
|
|
117
|
+
for (const event of named) {
|
|
118
|
+
for (const i of filesNamedBy(event, (id) => fileOf.get(id), inHorizon, (i, kind) => out[i].olderKinds.includes(kind))) {
|
|
119
|
+
if (have[i].has(event.id))
|
|
120
|
+
continue;
|
|
121
|
+
have[i].add(event.id);
|
|
122
|
+
out[i].events.push(event);
|
|
123
|
+
}
|
|
124
|
+
const target = event.kind === KIND_REACTION ? reactionTargetOf(event) : firstNamed(event, editChunkOf);
|
|
125
|
+
const chunk = target === undefined ? undefined : (event.kind === KIND_REACTION ? reactionChunkOf : editChunkOf).get(target);
|
|
126
|
+
if (chunk !== undefined)
|
|
127
|
+
(event.kind === KIND_REACTION ? answered.reaction : answered.edit)[chunk] += 1;
|
|
128
|
+
}
|
|
129
|
+
answered.edit.forEach((n, chunk) => {
|
|
130
|
+
if (n >= RELAY_PAGE_CEILING)
|
|
131
|
+
for (const id of editChunks[chunk])
|
|
132
|
+
out[fileOf.get(id)].editEventsCut = true;
|
|
133
|
+
});
|
|
134
|
+
answered.reaction.forEach((n, chunk) => {
|
|
135
|
+
if (n >= RELAY_PAGE_CEILING)
|
|
136
|
+
for (const id of reactionChunks[chunk])
|
|
137
|
+
out[fileOf.get(id)].reactionEventsCut = true;
|
|
138
|
+
});
|
|
139
|
+
return { files: out };
|
|
140
|
+
}
|
|
141
|
+
/** A comment or reply about the file (§6.4's A/O rules), or a root of an older kind the owner declared. */
|
|
142
|
+
function belongsAsComment(event, conversation) {
|
|
143
|
+
if (event.kind === KIND_COMMENT)
|
|
144
|
+
return isAbout(event, conversation.address);
|
|
145
|
+
return conversation.olderKinds.includes(event.kind) && isCommentOn(event, conversation.address, conversation.olderKinds);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Which files an event read by `#e` belongs to, by the id it names: an edit's
|
|
149
|
+
* and a resolution's target, a reaction's (only inside its file's horizon), a
|
|
150
|
+
* deletion's every `e`, an older-kind reply's parent.
|
|
151
|
+
*/
|
|
152
|
+
function filesNamedBy(event, fileOf, inHorizon, olderKindOf) {
|
|
153
|
+
const one = (id) => {
|
|
154
|
+
const i = id ? fileOf(id.toLowerCase()) ?? fileOf(id) : undefined;
|
|
155
|
+
return i === undefined ? [] : [i];
|
|
156
|
+
};
|
|
157
|
+
switch (event.kind) {
|
|
158
|
+
case KIND_REACTION: {
|
|
159
|
+
const target = reactionTargetOf(event);
|
|
160
|
+
return target && inHorizon.has(target) ? one(target) : [];
|
|
161
|
+
}
|
|
162
|
+
case KIND_EDIT:
|
|
163
|
+
return one(editTargetOf(event));
|
|
164
|
+
case KIND_ASSERTION:
|
|
165
|
+
return one(resolutionTargetOf(event));
|
|
166
|
+
case KIND_DELETION:
|
|
167
|
+
return [...new Set(event.tags.filter((t) => t[0] === 'e' && t[1]).flatMap((t) => one(t[1])))];
|
|
168
|
+
default: {
|
|
169
|
+
if (!isReply(event))
|
|
170
|
+
return [];
|
|
171
|
+
return one(parentOf(event)).filter((i) => olderKindOf(i, event.kind));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/** The first `e` an event names that a chunk holds — what counts it against that chunk's page. */
|
|
176
|
+
function firstNamed(event, chunkOf) {
|
|
177
|
+
return event.tags.find((t) => t[0] === 'e' && t[1] && chunkOf.has(t[1]))?.[1];
|
|
178
|
+
}
|
|
179
|
+
/** Each owned file's older comment kinds, one manifest per app; a manifest that cannot be read declares none. */
|
|
180
|
+
async function olderKindsOf(addresses, query, cache) {
|
|
181
|
+
const byApp = new Map();
|
|
182
|
+
for (const address of addresses) {
|
|
183
|
+
const [kind, pubkey] = address.split(':');
|
|
184
|
+
if (Number(kind) === KIND_BARE_FILE)
|
|
185
|
+
continue;
|
|
186
|
+
const key = `${kind}:${pubkey}`;
|
|
187
|
+
byApp.set(key, [...(byApp.get(key) ?? []), address]);
|
|
188
|
+
}
|
|
189
|
+
const out = new Map();
|
|
190
|
+
await Promise.all([...byApp.values()].map(async (owned) => {
|
|
191
|
+
let kinds = [];
|
|
192
|
+
try {
|
|
193
|
+
const resolved = await resolveManifest(referenceToPointer(owned[0]), query, cache);
|
|
194
|
+
kinds = resolved ? commentKindsOf(resolved.manifest).filter((kind) => kind !== KIND_COMMENT) : [];
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
kinds = [];
|
|
198
|
+
}
|
|
199
|
+
for (const address of owned)
|
|
200
|
+
out.set(address, kinds);
|
|
201
|
+
}));
|
|
202
|
+
return out;
|
|
203
|
+
}
|
|
204
|
+
/** Every filter answered, `MAX_FILTERS_PER_QUERY` per request, each event once. */
|
|
205
|
+
async function readAll(query, filters) {
|
|
206
|
+
const seen = new Map();
|
|
207
|
+
for (let start = 0; start < filters.length; start += MAX_FILTERS_PER_QUERY) {
|
|
208
|
+
for (const event of await query(filters.slice(start, start + MAX_FILTERS_PER_QUERY)))
|
|
209
|
+
if (!seen.has(event.id))
|
|
210
|
+
seen.set(event.id, event);
|
|
211
|
+
}
|
|
212
|
+
return [...seen.values()];
|
|
213
|
+
}
|
|
214
|
+
function chunked(list, size = IDS_PER_FILTER) {
|
|
215
|
+
const out = [];
|
|
216
|
+
for (let i = 0; i < list.length; i += size)
|
|
217
|
+
out.push(list.slice(i, i + size));
|
|
218
|
+
return out;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* The most filters one live `REQ` may carry on our relay. Over it, the relay
|
|
222
|
+
* answers only a `NOTICE` ("REQ contains 14 filters, maximum is 10", measured
|
|
223
|
+
* 6 Nov) — no `CLOSED`, no `EOSE` — so a watch past it hears nothing and says
|
|
224
|
+
* nothing. `POST /query` takes 128 (`MAX_FILTERS_PER_QUERY`); a socket does not.
|
|
225
|
+
*/
|
|
226
|
+
export const MAX_FILTERS_PER_REQ = 10;
|
|
227
|
+
/** Wait before a watch that has learnt a new id asks again, so a burst of messages costs one new REQ. */
|
|
228
|
+
export const LISTED_WATCH_REBUILD_MS = 250;
|
|
229
|
+
/**
|
|
230
|
+
* Hear, live, every new event on the files `read` holds, each handed to its
|
|
231
|
+
* file: a new comment or reply about one (`#A`, `#O`, and `#a` for an owner's
|
|
232
|
+
* older kinds), and an edit, resolution, reaction or deletion naming any
|
|
233
|
+
* message the watch knows (`#e`). One REQ for all of them (another per
|
|
234
|
+
* {@link MAX_FILTERS_PER_REQ} filters, past about 700 messages), asked again — a
|
|
235
|
+
* moment later, from the newest second it has seen — whenever a new message
|
|
236
|
+
* or reaction gives it another id to listen for, so a reaction to a comment
|
|
237
|
+
* written a second ago is heard. Each event is handed over once; the cold
|
|
238
|
+
* read's are never handed over.
|
|
239
|
+
*
|
|
240
|
+
* ## Naming the files' teams (`namesTeams`, on by default)
|
|
241
|
+
*
|
|
242
|
+
* The decided shape asks by file alone (Miky, 2026-11-06). Our relay does not
|
|
243
|
+
* yet deliver a team's event live to a subscription that names no team
|
|
244
|
+
* (buzz `fan_out_scoped`; measured 6 Nov: by `#A` or `#e` alone, nothing), so
|
|
245
|
+
* until it does every filter also carries the `#h` of each listed file's team
|
|
246
|
+
* and of every team a comment on them was filed in. Turn it off once the
|
|
247
|
+
* relay delivers by file — the Ship issue on the relay in "Topics: Main and
|
|
248
|
+
* All" — and the filters are the decided ones unchanged.
|
|
249
|
+
*/
|
|
250
|
+
export function watchListedConversations(relay, read, onEvent, options = {}) {
|
|
251
|
+
const files = read.files.map((c) => ({ ...c, ids: new Set(c.events.map((e) => e.id)) }));
|
|
252
|
+
// This package assumes no environment's typings; every JS runtime has both.
|
|
253
|
+
const timers = globalThis;
|
|
254
|
+
const setTimer = options.setTimer ?? ((run, ms) => timers.setTimeout(run, ms));
|
|
255
|
+
const clearTimer = options.clearTimer ?? ((timer) => timers.clearTimeout(timer));
|
|
256
|
+
const seen = new Set(files.flatMap((f) => [...f.ids]));
|
|
257
|
+
const teams = new Set();
|
|
258
|
+
for (const f of read.files) {
|
|
259
|
+
if (f.folder)
|
|
260
|
+
teams.add(f.folder);
|
|
261
|
+
for (const e of f.events)
|
|
262
|
+
if (e.kind !== KIND_REACTION && e.kind !== KIND_DELETION)
|
|
263
|
+
addTeam(teams, e);
|
|
264
|
+
}
|
|
265
|
+
const nowSeconds = () => Math.floor((options.now ?? Date.now)() / 1000);
|
|
266
|
+
// `created_at` is the author's to write (the relay takes 15 min ahead): `since` never passes the reader's own clock.
|
|
267
|
+
const newest = Math.max(0, ...read.files.flatMap((f) => f.events.map((e) => e.created_at)));
|
|
268
|
+
let since = options.since ?? (newest > 0 ? Math.min(newest, nowSeconds()) : nowSeconds());
|
|
269
|
+
const namesTeams = options.namesTeams ?? true;
|
|
270
|
+
let subs = [];
|
|
271
|
+
let timer = null;
|
|
272
|
+
let stopped = false;
|
|
273
|
+
const filtersNow = () => {
|
|
274
|
+
const older = [...new Set(files.flatMap((f) => f.olderKinds))];
|
|
275
|
+
const byFile = [
|
|
276
|
+
{ kinds: [KIND_COMMENT], '#A': files.map((f) => f.address) },
|
|
277
|
+
{ kinds: [KIND_COMMENT], '#O': files.map((f) => f.file) },
|
|
278
|
+
...(older.length > 0 ? [{ kinds: older, '#a': files.filter((f) => f.olderKinds.length > 0).map((f) => f.address) }] : []),
|
|
279
|
+
...chunked([...new Set(files.flatMap((f) => [...f.ids]))]).map((ids) => ({
|
|
280
|
+
kinds: [KIND_REACTION, KIND_DELETION, KIND_EDIT, KIND_ASSERTION, ...older],
|
|
281
|
+
'#e': ids,
|
|
282
|
+
})),
|
|
283
|
+
];
|
|
284
|
+
const teamChunks = namesTeams && teams.size > 0 ? chunked([...teams], 128) : [undefined];
|
|
285
|
+
return teamChunks.flatMap((h) => byFile.map((f) => ({ ...f, ...(h ? { '#h': h } : {}), since })));
|
|
286
|
+
};
|
|
287
|
+
const open = () => {
|
|
288
|
+
for (const sub of subs)
|
|
289
|
+
sub.close();
|
|
290
|
+
subs = chunked(filtersNow(), MAX_FILTERS_PER_REQ).map((filters) => relay.subscribe(filters, hear, options.onClosed ? { onClosed: options.onClosed } : undefined));
|
|
291
|
+
};
|
|
292
|
+
const reopenSoon = () => {
|
|
293
|
+
if (stopped || timer !== null)
|
|
294
|
+
return;
|
|
295
|
+
timer = setTimer(() => {
|
|
296
|
+
timer = null;
|
|
297
|
+
if (!stopped)
|
|
298
|
+
open();
|
|
299
|
+
}, LISTED_WATCH_REBUILD_MS);
|
|
300
|
+
};
|
|
301
|
+
function hear(event) {
|
|
302
|
+
if (stopped || seen.has(event.id))
|
|
303
|
+
return;
|
|
304
|
+
const fileOf = (id) => {
|
|
305
|
+
const i = files.findIndex((f) => f.ids.has(id) || f.ids.has(id.toLowerCase()));
|
|
306
|
+
return i === -1 ? undefined : i;
|
|
307
|
+
};
|
|
308
|
+
const everyId = new Set(files.flatMap((f) => [...f.ids]));
|
|
309
|
+
const owners = event.kind === KIND_COMMENT || files.some((f) => f.olderKinds.includes(event.kind) && !isReply(event))
|
|
310
|
+
? files.flatMap((f, i) => (belongsAsComment(event, f) ? [i] : []))
|
|
311
|
+
: filesNamedBy(event, fileOf, everyId, (i, kind) => files[i].olderKinds.includes(kind));
|
|
312
|
+
if (owners.length === 0)
|
|
313
|
+
return;
|
|
314
|
+
seen.add(event.id);
|
|
315
|
+
since = Math.max(since, Math.min(event.created_at, nowSeconds()));
|
|
316
|
+
let learnt = false;
|
|
317
|
+
for (const i of owners) {
|
|
318
|
+
if (event.kind !== KIND_DELETION && !files[i].ids.has(event.id)) {
|
|
319
|
+
files[i].ids.add(event.id);
|
|
320
|
+
learnt = true;
|
|
321
|
+
}
|
|
322
|
+
onEvent(files[i].file, event);
|
|
323
|
+
}
|
|
324
|
+
if (event.kind !== KIND_REACTION && event.kind !== KIND_DELETION) {
|
|
325
|
+
const before = teams.size;
|
|
326
|
+
addTeam(teams, event);
|
|
327
|
+
if (teams.size !== before)
|
|
328
|
+
learnt = true;
|
|
329
|
+
}
|
|
330
|
+
if (learnt)
|
|
331
|
+
reopenSoon();
|
|
332
|
+
}
|
|
333
|
+
open();
|
|
334
|
+
return {
|
|
335
|
+
stop() {
|
|
336
|
+
if (stopped)
|
|
337
|
+
return;
|
|
338
|
+
stopped = true;
|
|
339
|
+
if (timer !== null)
|
|
340
|
+
clearTimer(timer);
|
|
341
|
+
for (const sub of subs)
|
|
342
|
+
sub.close();
|
|
343
|
+
subs = [];
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
function addTeam(teams, event) {
|
|
348
|
+
const h = event.tags.find((t) => t[0] === 'h' && t[1])?.[1];
|
|
349
|
+
if (h)
|
|
350
|
+
teams.add(h);
|
|
351
|
+
}
|
|
352
|
+
//# sourceMappingURL=listedConversations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listedConversations.js","sourceRoot":"","sources":["../src/listedConversations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAoC,MAAM,sBAAsB,CAAA;AACtI,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,WAAW,EACX,OAAO,EACP,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,aAAa,EACb,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAsC,MAAM,iBAAiB,CAAA;AACrG,OAAO,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAA;AAExD,kGAAkG;AAClG,MAAM,cAAc,GAAG,KAAK,CAAA;AAC5B,gGAAgG;AAChG,MAAM,cAAc,GAAG,GAAG,CAAA;AAgC1B,qHAAqH;AACrH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAAc,EACd,KAAa,EACb,UAAsE,EAAE;IAEx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
|
@@ -188,6 +188,12 @@ export interface ConversationMessage {
|
|
|
188
188
|
by: string;
|
|
189
189
|
root: string;
|
|
190
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* The root of a comment's thread — NIP-22's uppercase `E` when the comment
|
|
193
|
+
* carries one, else the `['e', <root>, '', 'reply']` shape §6.4's table gives
|
|
194
|
+
* for a reply, else the message itself.
|
|
195
|
+
*/
|
|
196
|
+
export declare function rootOf(event: SignedEvent): string;
|
|
191
197
|
/**
|
|
192
198
|
* What each file's conversation holds — one round trip for all of them.
|
|
193
199
|
*
|