@liveblocks/node 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 +1 -179
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -127
- package/dist/index.d.ts +5 -127
- package/dist/index.js +1 -179
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseUserMeta, DU, LiveObject, Awaitable, DS,
|
|
1
|
+
import { BaseUserMeta, DU, LiveObject, Awaitable, DS, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, UserSubscriptionData, CommentData, CommentBody, Patchable, SubscriptionData, CommentUserReaction, InboxNotificationData, UserRoomSubscriptionSettings, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, GroupScopes, GroupData, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DTM, DCM, NotificationChannel } from '@liveblocks/core';
|
|
2
2
|
export { CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyLinkElementArgs, CommentBodyMention, CommentBodyMentionElementArgs, CommentBodyParagraph, CommentBodyParagraphElementArgs, CommentBodyText, CommentBodyTextElementArgs, CommentData, CommentUserReaction, IUserInfo, Json, JsonArray, JsonObject, JsonScalar, LiveList, LiveMap, LiveObject, LiveStructure, Lson, LsonObject, PlainLsonObject, ResolveUsersArgs, StringifyCommentBodyElements, StringifyCommentBodyOptions, ThreadData, User, getMentionsFromCommentBody, isNotificationChannelEnabled, stringifyCommentBody } from '@liveblocks/core';
|
|
3
3
|
import { IncomingHttpHeaders } from 'http';
|
|
4
4
|
|
|
@@ -182,6 +182,7 @@ type AiCopilot = {
|
|
|
182
182
|
description?: string;
|
|
183
183
|
systemPrompt: string;
|
|
184
184
|
knowledgePrompt?: string;
|
|
185
|
+
alwaysUseKnowledge: boolean;
|
|
185
186
|
createdAt: Date;
|
|
186
187
|
updatedAt: Date;
|
|
187
188
|
lastUsedAt?: Date;
|
|
@@ -329,6 +330,7 @@ type CreateAiCopilotOptions = {
|
|
|
329
330
|
description?: string;
|
|
330
331
|
systemPrompt: string;
|
|
331
332
|
knowledgePrompt?: string;
|
|
333
|
+
alwaysUseKnowledge?: boolean;
|
|
332
334
|
settings?: AiCopilotProviderSettings;
|
|
333
335
|
providerApiKey: string;
|
|
334
336
|
} & ({
|
|
@@ -354,6 +356,7 @@ type UpdateAiCopilotOptions = {
|
|
|
354
356
|
description?: string | null;
|
|
355
357
|
systemPrompt?: string;
|
|
356
358
|
knowledgePrompt?: string | null;
|
|
359
|
+
alwaysUseKnowledge?: boolean;
|
|
357
360
|
settings?: AiCopilotProviderSettings | null;
|
|
358
361
|
providerApiKey?: string;
|
|
359
362
|
} & ({
|
|
@@ -418,22 +421,6 @@ type GetWebKnowledgeSourceLinksOptions = {
|
|
|
418
421
|
copilotId: string;
|
|
419
422
|
knowledgeSourceId: string;
|
|
420
423
|
} & PaginationOptions;
|
|
421
|
-
type CreateAgentSessionOptions = {
|
|
422
|
-
sessionId: string;
|
|
423
|
-
metadata?: JsonObject;
|
|
424
|
-
timestamp?: number;
|
|
425
|
-
};
|
|
426
|
-
type UpdateAgentSessionOptions = {
|
|
427
|
-
metadata: JsonObject;
|
|
428
|
-
};
|
|
429
|
-
type CreateAgentMessageOptions = {
|
|
430
|
-
id?: string;
|
|
431
|
-
timestamp?: number;
|
|
432
|
-
data: JsonObject;
|
|
433
|
-
};
|
|
434
|
-
type UpdateAgentMessageOptions = {
|
|
435
|
-
data: JsonObject;
|
|
436
|
-
};
|
|
437
424
|
type KnowledgeSource = ({
|
|
438
425
|
type: "ai-knowledge-web-source";
|
|
439
426
|
link: {
|
|
@@ -1388,115 +1375,6 @@ declare class Liveblocks {
|
|
|
1388
1375
|
* @returns A paginated list of web knowledge source links.
|
|
1389
1376
|
*/
|
|
1390
1377
|
getWebKnowledgeSourceLinks(params: GetWebKnowledgeSourceLinksOptions, options?: RequestOptions): Promise<Page<WebKnowledgeSourceLink>>;
|
|
1391
|
-
/**
|
|
1392
|
-
* Returns a list of agent sessions in a room.
|
|
1393
|
-
* @param params.roomId The room ID to get the agent sessions from.
|
|
1394
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1395
|
-
* @returns A list of agent sessions.
|
|
1396
|
-
*/
|
|
1397
|
-
getAgentSessions(params: {
|
|
1398
|
-
roomId: string;
|
|
1399
|
-
}, options?: RequestOptions): Promise<{
|
|
1400
|
-
data: AgentSession[];
|
|
1401
|
-
}>;
|
|
1402
|
-
/**
|
|
1403
|
-
* Creates a new agent session in a room.
|
|
1404
|
-
* @param params.roomId The room ID to create the agent session in.
|
|
1405
|
-
* @param params.sessionId The session ID for the agent session.
|
|
1406
|
-
* @param params.metadata (optional) The metadata for the agent session.
|
|
1407
|
-
* @param params.timestamp (optional) The timestamp for the agent session. If not provided, the current time will be used.
|
|
1408
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1409
|
-
* @returns The created agent session.
|
|
1410
|
-
*/
|
|
1411
|
-
createAgentSession(params: {
|
|
1412
|
-
roomId: string;
|
|
1413
|
-
} & CreateAgentSessionOptions, options?: RequestOptions): Promise<AgentSession>;
|
|
1414
|
-
/**
|
|
1415
|
-
* Returns an agent session with the given id.
|
|
1416
|
-
* @param params.roomId The room ID to get the agent session from.
|
|
1417
|
-
* @param params.agentSessionId The agent session ID.
|
|
1418
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1419
|
-
* @returns The agent session.
|
|
1420
|
-
*/
|
|
1421
|
-
getAgentSession(params: {
|
|
1422
|
-
roomId: string;
|
|
1423
|
-
agentSessionId: string;
|
|
1424
|
-
}, options?: RequestOptions): Promise<AgentSession>;
|
|
1425
|
-
/**
|
|
1426
|
-
* Updates the metadata of an agent session.
|
|
1427
|
-
* @param params.roomId The room ID to update the agent session in.
|
|
1428
|
-
* @param params.agentSessionId The agent session ID to update.
|
|
1429
|
-
* @param params.metadata The metadata for the agent session.
|
|
1430
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1431
|
-
* @returns The updated agent session.
|
|
1432
|
-
*/
|
|
1433
|
-
updateAgentSessionMetadata(params: {
|
|
1434
|
-
roomId: string;
|
|
1435
|
-
agentSessionId: string;
|
|
1436
|
-
} & UpdateAgentSessionOptions, options?: RequestOptions): Promise<AgentSession>;
|
|
1437
|
-
/**
|
|
1438
|
-
* Deletes an agent session.
|
|
1439
|
-
* @param params.roomId The room ID to delete the agent session from.
|
|
1440
|
-
* @param params.agentSessionId The agent session ID to delete.
|
|
1441
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1442
|
-
*/
|
|
1443
|
-
deleteAgentSession(params: {
|
|
1444
|
-
roomId: string;
|
|
1445
|
-
agentSessionId: string;
|
|
1446
|
-
}, options?: RequestOptions): Promise<void>;
|
|
1447
|
-
/**
|
|
1448
|
-
* Returns a list of agent messages in an agent session.
|
|
1449
|
-
* @param params.roomId The room ID to get the agent messages from.
|
|
1450
|
-
* @param params.agentSessionId The agent session ID to get the messages from.
|
|
1451
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1452
|
-
* @returns A list of agent messages.
|
|
1453
|
-
*/
|
|
1454
|
-
getAgentMessages(params: {
|
|
1455
|
-
roomId: string;
|
|
1456
|
-
agentSessionId: string;
|
|
1457
|
-
}, options?: RequestOptions): Promise<{
|
|
1458
|
-
data: AgentMessage[];
|
|
1459
|
-
}>;
|
|
1460
|
-
/**
|
|
1461
|
-
* Creates a new agent message in an agent session.
|
|
1462
|
-
* @param params.roomId The room ID to create the agent message in.
|
|
1463
|
-
* @param params.agentSessionId The agent session ID to create the message in.
|
|
1464
|
-
* @param params.id (optional) The message ID. If not provided, one will be generated.
|
|
1465
|
-
* @param params.timestamp (optional) The message timestamp. If not provided, the current time will be used.
|
|
1466
|
-
* @param params.data The message data.
|
|
1467
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1468
|
-
* @returns The created agent message.
|
|
1469
|
-
*/
|
|
1470
|
-
createAgentMessage(params: {
|
|
1471
|
-
roomId: string;
|
|
1472
|
-
agentSessionId: string;
|
|
1473
|
-
} & CreateAgentMessageOptions, options?: RequestOptions): Promise<AgentMessage>;
|
|
1474
|
-
/**
|
|
1475
|
-
* Updates an agent message.
|
|
1476
|
-
* @param params.roomId The room ID to update the agent message in.
|
|
1477
|
-
* @param params.agentSessionId The agent session ID to update the message in.
|
|
1478
|
-
* @param params.messageId The message ID to update.
|
|
1479
|
-
* @param params.data The message data.
|
|
1480
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1481
|
-
* @returns The updated agent message.
|
|
1482
|
-
*/
|
|
1483
|
-
updateAgentMessage(params: {
|
|
1484
|
-
roomId: string;
|
|
1485
|
-
agentSessionId: string;
|
|
1486
|
-
messageId: string;
|
|
1487
|
-
} & UpdateAgentMessageOptions, options?: RequestOptions): Promise<AgentMessage>;
|
|
1488
|
-
/**
|
|
1489
|
-
* Deletes an agent message.
|
|
1490
|
-
* @param params.roomId The room ID to delete the agent message from.
|
|
1491
|
-
* @param params.agentSessionId The agent session ID to delete the message from.
|
|
1492
|
-
* @param params.messageId The message ID to delete.
|
|
1493
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1494
|
-
*/
|
|
1495
|
-
deleteAgentMessage(params: {
|
|
1496
|
-
roomId: string;
|
|
1497
|
-
agentSessionId: string;
|
|
1498
|
-
messageId: string;
|
|
1499
|
-
}, options?: RequestOptions): Promise<void>;
|
|
1500
1378
|
}
|
|
1501
1379
|
declare class LiveblocksError extends Error {
|
|
1502
1380
|
readonly status: number;
|
|
@@ -1907,4 +1785,4 @@ declare function isTextMentionNotificationEvent(event: WebhookEvent): event is T
|
|
|
1907
1785
|
*/
|
|
1908
1786
|
declare function isCustomNotificationEvent(event: WebhookEvent): event is CustomNotificationEvent;
|
|
1909
1787
|
|
|
1910
|
-
export { type AiCopilot, type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, type
|
|
1788
|
+
export { type AiCopilot, type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, type CreateAiCopilotOptions, type CreateFileKnowledgeSourceOptions, type CreateRoomOptions, type CreateWebKnowledgeSourceOptions, type CustomNotificationEvent, type GetAiCopilotsOptions, type GetInboxNotificationsOptions, type GetKnowledgeSourcesOptions, type GetRoomsOptions, type GetWebKnowledgeSourceLinksOptions, type InboxNotificationsQueryCriteria, type KnowledgeSource, Liveblocks, LiveblocksError, type LiveblocksOptions, type MassMutateStorageCallback, type MassMutateStorageOptions, type MutateStorageCallback, type MutateStorageOptions, type NotificationEvent, type Page, type PaginationOptions, type RoomAccesses, type RoomCreatedEvent, type RoomData, type RoomDeletedEvent, type RoomPermission, type RoomUser, type RoomsQueryCriteria, type StorageUpdatedEvent, type TextMentionNotificationEvent, type ThreadCreatedEvent, type ThreadDeletedEvent, type ThreadMarkedAsResolvedEvent, type ThreadMarkedAsUnresolvedEvent, type ThreadMetadataUpdatedEvent, type ThreadNotificationEvent, type ThreadParticipants, type UpdateAiCopilotOptions, type UpdateRoomOptions, type UpsertRoomOptions, type UserEnteredEvent, type UserLeftEvent, type WebKnowledgeSourceLink, type WebhookEvent, WebhookHandler, type WebhookRequest, type YDocUpdatedEvent, isCustomNotificationEvent, isTextMentionNotificationEvent, isThreadNotificationEvent };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseUserMeta, DU, LiveObject, Awaitable, DS,
|
|
1
|
+
import { BaseUserMeta, DU, LiveObject, Awaitable, DS, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, UserSubscriptionData, CommentData, CommentBody, Patchable, SubscriptionData, CommentUserReaction, InboxNotificationData, UserRoomSubscriptionSettings, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, GroupScopes, GroupData, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DTM, DCM, NotificationChannel } from '@liveblocks/core';
|
|
2
2
|
export { CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyLinkElementArgs, CommentBodyMention, CommentBodyMentionElementArgs, CommentBodyParagraph, CommentBodyParagraphElementArgs, CommentBodyText, CommentBodyTextElementArgs, CommentData, CommentUserReaction, IUserInfo, Json, JsonArray, JsonObject, JsonScalar, LiveList, LiveMap, LiveObject, LiveStructure, Lson, LsonObject, PlainLsonObject, ResolveUsersArgs, StringifyCommentBodyElements, StringifyCommentBodyOptions, ThreadData, User, getMentionsFromCommentBody, isNotificationChannelEnabled, stringifyCommentBody } from '@liveblocks/core';
|
|
3
3
|
import { IncomingHttpHeaders } from 'http';
|
|
4
4
|
|
|
@@ -182,6 +182,7 @@ type AiCopilot = {
|
|
|
182
182
|
description?: string;
|
|
183
183
|
systemPrompt: string;
|
|
184
184
|
knowledgePrompt?: string;
|
|
185
|
+
alwaysUseKnowledge: boolean;
|
|
185
186
|
createdAt: Date;
|
|
186
187
|
updatedAt: Date;
|
|
187
188
|
lastUsedAt?: Date;
|
|
@@ -329,6 +330,7 @@ type CreateAiCopilotOptions = {
|
|
|
329
330
|
description?: string;
|
|
330
331
|
systemPrompt: string;
|
|
331
332
|
knowledgePrompt?: string;
|
|
333
|
+
alwaysUseKnowledge?: boolean;
|
|
332
334
|
settings?: AiCopilotProviderSettings;
|
|
333
335
|
providerApiKey: string;
|
|
334
336
|
} & ({
|
|
@@ -354,6 +356,7 @@ type UpdateAiCopilotOptions = {
|
|
|
354
356
|
description?: string | null;
|
|
355
357
|
systemPrompt?: string;
|
|
356
358
|
knowledgePrompt?: string | null;
|
|
359
|
+
alwaysUseKnowledge?: boolean;
|
|
357
360
|
settings?: AiCopilotProviderSettings | null;
|
|
358
361
|
providerApiKey?: string;
|
|
359
362
|
} & ({
|
|
@@ -418,22 +421,6 @@ type GetWebKnowledgeSourceLinksOptions = {
|
|
|
418
421
|
copilotId: string;
|
|
419
422
|
knowledgeSourceId: string;
|
|
420
423
|
} & PaginationOptions;
|
|
421
|
-
type CreateAgentSessionOptions = {
|
|
422
|
-
sessionId: string;
|
|
423
|
-
metadata?: JsonObject;
|
|
424
|
-
timestamp?: number;
|
|
425
|
-
};
|
|
426
|
-
type UpdateAgentSessionOptions = {
|
|
427
|
-
metadata: JsonObject;
|
|
428
|
-
};
|
|
429
|
-
type CreateAgentMessageOptions = {
|
|
430
|
-
id?: string;
|
|
431
|
-
timestamp?: number;
|
|
432
|
-
data: JsonObject;
|
|
433
|
-
};
|
|
434
|
-
type UpdateAgentMessageOptions = {
|
|
435
|
-
data: JsonObject;
|
|
436
|
-
};
|
|
437
424
|
type KnowledgeSource = ({
|
|
438
425
|
type: "ai-knowledge-web-source";
|
|
439
426
|
link: {
|
|
@@ -1388,115 +1375,6 @@ declare class Liveblocks {
|
|
|
1388
1375
|
* @returns A paginated list of web knowledge source links.
|
|
1389
1376
|
*/
|
|
1390
1377
|
getWebKnowledgeSourceLinks(params: GetWebKnowledgeSourceLinksOptions, options?: RequestOptions): Promise<Page<WebKnowledgeSourceLink>>;
|
|
1391
|
-
/**
|
|
1392
|
-
* Returns a list of agent sessions in a room.
|
|
1393
|
-
* @param params.roomId The room ID to get the agent sessions from.
|
|
1394
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1395
|
-
* @returns A list of agent sessions.
|
|
1396
|
-
*/
|
|
1397
|
-
getAgentSessions(params: {
|
|
1398
|
-
roomId: string;
|
|
1399
|
-
}, options?: RequestOptions): Promise<{
|
|
1400
|
-
data: AgentSession[];
|
|
1401
|
-
}>;
|
|
1402
|
-
/**
|
|
1403
|
-
* Creates a new agent session in a room.
|
|
1404
|
-
* @param params.roomId The room ID to create the agent session in.
|
|
1405
|
-
* @param params.sessionId The session ID for the agent session.
|
|
1406
|
-
* @param params.metadata (optional) The metadata for the agent session.
|
|
1407
|
-
* @param params.timestamp (optional) The timestamp for the agent session. If not provided, the current time will be used.
|
|
1408
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1409
|
-
* @returns The created agent session.
|
|
1410
|
-
*/
|
|
1411
|
-
createAgentSession(params: {
|
|
1412
|
-
roomId: string;
|
|
1413
|
-
} & CreateAgentSessionOptions, options?: RequestOptions): Promise<AgentSession>;
|
|
1414
|
-
/**
|
|
1415
|
-
* Returns an agent session with the given id.
|
|
1416
|
-
* @param params.roomId The room ID to get the agent session from.
|
|
1417
|
-
* @param params.agentSessionId The agent session ID.
|
|
1418
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1419
|
-
* @returns The agent session.
|
|
1420
|
-
*/
|
|
1421
|
-
getAgentSession(params: {
|
|
1422
|
-
roomId: string;
|
|
1423
|
-
agentSessionId: string;
|
|
1424
|
-
}, options?: RequestOptions): Promise<AgentSession>;
|
|
1425
|
-
/**
|
|
1426
|
-
* Updates the metadata of an agent session.
|
|
1427
|
-
* @param params.roomId The room ID to update the agent session in.
|
|
1428
|
-
* @param params.agentSessionId The agent session ID to update.
|
|
1429
|
-
* @param params.metadata The metadata for the agent session.
|
|
1430
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1431
|
-
* @returns The updated agent session.
|
|
1432
|
-
*/
|
|
1433
|
-
updateAgentSessionMetadata(params: {
|
|
1434
|
-
roomId: string;
|
|
1435
|
-
agentSessionId: string;
|
|
1436
|
-
} & UpdateAgentSessionOptions, options?: RequestOptions): Promise<AgentSession>;
|
|
1437
|
-
/**
|
|
1438
|
-
* Deletes an agent session.
|
|
1439
|
-
* @param params.roomId The room ID to delete the agent session from.
|
|
1440
|
-
* @param params.agentSessionId The agent session ID to delete.
|
|
1441
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1442
|
-
*/
|
|
1443
|
-
deleteAgentSession(params: {
|
|
1444
|
-
roomId: string;
|
|
1445
|
-
agentSessionId: string;
|
|
1446
|
-
}, options?: RequestOptions): Promise<void>;
|
|
1447
|
-
/**
|
|
1448
|
-
* Returns a list of agent messages in an agent session.
|
|
1449
|
-
* @param params.roomId The room ID to get the agent messages from.
|
|
1450
|
-
* @param params.agentSessionId The agent session ID to get the messages from.
|
|
1451
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1452
|
-
* @returns A list of agent messages.
|
|
1453
|
-
*/
|
|
1454
|
-
getAgentMessages(params: {
|
|
1455
|
-
roomId: string;
|
|
1456
|
-
agentSessionId: string;
|
|
1457
|
-
}, options?: RequestOptions): Promise<{
|
|
1458
|
-
data: AgentMessage[];
|
|
1459
|
-
}>;
|
|
1460
|
-
/**
|
|
1461
|
-
* Creates a new agent message in an agent session.
|
|
1462
|
-
* @param params.roomId The room ID to create the agent message in.
|
|
1463
|
-
* @param params.agentSessionId The agent session ID to create the message in.
|
|
1464
|
-
* @param params.id (optional) The message ID. If not provided, one will be generated.
|
|
1465
|
-
* @param params.timestamp (optional) The message timestamp. If not provided, the current time will be used.
|
|
1466
|
-
* @param params.data The message data.
|
|
1467
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1468
|
-
* @returns The created agent message.
|
|
1469
|
-
*/
|
|
1470
|
-
createAgentMessage(params: {
|
|
1471
|
-
roomId: string;
|
|
1472
|
-
agentSessionId: string;
|
|
1473
|
-
} & CreateAgentMessageOptions, options?: RequestOptions): Promise<AgentMessage>;
|
|
1474
|
-
/**
|
|
1475
|
-
* Updates an agent message.
|
|
1476
|
-
* @param params.roomId The room ID to update the agent message in.
|
|
1477
|
-
* @param params.agentSessionId The agent session ID to update the message in.
|
|
1478
|
-
* @param params.messageId The message ID to update.
|
|
1479
|
-
* @param params.data The message data.
|
|
1480
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1481
|
-
* @returns The updated agent message.
|
|
1482
|
-
*/
|
|
1483
|
-
updateAgentMessage(params: {
|
|
1484
|
-
roomId: string;
|
|
1485
|
-
agentSessionId: string;
|
|
1486
|
-
messageId: string;
|
|
1487
|
-
} & UpdateAgentMessageOptions, options?: RequestOptions): Promise<AgentMessage>;
|
|
1488
|
-
/**
|
|
1489
|
-
* Deletes an agent message.
|
|
1490
|
-
* @param params.roomId The room ID to delete the agent message from.
|
|
1491
|
-
* @param params.agentSessionId The agent session ID to delete the message from.
|
|
1492
|
-
* @param params.messageId The message ID to delete.
|
|
1493
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1494
|
-
*/
|
|
1495
|
-
deleteAgentMessage(params: {
|
|
1496
|
-
roomId: string;
|
|
1497
|
-
agentSessionId: string;
|
|
1498
|
-
messageId: string;
|
|
1499
|
-
}, options?: RequestOptions): Promise<void>;
|
|
1500
1378
|
}
|
|
1501
1379
|
declare class LiveblocksError extends Error {
|
|
1502
1380
|
readonly status: number;
|
|
@@ -1907,4 +1785,4 @@ declare function isTextMentionNotificationEvent(event: WebhookEvent): event is T
|
|
|
1907
1785
|
*/
|
|
1908
1786
|
declare function isCustomNotificationEvent(event: WebhookEvent): event is CustomNotificationEvent;
|
|
1909
1787
|
|
|
1910
|
-
export { type AiCopilot, type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, type
|
|
1788
|
+
export { type AiCopilot, type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, type CreateAiCopilotOptions, type CreateFileKnowledgeSourceOptions, type CreateRoomOptions, type CreateWebKnowledgeSourceOptions, type CustomNotificationEvent, type GetAiCopilotsOptions, type GetInboxNotificationsOptions, type GetKnowledgeSourcesOptions, type GetRoomsOptions, type GetWebKnowledgeSourceLinksOptions, type InboxNotificationsQueryCriteria, type KnowledgeSource, Liveblocks, LiveblocksError, type LiveblocksOptions, type MassMutateStorageCallback, type MassMutateStorageOptions, type MutateStorageCallback, type MutateStorageOptions, type NotificationEvent, type Page, type PaginationOptions, type RoomAccesses, type RoomCreatedEvent, type RoomData, type RoomDeletedEvent, type RoomPermission, type RoomUser, type RoomsQueryCriteria, type StorageUpdatedEvent, type TextMentionNotificationEvent, type ThreadCreatedEvent, type ThreadDeletedEvent, type ThreadMarkedAsResolvedEvent, type ThreadMarkedAsUnresolvedEvent, type ThreadMetadataUpdatedEvent, type ThreadNotificationEvent, type ThreadParticipants, type UpdateAiCopilotOptions, type UpdateRoomOptions, type UpsertRoomOptions, type UserEnteredEvent, type UserLeftEvent, type WebKnowledgeSourceLink, type WebhookEvent, WebhookHandler, type WebhookRequest, type YDocUpdatedEvent, isCustomNotificationEvent, isTextMentionNotificationEvent, isThreadNotificationEvent };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { detectDupes } from "@liveblocks/core";
|
|
|
3
3
|
|
|
4
4
|
// src/version.ts
|
|
5
5
|
var PKG_NAME = "@liveblocks/node";
|
|
6
|
-
var PKG_VERSION = "3.13.
|
|
6
|
+
var PKG_VERSION = "3.13.2";
|
|
7
7
|
var PKG_FORMAT = "esm";
|
|
8
8
|
|
|
9
9
|
// src/client.ts
|
|
@@ -2088,184 +2088,6 @@ var Liveblocks = class {
|
|
|
2088
2088
|
data: page.data.map(inflateWebKnowledgeSourceLink)
|
|
2089
2089
|
};
|
|
2090
2090
|
}
|
|
2091
|
-
/* -------------------------------------------------------------------------------------------------
|
|
2092
|
-
* Agent Sessions
|
|
2093
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
2094
|
-
/**
|
|
2095
|
-
* Returns a list of agent sessions in a room.
|
|
2096
|
-
* @param params.roomId The room ID to get the agent sessions from.
|
|
2097
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
2098
|
-
* @returns A list of agent sessions.
|
|
2099
|
-
*/
|
|
2100
|
-
async getAgentSessions(params, options) {
|
|
2101
|
-
const { roomId } = params;
|
|
2102
|
-
const res = await this.#get(
|
|
2103
|
-
url2`/v2/rooms/${roomId}/agent-sessions`,
|
|
2104
|
-
void 0,
|
|
2105
|
-
options
|
|
2106
|
-
);
|
|
2107
|
-
if (!res.ok) {
|
|
2108
|
-
throw await LiveblocksError.from(res);
|
|
2109
|
-
}
|
|
2110
|
-
return await res.json();
|
|
2111
|
-
}
|
|
2112
|
-
/**
|
|
2113
|
-
* Creates a new agent session in a room.
|
|
2114
|
-
* @param params.roomId The room ID to create the agent session in.
|
|
2115
|
-
* @param params.sessionId The session ID for the agent session.
|
|
2116
|
-
* @param params.metadata (optional) The metadata for the agent session.
|
|
2117
|
-
* @param params.timestamp (optional) The timestamp for the agent session. If not provided, the current time will be used.
|
|
2118
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
2119
|
-
* @returns The created agent session.
|
|
2120
|
-
*/
|
|
2121
|
-
async createAgentSession(params, options) {
|
|
2122
|
-
const { roomId, sessionId, metadata, timestamp } = params;
|
|
2123
|
-
const res = await this.#post(
|
|
2124
|
-
url2`/v2/rooms/${roomId}/agent-sessions`,
|
|
2125
|
-
{ sessionId, metadata, timestamp },
|
|
2126
|
-
options
|
|
2127
|
-
);
|
|
2128
|
-
if (!res.ok) {
|
|
2129
|
-
throw await LiveblocksError.from(res);
|
|
2130
|
-
}
|
|
2131
|
-
return await res.json();
|
|
2132
|
-
}
|
|
2133
|
-
/**
|
|
2134
|
-
* Returns an agent session with the given id.
|
|
2135
|
-
* @param params.roomId The room ID to get the agent session from.
|
|
2136
|
-
* @param params.agentSessionId The agent session ID.
|
|
2137
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
2138
|
-
* @returns The agent session.
|
|
2139
|
-
*/
|
|
2140
|
-
async getAgentSession(params, options) {
|
|
2141
|
-
const { roomId, agentSessionId } = params;
|
|
2142
|
-
const res = await this.#get(
|
|
2143
|
-
url2`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}`,
|
|
2144
|
-
void 0,
|
|
2145
|
-
options
|
|
2146
|
-
);
|
|
2147
|
-
if (!res.ok) {
|
|
2148
|
-
throw await LiveblocksError.from(res);
|
|
2149
|
-
}
|
|
2150
|
-
return await res.json();
|
|
2151
|
-
}
|
|
2152
|
-
/**
|
|
2153
|
-
* Updates the metadata of an agent session.
|
|
2154
|
-
* @param params.roomId The room ID to update the agent session in.
|
|
2155
|
-
* @param params.agentSessionId The agent session ID to update.
|
|
2156
|
-
* @param params.metadata The metadata for the agent session.
|
|
2157
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
2158
|
-
* @returns The updated agent session.
|
|
2159
|
-
*/
|
|
2160
|
-
async updateAgentSessionMetadata(params, options) {
|
|
2161
|
-
const { roomId, agentSessionId, metadata } = params;
|
|
2162
|
-
const res = await this.#post(
|
|
2163
|
-
url2`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}`,
|
|
2164
|
-
{ metadata },
|
|
2165
|
-
options
|
|
2166
|
-
);
|
|
2167
|
-
if (!res.ok) {
|
|
2168
|
-
throw await LiveblocksError.from(res);
|
|
2169
|
-
}
|
|
2170
|
-
return await res.json();
|
|
2171
|
-
}
|
|
2172
|
-
/**
|
|
2173
|
-
* Deletes an agent session.
|
|
2174
|
-
* @param params.roomId The room ID to delete the agent session from.
|
|
2175
|
-
* @param params.agentSessionId The agent session ID to delete.
|
|
2176
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
2177
|
-
*/
|
|
2178
|
-
async deleteAgentSession(params, options) {
|
|
2179
|
-
const { roomId, agentSessionId } = params;
|
|
2180
|
-
const res = await this.#delete(
|
|
2181
|
-
url2`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}`,
|
|
2182
|
-
void 0,
|
|
2183
|
-
options
|
|
2184
|
-
);
|
|
2185
|
-
if (!res.ok) {
|
|
2186
|
-
throw await LiveblocksError.from(res);
|
|
2187
|
-
}
|
|
2188
|
-
}
|
|
2189
|
-
/**
|
|
2190
|
-
* Returns a list of agent messages in an agent session.
|
|
2191
|
-
* @param params.roomId The room ID to get the agent messages from.
|
|
2192
|
-
* @param params.agentSessionId The agent session ID to get the messages from.
|
|
2193
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
2194
|
-
* @returns A list of agent messages.
|
|
2195
|
-
*/
|
|
2196
|
-
async getAgentMessages(params, options) {
|
|
2197
|
-
const { roomId, agentSessionId } = params;
|
|
2198
|
-
const res = await this.#get(
|
|
2199
|
-
url2`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}/messages`,
|
|
2200
|
-
void 0,
|
|
2201
|
-
options
|
|
2202
|
-
);
|
|
2203
|
-
if (!res.ok) {
|
|
2204
|
-
throw await LiveblocksError.from(res);
|
|
2205
|
-
}
|
|
2206
|
-
return await res.json();
|
|
2207
|
-
}
|
|
2208
|
-
/**
|
|
2209
|
-
* Creates a new agent message in an agent session.
|
|
2210
|
-
* @param params.roomId The room ID to create the agent message in.
|
|
2211
|
-
* @param params.agentSessionId The agent session ID to create the message in.
|
|
2212
|
-
* @param params.id (optional) The message ID. If not provided, one will be generated.
|
|
2213
|
-
* @param params.timestamp (optional) The message timestamp. If not provided, the current time will be used.
|
|
2214
|
-
* @param params.data The message data.
|
|
2215
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
2216
|
-
* @returns The created agent message.
|
|
2217
|
-
*/
|
|
2218
|
-
async createAgentMessage(params, options) {
|
|
2219
|
-
const { roomId, agentSessionId, id, timestamp, data } = params;
|
|
2220
|
-
const res = await this.#post(
|
|
2221
|
-
url2`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}/messages`,
|
|
2222
|
-
{ id, timestamp, data },
|
|
2223
|
-
options
|
|
2224
|
-
);
|
|
2225
|
-
if (!res.ok) {
|
|
2226
|
-
throw await LiveblocksError.from(res);
|
|
2227
|
-
}
|
|
2228
|
-
return await res.json();
|
|
2229
|
-
}
|
|
2230
|
-
/**
|
|
2231
|
-
* Updates an agent message.
|
|
2232
|
-
* @param params.roomId The room ID to update the agent message in.
|
|
2233
|
-
* @param params.agentSessionId The agent session ID to update the message in.
|
|
2234
|
-
* @param params.messageId The message ID to update.
|
|
2235
|
-
* @param params.data The message data.
|
|
2236
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
2237
|
-
* @returns The updated agent message.
|
|
2238
|
-
*/
|
|
2239
|
-
async updateAgentMessage(params, options) {
|
|
2240
|
-
const { roomId, agentSessionId, messageId, data } = params;
|
|
2241
|
-
const res = await this.#post(
|
|
2242
|
-
url2`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}/messages/${messageId}`,
|
|
2243
|
-
{ data },
|
|
2244
|
-
options
|
|
2245
|
-
);
|
|
2246
|
-
if (!res.ok) {
|
|
2247
|
-
throw await LiveblocksError.from(res);
|
|
2248
|
-
}
|
|
2249
|
-
return await res.json();
|
|
2250
|
-
}
|
|
2251
|
-
/**
|
|
2252
|
-
* Deletes an agent message.
|
|
2253
|
-
* @param params.roomId The room ID to delete the agent message from.
|
|
2254
|
-
* @param params.agentSessionId The agent session ID to delete the message from.
|
|
2255
|
-
* @param params.messageId The message ID to delete.
|
|
2256
|
-
* @param options.signal (optional) An abort signal to cancel the request.
|
|
2257
|
-
*/
|
|
2258
|
-
async deleteAgentMessage(params, options) {
|
|
2259
|
-
const { roomId, agentSessionId, messageId } = params;
|
|
2260
|
-
const res = await this.#delete(
|
|
2261
|
-
url2`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}/messages/${messageId}`,
|
|
2262
|
-
void 0,
|
|
2263
|
-
options
|
|
2264
|
-
);
|
|
2265
|
-
if (!res.ok) {
|
|
2266
|
-
throw await LiveblocksError.from(res);
|
|
2267
|
-
}
|
|
2268
|
-
}
|
|
2269
2091
|
};
|
|
2270
2092
|
var LiveblocksError = class _LiveblocksError extends Error {
|
|
2271
2093
|
status;
|