@liveblocks/core 3.16.0-flow1 → 3.16.0-flow3

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
@@ -595,6 +595,47 @@ type PlainLsonList = {
595
595
  };
596
596
  type PlainLson = PlainLsonObject | PlainLsonMap | PlainLsonList | Json;
597
597
 
598
+ declare function lsonToJson(value: Lson): Json;
599
+ /**
600
+ * Per-key sync configuration for node/edge `data` properties.
601
+ *
602
+ * true
603
+ * Sync this property to Liveblocks Storage. Arrays and objects in the value
604
+ * will be stored as LiveLists and LiveObjects, enabling fine-grained
605
+ * conflict-free merging. This is the default for all keys.
606
+ *
607
+ * false
608
+ * Don't sync this property. It stays local to the current client. This
609
+ * property will be `undefined` on other clients.
610
+ *
611
+ * "atomic"
612
+ * Sync this property, but treat it as an indivisible value. The entire value
613
+ * is replaced as a whole (last-writer-wins) instead of being recursively
614
+ * converted to LiveObjects/LiveLists. Use this when clients always replace
615
+ * the value entirely and never need concurrent sub-key merging.
616
+ *
617
+ * { ... }
618
+ * A nested config object for recursively configuring sub-keys of an object.
619
+ *
620
+ * @example
621
+ * ```ts
622
+ * const sync: SyncConfig = {
623
+ * label: true, // sync (default)
624
+ * createdAt: false, // local-only
625
+ * shape: "atomic", // replaced as a whole, no deep merge
626
+ * nested: { // recursive config
627
+ * deep: false,
628
+ * },
629
+ * };
630
+ * ```
631
+ */
632
+ type SyncMode = boolean | "atomic" | SyncConfig;
633
+ type SyncConfig = {
634
+ [key: string]: SyncMode | undefined;
635
+ };
636
+ declare function legacy_patchLiveObjectKey<O extends LsonObject, K extends keyof O, V extends Json>(liveObject: LiveObject<O>, key: K, prev?: V, next?: V): void;
637
+ declare function legacy_patchImmutableObject<TState extends JsonObject>(state: TState, updates: StorageUpdate[]): TState;
638
+
598
639
  type CrdtType = (typeof CrdtType)[keyof typeof CrdtType];
599
640
  declare const CrdtType: Readonly<{
600
641
  OBJECT: 0;
@@ -684,6 +725,23 @@ type CompactRegisterNode = readonly [
684
725
  declare function compactNodesToNodeStream(compactNodes: CompactNode[]): NodeStream;
685
726
  declare function nodeStreamToCompactNodes(nodes: NodeStream): Iterable<CompactNode>;
686
727
 
728
+ /**
729
+ * Extracts only the explicitly-named string keys of a type, filtering out
730
+ * any index signature (e.g. `[key: string]: ...`).
731
+ */
732
+ type KnownKeys<T> = keyof {
733
+ [K in keyof T as {} extends Record<K, 1> ? never : K]: true;
734
+ } & string;
735
+
736
+ /**
737
+ * Optional keys of O whose non-undefined type is plain Json (not a
738
+ * LiveStructure). These are the only keys eligible for setLocal().
739
+ * Uses KnownKeys to only consider explicitly-named keys, not index signatures.
740
+ * Checks optionality inline to avoid index signature pollution of OptionalKeys.
741
+ */
742
+ type OptionalJsonKeys<O> = {
743
+ [K in KnownKeys<O>]: undefined extends O[K] ? Exclude<O[K], undefined> extends Json ? K : never : never;
744
+ }[KnownKeys<O>];
687
745
  type LiveObjectUpdateDelta<O extends {
688
746
  [key: string]: unknown;
689
747
  }> = {
@@ -718,6 +776,8 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
718
776
  /** @private Do not use this API directly */
719
777
  static _fromItems<O extends LsonObject>(nodes: NodeStream, pool: ManagedPool): LiveObject<O>;
720
778
  constructor(obj?: O);
779
+ /** @private */
780
+ keys(): Set<string>;
721
781
  /**
722
782
  * Transform the LiveObject into a javascript object
723
783
  */
@@ -728,6 +788,17 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
728
788
  * @param value The value of the property to add
729
789
  */
730
790
  set<TKey extends keyof O>(key: TKey, value: O[TKey]): void;
791
+ /**
792
+ * @experimental
793
+ *
794
+ * Sets a local-only property that is not synchronized over the wire.
795
+ * The value will be visible via get(), toObject(), and toImmutable() on
796
+ * this client only. Other clients and the server will see `undefined`
797
+ * for this key.
798
+ *
799
+ * Caveat: this method will not add changes to the undo/redo stack.
800
+ */
801
+ setLocal<TKey extends OptionalJsonKeys<O>>(key: TKey, value: Extract<Exclude<O[TKey], undefined>, Json>): void;
731
802
  /**
732
803
  * Returns a specified property from the LiveObject.
733
804
  * @param key The key of the property to get
@@ -743,6 +814,22 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
743
814
  * @param patch The object used to overrides properties
744
815
  */
745
816
  update(patch: Partial<O>): void;
817
+ /**
818
+ * Creates a new LiveObject from a plain JSON object, recursively converting
819
+ * nested objects to LiveObjects and arrays to LiveLists. An optional
820
+ * SyncConfig controls per-key behavior (local-only, atomic, or deep).
821
+ *
822
+ * @private
823
+ */
824
+ static from(obj: JsonObject, config?: SyncConfig): LiveObject<LsonObject>;
825
+ /**
826
+ * Reconciles a LiveObject tree to match the given JSON object and sync
827
+ * config. Only mutates keys that actually changed. Recursively reconciles
828
+ * the entire Live tree below it.
829
+ *
830
+ * @private
831
+ */
832
+ reconcile(jsonObj: JsonObject, config?: SyncConfig): void;
746
833
  toImmutable(): ToImmutable<O>;
747
834
  clone(): LiveObject<O>;
748
835
  }
@@ -908,6 +995,12 @@ declare function createManagedPool(roomId: string, options: CreateManagedPoolOpt
908
995
  declare abstract class AbstractCrdt {
909
996
  #private;
910
997
  get roomId(): string | null;
998
+ /**
999
+ * @private
1000
+ * Returns true if the cached immutable snapshot exists and is
1001
+ * reference-equal to the given value. Does not trigger a recompute.
1002
+ */
1003
+ immutableIs(value: unknown): boolean;
911
1004
  /**
912
1005
  * Return an immutable snapshot of this Live node and its children.
913
1006
  */
@@ -1601,12 +1694,20 @@ declare enum TextEditorType {
1601
1694
  }
1602
1695
  type BadgeLocation = "top-right" | "bottom-right" | "bottom-left" | "top-left";
1603
1696
 
1604
- type OptionalKeys<T> = {
1697
+ /**
1698
+ * Extracts the optional keys (whose values are allowed to be `undefined`).
1699
+ */
1700
+ type OptionalKeys<T> = Extract<{
1605
1701
  [K in keyof T]-?: undefined extends T[K] ? K : never;
1606
- }[keyof T];
1702
+ }[keyof T], string>;
1607
1703
  type MakeOptionalFieldsNullable<T> = {
1608
1704
  [K in keyof T]: K extends OptionalKeys<T> ? T[K] | null : T[K];
1609
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
+ */
1610
1711
  type Patchable<T> = Partial<MakeOptionalFieldsNullable<T>>;
1611
1712
 
1612
1713
  interface RoomHttpApi<TM extends BaseMetadata, CM extends BaseMetadata> {
@@ -3087,6 +3188,9 @@ interface History {
3087
3188
  * // room.getPresence() equals { cursor: { x: 0, y: 0 } }
3088
3189
  */
3089
3190
  resume: () => void;
3191
+ readonly [kInternal]: {
3192
+ withoutHistory: <T>(fn: () => T) => T;
3193
+ };
3090
3194
  }
3091
3195
  type HistoryEvent = {
3092
3196
  canUndo: boolean;
@@ -4627,10 +4731,6 @@ ChildStorageNode[]>;
4627
4731
  declare function isLiveNode(value: unknown): value is LiveNode;
4628
4732
  declare function cloneLson<L extends Lson | undefined>(value: L): L;
4629
4733
 
4630
- declare function lsonToJson(value: Lson): Json;
4631
- declare function patchLiveObjectKey<O extends LsonObject, K extends keyof O, V extends Json>(liveObject: LiveObject<O>, key: K, prev?: V, next?: V): void;
4632
- declare function legacy_patchImmutableObject<TState extends JsonObject>(state: TState, updates: StorageUpdate[]): TState;
4633
-
4634
4734
  /**
4635
4735
  * Like `new AbortController()`, but where the result can be unpacked
4636
4736
  * safely, i.e. `const { signal, abort } = makeAbortController()`.
@@ -5320,4 +5420,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
5320
5420
  [K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
5321
5421
  };
5322
5422
 
5323
- 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 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 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 };
5423
+ 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 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 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
@@ -595,6 +595,47 @@ type PlainLsonList = {
595
595
  };
596
596
  type PlainLson = PlainLsonObject | PlainLsonMap | PlainLsonList | Json;
597
597
 
598
+ declare function lsonToJson(value: Lson): Json;
599
+ /**
600
+ * Per-key sync configuration for node/edge `data` properties.
601
+ *
602
+ * true
603
+ * Sync this property to Liveblocks Storage. Arrays and objects in the value
604
+ * will be stored as LiveLists and LiveObjects, enabling fine-grained
605
+ * conflict-free merging. This is the default for all keys.
606
+ *
607
+ * false
608
+ * Don't sync this property. It stays local to the current client. This
609
+ * property will be `undefined` on other clients.
610
+ *
611
+ * "atomic"
612
+ * Sync this property, but treat it as an indivisible value. The entire value
613
+ * is replaced as a whole (last-writer-wins) instead of being recursively
614
+ * converted to LiveObjects/LiveLists. Use this when clients always replace
615
+ * the value entirely and never need concurrent sub-key merging.
616
+ *
617
+ * { ... }
618
+ * A nested config object for recursively configuring sub-keys of an object.
619
+ *
620
+ * @example
621
+ * ```ts
622
+ * const sync: SyncConfig = {
623
+ * label: true, // sync (default)
624
+ * createdAt: false, // local-only
625
+ * shape: "atomic", // replaced as a whole, no deep merge
626
+ * nested: { // recursive config
627
+ * deep: false,
628
+ * },
629
+ * };
630
+ * ```
631
+ */
632
+ type SyncMode = boolean | "atomic" | SyncConfig;
633
+ type SyncConfig = {
634
+ [key: string]: SyncMode | undefined;
635
+ };
636
+ declare function legacy_patchLiveObjectKey<O extends LsonObject, K extends keyof O, V extends Json>(liveObject: LiveObject<O>, key: K, prev?: V, next?: V): void;
637
+ declare function legacy_patchImmutableObject<TState extends JsonObject>(state: TState, updates: StorageUpdate[]): TState;
638
+
598
639
  type CrdtType = (typeof CrdtType)[keyof typeof CrdtType];
599
640
  declare const CrdtType: Readonly<{
600
641
  OBJECT: 0;
@@ -684,6 +725,23 @@ type CompactRegisterNode = readonly [
684
725
  declare function compactNodesToNodeStream(compactNodes: CompactNode[]): NodeStream;
685
726
  declare function nodeStreamToCompactNodes(nodes: NodeStream): Iterable<CompactNode>;
686
727
 
728
+ /**
729
+ * Extracts only the explicitly-named string keys of a type, filtering out
730
+ * any index signature (e.g. `[key: string]: ...`).
731
+ */
732
+ type KnownKeys<T> = keyof {
733
+ [K in keyof T as {} extends Record<K, 1> ? never : K]: true;
734
+ } & string;
735
+
736
+ /**
737
+ * Optional keys of O whose non-undefined type is plain Json (not a
738
+ * LiveStructure). These are the only keys eligible for setLocal().
739
+ * Uses KnownKeys to only consider explicitly-named keys, not index signatures.
740
+ * Checks optionality inline to avoid index signature pollution of OptionalKeys.
741
+ */
742
+ type OptionalJsonKeys<O> = {
743
+ [K in KnownKeys<O>]: undefined extends O[K] ? Exclude<O[K], undefined> extends Json ? K : never : never;
744
+ }[KnownKeys<O>];
687
745
  type LiveObjectUpdateDelta<O extends {
688
746
  [key: string]: unknown;
689
747
  }> = {
@@ -718,6 +776,8 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
718
776
  /** @private Do not use this API directly */
719
777
  static _fromItems<O extends LsonObject>(nodes: NodeStream, pool: ManagedPool): LiveObject<O>;
720
778
  constructor(obj?: O);
779
+ /** @private */
780
+ keys(): Set<string>;
721
781
  /**
722
782
  * Transform the LiveObject into a javascript object
723
783
  */
@@ -728,6 +788,17 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
728
788
  * @param value The value of the property to add
729
789
  */
730
790
  set<TKey extends keyof O>(key: TKey, value: O[TKey]): void;
791
+ /**
792
+ * @experimental
793
+ *
794
+ * Sets a local-only property that is not synchronized over the wire.
795
+ * The value will be visible via get(), toObject(), and toImmutable() on
796
+ * this client only. Other clients and the server will see `undefined`
797
+ * for this key.
798
+ *
799
+ * Caveat: this method will not add changes to the undo/redo stack.
800
+ */
801
+ setLocal<TKey extends OptionalJsonKeys<O>>(key: TKey, value: Extract<Exclude<O[TKey], undefined>, Json>): void;
731
802
  /**
732
803
  * Returns a specified property from the LiveObject.
733
804
  * @param key The key of the property to get
@@ -743,6 +814,22 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
743
814
  * @param patch The object used to overrides properties
744
815
  */
745
816
  update(patch: Partial<O>): void;
817
+ /**
818
+ * Creates a new LiveObject from a plain JSON object, recursively converting
819
+ * nested objects to LiveObjects and arrays to LiveLists. An optional
820
+ * SyncConfig controls per-key behavior (local-only, atomic, or deep).
821
+ *
822
+ * @private
823
+ */
824
+ static from(obj: JsonObject, config?: SyncConfig): LiveObject<LsonObject>;
825
+ /**
826
+ * Reconciles a LiveObject tree to match the given JSON object and sync
827
+ * config. Only mutates keys that actually changed. Recursively reconciles
828
+ * the entire Live tree below it.
829
+ *
830
+ * @private
831
+ */
832
+ reconcile(jsonObj: JsonObject, config?: SyncConfig): void;
746
833
  toImmutable(): ToImmutable<O>;
747
834
  clone(): LiveObject<O>;
748
835
  }
@@ -908,6 +995,12 @@ declare function createManagedPool(roomId: string, options: CreateManagedPoolOpt
908
995
  declare abstract class AbstractCrdt {
909
996
  #private;
910
997
  get roomId(): string | null;
998
+ /**
999
+ * @private
1000
+ * Returns true if the cached immutable snapshot exists and is
1001
+ * reference-equal to the given value. Does not trigger a recompute.
1002
+ */
1003
+ immutableIs(value: unknown): boolean;
911
1004
  /**
912
1005
  * Return an immutable snapshot of this Live node and its children.
913
1006
  */
@@ -1601,12 +1694,20 @@ declare enum TextEditorType {
1601
1694
  }
1602
1695
  type BadgeLocation = "top-right" | "bottom-right" | "bottom-left" | "top-left";
1603
1696
 
1604
- type OptionalKeys<T> = {
1697
+ /**
1698
+ * Extracts the optional keys (whose values are allowed to be `undefined`).
1699
+ */
1700
+ type OptionalKeys<T> = Extract<{
1605
1701
  [K in keyof T]-?: undefined extends T[K] ? K : never;
1606
- }[keyof T];
1702
+ }[keyof T], string>;
1607
1703
  type MakeOptionalFieldsNullable<T> = {
1608
1704
  [K in keyof T]: K extends OptionalKeys<T> ? T[K] | null : T[K];
1609
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
+ */
1610
1711
  type Patchable<T> = Partial<MakeOptionalFieldsNullable<T>>;
1611
1712
 
1612
1713
  interface RoomHttpApi<TM extends BaseMetadata, CM extends BaseMetadata> {
@@ -3087,6 +3188,9 @@ interface History {
3087
3188
  * // room.getPresence() equals { cursor: { x: 0, y: 0 } }
3088
3189
  */
3089
3190
  resume: () => void;
3191
+ readonly [kInternal]: {
3192
+ withoutHistory: <T>(fn: () => T) => T;
3193
+ };
3090
3194
  }
3091
3195
  type HistoryEvent = {
3092
3196
  canUndo: boolean;
@@ -4627,10 +4731,6 @@ ChildStorageNode[]>;
4627
4731
  declare function isLiveNode(value: unknown): value is LiveNode;
4628
4732
  declare function cloneLson<L extends Lson | undefined>(value: L): L;
4629
4733
 
4630
- declare function lsonToJson(value: Lson): Json;
4631
- declare function patchLiveObjectKey<O extends LsonObject, K extends keyof O, V extends Json>(liveObject: LiveObject<O>, key: K, prev?: V, next?: V): void;
4632
- declare function legacy_patchImmutableObject<TState extends JsonObject>(state: TState, updates: StorageUpdate[]): TState;
4633
-
4634
4734
  /**
4635
4735
  * Like `new AbortController()`, but where the result can be unpacked
4636
4736
  * safely, i.e. `const { signal, abort } = makeAbortController()`.
@@ -5320,4 +5420,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
5320
5420
  [K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
5321
5421
  };
5322
5422
 
5323
- 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 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 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 };
5423
+ 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 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 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 };