@wirecat/cli-core 0.306.0 → 0.307.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/dist/analysis/consents.js +4 -4
- package/dist/analysis/consents.js.map +1 -1
- package/dist/attachments/directory.js +1 -1
- package/dist/attachments/directory.js.map +1 -1
- package/dist/botcheck/service.js +3 -3
- package/dist/botcheck/service.js.map +1 -1
- package/dist/cli/bot/context.d.ts +2 -2
- package/dist/cli/bot/copy.js +4 -4
- package/dist/cli/bot/copy.js.map +1 -1
- package/dist/cli/bot/messages.d.ts.map +1 -1
- package/dist/cli/bot/messages.js +2 -2
- package/dist/cli/bot/messages.js.map +1 -1
- package/dist/cli/bot/moderation.js +1 -1
- package/dist/cli/bot/moderation.js.map +1 -1
- package/dist/cli/bot/people.js +4 -4
- package/dist/cli/bot/people.js.map +1 -1
- package/dist/cli/bot/store.js +2 -2
- package/dist/cli/bot/store.js.map +1 -1
- package/dist/cli/config-keys.d.ts.map +1 -1
- package/dist/cli/config-keys.js +2 -1
- package/dist/cli/config-keys.js.map +1 -1
- package/dist/cli/messenger/account-command.js +1 -1
- package/dist/cli/messenger/account-command.js.map +1 -1
- package/dist/cli/messenger/complete-command.js +2 -2
- package/dist/cli/messenger/complete-command.js.map +1 -1
- package/dist/cli/messenger/context.js +1 -1
- package/dist/cli/messenger/context.js.map +1 -1
- package/dist/cli/messenger/serve-members.js +1 -1
- package/dist/cli/messenger/serve-members.js.map +1 -1
- package/dist/cli/messenger/serve-stems.js +3 -3
- package/dist/cli/messenger/serve-stems.js.map +1 -1
- package/dist/cli/messenger/stored.d.ts.map +1 -1
- package/dist/cli/messenger/stored.js +21 -21
- package/dist/cli/messenger/stored.js.map +1 -1
- package/dist/cli/store-settings.js +3 -3
- package/dist/cli/store-settings.js.map +1 -1
- package/dist/errors/reasons.d.ts.map +1 -1
- package/dist/errors/reasons.js +1 -0
- package/dist/errors/reasons.js.map +1 -1
- package/dist/files/atomic-write.d.ts +15 -0
- package/dist/files/atomic-write.d.ts.map +1 -0
- package/dist/files/atomic-write.js +35 -0
- package/dist/files/atomic-write.js.map +1 -0
- package/dist/files/index.d.ts +2 -0
- package/dist/files/index.d.ts.map +1 -1
- package/dist/files/index.js +2 -0
- package/dist/files/index.js.map +1 -1
- package/dist/files/lock.d.ts +14 -0
- package/dist/files/lock.d.ts.map +1 -0
- package/dist/files/lock.js +22 -0
- package/dist/files/lock.js.map +1 -0
- package/dist/files/native-lease-release.d.ts +3 -1
- package/dist/files/native-lease-release.d.ts.map +1 -1
- package/dist/files/native-lease-release.js +7 -3
- package/dist/files/native-lease-release.js.map +1 -1
- package/dist/kit/search-recipes.d.ts.map +1 -1
- package/dist/kit/search-recipes.js +5 -5
- package/dist/kit/search-recipes.js.map +1 -1
- package/dist/mcp/resources.js +1 -1
- package/dist/mcp/resources.js.map +1 -1
- package/dist/mcp/tools/chats.js +1 -1
- package/dist/mcp/tools/chats.js.map +1 -1
- package/dist/replies/dry-run.d.ts.map +1 -1
- package/dist/replies/dry-run.js +5 -5
- package/dist/replies/dry-run.js.map +1 -1
- package/dist/services/admin-statistics.js +6 -6
- package/dist/services/admin-statistics.js.map +1 -1
- package/dist/services/agenda.js +1 -1
- package/dist/services/agenda.js.map +1 -1
- package/dist/services/archive-gaps.js +4 -4
- package/dist/services/archive-gaps.js.map +1 -1
- package/dist/services/archive.d.ts.map +1 -1
- package/dist/services/archive.js +23 -23
- package/dist/services/archive.js.map +1 -1
- package/dist/services/attachments.d.ts.map +1 -1
- package/dist/services/attachments.js +21 -10
- package/dist/services/attachments.js.map +1 -1
- package/dist/services/chat-documents.js +2 -2
- package/dist/services/chat-documents.js.map +1 -1
- package/dist/services/chats.d.ts.map +1 -1
- package/dist/services/chats.js +24 -19
- package/dist/services/chats.js.map +1 -1
- package/dist/services/conversations.js +15 -15
- package/dist/services/conversations.js.map +1 -1
- package/dist/services/counters.d.ts.map +1 -1
- package/dist/services/counters.js +4 -4
- package/dist/services/counters.js.map +1 -1
- package/dist/services/embeddings-maintenance.d.ts.map +1 -1
- package/dist/services/embeddings-maintenance.js +13 -13
- package/dist/services/embeddings-maintenance.js.map +1 -1
- package/dist/services/embeddings-search.d.ts.map +1 -1
- package/dist/services/embeddings-search.js +16 -16
- package/dist/services/embeddings-search.js.map +1 -1
- package/dist/services/evidence-read.js +1 -1
- package/dist/services/evidence-read.js.map +1 -1
- package/dist/services/folders.js +1 -1
- package/dist/services/folders.js.map +1 -1
- package/dist/services/inbox.js +4 -4
- package/dist/services/inbox.js.map +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/mail-search.d.ts.map +1 -1
- package/dist/services/mail-search.js +15 -13
- package/dist/services/mail-search.js.map +1 -1
- package/dist/services/meeting-context.d.ts +4 -2
- package/dist/services/meeting-context.d.ts.map +1 -1
- package/dist/services/meeting-context.js +1 -1
- package/dist/services/meeting-context.js.map +1 -1
- package/dist/services/meeting-tasks.d.ts +4 -2
- package/dist/services/meeting-tasks.d.ts.map +1 -1
- package/dist/services/meeting-tasks.js +1 -1
- package/dist/services/meeting-tasks.js.map +1 -1
- package/dist/services/mentions.d.ts.map +1 -1
- package/dist/services/mentions.js +8 -8
- package/dist/services/mentions.js.map +1 -1
- package/dist/services/message-resolution.d.ts.map +1 -1
- package/dist/services/message-resolution.js +6 -6
- package/dist/services/message-resolution.js.map +1 -1
- package/dist/services/messages-archive-search.js +4 -4
- package/dist/services/messages-archive-search.js.map +1 -1
- package/dist/services/messages-combined.js +3 -3
- package/dist/services/messages-combined.js.map +1 -1
- package/dist/services/messages-discovery.js +2 -2
- package/dist/services/messages-discovery.js.map +1 -1
- package/dist/services/messages-search.d.ts.map +1 -1
- package/dist/services/messages-search.js +13 -13
- package/dist/services/messages-search.js.map +1 -1
- package/dist/services/messages.js +6 -6
- package/dist/services/messages.js.map +1 -1
- package/dist/services/metadata.js +9 -9
- package/dist/services/metadata.js.map +1 -1
- package/dist/services/notes-search.js +4 -4
- package/dist/services/notes-search.js.map +1 -1
- package/dist/services/people.d.ts.map +1 -1
- package/dist/services/people.js +18 -17
- package/dist/services/people.js.map +1 -1
- package/dist/services/person-context.js +16 -16
- package/dist/services/person-context.js.map +1 -1
- package/dist/services/person-meeting-context.d.ts +3 -2
- package/dist/services/person-meeting-context.d.ts.map +1 -1
- package/dist/services/person-meeting-context.js +3 -3
- package/dist/services/person-meeting-context.js.map +1 -1
- package/dist/services/person-profile.js +5 -5
- package/dist/services/person-profile.js.map +1 -1
- package/dist/services/person-timeline.js +2 -2
- package/dist/services/person-timeline.js.map +1 -1
- package/dist/services/pictures.d.ts.map +1 -1
- package/dist/services/pictures.js +9 -6
- package/dist/services/pictures.js.map +1 -1
- package/dist/services/private-people.d.ts.map +1 -1
- package/dist/services/private-people.js +7 -7
- package/dist/services/private-people.js.map +1 -1
- package/dist/services/rankings-selection.js +1 -1
- package/dist/services/rankings-selection.js.map +1 -1
- package/dist/services/rankings.js +7 -7
- package/dist/services/rankings.js.map +1 -1
- package/dist/services/retention.d.ts +3 -3
- package/dist/services/retention.js +2 -2
- package/dist/services/retention.js.map +1 -1
- package/dist/services/search-all-meetings.js +2 -2
- package/dist/services/search-all-meetings.js.map +1 -1
- package/dist/services/search-all.d.ts.map +1 -1
- package/dist/services/search-all.js +3 -1
- package/dist/services/search-all.js.map +1 -1
- package/dist/services/search-catchup.js +1 -1
- package/dist/services/search-catchup.js.map +1 -1
- package/dist/services/search-kind.js +4 -4
- package/dist/services/search-kind.js.map +1 -1
- package/dist/services/search-refresh.d.ts.map +1 -1
- package/dist/services/search-refresh.js +2 -2
- package/dist/services/search-refresh.js.map +1 -1
- package/dist/services/searches.js +7 -7
- package/dist/services/searches.js.map +1 -1
- package/dist/services/server-search.js +4 -4
- package/dist/services/server-search.js.map +1 -1
- package/dist/services/tags.d.ts.map +1 -1
- package/dist/services/tags.js +7 -4
- package/dist/services/tags.js.map +1 -1
- package/dist/services/task-rules.js +6 -6
- package/dist/services/task-rules.js.map +1 -1
- package/dist/services/tasks.js +2 -2
- package/dist/services/tasks.js.map +1 -1
- package/dist/services/thread-context.d.ts.map +1 -1
- package/dist/services/thread-context.js +5 -5
- package/dist/services/thread-context.js.map +1 -1
- package/dist/speech/hearing.d.ts.map +1 -1
- package/dist/speech/hearing.js +2 -2
- package/dist/speech/hearing.js.map +1 -1
- package/dist/store/account-store.d.ts +64 -17
- package/dist/store/account-store.d.ts.map +1 -1
- package/dist/store/account-store.js +75 -121
- package/dist/store/account-store.js.map +1 -1
- package/dist/store/accounts.d.ts +35 -0
- package/dist/store/accounts.d.ts.map +1 -0
- package/dist/store/accounts.js +47 -0
- package/dist/store/accounts.js.map +1 -0
- package/dist/store/attachments.d.ts +40 -0
- package/dist/store/attachments.d.ts.map +1 -0
- package/dist/store/attachments.js +50 -0
- package/dist/store/attachments.js.map +1 -0
- package/dist/store/chats.d.ts +47 -0
- package/dist/store/chats.d.ts.map +1 -0
- package/dist/store/chats.js +80 -0
- package/dist/store/chats.js.map +1 -0
- package/dist/store/conversations.d.ts +73 -0
- package/dist/store/conversations.d.ts.map +1 -0
- package/dist/store/conversations.js +118 -0
- package/dist/store/conversations.js.map +1 -0
- package/dist/store/counters.d.ts +25 -0
- package/dist/store/counters.d.ts.map +1 -0
- package/dist/store/counters.js +26 -0
- package/dist/store/counters.js.map +1 -0
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js.map +1 -1
- package/dist/store/keys.d.ts +16 -0
- package/dist/store/keys.d.ts.map +1 -0
- package/dist/store/keys.js +25 -0
- package/dist/store/keys.js.map +1 -0
- package/dist/store/mentions.d.ts +41 -0
- package/dist/store/mentions.d.ts.map +1 -0
- package/dist/store/mentions.js +39 -0
- package/dist/store/mentions.js.map +1 -0
- package/dist/store/messages.d.ts +116 -0
- package/dist/store/messages.d.ts.map +1 -0
- package/dist/store/messages.js +102 -0
- package/dist/store/messages.js.map +1 -0
- package/dist/store/people.d.ts +53 -0
- package/dist/store/people.d.ts.map +1 -0
- package/dist/store/people.js +65 -0
- package/dist/store/people.js.map +1 -0
- package/dist/store/queries.d.ts +22 -0
- package/dist/store/queries.d.ts.map +1 -0
- package/dist/store/queries.js +22 -0
- package/dist/store/queries.js.map +1 -0
- package/dist/store/roster.d.ts +38 -0
- package/dist/store/roster.d.ts.map +1 -0
- package/dist/store/roster.js +54 -0
- package/dist/store/roster.js.map +1 -0
- package/dist/store/search-index.d.ts +40 -0
- package/dist/store/search-index.d.ts.map +1 -0
- package/dist/store/search-index.js +19 -0
- package/dist/store/search-index.js.map +1 -0
- package/dist/store/searches.d.ts +22 -0
- package/dist/store/searches.d.ts.map +1 -0
- package/dist/store/searches.js +25 -0
- package/dist/store/searches.js.map +1 -0
- package/dist/store/sqlite/accounts.d.ts +1 -1
- package/dist/store/sqlite/admin-statistics.d.ts +1 -1
- package/dist/store/sqlite/batches.d.ts +1 -1
- package/dist/store/sqlite/bot-updates.d.ts +1 -1
- package/dist/store/sqlite/chats.d.ts +1 -1
- package/dist/store/sqlite/conversation-eligibility.d.ts +1 -1
- package/dist/store/sqlite/conversations.d.ts +1 -1
- package/dist/store/sqlite/emails.d.ts +1 -1
- package/dist/store/sqlite/emails.d.ts.map +1 -1
- package/dist/store/sqlite/emails.js +5 -2
- package/dist/store/sqlite/emails.js.map +1 -1
- package/dist/store/sqlite/identities.d.ts +1 -1
- package/dist/store/sqlite/knowledge.d.ts +1 -1
- package/dist/store/sqlite/lucene-fields.d.ts +66 -0
- package/dist/store/sqlite/lucene-fields.d.ts.map +1 -0
- package/dist/store/sqlite/lucene-fields.js +360 -0
- package/dist/store/sqlite/lucene-fields.js.map +1 -0
- package/dist/store/sqlite/lucene.d.ts +2 -13
- package/dist/store/sqlite/lucene.d.ts.map +1 -1
- package/dist/store/sqlite/lucene.js +27 -329
- package/dist/store/sqlite/lucene.js.map +1 -1
- package/dist/store/sqlite/meeting-projects.d.ts +1 -1
- package/dist/store/sqlite/messages.d.ts +1 -1
- package/dist/store/sqlite/person-links.d.ts +1 -1
- package/dist/store/sqlite/private-people.d.ts +1 -1
- package/dist/store/sqlite/proposed-actions.d.ts +1 -1
- package/dist/store/sqlite/ranges.d.ts +1 -1
- package/dist/store/sqlite/ranking-evidence.d.ts +1 -1
- package/dist/store/sqlite/reads.d.ts +1 -1
- package/dist/store/sqlite/search.d.ts +1 -1
- package/dist/store/sqlite/tags.d.ts +1 -1
- package/dist/store/sqlite/task-rule-stops.d.ts +1 -1
- package/dist/store/sqlite/words.d.ts +1 -1
- package/dist/store/store.d.ts +62 -828
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +105 -836
- package/dist/store/store.js.map +1 -1
- package/dist/store/sync.d.ts +36 -0
- package/dist/store/sync.d.ts.map +1 -0
- package/dist/store/sync.js +59 -0
- package/dist/store/sync.js.map +1 -0
- package/dist/store/tags.d.ts +13 -0
- package/dist/store/tags.d.ts.map +1 -0
- package/dist/store/tags.js +23 -0
- package/dist/store/tags.js.map +1 -0
- package/dist/store/types.d.ts +247 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +2 -0
- package/dist/store/types.js.map +1 -0
- package/dist/store/vectors.d.ts +109 -0
- package/dist/store/vectors.d.ts.map +1 -0
- package/dist/store/vectors.js +221 -0
- package/dist/store/vectors.js.map +1 -0
- package/dist/update/index.d.ts +52 -0
- package/dist/update/index.d.ts.map +1 -0
- package/dist/update/index.js +68 -0
- package/dist/update/index.js.map +1 -0
- package/package.json +5 -1
package/dist/store/store.d.ts
CHANGED
|
@@ -1,694 +1,65 @@
|
|
|
1
|
-
import type { QueryAst } from "@wirecat/cli-base/query";
|
|
2
|
-
import type { TextRange } from "../conversations/chunks.js";
|
|
3
|
-
import type { Link, LinkInput } from "../conversations/link.js";
|
|
4
|
-
import type { DownloadedFile } from "../domain/attachments.js";
|
|
5
|
-
import type { ChannelTagMatch } from "../domain/channel-tags.js";
|
|
6
|
-
import type { CounterObservations, CounterState } from "../domain/counters.js";
|
|
7
|
-
import type { Decider, MentionKind } from "../domain/mentions.js";
|
|
8
|
-
import type { Chat, ChatKind, Contact, Id, Member, Message, MessageHit, Page, PersonAlias, Provider, Reactions, WindowedMessage } from "../domain/models.js";
|
|
9
|
-
import type { RetentionOptions } from "../domain/retention.js";
|
|
10
|
-
import type { PeopleLookup } from "../resolve.js";
|
|
11
|
-
import { type AccountGroups, type Profiles } from "../search/account-list.js";
|
|
12
|
-
import type { QueryExecution } from "../search/lucene/resolved.js";
|
|
13
|
-
import type { Stemmers } from "../search/stem.js";
|
|
14
1
|
import { type AccountStore } from "./account-store.js";
|
|
15
|
-
import { type
|
|
2
|
+
import { type AccountsStore } from "./accounts.js";
|
|
3
|
+
import { type AttachmentsStore } from "./attachments.js";
|
|
4
|
+
import { type ChatsStore } from "./chats.js";
|
|
5
|
+
import { type ConversationsStore } from "./conversations.js";
|
|
6
|
+
import { type CountersStore } from "./counters.js";
|
|
7
|
+
import { type MentionsStore } from "./mentions.js";
|
|
8
|
+
import { type MessagesStore } from "./messages.js";
|
|
9
|
+
import { type PeopleStore } from "./people.js";
|
|
10
|
+
import { type QueriesStore } from "./queries.js";
|
|
11
|
+
import { type RosterStore } from "./roster.js";
|
|
12
|
+
import { type SearchIndexStore } from "./search-index.js";
|
|
13
|
+
import { type SearchesStore } from "./searches.js";
|
|
16
14
|
import { type AgentActionsStore } from "./sqlite/agent-actions.js";
|
|
17
|
-
import type { AttachmentTextEntry, AttachmentView, FileAttachment } from "./sqlite/attachment-texts.js";
|
|
18
15
|
import { type BotUpdateStore } from "./sqlite/bot-updates.js";
|
|
19
16
|
import { type CatalogStore } from "./sqlite/catalog.js";
|
|
20
|
-
import type { ChatMetadata } from "./sqlite/chats.js";
|
|
21
|
-
import type { ChatCompleteness } from "./sqlite/completeness.js";
|
|
22
|
-
import { type ConversationEligibility } from "./sqlite/conversation-eligibility.js";
|
|
23
|
-
import { type CounterTarget } from "./sqlite/counters.js";
|
|
24
|
-
import { type DocumentLinkMessage } from "./sqlite/document-links.js";
|
|
25
17
|
import { type MailStore } from "./sqlite/emails.js";
|
|
26
18
|
import { type FactsStore } from "./sqlite/facts.js";
|
|
27
|
-
import type { ContactFilter } from "./sqlite/identities.js";
|
|
28
|
-
import * as imageChunks from "./sqlite/image-chunks.js";
|
|
29
19
|
import { type InvolvementStore } from "./sqlite/involvements.js";
|
|
30
20
|
import { type KnowledgeStore } from "./sqlite/knowledge.js";
|
|
31
|
-
import type { QueryGroup, QueryGrouping } from "./sqlite/lucene.js";
|
|
32
21
|
import { type MeetingVectors } from "./sqlite/meeting-vectors.js";
|
|
33
22
|
import { type StoredMeetings } from "./sqlite/meetings.js";
|
|
34
23
|
import { type MemoriesStore } from "./sqlite/memories.js";
|
|
35
24
|
import { type SourceMentionStore } from "./sqlite/mention-sources.js";
|
|
36
|
-
import { type MentionDecision, type MentionsRebuild, type MentionsState, type StoredMention } from "./sqlite/mentions.js";
|
|
37
25
|
import { type NotesStore } from "./sqlite/notes.js";
|
|
38
|
-
import type { PrivateContact, PrivateContactNote } from "./sqlite/private-people.js";
|
|
39
26
|
import { type ProposedActionsStore } from "./sqlite/proposed-actions.js";
|
|
40
|
-
import type { Where } from "./sqlite/query-filter.js";
|
|
41
|
-
import { type RankedEvidence, type RankingEvidenceRequest } from "./sqlite/ranking-evidence.js";
|
|
42
|
-
import { type RankedStoreFound, type RankingRequest } from "./sqlite/rankings.js";
|
|
43
|
-
import { type RetentionResult } from "./sqlite/retention.js";
|
|
44
|
-
import type { MemberCount, MemberStay, ProfileRevision, RosterChange, RosterRead, TrackedChat } from "./sqlite/roster.js";
|
|
45
|
-
import type { SearchIndexFill, SearchIndexState } from "./sqlite/search-index.js";
|
|
46
|
-
import type { SearchRecord, StoredSearch } from "./sqlite/searches.js";
|
|
47
|
-
import type { StemsFill, StemsState } from "./sqlite/stems.js";
|
|
48
|
-
import type { AnyTagTarget, StoredTag, TagFilter } from "./sqlite/tags.js";
|
|
49
27
|
import { type StoreTaskStore } from "./sqlite/tasks.js";
|
|
50
|
-
import type
|
|
51
|
-
import type
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
export interface AccountKey {
|
|
55
|
-
provider: Provider;
|
|
56
|
-
account: Id;
|
|
57
|
-
scope?: "personal" | "work";
|
|
58
|
-
}
|
|
59
|
-
/** An account as the store holds it: `id` is what `meetings` and `mail` take. */
|
|
60
|
-
export interface StoredAccount {
|
|
61
|
-
id: number;
|
|
62
|
-
provider: Provider;
|
|
63
|
-
account: Id;
|
|
64
|
-
name: string | null;
|
|
65
|
-
scope: "personal" | "work";
|
|
66
|
-
}
|
|
67
|
-
/** Whether a stored chat may hold a message deleted without naming its chat. */
|
|
68
|
-
export type DeletionScope = (chat: Pick<Chat, "id" | "kind" | "providerMetadata">) => boolean;
|
|
69
|
-
/** How a message reached the store — `history`, `send`, `backfill`, `update`. Diagnostic. */
|
|
70
|
-
export type IngestedVia = string;
|
|
71
|
-
export interface StoredHit extends MessageHit {
|
|
72
|
-
locator: string;
|
|
73
|
-
}
|
|
74
|
-
/** What a provider says about a person. `null` or absent never erases what was known. */
|
|
75
|
-
export interface PersonFacts {
|
|
76
|
-
id: Id;
|
|
77
|
-
name: string | null;
|
|
78
|
-
username?: string | null;
|
|
79
|
-
isBot?: boolean | null;
|
|
80
|
-
description?: string | null;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Which messages `find` returns. At least `text` or `senders`.
|
|
84
|
-
*
|
|
85
|
-
* `together` keeps only the chats where **every** sender has a message in this store — written
|
|
86
|
-
* there, as far as this copy knows, which is not the same as being a member.
|
|
87
|
-
*/
|
|
88
|
-
/** One identity in one messenger, by the messenger's own id. `provider` is any string: `email` is one. */
|
|
89
|
-
export interface IdentityRef {
|
|
90
|
-
provider: Provider;
|
|
91
|
-
id: Id;
|
|
92
|
-
}
|
|
93
|
-
/** How a link was decided (`manual`, `same-email`) and who decided it (`owner`, a program's name). */
|
|
94
|
-
export interface LinkOptions {
|
|
95
|
-
method: string;
|
|
96
|
-
by: string;
|
|
97
|
-
}
|
|
98
|
-
export interface LinkedIdentity extends IdentityRef {
|
|
99
|
-
name: string | null;
|
|
100
|
-
username: string | null;
|
|
101
|
-
isBot: boolean | null;
|
|
102
|
-
/** The accounts in this store that have seen it. */
|
|
103
|
-
accounts: Id[];
|
|
104
|
-
method: string;
|
|
105
|
-
linkedBy: string;
|
|
106
|
-
linkedAt: string;
|
|
107
|
-
}
|
|
108
|
-
/** A person across messengers: `uid` stays the same however their names change. */
|
|
109
|
-
export interface PersonRecord {
|
|
110
|
-
uid: string;
|
|
111
|
-
name: string | null;
|
|
112
|
-
identities: LinkedIdentity[];
|
|
113
|
-
}
|
|
114
|
-
/** What a search of one account's messages takes, the account given apart. */
|
|
115
|
-
export interface AccountMessageFilter {
|
|
116
|
-
senders?: Id[];
|
|
117
|
-
together?: boolean;
|
|
118
|
-
text?: string;
|
|
119
|
-
/** Only this chat of the account. */
|
|
120
|
-
chatId?: Id;
|
|
121
|
-
/** With `perChat`, the newest `limit` of each chat rather than of all of them together. */
|
|
122
|
-
limit: number;
|
|
123
|
-
perChat?: boolean;
|
|
124
|
-
}
|
|
125
|
-
/** A chat id is one account's, so `chatId` comes only with `account`. */
|
|
126
|
-
export type MessageFilter = AccountMessageFilter & {
|
|
127
|
-
provider?: Provider;
|
|
128
|
-
/** Several accounts of `provider`, by native id — a read across some of them, never all by accident. */
|
|
129
|
-
accounts?: Id[];
|
|
130
|
-
} & ({
|
|
131
|
-
account: AccountKey;
|
|
132
|
-
} | {
|
|
133
|
-
account?: undefined;
|
|
134
|
-
chatId?: undefined;
|
|
135
|
-
});
|
|
136
|
-
export interface Delta {
|
|
137
|
-
chats?: Chat[];
|
|
138
|
-
people?: PersonFacts[];
|
|
139
|
-
members?: Map<Id, Id[]>;
|
|
140
|
-
state?: Record<string, string>;
|
|
141
|
-
}
|
|
142
|
-
/** A chat list's query, compiled over `CHAT_COLUMNS`. */
|
|
143
|
-
export interface StoredChatFilter {
|
|
144
|
-
where?: Where;
|
|
145
|
-
}
|
|
28
|
+
import { type SyncStore } from "./sync.js";
|
|
29
|
+
import { type TagsStore } from "./tags.js";
|
|
30
|
+
import type { AccountKey } from "./types.js";
|
|
31
|
+
import { type VectorsStore } from "./vectors.js";
|
|
146
32
|
export interface MessageStore {
|
|
147
|
-
/**
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
memberStays(key: AccountKey, chatId: Id, options?: {
|
|
178
|
-
since?: string;
|
|
179
|
-
}): Promise<MemberStay[]>;
|
|
180
|
-
/** One row a day, oldest first; from `since` (`YYYY-MM-DD`) when given. */
|
|
181
|
-
memberCounts(key: AccountKey, chatId: Id, options?: {
|
|
182
|
-
since?: string;
|
|
183
|
-
}): Promise<MemberCount[]>;
|
|
184
|
-
/** Every profile the chat's members were seen with, oldest first. */
|
|
185
|
-
profileRevisions(key: AccountKey, chatId: Id, options?: {
|
|
186
|
-
since?: string;
|
|
187
|
-
}): Promise<ProfileRevision[]>;
|
|
188
|
-
/** Starts or stops `serve`'s daily fetch of the chat's members; history already kept stays. */
|
|
189
|
-
trackMembers(key: AccountKey, chatId: Id, tracked: boolean): Promise<void>;
|
|
190
|
-
trackedChats(key: AccountKey): Promise<TrackedChat[]>;
|
|
191
|
-
/** The chats a person is in, newest first — as far as the saved member lists go. */
|
|
192
|
-
chatsWith(key: AccountKey, memberId: Id): Promise<Chat[]>;
|
|
193
|
-
/** What a sync remembered under `name` for this account, and when; a caller encodes a number itself. */
|
|
194
|
-
syncState(key: AccountKey, name: string): Promise<{
|
|
195
|
-
value: string;
|
|
196
|
-
at: string;
|
|
197
|
-
} | undefined>;
|
|
198
|
-
setSyncState(key: AccountKey, name: string, value: string): Promise<void>;
|
|
199
|
-
clearSyncState(key: AccountKey, name: string): Promise<void>;
|
|
200
|
-
/**
|
|
201
|
-
* A catch-up's whole answer in one transaction, so a reader never sees half of it: chats, people,
|
|
202
|
-
* each listed chat's members (replaced whole) and sync state such as a delta marker.
|
|
203
|
-
*/
|
|
204
|
-
applyDelta(key: AccountKey, delta: Delta): Promise<void>;
|
|
205
|
-
/**
|
|
206
|
-
* Takes the stretch of a chat at `anchor` for `forMs`; answers whether `holder` has it. Refused
|
|
207
|
-
* while another holder's lease runs; the same holder renews its own.
|
|
208
|
-
*/
|
|
209
|
-
claim(key: AccountKey, chatId: Id, anchor: string, holder: string, forMs: number): Promise<boolean>;
|
|
210
|
-
/** Gives the stretch back, if `holder` still has it. */
|
|
211
|
-
release(key: AccountKey, chatId: Id, anchor: string, holder: string): Promise<void>;
|
|
212
|
-
/** What a voice message said, when it was heard before, and by what. */
|
|
213
|
-
transcript(key: AccountKey, chatId: Id, messageId: Id): Promise<{
|
|
214
|
-
text: string;
|
|
215
|
-
source: string;
|
|
216
|
-
} | undefined>;
|
|
217
|
-
/** Keeps a finished transcript; an empty one is not kept, so the message is heard again. */
|
|
218
|
-
keepTranscript(key: AccountKey, chatId: Id, messageId: Id, text: string, source: string): Promise<void>;
|
|
219
|
-
/**
|
|
220
|
-
* Where `messages download` saved a held message's files, for reading them later. Answers how many
|
|
221
|
-
* attachments it recorded: a file it cannot tell apart from another is not recorded.
|
|
222
|
-
*/
|
|
223
|
-
keepDownloads(key: AccountKey, chatId: Id, messageId: Id, files: readonly DownloadedFile[]): Promise<number>;
|
|
224
|
-
/** File attachments of this account's live messages, newest first, below `beforePk`; never one an agent wrote. */
|
|
225
|
-
fileAttachments(key: AccountKey, page: {
|
|
226
|
-
chatId?: Id;
|
|
227
|
-
messageId?: Id;
|
|
228
|
-
beforePk?: number;
|
|
229
|
-
limit: number;
|
|
230
|
-
}): Promise<FileAttachment[]>;
|
|
231
|
-
/**
|
|
232
|
-
* File attachments of live messages and what is held of their text, newest first; never the text. `where` is a
|
|
233
|
-
* list query compiled over `attachmentColumns`.
|
|
234
|
-
*/
|
|
235
|
-
attachments(key: AccountKey, filter: {
|
|
236
|
-
chatId?: Id;
|
|
237
|
-
messageId?: Id;
|
|
238
|
-
where?: Where;
|
|
239
|
-
offset?: number;
|
|
240
|
-
limit: number;
|
|
241
|
-
}): Promise<AttachmentView[]>;
|
|
242
|
-
/** Where the file of one attachment was saved, when that is recorded. */
|
|
243
|
-
localPathOf(attachmentPk: number): Promise<string | null>;
|
|
244
|
-
/** An extraction never replaces an agent's text; answers whether it was kept. */
|
|
245
|
-
keepAttachmentText(attachmentPk: number, entry: AttachmentTextEntry): Promise<boolean>;
|
|
246
|
-
/** A chat's live messages for the conversation rules, oldest first; pass `next` back as `after`. */
|
|
247
|
-
linkInputs(key: AccountKey, chatId: Id, page: {
|
|
248
|
-
after?: string;
|
|
249
|
-
limit: number;
|
|
250
|
-
}): Promise<{
|
|
251
|
-
items: LinkInput[];
|
|
252
|
-
next: string | null;
|
|
253
|
-
}>;
|
|
254
|
-
/** Who wrote in the chat, by lowercased username: what an `@mention` names. */
|
|
255
|
-
senderHandles(key: AccountKey, chatId: Id): Promise<Map<string, Id>>;
|
|
256
|
-
/**
|
|
257
|
-
* The chat's provider and rule links and its conversations, rebuilt: written as a new build in short
|
|
258
|
-
* transactions and made current in one, so readers never see half of it and a failed build changes nothing.
|
|
259
|
-
*/
|
|
260
|
-
replaceConversations(key: AccountKey, chatId: Id, build: ConversationBuild): Promise<void>;
|
|
261
|
-
/** Newest first; `where` is a list query compiled over `CONVERSATION_COLUMNS`. */
|
|
262
|
-
conversations(key: AccountKey, chatId: Id, window: {
|
|
263
|
-
limit: number;
|
|
264
|
-
offset?: number;
|
|
265
|
-
where?: Where;
|
|
266
|
-
}): Promise<Page<ConversationSummary>>;
|
|
267
|
-
/** Its messages oldest first; `undefined` when the account has no such conversation. */
|
|
268
|
-
conversation(key: AccountKey, id: string): Promise<{
|
|
269
|
-
summary: ConversationSummary;
|
|
270
|
-
messages: Message[];
|
|
271
|
-
} | undefined>;
|
|
272
|
-
/** Which conversation a message is in, once the chat is built. */
|
|
273
|
-
conversationOf(key: AccountKey, chatId: Id, messageId: Id): Promise<string | undefined>;
|
|
274
|
-
/** The conversation of the current build each message is in, in the same order; `undefined` where none. */
|
|
275
|
-
conversationsOfMessages(key: AccountKey, refs: {
|
|
276
|
-
chatId: Id;
|
|
277
|
-
messageId: Id;
|
|
278
|
-
}[]): Promise<(ConversationSummary | undefined)[]>;
|
|
279
|
-
/** Every link a message has, the messenger's first. */
|
|
280
|
-
links(key: AccountKey, chatId: Id, messageId: Id, options?: {
|
|
281
|
-
limit: number;
|
|
282
|
-
}): Promise<StoredLink[]>;
|
|
283
|
-
replies(key: AccountKey, chatId: Id, messageId: Id, limit: number): Promise<Page<{
|
|
284
|
-
messageId: Id;
|
|
285
|
-
}>>;
|
|
286
|
-
/** The user's agent's current answer per message: its parent, or `null` for "starts a conversation". */
|
|
287
|
-
agentAnswers(key: AccountKey, chatId: Id): Promise<Map<Id, Id | null>>;
|
|
288
|
-
/** Stores the agent's answer to a batch, checked whole first; answers how many were stored (A5). */
|
|
289
|
-
saveAnswers(key: AccountKey, batch: string, answer: AgentAnswer): Promise<{
|
|
290
|
-
chat: Id;
|
|
291
|
-
stored: number;
|
|
292
|
-
}>;
|
|
293
|
-
/** Drops the agent's answers for a chat, or one model's; answers how many. Messages are never touched. */
|
|
294
|
-
clearAnswers(key: AccountKey, chatId: Id, model?: string): Promise<number>;
|
|
295
|
-
/** How many messages still need the user's agent, and their characters (phase 4). */
|
|
296
|
-
batchStatus(key: AccountKey, chatId: Id): Promise<{
|
|
297
|
-
messages: number;
|
|
298
|
-
characters: number;
|
|
299
|
-
}>;
|
|
300
|
-
/** The earliest window holding a message the agent has not answered; `undefined` when none is left. */
|
|
301
|
-
nextBatch(key: AccountKey, chatId: Id, options: {
|
|
302
|
-
size: number;
|
|
303
|
-
}): Promise<LinkBatch | undefined>;
|
|
304
|
-
/** Chunks of the chat's current build with no vector of `model`, by hash after `after` (phase 5). */
|
|
305
|
-
chunksToEmbed(key: AccountKey, chatId: Id, model: string, options: {
|
|
306
|
-
after?: string;
|
|
307
|
-
limit: number;
|
|
308
|
-
}): Promise<ChunkToEmbed[]>;
|
|
309
|
-
saveVectors(model: string, dims: number, vectors: {
|
|
310
|
-
hash: string;
|
|
311
|
-
vector: Float32Array;
|
|
312
|
-
}[]): Promise<void>;
|
|
313
|
-
/** The chat's live image attachments with the messages around each, and the chunk each already has. */
|
|
314
|
-
imagesToDescribe(key: AccountKey, chatId: Id, window: {
|
|
315
|
-
messages: number;
|
|
316
|
-
withinMs: number;
|
|
317
|
-
}): Promise<imageChunks.ImageInput[]>;
|
|
318
|
-
/** Makes these the chunks of their images, and drops the chat's image chunks not in `keep` (attachment pks). */
|
|
319
|
-
saveImageChunks(key: AccountKey, chatId: Id, chunks: imageChunks.ImageChunk[], keep: number[]): Promise<void>;
|
|
320
|
-
/** Which of these chunk hashes already have a vector of `model`. */
|
|
321
|
-
embeddedHashes(model: string, hashes: string[]): Promise<Set<string>>;
|
|
322
|
-
/** The images nearest in meaning to `query` by the text around them, as their message in its conversation. */
|
|
323
|
-
nearestImages(key: AccountKey, options: {
|
|
324
|
-
chatId?: Id;
|
|
325
|
-
model: string;
|
|
326
|
-
since?: string;
|
|
327
|
-
limit: number;
|
|
328
|
-
query: Float32Array;
|
|
329
|
-
}): Promise<ConversationHit[]>;
|
|
330
|
-
/** Live image attachments with no picture vector yet, in attachment order after `after`; `chatId` narrows it. */
|
|
331
|
-
picturesToEmbed(key: AccountKey, options: {
|
|
332
|
-
chatId?: Id;
|
|
333
|
-
after?: number;
|
|
334
|
-
limit: number;
|
|
335
|
-
}): Promise<PictureInput[]>;
|
|
336
|
-
/** Keeps each picture's vector of `model` and makes its hash the image's picture chunk. */
|
|
337
|
-
savePictures(key: AccountKey, model: string, dims: number, pictures: {
|
|
338
|
-
attachmentPk: number;
|
|
339
|
-
hash: string;
|
|
340
|
-
bytes: number;
|
|
341
|
-
occurredAt: number;
|
|
342
|
-
vector: Float32Array;
|
|
343
|
-
}[]): Promise<void>;
|
|
344
|
-
/** The images nearest to `query` by their picture vector of `model`, best first, as their message. */
|
|
345
|
-
nearestPictures(key: AccountKey, options: {
|
|
346
|
-
chatId?: Id;
|
|
347
|
-
model: string;
|
|
348
|
-
since?: string;
|
|
349
|
-
limit: number;
|
|
350
|
-
query: Float32Array;
|
|
351
|
-
}): Promise<{
|
|
352
|
-
chatId: Id;
|
|
353
|
-
messageId: Id;
|
|
354
|
-
score: number;
|
|
355
|
-
}[]>;
|
|
356
|
-
/** The current build's distinct chunks, and how many have a vector of `model`. */
|
|
357
|
-
vectorStatus(key: AccountKey, chatId: Id, model: string): Promise<{
|
|
358
|
-
chunks: number;
|
|
359
|
-
embedded: number;
|
|
360
|
-
}>;
|
|
361
|
-
/** Drops the chat's vectors, or one model's; a vector another chat's chunk shares stays. */
|
|
362
|
-
clearVectors(key: AccountKey, chatId: Id, model?: string): Promise<number>;
|
|
363
|
-
/** The conversations nearest in meaning to `query`, in one chat or every one of the account, best first. */
|
|
364
|
-
nearestConversations(key: AccountKey, options: {
|
|
365
|
-
chatId?: Id;
|
|
366
|
-
model: string;
|
|
367
|
-
since?: string;
|
|
368
|
-
limit: number;
|
|
369
|
-
query: Float32Array;
|
|
370
|
-
exclude?: string;
|
|
371
|
-
conversations?: string[];
|
|
372
|
-
scope?: "personal" | "work";
|
|
373
|
-
projectId?: string;
|
|
374
|
-
personId?: string;
|
|
375
|
-
before?: string;
|
|
376
|
-
}): Promise<ConversationHit[]>;
|
|
377
|
-
/**
|
|
378
|
-
* A conversation of the current build: how many chunks it has, and the vectors of `model` of those whose
|
|
379
|
-
* messages did not change since — none when it is not the account's or not current.
|
|
380
|
-
*/
|
|
381
|
-
conversationVectors(key: AccountKey, id: string, model: string): Promise<{
|
|
382
|
-
chunks: number;
|
|
383
|
-
vectors: Float32Array[];
|
|
384
|
-
}>;
|
|
385
|
-
/**
|
|
386
|
-
* How fresh each built chat's conversations and `model`'s vectors are — one chat, or every chat whose
|
|
387
|
-
* conversations were ever built. A chat never built answers `builtAt: null`.
|
|
388
|
-
*/
|
|
389
|
-
readiness(key: AccountKey, options: {
|
|
390
|
-
chatId?: Id;
|
|
391
|
-
model: string;
|
|
392
|
-
}): Promise<StoredReadiness[]>;
|
|
393
|
-
/** Group chats with stored messages whose conversations were never built, the newest message first. */
|
|
394
|
-
unbuiltGroups(key: AccountKey): Promise<Id[]>;
|
|
395
|
-
/** Chats in scope embedded with another model and not with `model`, which a search with it cannot see. */
|
|
396
|
-
embeddedOnlyElsewhere(key: AccountKey, options: {
|
|
397
|
-
chatId?: Id;
|
|
398
|
-
model: string;
|
|
399
|
-
}): Promise<Id[]>;
|
|
400
|
-
/** Whether the chat's conversations were built, and when; `undefined` when never. */
|
|
401
|
-
conversationState(key: AccountKey, chatId: Id): Promise<{
|
|
402
|
-
enabledAt: string;
|
|
403
|
-
builtAt: string | null;
|
|
404
|
-
algorithmVersion: number | null;
|
|
405
|
-
} | undefined>;
|
|
406
|
-
/** Oldest to newest, like a provider's history page. */
|
|
407
|
-
/** `threadId` keeps one forum topic's; `outgoing` only the owner's (true) or only the others' (false). */
|
|
408
|
-
messages(key: AccountKey, chatId: Id, window: {
|
|
409
|
-
limit: number;
|
|
410
|
-
before?: Id;
|
|
411
|
-
since?: string;
|
|
412
|
-
threadId?: Id;
|
|
413
|
-
outgoing?: boolean;
|
|
414
|
-
}): Promise<Page<Message>>;
|
|
415
|
-
/** How many stored messages the chat has, sent at `since` or later when it is given. */
|
|
416
|
-
countMessages(key: AccountKey, chatId: Id, options?: {
|
|
417
|
-
since?: string;
|
|
418
|
-
}): Promise<number>;
|
|
419
|
-
/** The chat's messages that may hold a Google document link, newest first, with the documents linked from each. */
|
|
420
|
-
documentLinkMessages(key: AccountKey, chatId: Id): Promise<DocumentLinkMessage[]>;
|
|
421
|
-
/** The account's phones, e-mail addresses, links and documents that match the query, newest message first. */
|
|
422
|
-
mentions(key: AccountKey, query: QueryAst | undefined, window: {
|
|
423
|
-
limit?: number;
|
|
424
|
-
offset: number;
|
|
425
|
-
foundAfter?: number;
|
|
426
|
-
}): Promise<{
|
|
427
|
-
items: StoredMention[];
|
|
428
|
-
hasMore: boolean;
|
|
429
|
-
}>;
|
|
430
|
-
/** One mention of the account, with the text around it; `undefined` for another account's or a missing id. */
|
|
431
|
-
mention(key: AccountKey, id: number): Promise<(StoredMention & {
|
|
432
|
-
before: string;
|
|
433
|
-
after: string;
|
|
434
|
-
sameValue: number;
|
|
435
|
-
candidates: string[];
|
|
436
|
-
}) | undefined>;
|
|
437
|
-
/**
|
|
438
|
-
* Says what a mention's value is, everywhere it is written: a phone or an address belongs to its owner
|
|
439
|
-
* (`person:<uid>` or `organization:<id>`), a document id names the stored document.
|
|
440
|
-
*/
|
|
441
|
-
confirmMention(key: AccountKey, id: number, owner: string | undefined, by: Decider): Promise<MentionDecision>;
|
|
442
|
-
/** Dismisses a mention's value everywhere it is written, and on later syncs. */
|
|
443
|
-
rejectMention(key: AccountKey, id: number, by: Decider): Promise<MentionDecision>;
|
|
444
|
-
/** Finds the mentions of every stored message again, every account's; decisions stay. */
|
|
445
|
-
rebuildMentions(options?: {
|
|
446
|
-
kinds?: readonly MentionKind[];
|
|
447
|
-
onBatch?: (done: number, total: number) => void;
|
|
448
|
-
}): Promise<MentionsRebuild>;
|
|
449
|
-
mentionsState(): Promise<MentionsState>;
|
|
450
|
-
/** Where the account's last task-rule pass stopped: the newest store time it read. */
|
|
451
|
-
taskRulesStop(key: AccountKey): Promise<string | null>;
|
|
452
|
-
setTaskRulesStop(key: AccountKey, until: string): Promise<void>;
|
|
453
|
-
/** Saved or edited after `at` (ISO, this machine's clock), oldest first, and the ids deleted after it. */
|
|
454
|
-
changes(key: AccountKey, chatId: Id, at: string): Promise<{
|
|
455
|
-
messages: Message[];
|
|
456
|
-
deleted: Id[];
|
|
457
|
-
}>;
|
|
458
|
-
/**
|
|
459
|
-
* By time rather than by id: `before` messages sent at `at` or earlier and `after` sent later,
|
|
460
|
-
* oldest first. `around` answers the same question for a message id.
|
|
461
|
-
*/
|
|
462
|
-
messagesWindow(key: AccountKey, chatId: Id, window: {
|
|
463
|
-
at: string;
|
|
464
|
-
before: number;
|
|
465
|
-
after: number;
|
|
466
|
-
}): Promise<Message[]>;
|
|
467
|
-
/**
|
|
468
|
-
* A stored message and its stored neighbours, oldest first, the one asked for with `anchor`. Until
|
|
469
|
-
* backfill records which stretches are complete, a neighbour here is the nearest one kept, not
|
|
470
|
-
* necessarily the next one sent.
|
|
471
|
-
*/
|
|
472
|
-
around(key: AccountKey, chatId: Id, messageId: Id, window: {
|
|
473
|
-
before: number;
|
|
474
|
-
after: number;
|
|
475
|
-
}): Promise<WindowedMessage[]>;
|
|
476
|
-
/**
|
|
477
|
-
* One message by its id. Without `chatId` it is looked up across the account, which is enough
|
|
478
|
-
* where ids are unique per account (MAX) and refused where two chats share one (Telegram).
|
|
479
|
-
*/
|
|
480
|
-
message(key: AccountKey, messageId: Id, options?: {
|
|
481
|
-
chatId?: Id;
|
|
482
|
-
}): Promise<Message | undefined>;
|
|
483
|
-
/**
|
|
484
|
-
* Everything one account holds — its chats, messages, members, state, leases, transcripts and whom
|
|
485
|
-
* it has seen — for `cache clear`. Other accounts, and identities they share, stay.
|
|
486
|
-
*/
|
|
487
|
-
purge(key: AccountKey): Promise<void>;
|
|
488
|
-
/**
|
|
489
|
-
* Given every chat the account is in, marks the rest `left` and says how many it marked. Only
|
|
490
|
-
* ever from a complete list: a page or a cut list says nothing about the chats it leaves out.
|
|
491
|
-
* Remembers when, so a search can say the store knows the account's whole chat list.
|
|
492
|
-
*/
|
|
493
|
-
markChatsLeft(key: AccountKey, present: Id[]): Promise<number>;
|
|
494
|
-
/** The chats marked left and the messages they hold; with `clear`, deletes them and all under them. */
|
|
495
|
-
leftChats(key: AccountKey, options?: {
|
|
496
|
-
clear?: boolean;
|
|
497
|
-
}): Promise<{
|
|
498
|
-
chats: number;
|
|
499
|
-
messages: number;
|
|
500
|
-
}>;
|
|
501
|
-
/**
|
|
502
|
-
* A tombstone, not a removal: the row stays, so a copy fetched before the deletion does not bring
|
|
503
|
-
* the message back, and reads and search stop returning it. Its text goes — from the row, the
|
|
504
|
-
* search copy, the edit history and the transcript. Only the messenger returning it again, when
|
|
505
|
-
* asked after the deletion, lifts the tombstone (`saveMessages`' `seenAt`).
|
|
506
|
-
*
|
|
507
|
-
* Without `chatId`, a message is tombstoned only when exactly one live message with its id is left
|
|
508
|
-
* in the chats `among` accepts. Without `among`, nothing is: only the messenger knows which of its
|
|
509
|
-
* chats a deletion without one may belong to (`Messenger.deletedWithoutChat`).
|
|
510
|
-
*/
|
|
511
|
-
markDeleted(key: AccountKey, messageIds: Id[], options?: {
|
|
512
|
-
chatId?: Id;
|
|
513
|
-
among?: DeletionScope;
|
|
514
|
-
}): Promise<number>;
|
|
515
|
-
/** Newest first. At least three characters: a trigram index answers a shorter query with nothing. */
|
|
516
|
-
search(query: string, options: {
|
|
517
|
-
limit: number;
|
|
518
|
-
account?: AccountKey;
|
|
519
|
-
}): Promise<Page<StoredHit>>;
|
|
520
|
-
/** Newest first — by text, by who wrote it, or both. */
|
|
521
|
-
find(filter: MessageFilter): Promise<Page<StoredHit>>;
|
|
522
|
-
rankingDiscussionChats(account: AccountKey, chatId: string): Promise<string[]>;
|
|
523
|
-
rankingEvidence(execution: QueryExecution, request: RankingEvidenceRequest): Promise<RankedEvidence>;
|
|
524
|
-
retention(key: AccountKey, chatId: Id, options: RetentionOptions, evidence?: {
|
|
525
|
-
cohort: string;
|
|
526
|
-
cursor?: string;
|
|
527
|
-
}): Promise<RetentionResult>;
|
|
528
|
-
adminStatisticsQuery(execution: QueryExecution, request: AdminStoreRequest): Promise<AdminStoreResult>;
|
|
529
|
-
rankQuery(execution: QueryExecution, request: RankingRequest): Promise<RankedStoreFound>;
|
|
530
|
-
directReplies(parents: {
|
|
531
|
-
account: AccountKey;
|
|
532
|
-
chatId: Id;
|
|
533
|
-
id: Id;
|
|
534
|
-
}[], limit: number): Promise<Page<StoredHit>>;
|
|
535
|
-
matchQuery(execution: QueryExecution): Promise<Page<ScoredHit>>;
|
|
536
|
-
conversationEligibility(execution: QueryExecution): Promise<ConversationEligibility>;
|
|
537
|
-
/** The same matches as `matchQuery`, each counted once, grouped by chat, sender or quarter hour. */
|
|
538
|
-
countQuery(execution: QueryExecution, by: QueryGrouping): Promise<QueryGroup[]>;
|
|
539
|
-
/** Per chat: whether its history is held up to date, without gaps, back to its start. */
|
|
540
|
-
chatCompleteness(key: AccountKey, chatIds: Id[]): Promise<ChatCompleteness[]>;
|
|
541
|
-
/** Of `terms`, those the index knows as a word or the beginning of one. */
|
|
542
|
-
knownTerms(terms: string[]): Promise<Set<string>>;
|
|
543
|
-
/** Known words sharing these trigrams, within the lengths, most shared first. */
|
|
544
|
-
termCandidates(trigrams: string[], lengths: {
|
|
545
|
-
shortest: number;
|
|
546
|
-
longest: number;
|
|
547
|
-
}): Promise<{
|
|
548
|
-
term: string;
|
|
549
|
-
docs: number;
|
|
550
|
-
}[]>;
|
|
551
|
-
/** How far the word index is built; `undefined` on a file before it existed. */
|
|
552
|
-
searchIndexState(): Promise<SearchIndexState | undefined>;
|
|
553
|
-
/**
|
|
554
|
-
* Builds the word index towards "ready" in short batches — the normalized text, the messages up to
|
|
555
|
-
* the watermark, the typo vocabulary — until done or `until` says stop. Each batch is its own write.
|
|
556
|
-
*/
|
|
557
|
-
fillSearchIndex(options?: {
|
|
558
|
-
until?: () => boolean;
|
|
559
|
-
}): Promise<SearchIndexFill>;
|
|
560
|
-
/** How far the stems are built, and by which stemmer choices; `undefined` on a file before they existed. */
|
|
561
|
-
stemsState(): Promise<StemsState | undefined>;
|
|
562
|
-
/** Builds the stems towards "ready" in short batches until done or `until` says stop; never rebuilds. */
|
|
563
|
-
fillStems(options?: {
|
|
564
|
-
until?: () => boolean;
|
|
565
|
-
}): Promise<StemsFill>;
|
|
566
|
-
/**
|
|
567
|
-
* The stemmer choices saved in the store for every profile, tg and MAX; `undefined` while the defaults
|
|
568
|
-
* apply, `null` when a newer tool saved one this build does not know.
|
|
569
|
-
*/
|
|
570
|
-
stemmers(): Promise<Stemmers | null | undefined>;
|
|
571
|
-
/** Saves them; stems built by other choices wait for `store reindex` or `store migrate`. */
|
|
572
|
-
saveStemmers(stemmers: Stemmers): Promise<void>;
|
|
573
|
-
/** The account groups `--source group:<name>` reads: each group's entries as saved, store-wide. */
|
|
574
|
-
accountGroups(): Promise<AccountGroups>;
|
|
575
|
-
/** Saves one group's entries; `undefined` removes the group. */
|
|
576
|
-
saveAccountGroup(name: string, members: string[] | undefined): Promise<void>;
|
|
577
|
-
/** Per app command, each profile's account: how `--source max:default` finds a profile of another app. */
|
|
578
|
-
profiles(): Promise<Profiles>;
|
|
579
|
-
/** Records which account a profile of `app` is; a no-op when the store already says so. */
|
|
580
|
-
saveProfile(app: string, profile: string, key: AccountKey): Promise<void>;
|
|
581
|
-
savePeople(key: AccountKey, people: PersonFacts[]): Promise<void>;
|
|
582
|
-
/**
|
|
583
|
-
* The people this account has a one-to-one chat with — as far as the saved member lists go —
|
|
584
|
-
* newest conversation first or by name.
|
|
585
|
-
*/
|
|
586
|
-
contacts(key: AccountKey, options: {
|
|
587
|
-
order: "recent" | "name";
|
|
588
|
-
limit: number;
|
|
589
|
-
offset?: number;
|
|
590
|
-
} & ContactFilter): Promise<Page<Contact>>;
|
|
591
|
-
countContacts(key: AccountKey, options?: ContactFilter): Promise<number>;
|
|
592
|
-
/** Works out again when each contact was last written to, from their one-to-one chats. */
|
|
593
|
-
refreshRecency(key: AccountKey): Promise<void>;
|
|
594
|
-
/** Every account of every messenger the file holds, by messenger then id. */
|
|
595
|
-
accounts(): Promise<AccountKey[]>;
|
|
596
|
-
/** Every account with the store's id for it, by provider then external id. */
|
|
597
|
-
storedAccounts(): Promise<StoredAccount[]>;
|
|
598
|
-
/** One account by provider and external id, never created: `not_found` when the store has none. */
|
|
599
|
-
storedAccount(key: AccountKey): Promise<StoredAccount>;
|
|
600
|
-
/** The name the messenger last gave for this account; `null` when it never did. */
|
|
601
|
-
accountName(key: AccountKey): Promise<string | null>;
|
|
602
|
-
/** Everyone this provider's accounts have seen; with `account`, only who that account has seen. */
|
|
603
|
-
people(provider: Provider, options?: {
|
|
604
|
-
account?: Id;
|
|
605
|
-
accounts?: Id[];
|
|
606
|
-
}): Promise<PeopleLookup>;
|
|
607
|
-
personOf(identity: IdentityRef): Promise<PersonRecord | undefined>;
|
|
608
|
-
/** The person a `person:<uid>` reference names. */
|
|
609
|
-
personSeenInAccounts(uid: string, accountIds: readonly number[]): Promise<boolean>;
|
|
610
|
-
personByUid(uid: string): Promise<PersonRecord | undefined>;
|
|
611
|
-
/** Records the decision in `identity_link_events`; `unlinkIdentity` undoes it. */
|
|
612
|
-
linkIdentities(person: IdentityRef, other: IdentityRef, options: LinkOptions): Promise<PersonRecord>;
|
|
613
|
-
unlinkIdentity(identity: IdentityRef, options: LinkOptions): Promise<PersonRecord>;
|
|
614
|
-
/** Messages of the account that name this person, newest first. */
|
|
615
|
-
mentioning(key: AccountKey, person: {
|
|
616
|
-
id: Id;
|
|
617
|
-
username: string | null;
|
|
618
|
-
}, limit: number): Promise<Page<StoredHit>>;
|
|
619
|
-
/** A message's reactions as they are now; answers whether the message is held at all. */
|
|
620
|
-
saveReactions(key: AccountKey, chatId: Id, messageId: Id, reactions: Reactions, options?: {
|
|
621
|
-
observation?: CounterObservations["reactions"];
|
|
622
|
-
}): Promise<boolean>;
|
|
623
|
-
counterTargets(execution: QueryExecution, options: {
|
|
624
|
-
now: number;
|
|
625
|
-
maxAge: number;
|
|
626
|
-
}): Promise<{
|
|
627
|
-
items: CounterTarget[];
|
|
628
|
-
hasMore: boolean;
|
|
629
|
-
}>;
|
|
630
|
-
counterStates(key: AccountKey, chatId: Id, messageId: Id, options: {
|
|
631
|
-
now: number;
|
|
632
|
-
maxAge: number;
|
|
633
|
-
}): Promise<CounterState[]>;
|
|
634
|
-
updateCounterObservations(key: AccountKey, chatId: Id, messageId: Id, observations: CounterObservations): Promise<number>;
|
|
635
|
-
/**
|
|
636
|
-
* Records that every message from `from` to `to` (inclusive, by ordering key) is held, merging it
|
|
637
|
-
* with the stretches it overlaps or touches. Answers the merged stretch.
|
|
638
|
-
*/
|
|
639
|
-
markRange(key: AccountKey, chatId: Id, from: number, to: number): Promise<Range>;
|
|
640
|
-
/** Per chat that has messages: how many, the oldest and newest, and when the last one was stored. */
|
|
641
|
-
chatStats(key: AccountKey, chatId?: Id): Promise<ChatStats[]>;
|
|
642
|
-
/** Per chat that spoke since `since` (ms): its newest message and who sent it when stored, never the text. */
|
|
643
|
-
/** `where` is a `tasks agenda` query compiled over `AGENDA_COLUMNS`. */
|
|
644
|
-
chatActivity(key: AccountKey, since: number, where?: Where): Promise<{
|
|
645
|
-
chats: ChatActivity[];
|
|
646
|
-
storedAt: string | null;
|
|
647
|
-
}>;
|
|
648
|
-
/** One person's stored messages per chat of this account, newest first. */
|
|
649
|
-
senderStats(key: AccountKey, senderId: Id): Promise<SenderChatStats[]>;
|
|
650
|
-
/** Every name and username this account's store recorded for one person, the current ones included. */
|
|
651
|
-
personNames(key: AccountKey, personId: Id): Promise<PersonAlias[]>;
|
|
652
|
-
/** The stretches held completely, oldest first. */
|
|
653
|
-
ranges(key: AccountKey, chatId: Id): Promise<Range[]>;
|
|
654
|
-
/** Labels one stored chat, person or message; answers the tags it did not have. `not_found` for one not held. */
|
|
655
|
-
chatMetadata(key: AccountKey, chatId: Id): Promise<ChatMetadata | undefined>;
|
|
656
|
-
saveChatMetadata(key: AccountKey, entry: Omit<ChatMetadata, "fetchedAt">): Promise<ChatMetadata>;
|
|
657
|
-
replaceAutoTags(key: AccountKey, chatId: Id, algorithm: string, tags: ChannelTagMatch[]): Promise<void>;
|
|
658
|
-
privateContact(key: AccountKey, personId: Id): Promise<PrivateContact>;
|
|
659
|
-
setContactAlias(key: AccountKey, personId: Id, alias: string | null): Promise<{
|
|
660
|
-
personId: Id;
|
|
661
|
-
alias: string | null;
|
|
662
|
-
}>;
|
|
663
|
-
addContactNote(key: AccountKey, personId: Id, text: string): Promise<PrivateContactNote>;
|
|
664
|
-
contactNote(key: AccountKey, personId: Id, id: string): Promise<PrivateContactNote>;
|
|
665
|
-
editContactNote(key: AccountKey, personId: Id, id: string, text: string, revision: number): Promise<PrivateContactNote>;
|
|
666
|
-
removeContactNote(key: AccountKey, personId: Id, id: string): Promise<{
|
|
667
|
-
id: string;
|
|
668
|
-
personId: Id;
|
|
669
|
-
removed: boolean;
|
|
670
|
-
}>;
|
|
671
|
-
addTags(key: AccountKey, target: AnyTagTarget, tags: string[]): Promise<string[]>;
|
|
672
|
-
/** Answers the tags it had. */
|
|
673
|
-
removeTags(key: AccountKey, target: AnyTagTarget, tags: string[], source?: "manual" | "auto"): Promise<string[]>;
|
|
674
|
-
/** The account's tagged chats and messages, and its messenger's tagged people. */
|
|
675
|
-
tags(key: AccountKey, filter?: TagFilter): Promise<StoredTag[]>;
|
|
676
|
-
/** One run of a search or stats; the same unnamed run again counts on its row. `saved` is the saved search it ran. */
|
|
677
|
-
recordSearch(run: SearchRecord, options?: {
|
|
678
|
-
saved?: string;
|
|
679
|
-
}): Promise<void>;
|
|
680
|
-
/** A saved search by name; a name already taken is refused unless `replace`. */
|
|
681
|
-
saveSearch(name: string, search: SearchRecord, options?: {
|
|
682
|
-
replace?: boolean;
|
|
683
|
-
}): Promise<StoredSearch>;
|
|
684
|
-
/** A saved search by name, or any row by id. */
|
|
685
|
-
storedSearch(reference: string): Promise<StoredSearch | undefined>;
|
|
686
|
-
savedSearches(): Promise<StoredSearch[]>;
|
|
687
|
-
/** Runs, newest first, one more than `limit` when there are more. */
|
|
688
|
-
searchHistory(limit: number, offset?: number): Promise<StoredSearch[]>;
|
|
689
|
-
deleteSearch(reference: string): Promise<StoredSearch>;
|
|
690
|
-
/** Drops the unnamed runs; answers how many. */
|
|
691
|
-
clearSearchHistory(): Promise<number>;
|
|
33
|
+
/** Accounts, account groups and which account each app profile is. */
|
|
34
|
+
readonly accounts: AccountsStore;
|
|
35
|
+
/** One account's chats: the list, what left, what is complete, their metadata. */
|
|
36
|
+
readonly chats: ChatsStore;
|
|
37
|
+
/** Sync markers, catch-up deltas, stretch leases and the stretches held completely. */
|
|
38
|
+
readonly sync: SyncStore;
|
|
39
|
+
/** Messages: writes, reads, tombstones, reactions, transcripts and the plain text search. */
|
|
40
|
+
readonly messages: MessagesStore;
|
|
41
|
+
/** Downloaded files and the text held of them. */
|
|
42
|
+
readonly attachments: AttachmentsStore;
|
|
43
|
+
/** Who is in a chat, and its member history. */
|
|
44
|
+
readonly roster: RosterStore;
|
|
45
|
+
/** People and contacts, the links between their identities, and the owner's private notes on them. */
|
|
46
|
+
readonly people: PeopleStore;
|
|
47
|
+
/** Reply links, conversation builds and the user's agent's batches. */
|
|
48
|
+
readonly conversations: ConversationsStore;
|
|
49
|
+
/** Chunk, image and picture vectors, and the nearest conversations by meaning. */
|
|
50
|
+
readonly vectors: VectorsStore;
|
|
51
|
+
/** View, forward and reaction counters as they were observed. */
|
|
52
|
+
readonly counters: CountersStore;
|
|
53
|
+
/** The search history and saved searches. */
|
|
54
|
+
readonly searches: SearchesStore;
|
|
55
|
+
/** A resolved Lucene query run over the store. */
|
|
56
|
+
readonly queries: QueriesStore;
|
|
57
|
+
/** The word index, the stems and the stemmer choices. */
|
|
58
|
+
readonly searchIndex: SearchIndexStore;
|
|
59
|
+
/** Tags on chats, people and messages. */
|
|
60
|
+
readonly tags: TagsStore;
|
|
61
|
+
/** Phones, addresses, links and documents found in messages, and the owner's decisions on them. */
|
|
62
|
+
readonly mentions: MentionsStore;
|
|
692
63
|
/** Open tasks waiting on the owner, for the task service in `src/tasks/`. */
|
|
693
64
|
readonly botUpdates: BotUpdateStore;
|
|
694
65
|
readonly involvements: InvolvementStore;
|
|
@@ -716,159 +87,6 @@ export interface MessageStore {
|
|
|
716
87
|
forAccount(key: AccountKey): AccountStore;
|
|
717
88
|
close(): Promise<void>;
|
|
718
89
|
}
|
|
719
|
-
/** One sender's stored messages in one chat. */
|
|
720
|
-
export interface SenderChatStats {
|
|
721
|
-
chatId: Id;
|
|
722
|
-
title: string | null;
|
|
723
|
-
kind: ChatKind;
|
|
724
|
-
messages: number;
|
|
725
|
-
firstAt: string | null;
|
|
726
|
-
lastAt: string | null;
|
|
727
|
-
}
|
|
728
|
-
export interface ChatActivity {
|
|
729
|
-
chatId: Id;
|
|
730
|
-
title: string | null;
|
|
731
|
-
kind: ChatKind;
|
|
732
|
-
lastMessageAt: string;
|
|
733
|
-
/** `null` while the newest message is not stored: the chat list says the chat moved, nothing more. */
|
|
734
|
-
lastMessageId: Id | null;
|
|
735
|
-
/** `null` when the newest message is not stored, or the messenger did not say who sent it. */
|
|
736
|
-
lastFromOwner: boolean | null;
|
|
737
|
-
}
|
|
738
|
-
export interface ChatStats {
|
|
739
|
-
chatId: Id;
|
|
740
|
-
title: string | null;
|
|
741
|
-
messages: number;
|
|
742
|
-
oldestAt: string | null;
|
|
743
|
-
newestAt: string | null;
|
|
744
|
-
lastStoredAt: string | null;
|
|
745
|
-
}
|
|
746
|
-
/** One build of a chat's conversations, by message id; phase 3 plan C3. */
|
|
747
|
-
export interface ConversationBuild {
|
|
748
|
-
check?: () => void;
|
|
749
|
-
/** When the build started reading: a change after it is not in the build. */
|
|
750
|
-
startedAt: number;
|
|
751
|
-
algorithmVersion: number;
|
|
752
|
-
links: Link[];
|
|
753
|
-
/** Message ids, each conversation oldest first. */
|
|
754
|
-
conversations: Id[][];
|
|
755
|
-
/** Each conversation's chunks, in the same order as `conversations` (phase 5). */
|
|
756
|
-
chunks?: {
|
|
757
|
-
firstId: Id;
|
|
758
|
-
lastId: Id;
|
|
759
|
-
hash: string;
|
|
760
|
-
range?: TextRange;
|
|
761
|
-
}[][];
|
|
762
|
-
}
|
|
763
|
-
/**
|
|
764
|
-
* A conversation found by meaning: the chunk that matched best, and how near it is (−1 to 1). `stale` when
|
|
765
|
-
* the chunk's messages no longer read as they did when it was embedded (NEED-550 B).
|
|
766
|
-
*/
|
|
767
|
-
export interface ConversationHit {
|
|
768
|
-
summary: ConversationSummary;
|
|
769
|
-
chunk: {
|
|
770
|
-
firstMessageId: Id;
|
|
771
|
-
lastMessageId: Id;
|
|
772
|
-
};
|
|
773
|
-
score: number;
|
|
774
|
-
stale: boolean;
|
|
775
|
-
/** Set when the hit is an image, found by the text around it: its message is the chunk. */
|
|
776
|
-
matchedIn?: "context";
|
|
777
|
-
}
|
|
778
|
-
export interface StoredReadiness {
|
|
779
|
-
chatId: Id;
|
|
780
|
-
builtAt: string | null;
|
|
781
|
-
algorithmVersion: number | null;
|
|
782
|
-
/** Messages the current build has not seen. */
|
|
783
|
-
pending: {
|
|
784
|
-
new: number;
|
|
785
|
-
edited: number;
|
|
786
|
-
deleted: number;
|
|
787
|
-
};
|
|
788
|
-
/** The current build's distinct chunk texts: `current` + `stale` + `missing`; `embedded` have any vector. */
|
|
789
|
-
vectors: {
|
|
790
|
-
chunks: number;
|
|
791
|
-
embedded: number;
|
|
792
|
-
current: number;
|
|
793
|
-
stale: number;
|
|
794
|
-
missing: number;
|
|
795
|
-
};
|
|
796
|
-
}
|
|
797
|
-
export interface ConversationSummary {
|
|
798
|
-
id: string;
|
|
799
|
-
chatId: Id;
|
|
800
|
-
firstMessageId: Id;
|
|
801
|
-
firstAt: string;
|
|
802
|
-
lastAt: string;
|
|
803
|
-
messageCount: number;
|
|
804
|
-
/** How many people wrote in it. */
|
|
805
|
-
senders: number;
|
|
806
|
-
builtAt: string;
|
|
807
|
-
algorithmVersion: number;
|
|
808
|
-
}
|
|
809
|
-
/** One message as the user's agent sees it in a batch (phase 4 plan A4). */
|
|
810
|
-
export interface BatchMessage {
|
|
811
|
-
id: Id;
|
|
812
|
-
at: string;
|
|
813
|
-
sender: {
|
|
814
|
-
id: Id | null;
|
|
815
|
-
name: string | null;
|
|
816
|
-
};
|
|
817
|
-
text: string;
|
|
818
|
-
/** The message it answers, by the messenger's own record. */
|
|
819
|
-
replyTo?: Id;
|
|
820
|
-
thread?: Id;
|
|
821
|
-
mentions?: Id[];
|
|
822
|
-
/** `true`: the agent is asked which earlier message this one answers. `false`: context only. */
|
|
823
|
-
answer: boolean;
|
|
824
|
-
/** For a message to answer: the current build's messenger and rule links, strongest first. */
|
|
825
|
-
candidates?: {
|
|
826
|
-
parent: Id | null;
|
|
827
|
-
source: string;
|
|
828
|
-
kind: string;
|
|
829
|
-
confidence: number;
|
|
830
|
-
}[];
|
|
831
|
-
}
|
|
832
|
-
/** What the user's agent returns for a batch (phase 4 plan A5), as read from stdin. */
|
|
833
|
-
export interface AgentAnswer {
|
|
834
|
-
/** The model that answered; stored as the link's method. */
|
|
835
|
-
model: string;
|
|
836
|
-
/** The skill's version, when the skill sends it. */
|
|
837
|
-
skill?: string;
|
|
838
|
-
answers: {
|
|
839
|
-
message: Id;
|
|
840
|
-
parent: Id | null;
|
|
841
|
-
confidence: number;
|
|
842
|
-
}[];
|
|
843
|
-
}
|
|
844
|
-
/** A window of a chat for the agent: the messages to answer and the ones before them (A1). */
|
|
845
|
-
export interface LinkBatch {
|
|
846
|
-
/** Names the window, so an answer can be checked against it (A3). */
|
|
847
|
-
batch: string;
|
|
848
|
-
chat: Id;
|
|
849
|
-
messages: BatchMessage[];
|
|
850
|
-
/** Messages still needing the agent after this batch, and their characters. */
|
|
851
|
-
remaining: {
|
|
852
|
-
messages: number;
|
|
853
|
-
characters: number;
|
|
854
|
-
};
|
|
855
|
-
}
|
|
856
|
-
export interface StoredLink {
|
|
857
|
-
/** `null`: the source says the message starts a conversation. */
|
|
858
|
-
parentId: Id | null;
|
|
859
|
-
source: "provider" | "rule" | "agent";
|
|
860
|
-
kind: string;
|
|
861
|
-
confidence: number;
|
|
862
|
-
method: string;
|
|
863
|
-
version: string | null;
|
|
864
|
-
createdAt: string;
|
|
865
|
-
/** An end changed after the link was written; it is not chosen. */
|
|
866
|
-
stale: boolean;
|
|
867
|
-
}
|
|
868
|
-
export interface Range {
|
|
869
|
-
from: number;
|
|
870
|
-
to: number;
|
|
871
|
-
}
|
|
872
90
|
export interface StoreOptions {
|
|
873
91
|
path?: string;
|
|
874
92
|
env?: NodeJS.ProcessEnv;
|
|
@@ -881,6 +99,18 @@ export declare const BACKFILL_ON_OPEN = 5000;
|
|
|
881
99
|
export declare const openStore: ({ path, env, now, command }?: StoreOptions) => Promise<MessageStore>;
|
|
882
100
|
export type { CounterField, CounterObservations, CounterState } from "../domain/counters.js";
|
|
883
101
|
export type { RetentionOptions } from "../domain/retention.js";
|
|
102
|
+
export type { AccountAccounts, AccountsStore } from "./accounts.js";
|
|
103
|
+
export type { AccountAttachments, AttachmentsStore } from "./attachments.js";
|
|
104
|
+
export type { ChatsStore } from "./chats.js";
|
|
105
|
+
export type { ConversationsStore } from "./conversations.js";
|
|
106
|
+
export type { AccountCounters, CountersStore } from "./counters.js";
|
|
107
|
+
export type { AccountMentions, MentionsStore } from "./mentions.js";
|
|
108
|
+
export type { AccountMessages, MessagesStore } from "./messages.js";
|
|
109
|
+
export type { AccountPeople, PeopleStore } from "./people.js";
|
|
110
|
+
export type { QueriesStore } from "./queries.js";
|
|
111
|
+
export type { RosterStore } from "./roster.js";
|
|
112
|
+
export type { SearchIndexStore } from "./search-index.js";
|
|
113
|
+
export type { SearchesStore } from "./searches.js";
|
|
884
114
|
export { accountGroupsOf } from "./sqlite/account-groups.js";
|
|
885
115
|
export type { AdminStoreRequest, AdminStoreResult } from "./sqlite/admin-statistics.js";
|
|
886
116
|
export { type AttachmentTextEntry, type AttachmentView, attachmentColumns, type FileAttachment, resetAttachmentWords, type TextOrigin, } from "./sqlite/attachment-texts.js";
|
|
@@ -917,4 +147,8 @@ export { DEFAULT_AGENT_CLOSE, savedAgentClose } from "./sqlite/task-close.js";
|
|
|
917
147
|
export { inboxKey } from "./sqlite/tasks.js";
|
|
918
148
|
export type { MatchPlace, ScoredHit } from "./sqlite/words.js";
|
|
919
149
|
export type { TaskDetails } from "./sqlite/work-tasks.js";
|
|
150
|
+
export type { SyncStore } from "./sync.js";
|
|
151
|
+
export type { TagsStore } from "./tags.js";
|
|
152
|
+
export type { AccountKey, AccountMessageFilter, AgentAnswer, BatchMessage, ChatActivity, ChatStats, ConversationBuild, ConversationHit, ConversationSummary, DeletionScope, Delta, IdentityRef, IngestedVia, LinkBatch, LinkedIdentity, LinkOptions, MessageFilter, PersonFacts, PersonRecord, PictureInput, Range, SenderChatStats, StoredAccount, StoredChatFilter, StoredHit, StoredLink, StoredReadiness, } from "./types.js";
|
|
153
|
+
export type { AccountVectors, VectorsStore } from "./vectors.js";
|
|
920
154
|
//# sourceMappingURL=store.d.ts.map
|