@ai-matrx/messaging 0.15.82 → 0.16.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 +46 -1
- package/dist/index.cjs +171 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -2
- package/dist/index.d.ts +71 -2
- package/dist/index.js +171 -9
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +206 -10
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +73 -2
- package/dist/react.d.ts +73 -2
- package/dist/react.js +206 -10
- package/dist/react.js.map +1 -1
- package/dist/styles.css +15 -0
- package/package.json +1 -1
package/dist/react.d.cts
CHANGED
|
@@ -135,6 +135,13 @@ interface Message {
|
|
|
135
135
|
readonly attachments: readonly Attachment[];
|
|
136
136
|
readonly references: readonly MatrxReference[];
|
|
137
137
|
readonly metadata: JsonObject;
|
|
138
|
+
/**
|
|
139
|
+
* SOFT EXPIRY (`dm_messages.soft_expires_at`). Past this instant the message
|
|
140
|
+
* is LAPSED: still readable and actionable, never hidden or edited, and it no
|
|
141
|
+
* longer counts as unread. `null` = never lapses. Ask `isLapsed`, never
|
|
142
|
+
* compare this yourself — that is the one lapse rule.
|
|
143
|
+
*/
|
|
144
|
+
readonly softExpiresAt: string | null;
|
|
138
145
|
/** Set only while this message is in the outbox and its last send failed. */
|
|
139
146
|
readonly failureReason?: string | undefined;
|
|
140
147
|
}
|
|
@@ -223,6 +230,8 @@ interface DraftMessage {
|
|
|
223
230
|
readonly attachments?: readonly Attachment[] | undefined;
|
|
224
231
|
readonly references?: readonly MatrxReference[] | undefined;
|
|
225
232
|
readonly metadata?: JsonObject | undefined;
|
|
233
|
+
/** ISO instant after which the message is lapsed (see `Message.softExpiresAt`). */
|
|
234
|
+
readonly softExpiresAt?: string | undefined;
|
|
226
235
|
}
|
|
227
236
|
|
|
228
237
|
/**
|
|
@@ -836,9 +845,22 @@ declare const RPCS: {
|
|
|
836
845
|
/** Conversation list + participants + last message + unread, keyset paged. */
|
|
837
846
|
readonly conversationsWithDetails: "get_dm_conversations_with_details";
|
|
838
847
|
readonly unreadCount: "get_dm_unread_count";
|
|
848
|
+
/** The soonest future soft expiry per conversation, plus the server's clock. */
|
|
849
|
+
readonly pendingSoftExpiries: "get_dm_pending_soft_expiries";
|
|
839
850
|
readonly userInfo: "get_dm_user_info";
|
|
840
851
|
readonly isParticipant: "is_dm_participant";
|
|
841
852
|
};
|
|
853
|
+
/** The answer to `pendingSoftExpiries`: per conversation, and the server's own clock. */
|
|
854
|
+
interface PendingSoftExpiries {
|
|
855
|
+
/** Soonest FUTURE `soft_expires_at` per conversation; absent = nothing pending. */
|
|
856
|
+
readonly byConversation: ReadonlyMap<ConversationId, string>;
|
|
857
|
+
/**
|
|
858
|
+
* The database's `now()` when it answered. The engine measures its clock against this and
|
|
859
|
+
* judges lapse on the SERVER's clock — a skewed browser clock never suppresses a count.
|
|
860
|
+
* `null` when nothing was asked (no conversations), so no clock was read.
|
|
861
|
+
*/
|
|
862
|
+
readonly serverNow: string | null;
|
|
863
|
+
}
|
|
842
864
|
/**
|
|
843
865
|
* The host's session source. A messaging read that lands between sign-in and
|
|
844
866
|
* token arrival must not become a red error — it retries ONCE after the host
|
|
@@ -951,6 +973,20 @@ interface MessagingRepository {
|
|
|
951
973
|
deleteMessage(id: MessageId, forEveryone: boolean): Promise<void>;
|
|
952
974
|
/** Persists the cutoff, then returns the server's remaining unread count. */
|
|
953
975
|
markRead(conversationId: ConversationId, at: string): Promise<number>;
|
|
976
|
+
/**
|
|
977
|
+
* The server's unread count for one conversation — READ ONLY. It never moves
|
|
978
|
+
* the watermark. The soft-expiry timer uses it to re-derive unread once a
|
|
979
|
+
* counted message lapses, instead of guessing with local arithmetic.
|
|
980
|
+
*/
|
|
981
|
+
unreadCount(conversationId: ConversationId): Promise<number>;
|
|
982
|
+
/**
|
|
983
|
+
* The soonest FUTURE `soft_expires_at` among other people's live messages,
|
|
984
|
+
* per conversation, for the given conversations, and the server's clock.
|
|
985
|
+
* Conversations with nothing pending are absent. One call per
|
|
986
|
+
* `PENDING_SOFT_EXPIRY_CHUNK` conversations, each answering every one of them
|
|
987
|
+
* — this is what lets ONE timer re-derive unread when a counted message lapses.
|
|
988
|
+
*/
|
|
989
|
+
pendingSoftExpiries(conversationIds: readonly ConversationId[]): Promise<PendingSoftExpiries>;
|
|
954
990
|
setConversationFlags(conversationId: ConversationId, flags: {
|
|
955
991
|
isMuted?: boolean;
|
|
956
992
|
isArchived?: boolean;
|
|
@@ -995,6 +1031,10 @@ declare function createMessagingRepository(options: RepositoryOptions): Messagin
|
|
|
995
1031
|
* clears unread counts. Only a confirmed participant write may do that, and
|
|
996
1032
|
* overlapping confirmations apply monotonically so one baseline is never
|
|
997
1033
|
* subtracted twice.
|
|
1034
|
+
* 6. **A lapsed message never counts as unread** (`isLapsed`, the one lapse
|
|
1035
|
+
* rule). It is ingested and drawn like any other message; it just never
|
|
1036
|
+
* increments a badge. Messages that lapse LATER are re-derived from the
|
|
1037
|
+
* server by the engine's one soft-expiry timer, never subtracted here.
|
|
998
1038
|
*/
|
|
999
1039
|
|
|
1000
1040
|
/**
|
|
@@ -1126,7 +1166,11 @@ interface ConversationReadCutoff {
|
|
|
1126
1166
|
/** Per-conversation unread-state revision observed when this read began. */
|
|
1127
1167
|
readonly revision: number;
|
|
1128
1168
|
}
|
|
1129
|
-
|
|
1169
|
+
interface MessagingStoreOptions {
|
|
1170
|
+
/** The clock the lapse rule reads. Defaults to `Date.now`. */
|
|
1171
|
+
now?: (() => number) | undefined;
|
|
1172
|
+
}
|
|
1173
|
+
declare function createMessagingStore(options?: MessagingStoreOptions): MessagingStore;
|
|
1130
1174
|
/**
|
|
1131
1175
|
* The optimistic row a composer shows the instant Enter is pressed. It carries
|
|
1132
1176
|
* the outbox's client key, which is the whole reason the confirmed row can find
|
|
@@ -1143,6 +1187,7 @@ declare function optimisticMessage(args: {
|
|
|
1143
1187
|
action?: Message["action"];
|
|
1144
1188
|
attachments?: readonly Message["attachments"][number][];
|
|
1145
1189
|
references?: readonly Message["references"][number][];
|
|
1190
|
+
softExpiresAt?: string | null;
|
|
1146
1191
|
now?: () => number;
|
|
1147
1192
|
}): Message;
|
|
1148
1193
|
|
|
@@ -1191,6 +1236,8 @@ interface MessagingEngineOptions {
|
|
|
1191
1236
|
* the list.
|
|
1192
1237
|
*/
|
|
1193
1238
|
archiveFilter?: MessagingArchiveFilter | undefined;
|
|
1239
|
+
/** The clock the soft-expiry rule reads. Defaults to `Date.now`. */
|
|
1240
|
+
now?: (() => number) | undefined;
|
|
1194
1241
|
}
|
|
1195
1242
|
interface MessagingEngine {
|
|
1196
1243
|
readonly store: MessagingStore;
|
|
@@ -1582,6 +1629,8 @@ declare function MessageBubble(props: {
|
|
|
1582
1629
|
replyTo?: Message | undefined;
|
|
1583
1630
|
isMine: boolean;
|
|
1584
1631
|
isLast: boolean;
|
|
1632
|
+
/** The clock the lapse rule reads; a thread passes its one shared clock. */
|
|
1633
|
+
now?: number;
|
|
1585
1634
|
onRetry?: (entryId: string) => void;
|
|
1586
1635
|
onReply?: (message: Message) => void;
|
|
1587
1636
|
failedEntryId?: string | null;
|
|
@@ -1837,6 +1886,28 @@ declare function participantNames(participants: readonly UserSummary[], excludin
|
|
|
1837
1886
|
*/
|
|
1838
1887
|
declare function formatLastSeen(lastSeenMs: number | null, now?: number): string;
|
|
1839
1888
|
|
|
1889
|
+
/**
|
|
1890
|
+
* THE LAPSE RULE — the only place in this package that decides whether a
|
|
1891
|
+
* message has soft-expired.
|
|
1892
|
+
*
|
|
1893
|
+
* A message carrying `softExpiresAt` (a meeting invitation is worth reading
|
|
1894
|
+
* until an hour after the meeting starts) is LAPSED once that instant has
|
|
1895
|
+
* passed. Lapsed is DERIVED from the clock every time it is asked, never
|
|
1896
|
+
* stamped on the row: there is no sweeper and nothing to drift. The database's
|
|
1897
|
+
* `get_dm_unread_count` applies the same comparison (`soft_expires_at > now()`
|
|
1898
|
+
* still counts), so the badge the server computes and the bubble the client
|
|
1899
|
+
* draws agree.
|
|
1900
|
+
*
|
|
1901
|
+
* A lapsed message stays readable and its actions keep working. It simply
|
|
1902
|
+
* stops counting as unread — and the reader's watermark is NEVER moved for it,
|
|
1903
|
+
* because moving `last_read_at` would mark every other message read too.
|
|
1904
|
+
*/
|
|
1905
|
+
|
|
1906
|
+
/** Parse a soft-expiry instant; `null` when absent or unparseable (never lapses). */
|
|
1907
|
+
declare function softExpiryTime(message: Pick<Message, "softExpiresAt">): number | null;
|
|
1908
|
+
/** True when the message's soft expiry is at or before `now` (epoch ms or Date). */
|
|
1909
|
+
declare function isLapsed(message: Pick<Message, "softExpiresAt">, now?: number | Date): boolean;
|
|
1910
|
+
|
|
1840
1911
|
/**
|
|
1841
1912
|
* THE INGRESS BOUNDARY — where a database row becomes a domain object.
|
|
1842
1913
|
*
|
|
@@ -1919,4 +1990,4 @@ declare function summarizeText(content: string, maxLength?: number): string;
|
|
|
1919
1990
|
/** Serialize picked references into a fence the platform's other readers accept. */
|
|
1920
1991
|
declare function composeFence(references: readonly MatrxReference[]): string;
|
|
1921
1992
|
|
|
1922
|
-
export { type ActionChoice, type ActionContext, type ActionHandler, type ActionOutcome, type ActionReceipt, type ActionRegistry, type ActorPresentation, AgentTag, type AiCallArgs, type AiCapability, type AiResult, AlertIcon, type Attachment, Avatar, BotIcon, CheckIcon, ChevronLeftIcon, type ClientMessageId, ClockIcon, CloseIcon, Composer, type ComposerAttachment, type ComposerInputRenderProps, type Conversation, type ConversationAiContext, type ConversationCursor, type ConversationId, ConversationList, type ConversationListProps, type ConversationReadCutoff, type ConversationReadFailure, type ConversationRowWrapperProps, ConversationSkeleton, type ConversationSummary, type ConversationThread, type ConversationType, ConversationView, type ConversationViewProps, DEFAULT_MESSAGING_ARCHIVE_FILTER, type DeliveryState, DeliveryTick, DoubleCheckIcon, type DraftMessage, EmptyState, type EngineDiagnostic, type IncomingMessageContext, type JsonObject, type JsonValue, LinkIcon, MESSAGING_EVENTS, MESSAGING_RPC_SCHEMA, MESSAGING_SCHEMA, type MatrxReference, type Message, type MessageAction, MessageActionChips, type MessageActionRenderProps, type MessageActionRenderer, MessageBubble, type MessageCursor, type MessageGroup, type MessageId, type MessageKind, type MessageWrapperProps, type MessagingAgentIdentity, type MessagingAgents, type MessagingAi, type MessagingAiOptions, type MessagingArchiveFilter, type MessagingEngine, type MessagingEngineOptions, MessagingError, type MessagingErrorCode, type MessagingHost, type MessagingIdentity, MessagingInbox, type MessagingInboxProps, MessagingProvider, type MessagingProviderProps, type MessagingRepository, type MessagingSnapshot, type MessagingStore, type MessagingSupabaseClient, type MessagingSupabaseInternal, type OrganizationId, type Outbox, type OutboxEntry, type OutboxOptions, type OutboxStorage, type Page, PaperclipIcon, type Participant, type ParticipantRole, PlusIcon, type PostgrestFilterLike, type PostgrestLikeResponse, type PostgrestTableLike, RPCS, type ReadCache, type ReadCacheOptions, ReferenceCard, type ReferenceRenderer, ReplyIcon, type RepositoryOptions, SERVER_SESSION_IDENTITY, type SchemaLike, SearchIcon, SendIcon, type SessionIdentity, type SessionIdentitySnapshot, type SessionResolver, SparklesIcon, type SupabaseLike, TABLES, type TextSegment, TypingDots, type UseComposerResult, type UseConversationResult, type UseConversationsResult, type UseMessageActionResult, type UseMessagingAiResult, type UseTypistsResult, type UserId, type UserSummary, UsersIcon, asClientMessageId, asConversationId, asMessageId, asOrganizationId, asUserId, composeFence, conversationContextVariables, conversationTopic, createActionRegistry, createMemoryOutboxStorage, createMessagingAi, createMessagingEngine, createMessagingRepository, createMessagingStore, createOutbox, createReadCache, createSessionIdentity, createWebOutboxStorage, effectiveActorKey, extractReferences, formatConversationTime, formatDateSeparator, formatLastSeen, formatMessageTime, formatTypists, groupMessages, inboxTopic, invalidResponse, isSameDay, messagingClientId, normalizeMessagingError, optimisticMessage, participantNames, projectConversationSummary, projectMessage, projectMessageAction, projectParticipantRole, projectUserSummary, resolveActor, splitText, summarizeText, toMessagingArchiveFilter, unreadCutoff, useComposer, useConversation, useConversations, useMessageAction, useMessagingAi, useMessagingHost, useMessagingSnapshot, useOnlineUserIds, useRequiredMessagingHost, useTypists, writeNotApplied };
|
|
1993
|
+
export { type ActionChoice, type ActionContext, type ActionHandler, type ActionOutcome, type ActionReceipt, type ActionRegistry, type ActorPresentation, AgentTag, type AiCallArgs, type AiCapability, type AiResult, AlertIcon, type Attachment, Avatar, BotIcon, CheckIcon, ChevronLeftIcon, type ClientMessageId, ClockIcon, CloseIcon, Composer, type ComposerAttachment, type ComposerInputRenderProps, type Conversation, type ConversationAiContext, type ConversationCursor, type ConversationId, ConversationList, type ConversationListProps, type ConversationReadCutoff, type ConversationReadFailure, type ConversationRowWrapperProps, ConversationSkeleton, type ConversationSummary, type ConversationThread, type ConversationType, ConversationView, type ConversationViewProps, DEFAULT_MESSAGING_ARCHIVE_FILTER, type DeliveryState, DeliveryTick, DoubleCheckIcon, type DraftMessage, EmptyState, type EngineDiagnostic, type IncomingMessageContext, type JsonObject, type JsonValue, LinkIcon, MESSAGING_EVENTS, MESSAGING_RPC_SCHEMA, MESSAGING_SCHEMA, type MatrxReference, type Message, type MessageAction, MessageActionChips, type MessageActionRenderProps, type MessageActionRenderer, MessageBubble, type MessageCursor, type MessageGroup, type MessageId, type MessageKind, type MessageWrapperProps, type MessagingAgentIdentity, type MessagingAgents, type MessagingAi, type MessagingAiOptions, type MessagingArchiveFilter, type MessagingEngine, type MessagingEngineOptions, MessagingError, type MessagingErrorCode, type MessagingHost, type MessagingIdentity, MessagingInbox, type MessagingInboxProps, MessagingProvider, type MessagingProviderProps, type MessagingRepository, type MessagingSnapshot, type MessagingStore, type MessagingSupabaseClient, type MessagingSupabaseInternal, type OrganizationId, type Outbox, type OutboxEntry, type OutboxOptions, type OutboxStorage, type Page, PaperclipIcon, type Participant, type ParticipantRole, type PendingSoftExpiries, PlusIcon, type PostgrestFilterLike, type PostgrestLikeResponse, type PostgrestTableLike, RPCS, type ReadCache, type ReadCacheOptions, ReferenceCard, type ReferenceRenderer, ReplyIcon, type RepositoryOptions, SERVER_SESSION_IDENTITY, type SchemaLike, SearchIcon, SendIcon, type SessionIdentity, type SessionIdentitySnapshot, type SessionResolver, SparklesIcon, type SupabaseLike, TABLES, type TextSegment, TypingDots, type UseComposerResult, type UseConversationResult, type UseConversationsResult, type UseMessageActionResult, type UseMessagingAiResult, type UseTypistsResult, type UserId, type UserSummary, UsersIcon, asClientMessageId, asConversationId, asMessageId, asOrganizationId, asUserId, composeFence, conversationContextVariables, conversationTopic, createActionRegistry, createMemoryOutboxStorage, createMessagingAi, createMessagingEngine, createMessagingRepository, createMessagingStore, createOutbox, createReadCache, createSessionIdentity, createWebOutboxStorage, effectiveActorKey, extractReferences, formatConversationTime, formatDateSeparator, formatLastSeen, formatMessageTime, formatTypists, groupMessages, inboxTopic, invalidResponse, isLapsed, isSameDay, messagingClientId, normalizeMessagingError, optimisticMessage, participantNames, projectConversationSummary, projectMessage, projectMessageAction, projectParticipantRole, projectUserSummary, resolveActor, softExpiryTime, splitText, summarizeText, toMessagingArchiveFilter, unreadCutoff, useComposer, useConversation, useConversations, useMessageAction, useMessagingAi, useMessagingHost, useMessagingSnapshot, useOnlineUserIds, useRequiredMessagingHost, useTypists, writeNotApplied };
|
package/dist/react.d.ts
CHANGED
|
@@ -135,6 +135,13 @@ interface Message {
|
|
|
135
135
|
readonly attachments: readonly Attachment[];
|
|
136
136
|
readonly references: readonly MatrxReference[];
|
|
137
137
|
readonly metadata: JsonObject;
|
|
138
|
+
/**
|
|
139
|
+
* SOFT EXPIRY (`dm_messages.soft_expires_at`). Past this instant the message
|
|
140
|
+
* is LAPSED: still readable and actionable, never hidden or edited, and it no
|
|
141
|
+
* longer counts as unread. `null` = never lapses. Ask `isLapsed`, never
|
|
142
|
+
* compare this yourself — that is the one lapse rule.
|
|
143
|
+
*/
|
|
144
|
+
readonly softExpiresAt: string | null;
|
|
138
145
|
/** Set only while this message is in the outbox and its last send failed. */
|
|
139
146
|
readonly failureReason?: string | undefined;
|
|
140
147
|
}
|
|
@@ -223,6 +230,8 @@ interface DraftMessage {
|
|
|
223
230
|
readonly attachments?: readonly Attachment[] | undefined;
|
|
224
231
|
readonly references?: readonly MatrxReference[] | undefined;
|
|
225
232
|
readonly metadata?: JsonObject | undefined;
|
|
233
|
+
/** ISO instant after which the message is lapsed (see `Message.softExpiresAt`). */
|
|
234
|
+
readonly softExpiresAt?: string | undefined;
|
|
226
235
|
}
|
|
227
236
|
|
|
228
237
|
/**
|
|
@@ -836,9 +845,22 @@ declare const RPCS: {
|
|
|
836
845
|
/** Conversation list + participants + last message + unread, keyset paged. */
|
|
837
846
|
readonly conversationsWithDetails: "get_dm_conversations_with_details";
|
|
838
847
|
readonly unreadCount: "get_dm_unread_count";
|
|
848
|
+
/** The soonest future soft expiry per conversation, plus the server's clock. */
|
|
849
|
+
readonly pendingSoftExpiries: "get_dm_pending_soft_expiries";
|
|
839
850
|
readonly userInfo: "get_dm_user_info";
|
|
840
851
|
readonly isParticipant: "is_dm_participant";
|
|
841
852
|
};
|
|
853
|
+
/** The answer to `pendingSoftExpiries`: per conversation, and the server's own clock. */
|
|
854
|
+
interface PendingSoftExpiries {
|
|
855
|
+
/** Soonest FUTURE `soft_expires_at` per conversation; absent = nothing pending. */
|
|
856
|
+
readonly byConversation: ReadonlyMap<ConversationId, string>;
|
|
857
|
+
/**
|
|
858
|
+
* The database's `now()` when it answered. The engine measures its clock against this and
|
|
859
|
+
* judges lapse on the SERVER's clock — a skewed browser clock never suppresses a count.
|
|
860
|
+
* `null` when nothing was asked (no conversations), so no clock was read.
|
|
861
|
+
*/
|
|
862
|
+
readonly serverNow: string | null;
|
|
863
|
+
}
|
|
842
864
|
/**
|
|
843
865
|
* The host's session source. A messaging read that lands between sign-in and
|
|
844
866
|
* token arrival must not become a red error — it retries ONCE after the host
|
|
@@ -951,6 +973,20 @@ interface MessagingRepository {
|
|
|
951
973
|
deleteMessage(id: MessageId, forEveryone: boolean): Promise<void>;
|
|
952
974
|
/** Persists the cutoff, then returns the server's remaining unread count. */
|
|
953
975
|
markRead(conversationId: ConversationId, at: string): Promise<number>;
|
|
976
|
+
/**
|
|
977
|
+
* The server's unread count for one conversation — READ ONLY. It never moves
|
|
978
|
+
* the watermark. The soft-expiry timer uses it to re-derive unread once a
|
|
979
|
+
* counted message lapses, instead of guessing with local arithmetic.
|
|
980
|
+
*/
|
|
981
|
+
unreadCount(conversationId: ConversationId): Promise<number>;
|
|
982
|
+
/**
|
|
983
|
+
* The soonest FUTURE `soft_expires_at` among other people's live messages,
|
|
984
|
+
* per conversation, for the given conversations, and the server's clock.
|
|
985
|
+
* Conversations with nothing pending are absent. One call per
|
|
986
|
+
* `PENDING_SOFT_EXPIRY_CHUNK` conversations, each answering every one of them
|
|
987
|
+
* — this is what lets ONE timer re-derive unread when a counted message lapses.
|
|
988
|
+
*/
|
|
989
|
+
pendingSoftExpiries(conversationIds: readonly ConversationId[]): Promise<PendingSoftExpiries>;
|
|
954
990
|
setConversationFlags(conversationId: ConversationId, flags: {
|
|
955
991
|
isMuted?: boolean;
|
|
956
992
|
isArchived?: boolean;
|
|
@@ -995,6 +1031,10 @@ declare function createMessagingRepository(options: RepositoryOptions): Messagin
|
|
|
995
1031
|
* clears unread counts. Only a confirmed participant write may do that, and
|
|
996
1032
|
* overlapping confirmations apply monotonically so one baseline is never
|
|
997
1033
|
* subtracted twice.
|
|
1034
|
+
* 6. **A lapsed message never counts as unread** (`isLapsed`, the one lapse
|
|
1035
|
+
* rule). It is ingested and drawn like any other message; it just never
|
|
1036
|
+
* increments a badge. Messages that lapse LATER are re-derived from the
|
|
1037
|
+
* server by the engine's one soft-expiry timer, never subtracted here.
|
|
998
1038
|
*/
|
|
999
1039
|
|
|
1000
1040
|
/**
|
|
@@ -1126,7 +1166,11 @@ interface ConversationReadCutoff {
|
|
|
1126
1166
|
/** Per-conversation unread-state revision observed when this read began. */
|
|
1127
1167
|
readonly revision: number;
|
|
1128
1168
|
}
|
|
1129
|
-
|
|
1169
|
+
interface MessagingStoreOptions {
|
|
1170
|
+
/** The clock the lapse rule reads. Defaults to `Date.now`. */
|
|
1171
|
+
now?: (() => number) | undefined;
|
|
1172
|
+
}
|
|
1173
|
+
declare function createMessagingStore(options?: MessagingStoreOptions): MessagingStore;
|
|
1130
1174
|
/**
|
|
1131
1175
|
* The optimistic row a composer shows the instant Enter is pressed. It carries
|
|
1132
1176
|
* the outbox's client key, which is the whole reason the confirmed row can find
|
|
@@ -1143,6 +1187,7 @@ declare function optimisticMessage(args: {
|
|
|
1143
1187
|
action?: Message["action"];
|
|
1144
1188
|
attachments?: readonly Message["attachments"][number][];
|
|
1145
1189
|
references?: readonly Message["references"][number][];
|
|
1190
|
+
softExpiresAt?: string | null;
|
|
1146
1191
|
now?: () => number;
|
|
1147
1192
|
}): Message;
|
|
1148
1193
|
|
|
@@ -1191,6 +1236,8 @@ interface MessagingEngineOptions {
|
|
|
1191
1236
|
* the list.
|
|
1192
1237
|
*/
|
|
1193
1238
|
archiveFilter?: MessagingArchiveFilter | undefined;
|
|
1239
|
+
/** The clock the soft-expiry rule reads. Defaults to `Date.now`. */
|
|
1240
|
+
now?: (() => number) | undefined;
|
|
1194
1241
|
}
|
|
1195
1242
|
interface MessagingEngine {
|
|
1196
1243
|
readonly store: MessagingStore;
|
|
@@ -1582,6 +1629,8 @@ declare function MessageBubble(props: {
|
|
|
1582
1629
|
replyTo?: Message | undefined;
|
|
1583
1630
|
isMine: boolean;
|
|
1584
1631
|
isLast: boolean;
|
|
1632
|
+
/** The clock the lapse rule reads; a thread passes its one shared clock. */
|
|
1633
|
+
now?: number;
|
|
1585
1634
|
onRetry?: (entryId: string) => void;
|
|
1586
1635
|
onReply?: (message: Message) => void;
|
|
1587
1636
|
failedEntryId?: string | null;
|
|
@@ -1837,6 +1886,28 @@ declare function participantNames(participants: readonly UserSummary[], excludin
|
|
|
1837
1886
|
*/
|
|
1838
1887
|
declare function formatLastSeen(lastSeenMs: number | null, now?: number): string;
|
|
1839
1888
|
|
|
1889
|
+
/**
|
|
1890
|
+
* THE LAPSE RULE — the only place in this package that decides whether a
|
|
1891
|
+
* message has soft-expired.
|
|
1892
|
+
*
|
|
1893
|
+
* A message carrying `softExpiresAt` (a meeting invitation is worth reading
|
|
1894
|
+
* until an hour after the meeting starts) is LAPSED once that instant has
|
|
1895
|
+
* passed. Lapsed is DERIVED from the clock every time it is asked, never
|
|
1896
|
+
* stamped on the row: there is no sweeper and nothing to drift. The database's
|
|
1897
|
+
* `get_dm_unread_count` applies the same comparison (`soft_expires_at > now()`
|
|
1898
|
+
* still counts), so the badge the server computes and the bubble the client
|
|
1899
|
+
* draws agree.
|
|
1900
|
+
*
|
|
1901
|
+
* A lapsed message stays readable and its actions keep working. It simply
|
|
1902
|
+
* stops counting as unread — and the reader's watermark is NEVER moved for it,
|
|
1903
|
+
* because moving `last_read_at` would mark every other message read too.
|
|
1904
|
+
*/
|
|
1905
|
+
|
|
1906
|
+
/** Parse a soft-expiry instant; `null` when absent or unparseable (never lapses). */
|
|
1907
|
+
declare function softExpiryTime(message: Pick<Message, "softExpiresAt">): number | null;
|
|
1908
|
+
/** True when the message's soft expiry is at or before `now` (epoch ms or Date). */
|
|
1909
|
+
declare function isLapsed(message: Pick<Message, "softExpiresAt">, now?: number | Date): boolean;
|
|
1910
|
+
|
|
1840
1911
|
/**
|
|
1841
1912
|
* THE INGRESS BOUNDARY — where a database row becomes a domain object.
|
|
1842
1913
|
*
|
|
@@ -1919,4 +1990,4 @@ declare function summarizeText(content: string, maxLength?: number): string;
|
|
|
1919
1990
|
/** Serialize picked references into a fence the platform's other readers accept. */
|
|
1920
1991
|
declare function composeFence(references: readonly MatrxReference[]): string;
|
|
1921
1992
|
|
|
1922
|
-
export { type ActionChoice, type ActionContext, type ActionHandler, type ActionOutcome, type ActionReceipt, type ActionRegistry, type ActorPresentation, AgentTag, type AiCallArgs, type AiCapability, type AiResult, AlertIcon, type Attachment, Avatar, BotIcon, CheckIcon, ChevronLeftIcon, type ClientMessageId, ClockIcon, CloseIcon, Composer, type ComposerAttachment, type ComposerInputRenderProps, type Conversation, type ConversationAiContext, type ConversationCursor, type ConversationId, ConversationList, type ConversationListProps, type ConversationReadCutoff, type ConversationReadFailure, type ConversationRowWrapperProps, ConversationSkeleton, type ConversationSummary, type ConversationThread, type ConversationType, ConversationView, type ConversationViewProps, DEFAULT_MESSAGING_ARCHIVE_FILTER, type DeliveryState, DeliveryTick, DoubleCheckIcon, type DraftMessage, EmptyState, type EngineDiagnostic, type IncomingMessageContext, type JsonObject, type JsonValue, LinkIcon, MESSAGING_EVENTS, MESSAGING_RPC_SCHEMA, MESSAGING_SCHEMA, type MatrxReference, type Message, type MessageAction, MessageActionChips, type MessageActionRenderProps, type MessageActionRenderer, MessageBubble, type MessageCursor, type MessageGroup, type MessageId, type MessageKind, type MessageWrapperProps, type MessagingAgentIdentity, type MessagingAgents, type MessagingAi, type MessagingAiOptions, type MessagingArchiveFilter, type MessagingEngine, type MessagingEngineOptions, MessagingError, type MessagingErrorCode, type MessagingHost, type MessagingIdentity, MessagingInbox, type MessagingInboxProps, MessagingProvider, type MessagingProviderProps, type MessagingRepository, type MessagingSnapshot, type MessagingStore, type MessagingSupabaseClient, type MessagingSupabaseInternal, type OrganizationId, type Outbox, type OutboxEntry, type OutboxOptions, type OutboxStorage, type Page, PaperclipIcon, type Participant, type ParticipantRole, PlusIcon, type PostgrestFilterLike, type PostgrestLikeResponse, type PostgrestTableLike, RPCS, type ReadCache, type ReadCacheOptions, ReferenceCard, type ReferenceRenderer, ReplyIcon, type RepositoryOptions, SERVER_SESSION_IDENTITY, type SchemaLike, SearchIcon, SendIcon, type SessionIdentity, type SessionIdentitySnapshot, type SessionResolver, SparklesIcon, type SupabaseLike, TABLES, type TextSegment, TypingDots, type UseComposerResult, type UseConversationResult, type UseConversationsResult, type UseMessageActionResult, type UseMessagingAiResult, type UseTypistsResult, type UserId, type UserSummary, UsersIcon, asClientMessageId, asConversationId, asMessageId, asOrganizationId, asUserId, composeFence, conversationContextVariables, conversationTopic, createActionRegistry, createMemoryOutboxStorage, createMessagingAi, createMessagingEngine, createMessagingRepository, createMessagingStore, createOutbox, createReadCache, createSessionIdentity, createWebOutboxStorage, effectiveActorKey, extractReferences, formatConversationTime, formatDateSeparator, formatLastSeen, formatMessageTime, formatTypists, groupMessages, inboxTopic, invalidResponse, isSameDay, messagingClientId, normalizeMessagingError, optimisticMessage, participantNames, projectConversationSummary, projectMessage, projectMessageAction, projectParticipantRole, projectUserSummary, resolveActor, splitText, summarizeText, toMessagingArchiveFilter, unreadCutoff, useComposer, useConversation, useConversations, useMessageAction, useMessagingAi, useMessagingHost, useMessagingSnapshot, useOnlineUserIds, useRequiredMessagingHost, useTypists, writeNotApplied };
|
|
1993
|
+
export { type ActionChoice, type ActionContext, type ActionHandler, type ActionOutcome, type ActionReceipt, type ActionRegistry, type ActorPresentation, AgentTag, type AiCallArgs, type AiCapability, type AiResult, AlertIcon, type Attachment, Avatar, BotIcon, CheckIcon, ChevronLeftIcon, type ClientMessageId, ClockIcon, CloseIcon, Composer, type ComposerAttachment, type ComposerInputRenderProps, type Conversation, type ConversationAiContext, type ConversationCursor, type ConversationId, ConversationList, type ConversationListProps, type ConversationReadCutoff, type ConversationReadFailure, type ConversationRowWrapperProps, ConversationSkeleton, type ConversationSummary, type ConversationThread, type ConversationType, ConversationView, type ConversationViewProps, DEFAULT_MESSAGING_ARCHIVE_FILTER, type DeliveryState, DeliveryTick, DoubleCheckIcon, type DraftMessage, EmptyState, type EngineDiagnostic, type IncomingMessageContext, type JsonObject, type JsonValue, LinkIcon, MESSAGING_EVENTS, MESSAGING_RPC_SCHEMA, MESSAGING_SCHEMA, type MatrxReference, type Message, type MessageAction, MessageActionChips, type MessageActionRenderProps, type MessageActionRenderer, MessageBubble, type MessageCursor, type MessageGroup, type MessageId, type MessageKind, type MessageWrapperProps, type MessagingAgentIdentity, type MessagingAgents, type MessagingAi, type MessagingAiOptions, type MessagingArchiveFilter, type MessagingEngine, type MessagingEngineOptions, MessagingError, type MessagingErrorCode, type MessagingHost, type MessagingIdentity, MessagingInbox, type MessagingInboxProps, MessagingProvider, type MessagingProviderProps, type MessagingRepository, type MessagingSnapshot, type MessagingStore, type MessagingSupabaseClient, type MessagingSupabaseInternal, type OrganizationId, type Outbox, type OutboxEntry, type OutboxOptions, type OutboxStorage, type Page, PaperclipIcon, type Participant, type ParticipantRole, type PendingSoftExpiries, PlusIcon, type PostgrestFilterLike, type PostgrestLikeResponse, type PostgrestTableLike, RPCS, type ReadCache, type ReadCacheOptions, ReferenceCard, type ReferenceRenderer, ReplyIcon, type RepositoryOptions, SERVER_SESSION_IDENTITY, type SchemaLike, SearchIcon, SendIcon, type SessionIdentity, type SessionIdentitySnapshot, type SessionResolver, SparklesIcon, type SupabaseLike, TABLES, type TextSegment, TypingDots, type UseComposerResult, type UseConversationResult, type UseConversationsResult, type UseMessageActionResult, type UseMessagingAiResult, type UseTypistsResult, type UserId, type UserSummary, UsersIcon, asClientMessageId, asConversationId, asMessageId, asOrganizationId, asUserId, composeFence, conversationContextVariables, conversationTopic, createActionRegistry, createMemoryOutboxStorage, createMessagingAi, createMessagingEngine, createMessagingRepository, createMessagingStore, createOutbox, createReadCache, createSessionIdentity, createWebOutboxStorage, effectiveActorKey, extractReferences, formatConversationTime, formatDateSeparator, formatLastSeen, formatMessageTime, formatTypists, groupMessages, inboxTopic, invalidResponse, isLapsed, isSameDay, messagingClientId, normalizeMessagingError, optimisticMessage, participantNames, projectConversationSummary, projectMessage, projectMessageAction, projectParticipantRole, projectUserSummary, resolveActor, softExpiryTime, splitText, summarizeText, toMessagingArchiveFilter, unreadCutoff, useComposer, useConversation, useConversations, useMessageAction, useMessagingAi, useMessagingHost, useMessagingSnapshot, useOnlineUserIds, useRequiredMessagingHost, useTypists, writeNotApplied };
|