@liveblocks/core 3.16.0 → 3.17.0-rc1

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/index.d.cts CHANGED
@@ -685,6 +685,61 @@ type CompactRegisterNode = readonly [
685
685
  declare function compactNodesToNodeStream(compactNodes: CompactNode[]): NodeStream;
686
686
  declare function nodeStreamToCompactNodes(nodes: NodeStream): Iterable<CompactNode>;
687
687
 
688
+ /**
689
+ * Extracts only the explicitly-named string keys of a type, filtering out
690
+ * any index signature (e.g. `[key: string]: ...`).
691
+ */
692
+ type KnownKeys<T> = keyof {
693
+ [K in keyof T as {} extends Record<K, 1> ? never : K]: true;
694
+ } & string;
695
+
696
+ /**
697
+ * Per-key sync configuration for node/edge `data` properties.
698
+ *
699
+ * true
700
+ * Sync this property to Liveblocks Storage. Arrays and objects in the value
701
+ * will be stored as LiveLists and LiveObjects, enabling fine-grained
702
+ * conflict-free merging. This is the default for all keys.
703
+ *
704
+ * false
705
+ * Don't sync this property. It stays local to the current client. This
706
+ * property will be `undefined` on other clients.
707
+ *
708
+ * "atomic"
709
+ * Sync this property, but treat it as an indivisible value. The entire value
710
+ * is replaced as a whole (last-writer-wins) instead of being recursively
711
+ * converted to LiveObjects/LiveLists. Use this when clients always replace
712
+ * the value entirely and never need concurrent sub-key merging.
713
+ *
714
+ * { ... }
715
+ * A nested config object for recursively configuring sub-keys of an object.
716
+ *
717
+ * @example
718
+ * ```ts
719
+ * const sync: SyncConfig = {
720
+ * label: true, // sync (default)
721
+ * createdAt: false, // local-only
722
+ * shape: "atomic", // replaced as a whole, no deep merge
723
+ * nested: { // recursive config
724
+ * deep: false,
725
+ * },
726
+ * };
727
+ * ```
728
+ */
729
+ type SyncMode = boolean | "atomic" | SyncConfig;
730
+ type SyncConfig = {
731
+ [key: string]: SyncMode | undefined;
732
+ };
733
+
734
+ /**
735
+ * Optional keys of O whose non-undefined type is plain Json (not a
736
+ * LiveStructure). These are the only keys eligible for setLocal().
737
+ * Uses KnownKeys to only consider explicitly-named keys, not index signatures.
738
+ * Checks optionality inline to avoid index signature pollution of OptionalKeys.
739
+ */
740
+ type OptionalJsonKeys<O> = {
741
+ [K in KnownKeys<O>]: undefined extends O[K] ? Exclude<O[K], undefined> extends Json ? K : never : never;
742
+ }[KnownKeys<O>];
688
743
  type LiveObjectUpdateDelta<O extends {
689
744
  [key: string]: unknown;
690
745
  }> = {
@@ -719,6 +774,8 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
719
774
  /** @private Do not use this API directly */
720
775
  static _fromItems<O extends LsonObject>(nodes: NodeStream, pool: ManagedPool): LiveObject<O>;
721
776
  constructor(obj?: O);
777
+ /** @private */
778
+ keys(): Set<string>;
722
779
  /**
723
780
  * Transform the LiveObject into a javascript object
724
781
  */
@@ -729,6 +786,17 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
729
786
  * @param value The value of the property to add
730
787
  */
731
788
  set<TKey extends keyof O>(key: TKey, value: O[TKey]): void;
789
+ /**
790
+ * @experimental
791
+ *
792
+ * Sets a local-only property that is not synchronized over the wire.
793
+ * The value will be visible via get(), toObject(), and toImmutable() on
794
+ * this client only. Other clients and the server will see `undefined`
795
+ * for this key.
796
+ *
797
+ * Caveat: this method will not add changes to the undo/redo stack.
798
+ */
799
+ setLocal<TKey extends OptionalJsonKeys<O>>(key: TKey, value: Extract<Exclude<O[TKey], undefined>, Json>): void;
732
800
  /**
733
801
  * Returns a specified property from the LiveObject.
734
802
  * @param key The key of the property to get
@@ -744,6 +812,22 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
744
812
  * @param patch The object used to overrides properties
745
813
  */
746
814
  update(patch: Partial<O>): void;
815
+ /**
816
+ * Creates a new LiveObject from a plain JSON object, recursively converting
817
+ * nested objects to LiveObjects and arrays to LiveLists. An optional
818
+ * SyncConfig controls per-key behavior (local-only, atomic, or deep).
819
+ *
820
+ * @private
821
+ */
822
+ static from(obj: JsonObject, config?: SyncConfig): LiveObject<LsonObject>;
823
+ /**
824
+ * Reconciles a LiveObject tree to match the given JSON object and sync
825
+ * config. Only mutates keys that actually changed. Recursively reconciles
826
+ * the entire Live tree below it.
827
+ *
828
+ * @private
829
+ */
830
+ reconcile(jsonObj: JsonObject, config?: SyncConfig): void;
747
831
  toImmutable(): ToImmutable<O>;
748
832
  clone(): LiveObject<O>;
749
833
  }
@@ -909,6 +993,12 @@ declare function createManagedPool(roomId: string, options: CreateManagedPoolOpt
909
993
  declare abstract class AbstractCrdt {
910
994
  #private;
911
995
  get roomId(): string | null;
996
+ /**
997
+ * @private
998
+ * Returns true if the cached immutable snapshot exists and is
999
+ * reference-equal to the given value. Does not trigger a recompute.
1000
+ */
1001
+ immutableIs(value: unknown): boolean;
912
1002
  /**
913
1003
  * Return an immutable snapshot of this Live node and its children.
914
1004
  */
@@ -1604,12 +1694,20 @@ declare enum TextEditorType {
1604
1694
  }
1605
1695
  type BadgeLocation = "top-right" | "bottom-right" | "bottom-left" | "top-left";
1606
1696
 
1607
- type OptionalKeys<T> = {
1697
+ /**
1698
+ * Extracts the optional keys (whose values are allowed to be `undefined`).
1699
+ */
1700
+ type OptionalKeys<T> = Extract<{
1608
1701
  [K in keyof T]-?: undefined extends T[K] ? K : never;
1609
- }[keyof T];
1702
+ }[keyof T], string>;
1610
1703
  type MakeOptionalFieldsNullable<T> = {
1611
1704
  [K in keyof T]: K extends OptionalKeys<T> ? T[K] | null : T[K];
1612
1705
  };
1706
+ /**
1707
+ * Like Partial<T>, but also allows `null` for optional fields. Useful for
1708
+ * representing patches where `null` means "remove this field" and `undefined`
1709
+ * means "leave this field unchanged".
1710
+ */
1613
1711
  type Patchable<T> = Partial<MakeOptionalFieldsNullable<T>>;
1614
1712
 
1615
1713
  interface RoomHttpApi<TM extends BaseMetadata, CM extends BaseMetadata> {
@@ -3266,6 +3364,9 @@ interface History {
3266
3364
  * // room.getPresence() equals { cursor: { x: 0, y: 0 } }
3267
3365
  */
3268
3366
  resume: () => void;
3367
+ readonly [kInternal]: {
3368
+ withoutHistory: <T>(fn: () => T) => T;
3369
+ };
3269
3370
  }
3270
3371
  type HistoryEvent = {
3271
3372
  canUndo: boolean;
@@ -4865,7 +4966,7 @@ declare function isLiveNode(value: unknown): value is LiveNode;
4865
4966
  declare function cloneLson<L extends Lson | undefined>(value: L): L;
4866
4967
 
4867
4968
  declare function lsonToJson(value: Lson): Json;
4868
- declare function patchLiveObjectKey<O extends LsonObject, K extends keyof O, V extends Json>(liveObject: LiveObject<O>, key: K, prev?: V, next?: V): void;
4969
+ declare function legacy_patchLiveObjectKey<O extends LsonObject, K extends keyof O, V extends Json>(liveObject: LiveObject<O>, key: K, prev?: V, next?: V): void;
4869
4970
  declare function legacy_patchImmutableObject<TState extends JsonObject>(state: TState, updates: StorageUpdate[]): TState;
4870
4971
 
4871
4972
  /**
@@ -5557,4 +5658,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
5557
5658
  [K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
5558
5659
  };
5559
5660
 
5560
- export { type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeRetrievalPart, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiSourcesPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUrlSource, type AiUserMessage, type AiWebRetrievalPart, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type ChildStorageNode, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type ClientWireOp, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, type CommentsEventServerMsg, type CompactChildNode, type CompactListNode, type CompactMapNode, type CompactNode, type CompactObjectNode, type CompactRegisterNode, type CompactRootNode, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DCM, type DE, type DFM, type DFMD, type DGI, type DP, type DRI, type DS, type DTM, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type Feed, type FeedCreateMetadata, type FeedDeletedServerMsg, type FeedFetchMetadataFilter, type FeedMessage, type FeedMessagesAddedServerMsg, type FeedMessagesDeletedServerMsg, type FeedMessagesListServerMsg, type FeedMessagesUpdatedServerMsg, type FeedRequestError, FeedRequestErrorCode, type FeedRequestFailedServerMsg, type FeedUpdateMetadata, type FeedsAddedServerMsg, type FeedsEventServerMsg, type FeedsListServerMsg, type FeedsUpdatedServerMsg, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type HasOpId, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IgnoredOp, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LayerKey, type ListStorageNode, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MapStorageNode, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NodeStream, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type ObjectStorageNode, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RegisterStorageNode, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type RootStorageNode, type SearchCommentsResult, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type ServerWireOp, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageChunkServerMsg, type StorageNode, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type UrlMetadata, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactNodesToNodeStream, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isListStorageNode, isLiveNode, isMapStorageNode, isNotificationChannelEnabled, isNumberOperator, isObjectStorageNode, isPlainObject, isRegisterStorageNode, isRootStorageNode, isStartsWithOperator, isUrl, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, nodeStreamToCompactNodes, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
5661
+ export { type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeRetrievalPart, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiSourcesPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUrlSource, type AiUserMessage, type AiWebRetrievalPart, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type ChildStorageNode, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type ClientWireOp, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, type CommentsEventServerMsg, type CompactChildNode, type CompactListNode, type CompactMapNode, type CompactNode, type CompactObjectNode, type CompactRegisterNode, type CompactRootNode, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DCM, type DE, type DFM, type DFMD, type DGI, type DP, type DRI, type DS, type DTM, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type Feed, type FeedCreateMetadata, type FeedDeletedServerMsg, type FeedFetchMetadataFilter, type FeedMessage, type FeedMessagesAddedServerMsg, type FeedMessagesDeletedServerMsg, type FeedMessagesListServerMsg, type FeedMessagesUpdatedServerMsg, type FeedRequestError, FeedRequestErrorCode, type FeedRequestFailedServerMsg, type FeedUpdateMetadata, type FeedsAddedServerMsg, type FeedsEventServerMsg, type FeedsListServerMsg, type FeedsUpdatedServerMsg, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type HasOpId, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IgnoredOp, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LayerKey, type ListStorageNode, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MapStorageNode, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NodeStream, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type ObjectStorageNode, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RegisterStorageNode, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type RootStorageNode, type SearchCommentsResult, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type ServerWireOp, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageChunkServerMsg, type StorageNode, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncConfig, type SyncMode, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type UrlMetadata, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactNodesToNodeStream, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isListStorageNode, isLiveNode, isMapStorageNode, isNotificationChannelEnabled, isNumberOperator, isObjectStorageNode, isPlainObject, isRegisterStorageNode, isRootStorageNode, isStartsWithOperator, isUrl, kInternal, keys, legacy_patchImmutableObject, legacy_patchLiveObjectKey, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, nodeStreamToCompactNodes, objectToQuery, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
package/dist/index.d.ts CHANGED
@@ -685,6 +685,61 @@ type CompactRegisterNode = readonly [
685
685
  declare function compactNodesToNodeStream(compactNodes: CompactNode[]): NodeStream;
686
686
  declare function nodeStreamToCompactNodes(nodes: NodeStream): Iterable<CompactNode>;
687
687
 
688
+ /**
689
+ * Extracts only the explicitly-named string keys of a type, filtering out
690
+ * any index signature (e.g. `[key: string]: ...`).
691
+ */
692
+ type KnownKeys<T> = keyof {
693
+ [K in keyof T as {} extends Record<K, 1> ? never : K]: true;
694
+ } & string;
695
+
696
+ /**
697
+ * Per-key sync configuration for node/edge `data` properties.
698
+ *
699
+ * true
700
+ * Sync this property to Liveblocks Storage. Arrays and objects in the value
701
+ * will be stored as LiveLists and LiveObjects, enabling fine-grained
702
+ * conflict-free merging. This is the default for all keys.
703
+ *
704
+ * false
705
+ * Don't sync this property. It stays local to the current client. This
706
+ * property will be `undefined` on other clients.
707
+ *
708
+ * "atomic"
709
+ * Sync this property, but treat it as an indivisible value. The entire value
710
+ * is replaced as a whole (last-writer-wins) instead of being recursively
711
+ * converted to LiveObjects/LiveLists. Use this when clients always replace
712
+ * the value entirely and never need concurrent sub-key merging.
713
+ *
714
+ * { ... }
715
+ * A nested config object for recursively configuring sub-keys of an object.
716
+ *
717
+ * @example
718
+ * ```ts
719
+ * const sync: SyncConfig = {
720
+ * label: true, // sync (default)
721
+ * createdAt: false, // local-only
722
+ * shape: "atomic", // replaced as a whole, no deep merge
723
+ * nested: { // recursive config
724
+ * deep: false,
725
+ * },
726
+ * };
727
+ * ```
728
+ */
729
+ type SyncMode = boolean | "atomic" | SyncConfig;
730
+ type SyncConfig = {
731
+ [key: string]: SyncMode | undefined;
732
+ };
733
+
734
+ /**
735
+ * Optional keys of O whose non-undefined type is plain Json (not a
736
+ * LiveStructure). These are the only keys eligible for setLocal().
737
+ * Uses KnownKeys to only consider explicitly-named keys, not index signatures.
738
+ * Checks optionality inline to avoid index signature pollution of OptionalKeys.
739
+ */
740
+ type OptionalJsonKeys<O> = {
741
+ [K in KnownKeys<O>]: undefined extends O[K] ? Exclude<O[K], undefined> extends Json ? K : never : never;
742
+ }[KnownKeys<O>];
688
743
  type LiveObjectUpdateDelta<O extends {
689
744
  [key: string]: unknown;
690
745
  }> = {
@@ -719,6 +774,8 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
719
774
  /** @private Do not use this API directly */
720
775
  static _fromItems<O extends LsonObject>(nodes: NodeStream, pool: ManagedPool): LiveObject<O>;
721
776
  constructor(obj?: O);
777
+ /** @private */
778
+ keys(): Set<string>;
722
779
  /**
723
780
  * Transform the LiveObject into a javascript object
724
781
  */
@@ -729,6 +786,17 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
729
786
  * @param value The value of the property to add
730
787
  */
731
788
  set<TKey extends keyof O>(key: TKey, value: O[TKey]): void;
789
+ /**
790
+ * @experimental
791
+ *
792
+ * Sets a local-only property that is not synchronized over the wire.
793
+ * The value will be visible via get(), toObject(), and toImmutable() on
794
+ * this client only. Other clients and the server will see `undefined`
795
+ * for this key.
796
+ *
797
+ * Caveat: this method will not add changes to the undo/redo stack.
798
+ */
799
+ setLocal<TKey extends OptionalJsonKeys<O>>(key: TKey, value: Extract<Exclude<O[TKey], undefined>, Json>): void;
732
800
  /**
733
801
  * Returns a specified property from the LiveObject.
734
802
  * @param key The key of the property to get
@@ -744,6 +812,22 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
744
812
  * @param patch The object used to overrides properties
745
813
  */
746
814
  update(patch: Partial<O>): void;
815
+ /**
816
+ * Creates a new LiveObject from a plain JSON object, recursively converting
817
+ * nested objects to LiveObjects and arrays to LiveLists. An optional
818
+ * SyncConfig controls per-key behavior (local-only, atomic, or deep).
819
+ *
820
+ * @private
821
+ */
822
+ static from(obj: JsonObject, config?: SyncConfig): LiveObject<LsonObject>;
823
+ /**
824
+ * Reconciles a LiveObject tree to match the given JSON object and sync
825
+ * config. Only mutates keys that actually changed. Recursively reconciles
826
+ * the entire Live tree below it.
827
+ *
828
+ * @private
829
+ */
830
+ reconcile(jsonObj: JsonObject, config?: SyncConfig): void;
747
831
  toImmutable(): ToImmutable<O>;
748
832
  clone(): LiveObject<O>;
749
833
  }
@@ -909,6 +993,12 @@ declare function createManagedPool(roomId: string, options: CreateManagedPoolOpt
909
993
  declare abstract class AbstractCrdt {
910
994
  #private;
911
995
  get roomId(): string | null;
996
+ /**
997
+ * @private
998
+ * Returns true if the cached immutable snapshot exists and is
999
+ * reference-equal to the given value. Does not trigger a recompute.
1000
+ */
1001
+ immutableIs(value: unknown): boolean;
912
1002
  /**
913
1003
  * Return an immutable snapshot of this Live node and its children.
914
1004
  */
@@ -1604,12 +1694,20 @@ declare enum TextEditorType {
1604
1694
  }
1605
1695
  type BadgeLocation = "top-right" | "bottom-right" | "bottom-left" | "top-left";
1606
1696
 
1607
- type OptionalKeys<T> = {
1697
+ /**
1698
+ * Extracts the optional keys (whose values are allowed to be `undefined`).
1699
+ */
1700
+ type OptionalKeys<T> = Extract<{
1608
1701
  [K in keyof T]-?: undefined extends T[K] ? K : never;
1609
- }[keyof T];
1702
+ }[keyof T], string>;
1610
1703
  type MakeOptionalFieldsNullable<T> = {
1611
1704
  [K in keyof T]: K extends OptionalKeys<T> ? T[K] | null : T[K];
1612
1705
  };
1706
+ /**
1707
+ * Like Partial<T>, but also allows `null` for optional fields. Useful for
1708
+ * representing patches where `null` means "remove this field" and `undefined`
1709
+ * means "leave this field unchanged".
1710
+ */
1613
1711
  type Patchable<T> = Partial<MakeOptionalFieldsNullable<T>>;
1614
1712
 
1615
1713
  interface RoomHttpApi<TM extends BaseMetadata, CM extends BaseMetadata> {
@@ -3266,6 +3364,9 @@ interface History {
3266
3364
  * // room.getPresence() equals { cursor: { x: 0, y: 0 } }
3267
3365
  */
3268
3366
  resume: () => void;
3367
+ readonly [kInternal]: {
3368
+ withoutHistory: <T>(fn: () => T) => T;
3369
+ };
3269
3370
  }
3270
3371
  type HistoryEvent = {
3271
3372
  canUndo: boolean;
@@ -4865,7 +4966,7 @@ declare function isLiveNode(value: unknown): value is LiveNode;
4865
4966
  declare function cloneLson<L extends Lson | undefined>(value: L): L;
4866
4967
 
4867
4968
  declare function lsonToJson(value: Lson): Json;
4868
- declare function patchLiveObjectKey<O extends LsonObject, K extends keyof O, V extends Json>(liveObject: LiveObject<O>, key: K, prev?: V, next?: V): void;
4969
+ declare function legacy_patchLiveObjectKey<O extends LsonObject, K extends keyof O, V extends Json>(liveObject: LiveObject<O>, key: K, prev?: V, next?: V): void;
4869
4970
  declare function legacy_patchImmutableObject<TState extends JsonObject>(state: TState, updates: StorageUpdate[]): TState;
4870
4971
 
4871
4972
  /**
@@ -5557,4 +5658,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
5557
5658
  [K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
5558
5659
  };
5559
5660
 
5560
- export { type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeRetrievalPart, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiSourcesPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUrlSource, type AiUserMessage, type AiWebRetrievalPart, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type ChildStorageNode, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type ClientWireOp, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, type CommentsEventServerMsg, type CompactChildNode, type CompactListNode, type CompactMapNode, type CompactNode, type CompactObjectNode, type CompactRegisterNode, type CompactRootNode, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DCM, type DE, type DFM, type DFMD, type DGI, type DP, type DRI, type DS, type DTM, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type Feed, type FeedCreateMetadata, type FeedDeletedServerMsg, type FeedFetchMetadataFilter, type FeedMessage, type FeedMessagesAddedServerMsg, type FeedMessagesDeletedServerMsg, type FeedMessagesListServerMsg, type FeedMessagesUpdatedServerMsg, type FeedRequestError, FeedRequestErrorCode, type FeedRequestFailedServerMsg, type FeedUpdateMetadata, type FeedsAddedServerMsg, type FeedsEventServerMsg, type FeedsListServerMsg, type FeedsUpdatedServerMsg, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type HasOpId, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IgnoredOp, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LayerKey, type ListStorageNode, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MapStorageNode, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NodeStream, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type ObjectStorageNode, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RegisterStorageNode, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type RootStorageNode, type SearchCommentsResult, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type ServerWireOp, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageChunkServerMsg, type StorageNode, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type UrlMetadata, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactNodesToNodeStream, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isListStorageNode, isLiveNode, isMapStorageNode, isNotificationChannelEnabled, isNumberOperator, isObjectStorageNode, isPlainObject, isRegisterStorageNode, isRootStorageNode, isStartsWithOperator, isUrl, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, nodeStreamToCompactNodes, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
5661
+ export { type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeRetrievalPart, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiSourcesPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUrlSource, type AiUserMessage, type AiWebRetrievalPart, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type ChildStorageNode, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type ClientWireOp, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, type CommentsEventServerMsg, type CompactChildNode, type CompactListNode, type CompactMapNode, type CompactNode, type CompactObjectNode, type CompactRegisterNode, type CompactRootNode, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DCM, type DE, type DFM, type DFMD, type DGI, type DP, type DRI, type DS, type DTM, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type Feed, type FeedCreateMetadata, type FeedDeletedServerMsg, type FeedFetchMetadataFilter, type FeedMessage, type FeedMessagesAddedServerMsg, type FeedMessagesDeletedServerMsg, type FeedMessagesListServerMsg, type FeedMessagesUpdatedServerMsg, type FeedRequestError, FeedRequestErrorCode, type FeedRequestFailedServerMsg, type FeedUpdateMetadata, type FeedsAddedServerMsg, type FeedsEventServerMsg, type FeedsListServerMsg, type FeedsUpdatedServerMsg, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type HasOpId, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IgnoredOp, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LayerKey, type ListStorageNode, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MapStorageNode, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NodeStream, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type ObjectStorageNode, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RegisterStorageNode, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type RootStorageNode, type SearchCommentsResult, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type ServerWireOp, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageChunkServerMsg, type StorageNode, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncConfig, type SyncMode, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type UrlMetadata, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactNodesToNodeStream, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isListStorageNode, isLiveNode, isMapStorageNode, isNotificationChannelEnabled, isNumberOperator, isObjectStorageNode, isPlainObject, isRegisterStorageNode, isRootStorageNode, isStartsWithOperator, isUrl, kInternal, keys, legacy_patchImmutableObject, legacy_patchLiveObjectKey, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, nodeStreamToCompactNodes, objectToQuery, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };