@liveblocks/core 3.13.1-hackathon → 3.13.2
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.cjs +54 -247
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -101
- package/dist/index.d.ts +3 -101
- package/dist/index.js +14 -207
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -527,8 +527,6 @@ declare const ClientMsgCode: Readonly<{
|
|
|
527
527
|
UPDATE_STORAGE: 201;
|
|
528
528
|
FETCH_YDOC: 300;
|
|
529
529
|
UPDATE_YDOC: 301;
|
|
530
|
-
FETCH_AGENT_SESSIONS: 500;
|
|
531
|
-
FETCH_AGENT_MESSAGES: 502;
|
|
532
530
|
}>;
|
|
533
531
|
declare namespace ClientMsgCode {
|
|
534
532
|
type UPDATE_PRESENCE = typeof ClientMsgCode.UPDATE_PRESENCE;
|
|
@@ -537,13 +535,11 @@ declare namespace ClientMsgCode {
|
|
|
537
535
|
type UPDATE_STORAGE = typeof ClientMsgCode.UPDATE_STORAGE;
|
|
538
536
|
type FETCH_YDOC = typeof ClientMsgCode.FETCH_YDOC;
|
|
539
537
|
type UPDATE_YDOC = typeof ClientMsgCode.UPDATE_YDOC;
|
|
540
|
-
type FETCH_AGENT_SESSIONS = typeof ClientMsgCode.FETCH_AGENT_SESSIONS;
|
|
541
|
-
type FETCH_AGENT_MESSAGES = typeof ClientMsgCode.FETCH_AGENT_MESSAGES;
|
|
542
538
|
}
|
|
543
539
|
/**
|
|
544
540
|
* Messages that can be sent from the client to the server.
|
|
545
541
|
*/
|
|
546
|
-
type ClientMsg<P extends JsonObject, E extends Json> = BroadcastEventClientMsg<E> | UpdatePresenceClientMsg<P> | UpdateStorageClientMsg | FetchStorageClientMsg | FetchYDocClientMsg | UpdateYDocClientMsg
|
|
542
|
+
type ClientMsg<P extends JsonObject, E extends Json> = BroadcastEventClientMsg<E> | UpdatePresenceClientMsg<P> | UpdateStorageClientMsg | FetchStorageClientMsg | FetchYDocClientMsg | UpdateYDocClientMsg;
|
|
547
543
|
type BroadcastEventClientMsg<E extends Json> = {
|
|
548
544
|
type: ClientMsgCode.BROADCAST_EVENT;
|
|
549
545
|
event: E;
|
|
@@ -593,20 +589,6 @@ type UpdateYDocClientMsg = {
|
|
|
593
589
|
readonly guid?: string;
|
|
594
590
|
readonly v2?: boolean;
|
|
595
591
|
};
|
|
596
|
-
type FetchAgentSessionsClientMsg = {
|
|
597
|
-
readonly type: ClientMsgCode.FETCH_AGENT_SESSIONS;
|
|
598
|
-
readonly cursor?: string;
|
|
599
|
-
readonly since?: number;
|
|
600
|
-
readonly limit?: number;
|
|
601
|
-
readonly metadata?: Record<string, string>;
|
|
602
|
-
};
|
|
603
|
-
type FetchAgentMessagesClientMsg = {
|
|
604
|
-
readonly type: ClientMsgCode.FETCH_AGENT_MESSAGES;
|
|
605
|
-
readonly sessionId: string;
|
|
606
|
-
readonly cursor?: string;
|
|
607
|
-
readonly since?: number;
|
|
608
|
-
readonly limit?: number;
|
|
609
|
-
};
|
|
610
592
|
|
|
611
593
|
/**
|
|
612
594
|
* Represents an indefinitely deep arbitrary immutable data
|
|
@@ -2615,17 +2597,6 @@ type Delegates<T extends BaseAuthResult> = {
|
|
|
2615
2597
|
canZombie: () => boolean;
|
|
2616
2598
|
};
|
|
2617
2599
|
|
|
2618
|
-
type AgentSession = {
|
|
2619
|
-
sessionId: string;
|
|
2620
|
-
metadata: Json;
|
|
2621
|
-
timestamp: number;
|
|
2622
|
-
};
|
|
2623
|
-
type AgentMessage = {
|
|
2624
|
-
id: string;
|
|
2625
|
-
timestamp: number;
|
|
2626
|
-
data: Json;
|
|
2627
|
-
};
|
|
2628
|
-
|
|
2629
2600
|
type ServerMsgCode = (typeof ServerMsgCode)[keyof typeof ServerMsgCode];
|
|
2630
2601
|
declare const ServerMsgCode: Readonly<{
|
|
2631
2602
|
UPDATE_PRESENCE: 100;
|
|
@@ -2646,8 +2617,6 @@ declare const ServerMsgCode: Readonly<{
|
|
|
2646
2617
|
COMMENT_REACTION_ADDED: 405;
|
|
2647
2618
|
COMMENT_REACTION_REMOVED: 406;
|
|
2648
2619
|
COMMENT_METADATA_UPDATED: 409;
|
|
2649
|
-
AGENT_SESSIONS: 501;
|
|
2650
|
-
AGENT_MESSAGES: 503;
|
|
2651
2620
|
REJECT_STORAGE_OP: 299;
|
|
2652
2621
|
}>;
|
|
2653
2622
|
declare namespace ServerMsgCode {
|
|
@@ -2668,15 +2637,13 @@ declare namespace ServerMsgCode {
|
|
|
2668
2637
|
type COMMENT_DELETED = typeof ServerMsgCode.COMMENT_DELETED;
|
|
2669
2638
|
type COMMENT_REACTION_ADDED = typeof ServerMsgCode.COMMENT_REACTION_ADDED;
|
|
2670
2639
|
type COMMENT_REACTION_REMOVED = typeof ServerMsgCode.COMMENT_REACTION_REMOVED;
|
|
2671
|
-
type AGENT_SESSIONS = typeof ServerMsgCode.AGENT_SESSIONS;
|
|
2672
|
-
type AGENT_MESSAGES = typeof ServerMsgCode.AGENT_MESSAGES;
|
|
2673
2640
|
type COMMENT_METADATA_UPDATED = typeof ServerMsgCode.COMMENT_METADATA_UPDATED;
|
|
2674
2641
|
type REJECT_STORAGE_OP = typeof ServerMsgCode.REJECT_STORAGE_OP;
|
|
2675
2642
|
}
|
|
2676
2643
|
/**
|
|
2677
2644
|
* Messages that can be sent from the server to the client.
|
|
2678
2645
|
*/
|
|
2679
|
-
type ServerMsg<P extends JsonObject, U extends BaseUserMeta, E extends Json> = UpdatePresenceServerMsg<P> | UserJoinServerMsg<U> | UserLeftServerMsg | BroadcastedEventServerMsg<E> | RoomStateServerMsg<U> | StorageStateServerMsg | UpdateStorageServerMsg | YDocUpdateServerMsg | RejectedStorageOpServerMsg | CommentsEventServerMsg
|
|
2646
|
+
type ServerMsg<P extends JsonObject, U extends BaseUserMeta, E extends Json> = UpdatePresenceServerMsg<P> | UserJoinServerMsg<U> | UserLeftServerMsg | BroadcastedEventServerMsg<E> | RoomStateServerMsg<U> | StorageStateServerMsg | UpdateStorageServerMsg | YDocUpdateServerMsg | RejectedStorageOpServerMsg | CommentsEventServerMsg;
|
|
2680
2647
|
type CommentsEventServerMsg = ThreadCreatedEvent | ThreadDeletedEvent | ThreadMetadataUpdatedEvent | ThreadUpdatedEvent | CommentCreatedEvent | CommentEditedEvent | CommentDeletedEvent | CommentReactionAdded | CommentReactionRemoved | CommentMetadataUpdatedEvent;
|
|
2681
2648
|
type ThreadCreatedEvent = {
|
|
2682
2649
|
type: ServerMsgCode.THREAD_CREATED;
|
|
@@ -2900,19 +2867,6 @@ type RejectedStorageOpServerMsg = {
|
|
|
2900
2867
|
readonly opIds: string[];
|
|
2901
2868
|
readonly reason: string;
|
|
2902
2869
|
};
|
|
2903
|
-
type AgentSessionsServerMsg = {
|
|
2904
|
-
readonly type: ServerMsgCode.AGENT_SESSIONS;
|
|
2905
|
-
readonly sessions: AgentSession[];
|
|
2906
|
-
readonly nextCursor?: string;
|
|
2907
|
-
readonly operation: "list" | "added" | "updated" | "deleted";
|
|
2908
|
-
};
|
|
2909
|
-
type AgentMessagesServerMsg = {
|
|
2910
|
-
readonly type: ServerMsgCode.AGENT_MESSAGES;
|
|
2911
|
-
readonly sessionId: string;
|
|
2912
|
-
readonly messages: AgentMessage[];
|
|
2913
|
-
readonly nextCursor?: string;
|
|
2914
|
-
readonly operation: "list" | "added" | "updated" | "deleted";
|
|
2915
|
-
};
|
|
2916
2870
|
|
|
2917
2871
|
type HistoryVersion = {
|
|
2918
2872
|
type: "historyVersion";
|
|
@@ -3321,29 +3275,6 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
|
|
|
3321
3275
|
* Sends a request for the current document from liveblocks server
|
|
3322
3276
|
*/
|
|
3323
3277
|
fetchYDoc(stateVector: string, guid?: string, isV2?: boolean): void;
|
|
3324
|
-
/**
|
|
3325
|
-
* Fetches agent sessions for the room.
|
|
3326
|
-
*/
|
|
3327
|
-
fetchAgentSessions(options?: {
|
|
3328
|
-
cursor?: string;
|
|
3329
|
-
since?: number;
|
|
3330
|
-
limit?: number;
|
|
3331
|
-
metadata?: Record<string, string>;
|
|
3332
|
-
}): Promise<{
|
|
3333
|
-
sessions: AgentSession[];
|
|
3334
|
-
nextCursor?: string;
|
|
3335
|
-
}>;
|
|
3336
|
-
/**
|
|
3337
|
-
* Fetches agent messages for a specific session.
|
|
3338
|
-
*/
|
|
3339
|
-
fetchAgentMessages(sessionId: string, options?: {
|
|
3340
|
-
cursor?: string;
|
|
3341
|
-
since?: number;
|
|
3342
|
-
limit?: number;
|
|
3343
|
-
}): Promise<{
|
|
3344
|
-
messages: AgentMessage[];
|
|
3345
|
-
nextCursor?: string;
|
|
3346
|
-
}>;
|
|
3347
3278
|
/**
|
|
3348
3279
|
* Broadcasts an event to other users in the room. Event broadcasted to the room can be listened with {@link Room.subscribe}("event").
|
|
3349
3280
|
* @param {any} event the event to broadcast. Should be serializable to JSON
|
|
@@ -3402,7 +3333,6 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
|
|
|
3402
3333
|
readonly storageStatus: Observable<StorageStatus>;
|
|
3403
3334
|
readonly ydoc: Observable<YDocUpdateServerMsg | UpdateYDocClientMsg>;
|
|
3404
3335
|
readonly comments: Observable<CommentsEventServerMsg>;
|
|
3405
|
-
readonly agentSessions: Observable<AgentSessionsServerMsg | AgentMessagesServerMsg>;
|
|
3406
3336
|
/**
|
|
3407
3337
|
* Called right before the room is destroyed. The event cannot be used to
|
|
3408
3338
|
* prevent the room from being destroyed, only to be informed that this is
|
|
@@ -5181,34 +5111,6 @@ declare function warnOnce(message: string, key?: string): void;
|
|
|
5181
5111
|
*/
|
|
5182
5112
|
declare function warnOnceIf(condition: boolean | (() => boolean), message: string, key?: string): void;
|
|
5183
5113
|
|
|
5184
|
-
/**
|
|
5185
|
-
* Generates operations to mutate an existing Live storage structure.
|
|
5186
|
-
*
|
|
5187
|
-
* This function attempts to merge mutation data into an existing Live structure,
|
|
5188
|
-
* preserving nested LiveObjects, LiveMaps, and LiveLists. For example, if you have
|
|
5189
|
-
* a LiveObject with a nested LiveObject (engine), and you pass a plain object
|
|
5190
|
-
* mutation, it will preserve the nested LiveObject structure and only update the
|
|
5191
|
-
* specified fields.
|
|
5192
|
-
*
|
|
5193
|
-
* @param nodes - The existing storage nodes as IdTuple<SerializedCrdt>[]
|
|
5194
|
-
* @param mutation - The mutation data (can be partial JSON or LSON)
|
|
5195
|
-
* @param actorId - Optional actor/connection ID to use for generating op IDs. Defaults to 1.
|
|
5196
|
-
* @returns Array of operations that can be applied to achieve the mutation
|
|
5197
|
-
*
|
|
5198
|
-
* @example
|
|
5199
|
-
* ```typescript
|
|
5200
|
-
* const nodes: IdTuple<SerializedCrdt>[] = [
|
|
5201
|
-
* ["0:0", { type: CrdtType.OBJECT, data: {} }],
|
|
5202
|
-
* ["0:1", { type: CrdtType.OBJECT, data: { displacement: 1 }, parentId: "0:0", parentKey: "engine" }]
|
|
5203
|
-
* ];
|
|
5204
|
-
*
|
|
5205
|
-
* const ops = generateOpsFromJson(nodes, {
|
|
5206
|
-
* engine: { displacement: 2 } // Preserves engine as LiveObject, only updates displacement
|
|
5207
|
-
* }, 42); // Use actor ID 42 for generated ops
|
|
5208
|
-
* ```
|
|
5209
|
-
*/
|
|
5210
|
-
declare function generateOpsFromJson<S extends LsonObject>(nodes: IdTuple<SerializedCrdt>[], mutation: Partial<S> | Json, actorId?: number): Op[];
|
|
5211
|
-
|
|
5212
5114
|
/**
|
|
5213
5115
|
* Definition of all messages the Panel can send to the Client.
|
|
5214
5116
|
*/
|
|
@@ -5341,4 +5243,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
|
|
|
5341
5243
|
[K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
|
|
5342
5244
|
};
|
|
5343
5245
|
|
|
5344
|
-
export { type AckOp, type ActivityData, type
|
|
5246
|
+
export { type AckOp, 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 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 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 IdTuple, 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 LargeMessageStrategy, type LayerKey, 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 MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, 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 RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, 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 StorageStateServerMsg, 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, 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, isLiveNode, isNotificationChannelEnabled, isNumberOperator, isPlainObject, isStartsWithOperator, isUrl, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
|
package/dist/index.d.ts
CHANGED
|
@@ -527,8 +527,6 @@ declare const ClientMsgCode: Readonly<{
|
|
|
527
527
|
UPDATE_STORAGE: 201;
|
|
528
528
|
FETCH_YDOC: 300;
|
|
529
529
|
UPDATE_YDOC: 301;
|
|
530
|
-
FETCH_AGENT_SESSIONS: 500;
|
|
531
|
-
FETCH_AGENT_MESSAGES: 502;
|
|
532
530
|
}>;
|
|
533
531
|
declare namespace ClientMsgCode {
|
|
534
532
|
type UPDATE_PRESENCE = typeof ClientMsgCode.UPDATE_PRESENCE;
|
|
@@ -537,13 +535,11 @@ declare namespace ClientMsgCode {
|
|
|
537
535
|
type UPDATE_STORAGE = typeof ClientMsgCode.UPDATE_STORAGE;
|
|
538
536
|
type FETCH_YDOC = typeof ClientMsgCode.FETCH_YDOC;
|
|
539
537
|
type UPDATE_YDOC = typeof ClientMsgCode.UPDATE_YDOC;
|
|
540
|
-
type FETCH_AGENT_SESSIONS = typeof ClientMsgCode.FETCH_AGENT_SESSIONS;
|
|
541
|
-
type FETCH_AGENT_MESSAGES = typeof ClientMsgCode.FETCH_AGENT_MESSAGES;
|
|
542
538
|
}
|
|
543
539
|
/**
|
|
544
540
|
* Messages that can be sent from the client to the server.
|
|
545
541
|
*/
|
|
546
|
-
type ClientMsg<P extends JsonObject, E extends Json> = BroadcastEventClientMsg<E> | UpdatePresenceClientMsg<P> | UpdateStorageClientMsg | FetchStorageClientMsg | FetchYDocClientMsg | UpdateYDocClientMsg
|
|
542
|
+
type ClientMsg<P extends JsonObject, E extends Json> = BroadcastEventClientMsg<E> | UpdatePresenceClientMsg<P> | UpdateStorageClientMsg | FetchStorageClientMsg | FetchYDocClientMsg | UpdateYDocClientMsg;
|
|
547
543
|
type BroadcastEventClientMsg<E extends Json> = {
|
|
548
544
|
type: ClientMsgCode.BROADCAST_EVENT;
|
|
549
545
|
event: E;
|
|
@@ -593,20 +589,6 @@ type UpdateYDocClientMsg = {
|
|
|
593
589
|
readonly guid?: string;
|
|
594
590
|
readonly v2?: boolean;
|
|
595
591
|
};
|
|
596
|
-
type FetchAgentSessionsClientMsg = {
|
|
597
|
-
readonly type: ClientMsgCode.FETCH_AGENT_SESSIONS;
|
|
598
|
-
readonly cursor?: string;
|
|
599
|
-
readonly since?: number;
|
|
600
|
-
readonly limit?: number;
|
|
601
|
-
readonly metadata?: Record<string, string>;
|
|
602
|
-
};
|
|
603
|
-
type FetchAgentMessagesClientMsg = {
|
|
604
|
-
readonly type: ClientMsgCode.FETCH_AGENT_MESSAGES;
|
|
605
|
-
readonly sessionId: string;
|
|
606
|
-
readonly cursor?: string;
|
|
607
|
-
readonly since?: number;
|
|
608
|
-
readonly limit?: number;
|
|
609
|
-
};
|
|
610
592
|
|
|
611
593
|
/**
|
|
612
594
|
* Represents an indefinitely deep arbitrary immutable data
|
|
@@ -2615,17 +2597,6 @@ type Delegates<T extends BaseAuthResult> = {
|
|
|
2615
2597
|
canZombie: () => boolean;
|
|
2616
2598
|
};
|
|
2617
2599
|
|
|
2618
|
-
type AgentSession = {
|
|
2619
|
-
sessionId: string;
|
|
2620
|
-
metadata: Json;
|
|
2621
|
-
timestamp: number;
|
|
2622
|
-
};
|
|
2623
|
-
type AgentMessage = {
|
|
2624
|
-
id: string;
|
|
2625
|
-
timestamp: number;
|
|
2626
|
-
data: Json;
|
|
2627
|
-
};
|
|
2628
|
-
|
|
2629
2600
|
type ServerMsgCode = (typeof ServerMsgCode)[keyof typeof ServerMsgCode];
|
|
2630
2601
|
declare const ServerMsgCode: Readonly<{
|
|
2631
2602
|
UPDATE_PRESENCE: 100;
|
|
@@ -2646,8 +2617,6 @@ declare const ServerMsgCode: Readonly<{
|
|
|
2646
2617
|
COMMENT_REACTION_ADDED: 405;
|
|
2647
2618
|
COMMENT_REACTION_REMOVED: 406;
|
|
2648
2619
|
COMMENT_METADATA_UPDATED: 409;
|
|
2649
|
-
AGENT_SESSIONS: 501;
|
|
2650
|
-
AGENT_MESSAGES: 503;
|
|
2651
2620
|
REJECT_STORAGE_OP: 299;
|
|
2652
2621
|
}>;
|
|
2653
2622
|
declare namespace ServerMsgCode {
|
|
@@ -2668,15 +2637,13 @@ declare namespace ServerMsgCode {
|
|
|
2668
2637
|
type COMMENT_DELETED = typeof ServerMsgCode.COMMENT_DELETED;
|
|
2669
2638
|
type COMMENT_REACTION_ADDED = typeof ServerMsgCode.COMMENT_REACTION_ADDED;
|
|
2670
2639
|
type COMMENT_REACTION_REMOVED = typeof ServerMsgCode.COMMENT_REACTION_REMOVED;
|
|
2671
|
-
type AGENT_SESSIONS = typeof ServerMsgCode.AGENT_SESSIONS;
|
|
2672
|
-
type AGENT_MESSAGES = typeof ServerMsgCode.AGENT_MESSAGES;
|
|
2673
2640
|
type COMMENT_METADATA_UPDATED = typeof ServerMsgCode.COMMENT_METADATA_UPDATED;
|
|
2674
2641
|
type REJECT_STORAGE_OP = typeof ServerMsgCode.REJECT_STORAGE_OP;
|
|
2675
2642
|
}
|
|
2676
2643
|
/**
|
|
2677
2644
|
* Messages that can be sent from the server to the client.
|
|
2678
2645
|
*/
|
|
2679
|
-
type ServerMsg<P extends JsonObject, U extends BaseUserMeta, E extends Json> = UpdatePresenceServerMsg<P> | UserJoinServerMsg<U> | UserLeftServerMsg | BroadcastedEventServerMsg<E> | RoomStateServerMsg<U> | StorageStateServerMsg | UpdateStorageServerMsg | YDocUpdateServerMsg | RejectedStorageOpServerMsg | CommentsEventServerMsg
|
|
2646
|
+
type ServerMsg<P extends JsonObject, U extends BaseUserMeta, E extends Json> = UpdatePresenceServerMsg<P> | UserJoinServerMsg<U> | UserLeftServerMsg | BroadcastedEventServerMsg<E> | RoomStateServerMsg<U> | StorageStateServerMsg | UpdateStorageServerMsg | YDocUpdateServerMsg | RejectedStorageOpServerMsg | CommentsEventServerMsg;
|
|
2680
2647
|
type CommentsEventServerMsg = ThreadCreatedEvent | ThreadDeletedEvent | ThreadMetadataUpdatedEvent | ThreadUpdatedEvent | CommentCreatedEvent | CommentEditedEvent | CommentDeletedEvent | CommentReactionAdded | CommentReactionRemoved | CommentMetadataUpdatedEvent;
|
|
2681
2648
|
type ThreadCreatedEvent = {
|
|
2682
2649
|
type: ServerMsgCode.THREAD_CREATED;
|
|
@@ -2900,19 +2867,6 @@ type RejectedStorageOpServerMsg = {
|
|
|
2900
2867
|
readonly opIds: string[];
|
|
2901
2868
|
readonly reason: string;
|
|
2902
2869
|
};
|
|
2903
|
-
type AgentSessionsServerMsg = {
|
|
2904
|
-
readonly type: ServerMsgCode.AGENT_SESSIONS;
|
|
2905
|
-
readonly sessions: AgentSession[];
|
|
2906
|
-
readonly nextCursor?: string;
|
|
2907
|
-
readonly operation: "list" | "added" | "updated" | "deleted";
|
|
2908
|
-
};
|
|
2909
|
-
type AgentMessagesServerMsg = {
|
|
2910
|
-
readonly type: ServerMsgCode.AGENT_MESSAGES;
|
|
2911
|
-
readonly sessionId: string;
|
|
2912
|
-
readonly messages: AgentMessage[];
|
|
2913
|
-
readonly nextCursor?: string;
|
|
2914
|
-
readonly operation: "list" | "added" | "updated" | "deleted";
|
|
2915
|
-
};
|
|
2916
2870
|
|
|
2917
2871
|
type HistoryVersion = {
|
|
2918
2872
|
type: "historyVersion";
|
|
@@ -3321,29 +3275,6 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
|
|
|
3321
3275
|
* Sends a request for the current document from liveblocks server
|
|
3322
3276
|
*/
|
|
3323
3277
|
fetchYDoc(stateVector: string, guid?: string, isV2?: boolean): void;
|
|
3324
|
-
/**
|
|
3325
|
-
* Fetches agent sessions for the room.
|
|
3326
|
-
*/
|
|
3327
|
-
fetchAgentSessions(options?: {
|
|
3328
|
-
cursor?: string;
|
|
3329
|
-
since?: number;
|
|
3330
|
-
limit?: number;
|
|
3331
|
-
metadata?: Record<string, string>;
|
|
3332
|
-
}): Promise<{
|
|
3333
|
-
sessions: AgentSession[];
|
|
3334
|
-
nextCursor?: string;
|
|
3335
|
-
}>;
|
|
3336
|
-
/**
|
|
3337
|
-
* Fetches agent messages for a specific session.
|
|
3338
|
-
*/
|
|
3339
|
-
fetchAgentMessages(sessionId: string, options?: {
|
|
3340
|
-
cursor?: string;
|
|
3341
|
-
since?: number;
|
|
3342
|
-
limit?: number;
|
|
3343
|
-
}): Promise<{
|
|
3344
|
-
messages: AgentMessage[];
|
|
3345
|
-
nextCursor?: string;
|
|
3346
|
-
}>;
|
|
3347
3278
|
/**
|
|
3348
3279
|
* Broadcasts an event to other users in the room. Event broadcasted to the room can be listened with {@link Room.subscribe}("event").
|
|
3349
3280
|
* @param {any} event the event to broadcast. Should be serializable to JSON
|
|
@@ -3402,7 +3333,6 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
|
|
|
3402
3333
|
readonly storageStatus: Observable<StorageStatus>;
|
|
3403
3334
|
readonly ydoc: Observable<YDocUpdateServerMsg | UpdateYDocClientMsg>;
|
|
3404
3335
|
readonly comments: Observable<CommentsEventServerMsg>;
|
|
3405
|
-
readonly agentSessions: Observable<AgentSessionsServerMsg | AgentMessagesServerMsg>;
|
|
3406
3336
|
/**
|
|
3407
3337
|
* Called right before the room is destroyed. The event cannot be used to
|
|
3408
3338
|
* prevent the room from being destroyed, only to be informed that this is
|
|
@@ -5181,34 +5111,6 @@ declare function warnOnce(message: string, key?: string): void;
|
|
|
5181
5111
|
*/
|
|
5182
5112
|
declare function warnOnceIf(condition: boolean | (() => boolean), message: string, key?: string): void;
|
|
5183
5113
|
|
|
5184
|
-
/**
|
|
5185
|
-
* Generates operations to mutate an existing Live storage structure.
|
|
5186
|
-
*
|
|
5187
|
-
* This function attempts to merge mutation data into an existing Live structure,
|
|
5188
|
-
* preserving nested LiveObjects, LiveMaps, and LiveLists. For example, if you have
|
|
5189
|
-
* a LiveObject with a nested LiveObject (engine), and you pass a plain object
|
|
5190
|
-
* mutation, it will preserve the nested LiveObject structure and only update the
|
|
5191
|
-
* specified fields.
|
|
5192
|
-
*
|
|
5193
|
-
* @param nodes - The existing storage nodes as IdTuple<SerializedCrdt>[]
|
|
5194
|
-
* @param mutation - The mutation data (can be partial JSON or LSON)
|
|
5195
|
-
* @param actorId - Optional actor/connection ID to use for generating op IDs. Defaults to 1.
|
|
5196
|
-
* @returns Array of operations that can be applied to achieve the mutation
|
|
5197
|
-
*
|
|
5198
|
-
* @example
|
|
5199
|
-
* ```typescript
|
|
5200
|
-
* const nodes: IdTuple<SerializedCrdt>[] = [
|
|
5201
|
-
* ["0:0", { type: CrdtType.OBJECT, data: {} }],
|
|
5202
|
-
* ["0:1", { type: CrdtType.OBJECT, data: { displacement: 1 }, parentId: "0:0", parentKey: "engine" }]
|
|
5203
|
-
* ];
|
|
5204
|
-
*
|
|
5205
|
-
* const ops = generateOpsFromJson(nodes, {
|
|
5206
|
-
* engine: { displacement: 2 } // Preserves engine as LiveObject, only updates displacement
|
|
5207
|
-
* }, 42); // Use actor ID 42 for generated ops
|
|
5208
|
-
* ```
|
|
5209
|
-
*/
|
|
5210
|
-
declare function generateOpsFromJson<S extends LsonObject>(nodes: IdTuple<SerializedCrdt>[], mutation: Partial<S> | Json, actorId?: number): Op[];
|
|
5211
|
-
|
|
5212
5114
|
/**
|
|
5213
5115
|
* Definition of all messages the Panel can send to the Client.
|
|
5214
5116
|
*/
|
|
@@ -5341,4 +5243,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
|
|
|
5341
5243
|
[K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
|
|
5342
5244
|
};
|
|
5343
5245
|
|
|
5344
|
-
export { type AckOp, type ActivityData, type
|
|
5246
|
+
export { type AckOp, 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 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 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 IdTuple, 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 LargeMessageStrategy, type LayerKey, 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 MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, 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 RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, 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 StorageStateServerMsg, 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, 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, isLiveNode, isNotificationChannelEnabled, isNumberOperator, isPlainObject, isStartsWithOperator, isUrl, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
|