@liveblocks/core 2.25.0-aiprivatebeta10 → 2.25.0-aiprivatebeta12
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 +173 -150
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +93 -91
- package/dist/index.d.ts +93 -91
- package/dist/index.js +83 -60
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/dist/index.d.cts
CHANGED
|
@@ -3633,7 +3633,7 @@ type ToolResultData = Json;
|
|
|
3633
3633
|
type SetToolResultPair = DefineCmd<"set-tool-result", {
|
|
3634
3634
|
chatId: ChatId;
|
|
3635
3635
|
messageId: MessageId;
|
|
3636
|
-
|
|
3636
|
+
invocationId: string;
|
|
3637
3637
|
result: ToolResultData;
|
|
3638
3638
|
generationOptions: AiGenerationOptions;
|
|
3639
3639
|
}, {
|
|
@@ -3642,7 +3642,7 @@ type SetToolResultPair = DefineCmd<"set-tool-result", {
|
|
|
3642
3642
|
} | {
|
|
3643
3643
|
ok: false;
|
|
3644
3644
|
}>;
|
|
3645
|
-
type ServerEvent = RebootedEvent | CmdFailedEvent | ErrorServerEvent | SyncServerEvent | DeltaServerEvent | SettleServerEvent;
|
|
3645
|
+
type ServerEvent = RebootedEvent | CmdFailedEvent | WarningServerEvent | ErrorServerEvent | SyncServerEvent | DeltaServerEvent | SettleServerEvent;
|
|
3646
3646
|
type RebootedEvent = {
|
|
3647
3647
|
event: "rebooted";
|
|
3648
3648
|
};
|
|
@@ -3652,6 +3652,10 @@ type CmdFailedEvent = {
|
|
|
3652
3652
|
failedCmdId: CmdId;
|
|
3653
3653
|
error: string;
|
|
3654
3654
|
};
|
|
3655
|
+
type WarningServerEvent = {
|
|
3656
|
+
event: "warning";
|
|
3657
|
+
message: string;
|
|
3658
|
+
};
|
|
3655
3659
|
type ErrorServerEvent = {
|
|
3656
3660
|
event: "error";
|
|
3657
3661
|
error: string;
|
|
@@ -3699,22 +3703,22 @@ type AiToolInvocationPart<A extends JsonObject = JsonObject, R extends ToolResul
|
|
|
3699
3703
|
type AiReceivingToolInvocationPart = {
|
|
3700
3704
|
type: "tool-invocation";
|
|
3701
3705
|
status: "receiving";
|
|
3702
|
-
|
|
3703
|
-
|
|
3706
|
+
invocationId: string;
|
|
3707
|
+
name: string;
|
|
3704
3708
|
partialArgs: Json;
|
|
3705
3709
|
};
|
|
3706
3710
|
type AiExecutingToolInvocationPart<A extends JsonObject = JsonObject> = {
|
|
3707
3711
|
type: "tool-invocation";
|
|
3708
3712
|
status: "executing";
|
|
3709
|
-
|
|
3710
|
-
|
|
3713
|
+
invocationId: string;
|
|
3714
|
+
name: string;
|
|
3711
3715
|
args: A;
|
|
3712
3716
|
};
|
|
3713
3717
|
type AiExecutedToolInvocationPart<A extends JsonObject = JsonObject, R extends ToolResultData = ToolResultData> = {
|
|
3714
3718
|
type: "tool-invocation";
|
|
3715
3719
|
status: "executed";
|
|
3716
|
-
|
|
3717
|
-
|
|
3720
|
+
invocationId: string;
|
|
3721
|
+
name: string;
|
|
3718
3722
|
args: A;
|
|
3719
3723
|
result: R;
|
|
3720
3724
|
};
|
|
@@ -3804,35 +3808,72 @@ type AiKnowledgeSource = {
|
|
|
3804
3808
|
value: Json;
|
|
3805
3809
|
};
|
|
3806
3810
|
|
|
3807
|
-
type
|
|
3808
|
-
type: "object";
|
|
3809
|
-
properties: Record<string, JSONSchema7>;
|
|
3810
|
-
required: readonly string[];
|
|
3811
|
-
} ? Resolve<{
|
|
3812
|
-
-readonly [K in keyof T["properties"] as K extends string ? K extends Extract<K, T["required"][number]> ? K : never : never]: InferFromSchema<T["properties"][K]>;
|
|
3813
|
-
} & {
|
|
3814
|
-
-readonly [K in keyof T["properties"] as K extends string ? K extends Extract<K, T["required"][number]> ? never : K : never]?: InferFromSchema<T["properties"][K]>;
|
|
3815
|
-
}> : T extends {
|
|
3811
|
+
type JSONObjectSchema7 = JSONSchema7 & {
|
|
3816
3812
|
type: "object";
|
|
3817
|
-
|
|
3813
|
+
};
|
|
3814
|
+
type NoFields = {};
|
|
3815
|
+
type Infer<T> = T extends JSONSchema7 ? InferFromSchema<T> : never;
|
|
3816
|
+
type InferAllOf<T extends readonly JSONSchema7[]> = T extends readonly [
|
|
3817
|
+
infer U,
|
|
3818
|
+
...infer R
|
|
3819
|
+
] ? R extends readonly JSONSchema7[] ? Infer<U> & InferAllOf<R> : Infer<U> : unknown;
|
|
3820
|
+
type InferRequireds<P, R extends readonly string[]> = {
|
|
3821
|
+
-readonly [K in keyof P as K extends string ? K extends Extract<K, R[number]> ? K : never : never]: Infer<P[K]>;
|
|
3822
|
+
};
|
|
3823
|
+
type InferOptionals<P, R extends readonly string[]> = {
|
|
3824
|
+
-readonly [K in keyof P as K extends string ? K extends Extract<K, R[number]> ? never : K : never]?: Infer<P[K]>;
|
|
3825
|
+
};
|
|
3826
|
+
type InferBaseObject<T extends JSONObjectSchema7> = T extends {
|
|
3827
|
+
properties?: infer P extends Record<string, JSONSchema7>;
|
|
3828
|
+
required?: infer R;
|
|
3829
|
+
} ? InferRequireds<P, R extends readonly string[] ? R : []> & InferOptionals<P, R extends readonly string[] ? R : []> : NoFields;
|
|
3830
|
+
type InferAdditionals<T extends JSONObjectSchema7> = T extends {
|
|
3831
|
+
additionalProperties: false;
|
|
3832
|
+
} ? NoFields : T extends {
|
|
3833
|
+
additionalProperties?: true;
|
|
3834
|
+
} ? JsonObject : T extends {
|
|
3835
|
+
additionalProperties: infer A;
|
|
3818
3836
|
} ? {
|
|
3819
|
-
|
|
3820
|
-
} :
|
|
3837
|
+
[extra: string]: Infer<A> | undefined;
|
|
3838
|
+
} : JsonObject;
|
|
3839
|
+
type InferFromObjectSchema<T extends JSONObjectSchema7> = Resolve<InferBaseObject<T> & InferAdditionals<T>>;
|
|
3840
|
+
type InferFromArraySchema<T extends JSONSchema7> = T extends {
|
|
3841
|
+
items: infer U;
|
|
3842
|
+
} ? Infer<U>[] : Json[];
|
|
3843
|
+
type InferFromSchema<T extends JSONSchema7> = JSONSchema7 extends T ? JsonObject : T extends {
|
|
3844
|
+
type: "object";
|
|
3845
|
+
} ? InferFromObjectSchema<T> : T extends {
|
|
3846
|
+
type: "array";
|
|
3847
|
+
} ? InferFromArraySchema<T> : T extends {
|
|
3848
|
+
oneOf: readonly (infer U)[];
|
|
3849
|
+
} ? Infer<U> : T extends {
|
|
3850
|
+
anyOf: readonly (infer U)[];
|
|
3851
|
+
} ? Infer<U> : T extends {
|
|
3852
|
+
allOf: readonly JSONSchema7[];
|
|
3853
|
+
} ? InferAllOf<T["allOf"]> : T extends {
|
|
3854
|
+
not: JSONSchema7;
|
|
3855
|
+
} ? Json : T extends {
|
|
3856
|
+
enum: readonly (infer U)[];
|
|
3857
|
+
} ? U : T extends {
|
|
3858
|
+
const: infer C;
|
|
3859
|
+
} ? C : T extends {
|
|
3821
3860
|
type: "string";
|
|
3822
3861
|
} ? string : T extends {
|
|
3823
3862
|
type: "number";
|
|
3863
|
+
} ? number : T extends {
|
|
3864
|
+
type: "integer";
|
|
3824
3865
|
} ? number : T extends {
|
|
3825
3866
|
type: "boolean";
|
|
3826
3867
|
} ? boolean : T extends {
|
|
3827
3868
|
type: "null";
|
|
3828
|
-
} ? null :
|
|
3829
|
-
|
|
3830
|
-
items: JSONSchema7;
|
|
3831
|
-
} ? InferFromSchema<T["items"]>[] : unknown;
|
|
3869
|
+
} ? null : Json;
|
|
3870
|
+
|
|
3832
3871
|
type AiToolTypePack<A extends JsonObject = JsonObject, R extends ToolResultData = ToolResultData> = {
|
|
3833
3872
|
A: A;
|
|
3834
3873
|
R: R;
|
|
3835
3874
|
};
|
|
3875
|
+
type AskUserMessageInChatOptions = Omit<AiGenerationOptions, "tools" | "knowledge">;
|
|
3876
|
+
type SetToolResultOptions = Omit<AiGenerationOptions, "tools" | "knowledge">;
|
|
3836
3877
|
type AiToolInvocationProps<A extends JsonObject, R extends ToolResultData> = Resolve<DistributiveOmit<AiToolInvocationPart<A, R>, "type"> & {
|
|
3837
3878
|
respond: (result: R) => void;
|
|
3838
3879
|
/**
|
|
@@ -3856,8 +3897,8 @@ type AiToolInvocationProps<A extends JsonObject, R extends ToolResultData> = Res
|
|
|
3856
3897
|
}>;
|
|
3857
3898
|
type AiOpaqueToolInvocationProps = AiToolInvocationProps<JsonObject, ToolResultData>;
|
|
3858
3899
|
type AiToolExecuteContext = {
|
|
3859
|
-
|
|
3860
|
-
|
|
3900
|
+
name: string;
|
|
3901
|
+
invocationId: string;
|
|
3861
3902
|
};
|
|
3862
3903
|
type AiToolExecuteCallback<A extends JsonObject, R extends ToolResultData> = (args: A, context: AiToolExecuteContext) => Awaitable<R>;
|
|
3863
3904
|
type AiToolDefinition<S extends JSONObjectSchema7, A extends JsonObject, R extends ToolResultData> = {
|
|
@@ -3867,63 +3908,30 @@ type AiToolDefinition<S extends JSONObjectSchema7, A extends JsonObject, R exten
|
|
|
3867
3908
|
render?: (props: AiToolInvocationProps<A, R>) => unknown;
|
|
3868
3909
|
};
|
|
3869
3910
|
type AiOpaqueToolDefinition = AiToolDefinition<JSONObjectSchema7, JsonObject, ToolResultData>;
|
|
3870
|
-
type JSONObjectSchema7 = JSONSchema7 & {
|
|
3871
|
-
type: "object";
|
|
3872
|
-
};
|
|
3873
3911
|
/**
|
|
3874
3912
|
* Helper function to help infer the types of `args`, `render`, and `result`.
|
|
3875
3913
|
* This function has no runtime implementation and is only needed to make it
|
|
3876
3914
|
* possible for TypeScript to infer types.
|
|
3877
3915
|
*/
|
|
3878
3916
|
declare function defineAiTool<R extends ToolResultData>(): <const S extends JSONObjectSchema7>(def: AiToolDefinition<S, InferFromSchema<S> extends JsonObject ? InferFromSchema<S> : JsonObject, R>) => AiOpaqueToolDefinition;
|
|
3879
|
-
type
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
next: MessageId | null;
|
|
3893
|
-
};
|
|
3894
|
-
};
|
|
3895
|
-
type UiUserMessage = AiUserMessage & {
|
|
3896
|
-
navigation: {
|
|
3897
|
-
/**
|
|
3898
|
-
* The message ID of the parent message, or null if there is no parent.
|
|
3899
|
-
*/
|
|
3900
|
-
parent: MessageId | null;
|
|
3901
|
-
/**
|
|
3902
|
-
* The message ID of the left sibling message, or null if there is no left sibling.
|
|
3903
|
-
*/
|
|
3904
|
-
prev: MessageId | null;
|
|
3905
|
-
/**
|
|
3906
|
-
* The message ID of the right sibling message, or null if there is no right sibling.
|
|
3907
|
-
*/
|
|
3908
|
-
next: MessageId | null;
|
|
3909
|
-
};
|
|
3917
|
+
type NavigationInfo = {
|
|
3918
|
+
/**
|
|
3919
|
+
* The message ID of the parent message, or null if there is no parent.
|
|
3920
|
+
*/
|
|
3921
|
+
parent: MessageId | null;
|
|
3922
|
+
/**
|
|
3923
|
+
* The message ID of the left sibling message, or null if there is no left sibling.
|
|
3924
|
+
*/
|
|
3925
|
+
prev: MessageId | null;
|
|
3926
|
+
/**
|
|
3927
|
+
* The message ID of the right sibling message, or null if there is no right sibling.
|
|
3928
|
+
*/
|
|
3929
|
+
next: MessageId | null;
|
|
3910
3930
|
};
|
|
3911
|
-
type
|
|
3912
|
-
navigation:
|
|
3913
|
-
/**
|
|
3914
|
-
* The message ID of the parent message, or null if there is no parent.
|
|
3915
|
-
*/
|
|
3916
|
-
parent: MessageId | null;
|
|
3917
|
-
/**
|
|
3918
|
-
* The message ID of the left sibling message, or null if there is no left sibling.
|
|
3919
|
-
*/
|
|
3920
|
-
prev: MessageId | null;
|
|
3921
|
-
/**
|
|
3922
|
-
* The message ID of the right sibling message, or null if there is no right sibling.
|
|
3923
|
-
*/
|
|
3924
|
-
next: MessageId | null;
|
|
3925
|
-
};
|
|
3931
|
+
type WithNavigation<T> = T & {
|
|
3932
|
+
navigation: NavigationInfo;
|
|
3926
3933
|
};
|
|
3934
|
+
type UiChatMessage = WithNavigation<AiChatMessage>;
|
|
3927
3935
|
type AiContext = {
|
|
3928
3936
|
staticSessionInfoSig: Signal<StaticSessionInfo | null>;
|
|
3929
3937
|
dynamicSessionInfoSig: Signal<DynamicSessionInfo | null>;
|
|
@@ -3947,15 +3955,11 @@ declare class KnowledgeStack {
|
|
|
3947
3955
|
updateKnowledge(layerKey: LayerKey, key: string, data: AiKnowledgeSource | null): void;
|
|
3948
3956
|
}
|
|
3949
3957
|
declare function createStore_forTools(): {
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
definition: AiOpaqueToolDefinition;
|
|
3954
|
-
}[];
|
|
3955
|
-
addToolDefinition: (chatId: string, name: string, definition: AiOpaqueToolDefinition) => void;
|
|
3956
|
-
removeToolDefinition: (chatId: string, toolName: string) => void;
|
|
3958
|
+
getToolDescriptions: (chatId: string) => AiToolDescription[];
|
|
3959
|
+
getToolΣ: (name: string, chatId?: string) => DerivedSignal<AiOpaqueToolDefinition | undefined>;
|
|
3960
|
+
registerTool: (name: string, tool: AiOpaqueToolDefinition, chatId?: string) => () => void;
|
|
3957
3961
|
};
|
|
3958
|
-
declare function createStore_forChatMessages(toolsStore: ReturnType<typeof createStore_forTools>, setToolResult: (chatId: string, messageId: MessageId,
|
|
3962
|
+
declare function createStore_forChatMessages(toolsStore: ReturnType<typeof createStore_forTools>, setToolResult: (chatId: string, messageId: MessageId, invocationId: string, result: ToolResultData, options?: SetToolResultOptions) => Promise<SetToolResultResponse>): {
|
|
3959
3963
|
getMessageById: (messageId: MessageId) => AiChatMessage | undefined;
|
|
3960
3964
|
getChatMessagesForBranchΣ: (chatId: string, branch?: MessageId) => DerivedSignal<UiChatMessage[]>;
|
|
3961
3965
|
createOptimistically: {
|
|
@@ -3975,7 +3979,7 @@ declare function createStore_forUserAiChats(): {
|
|
|
3975
3979
|
getChatById: (chatId: string) => AiChat | undefined;
|
|
3976
3980
|
upsert: (chat: AiChat) => void;
|
|
3977
3981
|
upsertMany: (chats: AiChat[]) => void;
|
|
3978
|
-
|
|
3982
|
+
markDeleted: (chatId: string) => void;
|
|
3979
3983
|
};
|
|
3980
3984
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
3981
3985
|
type Ai = {
|
|
@@ -4007,16 +4011,16 @@ type Ai = {
|
|
|
4007
4011
|
id: MessageId;
|
|
4008
4012
|
parentMessageId: MessageId | null;
|
|
4009
4013
|
content: AiUserContentPart[];
|
|
4010
|
-
}, targetMessageId: MessageId, options?:
|
|
4014
|
+
}, targetMessageId: MessageId, options?: AskUserMessageInChatOptions) => Promise<AskInChatResponse>;
|
|
4011
4015
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4012
4016
|
abort: (messageId: MessageId) => Promise<AbortAiResponse>;
|
|
4013
4017
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4014
|
-
setToolResult: (chatId: string, messageId: MessageId,
|
|
4018
|
+
setToolResult: (chatId: string, messageId: MessageId, invocationId: string, result: ToolResultData, options?: SetToolResultOptions) => Promise<SetToolResultResponse>;
|
|
4015
4019
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4016
4020
|
signals: {
|
|
4017
4021
|
chatsΣ: DerivedSignal<AiChat[]>;
|
|
4018
4022
|
getChatMessagesForBranchΣ(chatId: string, branch?: MessageId): DerivedSignal<UiChatMessage[]>;
|
|
4019
|
-
|
|
4023
|
+
getToolΣ(name: string, chatId?: string): DerivedSignal<AiOpaqueToolDefinition | undefined>;
|
|
4020
4024
|
};
|
|
4021
4025
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4022
4026
|
getChatById: (chatId: string) => AiChat | undefined;
|
|
@@ -4027,9 +4031,7 @@ type Ai = {
|
|
|
4027
4031
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4028
4032
|
updateKnowledge: (layerKey: LayerKey, data: AiKnowledgeSource, key?: string) => void;
|
|
4029
4033
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4030
|
-
|
|
4031
|
-
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4032
|
-
unregisterChatTool: (chatId: string, toolName: string) => void;
|
|
4034
|
+
registerTool: (name: string, tool: AiOpaqueToolDefinition, chatId?: string) => () => void;
|
|
4033
4035
|
};
|
|
4034
4036
|
|
|
4035
4037
|
type CommentBodyParagraphElementArgs = {
|
|
@@ -4820,4 +4822,4 @@ declare const CommentsApiError: typeof HttpError;
|
|
|
4820
4822
|
/** @deprecated Use HttpError instead. */
|
|
4821
4823
|
declare const NotificationsApiError: typeof HttpError;
|
|
4822
4824
|
|
|
4823
|
-
export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiChat, type AiChatMessage, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, 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, CommentsApiError, 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 DE, type DM, type DP, type DRI, type DS, 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 History, type HistoryVersion, HttpError, 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 InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, type ManagedPool, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, NotificationsApiError, 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 Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, 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 ToolResultData, type URLSafeString, type
|
|
4825
|
+
export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUserMessage, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, 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, CommentsApiError, 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 DE, type DM, type DP, type DRI, type DS, 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 History, type HistoryVersion, HttpError, 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 InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, type ManagedPool, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, NotificationsApiError, 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 Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, 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 ToolResultData, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserNotificationSettings, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveUsersInCommentBody, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
|
package/dist/index.d.ts
CHANGED
|
@@ -3633,7 +3633,7 @@ type ToolResultData = Json;
|
|
|
3633
3633
|
type SetToolResultPair = DefineCmd<"set-tool-result", {
|
|
3634
3634
|
chatId: ChatId;
|
|
3635
3635
|
messageId: MessageId;
|
|
3636
|
-
|
|
3636
|
+
invocationId: string;
|
|
3637
3637
|
result: ToolResultData;
|
|
3638
3638
|
generationOptions: AiGenerationOptions;
|
|
3639
3639
|
}, {
|
|
@@ -3642,7 +3642,7 @@ type SetToolResultPair = DefineCmd<"set-tool-result", {
|
|
|
3642
3642
|
} | {
|
|
3643
3643
|
ok: false;
|
|
3644
3644
|
}>;
|
|
3645
|
-
type ServerEvent = RebootedEvent | CmdFailedEvent | ErrorServerEvent | SyncServerEvent | DeltaServerEvent | SettleServerEvent;
|
|
3645
|
+
type ServerEvent = RebootedEvent | CmdFailedEvent | WarningServerEvent | ErrorServerEvent | SyncServerEvent | DeltaServerEvent | SettleServerEvent;
|
|
3646
3646
|
type RebootedEvent = {
|
|
3647
3647
|
event: "rebooted";
|
|
3648
3648
|
};
|
|
@@ -3652,6 +3652,10 @@ type CmdFailedEvent = {
|
|
|
3652
3652
|
failedCmdId: CmdId;
|
|
3653
3653
|
error: string;
|
|
3654
3654
|
};
|
|
3655
|
+
type WarningServerEvent = {
|
|
3656
|
+
event: "warning";
|
|
3657
|
+
message: string;
|
|
3658
|
+
};
|
|
3655
3659
|
type ErrorServerEvent = {
|
|
3656
3660
|
event: "error";
|
|
3657
3661
|
error: string;
|
|
@@ -3699,22 +3703,22 @@ type AiToolInvocationPart<A extends JsonObject = JsonObject, R extends ToolResul
|
|
|
3699
3703
|
type AiReceivingToolInvocationPart = {
|
|
3700
3704
|
type: "tool-invocation";
|
|
3701
3705
|
status: "receiving";
|
|
3702
|
-
|
|
3703
|
-
|
|
3706
|
+
invocationId: string;
|
|
3707
|
+
name: string;
|
|
3704
3708
|
partialArgs: Json;
|
|
3705
3709
|
};
|
|
3706
3710
|
type AiExecutingToolInvocationPart<A extends JsonObject = JsonObject> = {
|
|
3707
3711
|
type: "tool-invocation";
|
|
3708
3712
|
status: "executing";
|
|
3709
|
-
|
|
3710
|
-
|
|
3713
|
+
invocationId: string;
|
|
3714
|
+
name: string;
|
|
3711
3715
|
args: A;
|
|
3712
3716
|
};
|
|
3713
3717
|
type AiExecutedToolInvocationPart<A extends JsonObject = JsonObject, R extends ToolResultData = ToolResultData> = {
|
|
3714
3718
|
type: "tool-invocation";
|
|
3715
3719
|
status: "executed";
|
|
3716
|
-
|
|
3717
|
-
|
|
3720
|
+
invocationId: string;
|
|
3721
|
+
name: string;
|
|
3718
3722
|
args: A;
|
|
3719
3723
|
result: R;
|
|
3720
3724
|
};
|
|
@@ -3804,35 +3808,72 @@ type AiKnowledgeSource = {
|
|
|
3804
3808
|
value: Json;
|
|
3805
3809
|
};
|
|
3806
3810
|
|
|
3807
|
-
type
|
|
3808
|
-
type: "object";
|
|
3809
|
-
properties: Record<string, JSONSchema7>;
|
|
3810
|
-
required: readonly string[];
|
|
3811
|
-
} ? Resolve<{
|
|
3812
|
-
-readonly [K in keyof T["properties"] as K extends string ? K extends Extract<K, T["required"][number]> ? K : never : never]: InferFromSchema<T["properties"][K]>;
|
|
3813
|
-
} & {
|
|
3814
|
-
-readonly [K in keyof T["properties"] as K extends string ? K extends Extract<K, T["required"][number]> ? never : K : never]?: InferFromSchema<T["properties"][K]>;
|
|
3815
|
-
}> : T extends {
|
|
3811
|
+
type JSONObjectSchema7 = JSONSchema7 & {
|
|
3816
3812
|
type: "object";
|
|
3817
|
-
|
|
3813
|
+
};
|
|
3814
|
+
type NoFields = {};
|
|
3815
|
+
type Infer<T> = T extends JSONSchema7 ? InferFromSchema<T> : never;
|
|
3816
|
+
type InferAllOf<T extends readonly JSONSchema7[]> = T extends readonly [
|
|
3817
|
+
infer U,
|
|
3818
|
+
...infer R
|
|
3819
|
+
] ? R extends readonly JSONSchema7[] ? Infer<U> & InferAllOf<R> : Infer<U> : unknown;
|
|
3820
|
+
type InferRequireds<P, R extends readonly string[]> = {
|
|
3821
|
+
-readonly [K in keyof P as K extends string ? K extends Extract<K, R[number]> ? K : never : never]: Infer<P[K]>;
|
|
3822
|
+
};
|
|
3823
|
+
type InferOptionals<P, R extends readonly string[]> = {
|
|
3824
|
+
-readonly [K in keyof P as K extends string ? K extends Extract<K, R[number]> ? never : K : never]?: Infer<P[K]>;
|
|
3825
|
+
};
|
|
3826
|
+
type InferBaseObject<T extends JSONObjectSchema7> = T extends {
|
|
3827
|
+
properties?: infer P extends Record<string, JSONSchema7>;
|
|
3828
|
+
required?: infer R;
|
|
3829
|
+
} ? InferRequireds<P, R extends readonly string[] ? R : []> & InferOptionals<P, R extends readonly string[] ? R : []> : NoFields;
|
|
3830
|
+
type InferAdditionals<T extends JSONObjectSchema7> = T extends {
|
|
3831
|
+
additionalProperties: false;
|
|
3832
|
+
} ? NoFields : T extends {
|
|
3833
|
+
additionalProperties?: true;
|
|
3834
|
+
} ? JsonObject : T extends {
|
|
3835
|
+
additionalProperties: infer A;
|
|
3818
3836
|
} ? {
|
|
3819
|
-
|
|
3820
|
-
} :
|
|
3837
|
+
[extra: string]: Infer<A> | undefined;
|
|
3838
|
+
} : JsonObject;
|
|
3839
|
+
type InferFromObjectSchema<T extends JSONObjectSchema7> = Resolve<InferBaseObject<T> & InferAdditionals<T>>;
|
|
3840
|
+
type InferFromArraySchema<T extends JSONSchema7> = T extends {
|
|
3841
|
+
items: infer U;
|
|
3842
|
+
} ? Infer<U>[] : Json[];
|
|
3843
|
+
type InferFromSchema<T extends JSONSchema7> = JSONSchema7 extends T ? JsonObject : T extends {
|
|
3844
|
+
type: "object";
|
|
3845
|
+
} ? InferFromObjectSchema<T> : T extends {
|
|
3846
|
+
type: "array";
|
|
3847
|
+
} ? InferFromArraySchema<T> : T extends {
|
|
3848
|
+
oneOf: readonly (infer U)[];
|
|
3849
|
+
} ? Infer<U> : T extends {
|
|
3850
|
+
anyOf: readonly (infer U)[];
|
|
3851
|
+
} ? Infer<U> : T extends {
|
|
3852
|
+
allOf: readonly JSONSchema7[];
|
|
3853
|
+
} ? InferAllOf<T["allOf"]> : T extends {
|
|
3854
|
+
not: JSONSchema7;
|
|
3855
|
+
} ? Json : T extends {
|
|
3856
|
+
enum: readonly (infer U)[];
|
|
3857
|
+
} ? U : T extends {
|
|
3858
|
+
const: infer C;
|
|
3859
|
+
} ? C : T extends {
|
|
3821
3860
|
type: "string";
|
|
3822
3861
|
} ? string : T extends {
|
|
3823
3862
|
type: "number";
|
|
3863
|
+
} ? number : T extends {
|
|
3864
|
+
type: "integer";
|
|
3824
3865
|
} ? number : T extends {
|
|
3825
3866
|
type: "boolean";
|
|
3826
3867
|
} ? boolean : T extends {
|
|
3827
3868
|
type: "null";
|
|
3828
|
-
} ? null :
|
|
3829
|
-
|
|
3830
|
-
items: JSONSchema7;
|
|
3831
|
-
} ? InferFromSchema<T["items"]>[] : unknown;
|
|
3869
|
+
} ? null : Json;
|
|
3870
|
+
|
|
3832
3871
|
type AiToolTypePack<A extends JsonObject = JsonObject, R extends ToolResultData = ToolResultData> = {
|
|
3833
3872
|
A: A;
|
|
3834
3873
|
R: R;
|
|
3835
3874
|
};
|
|
3875
|
+
type AskUserMessageInChatOptions = Omit<AiGenerationOptions, "tools" | "knowledge">;
|
|
3876
|
+
type SetToolResultOptions = Omit<AiGenerationOptions, "tools" | "knowledge">;
|
|
3836
3877
|
type AiToolInvocationProps<A extends JsonObject, R extends ToolResultData> = Resolve<DistributiveOmit<AiToolInvocationPart<A, R>, "type"> & {
|
|
3837
3878
|
respond: (result: R) => void;
|
|
3838
3879
|
/**
|
|
@@ -3856,8 +3897,8 @@ type AiToolInvocationProps<A extends JsonObject, R extends ToolResultData> = Res
|
|
|
3856
3897
|
}>;
|
|
3857
3898
|
type AiOpaqueToolInvocationProps = AiToolInvocationProps<JsonObject, ToolResultData>;
|
|
3858
3899
|
type AiToolExecuteContext = {
|
|
3859
|
-
|
|
3860
|
-
|
|
3900
|
+
name: string;
|
|
3901
|
+
invocationId: string;
|
|
3861
3902
|
};
|
|
3862
3903
|
type AiToolExecuteCallback<A extends JsonObject, R extends ToolResultData> = (args: A, context: AiToolExecuteContext) => Awaitable<R>;
|
|
3863
3904
|
type AiToolDefinition<S extends JSONObjectSchema7, A extends JsonObject, R extends ToolResultData> = {
|
|
@@ -3867,63 +3908,30 @@ type AiToolDefinition<S extends JSONObjectSchema7, A extends JsonObject, R exten
|
|
|
3867
3908
|
render?: (props: AiToolInvocationProps<A, R>) => unknown;
|
|
3868
3909
|
};
|
|
3869
3910
|
type AiOpaqueToolDefinition = AiToolDefinition<JSONObjectSchema7, JsonObject, ToolResultData>;
|
|
3870
|
-
type JSONObjectSchema7 = JSONSchema7 & {
|
|
3871
|
-
type: "object";
|
|
3872
|
-
};
|
|
3873
3911
|
/**
|
|
3874
3912
|
* Helper function to help infer the types of `args`, `render`, and `result`.
|
|
3875
3913
|
* This function has no runtime implementation and is only needed to make it
|
|
3876
3914
|
* possible for TypeScript to infer types.
|
|
3877
3915
|
*/
|
|
3878
3916
|
declare function defineAiTool<R extends ToolResultData>(): <const S extends JSONObjectSchema7>(def: AiToolDefinition<S, InferFromSchema<S> extends JsonObject ? InferFromSchema<S> : JsonObject, R>) => AiOpaqueToolDefinition;
|
|
3879
|
-
type
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
next: MessageId | null;
|
|
3893
|
-
};
|
|
3894
|
-
};
|
|
3895
|
-
type UiUserMessage = AiUserMessage & {
|
|
3896
|
-
navigation: {
|
|
3897
|
-
/**
|
|
3898
|
-
* The message ID of the parent message, or null if there is no parent.
|
|
3899
|
-
*/
|
|
3900
|
-
parent: MessageId | null;
|
|
3901
|
-
/**
|
|
3902
|
-
* The message ID of the left sibling message, or null if there is no left sibling.
|
|
3903
|
-
*/
|
|
3904
|
-
prev: MessageId | null;
|
|
3905
|
-
/**
|
|
3906
|
-
* The message ID of the right sibling message, or null if there is no right sibling.
|
|
3907
|
-
*/
|
|
3908
|
-
next: MessageId | null;
|
|
3909
|
-
};
|
|
3917
|
+
type NavigationInfo = {
|
|
3918
|
+
/**
|
|
3919
|
+
* The message ID of the parent message, or null if there is no parent.
|
|
3920
|
+
*/
|
|
3921
|
+
parent: MessageId | null;
|
|
3922
|
+
/**
|
|
3923
|
+
* The message ID of the left sibling message, or null if there is no left sibling.
|
|
3924
|
+
*/
|
|
3925
|
+
prev: MessageId | null;
|
|
3926
|
+
/**
|
|
3927
|
+
* The message ID of the right sibling message, or null if there is no right sibling.
|
|
3928
|
+
*/
|
|
3929
|
+
next: MessageId | null;
|
|
3910
3930
|
};
|
|
3911
|
-
type
|
|
3912
|
-
navigation:
|
|
3913
|
-
/**
|
|
3914
|
-
* The message ID of the parent message, or null if there is no parent.
|
|
3915
|
-
*/
|
|
3916
|
-
parent: MessageId | null;
|
|
3917
|
-
/**
|
|
3918
|
-
* The message ID of the left sibling message, or null if there is no left sibling.
|
|
3919
|
-
*/
|
|
3920
|
-
prev: MessageId | null;
|
|
3921
|
-
/**
|
|
3922
|
-
* The message ID of the right sibling message, or null if there is no right sibling.
|
|
3923
|
-
*/
|
|
3924
|
-
next: MessageId | null;
|
|
3925
|
-
};
|
|
3931
|
+
type WithNavigation<T> = T & {
|
|
3932
|
+
navigation: NavigationInfo;
|
|
3926
3933
|
};
|
|
3934
|
+
type UiChatMessage = WithNavigation<AiChatMessage>;
|
|
3927
3935
|
type AiContext = {
|
|
3928
3936
|
staticSessionInfoSig: Signal<StaticSessionInfo | null>;
|
|
3929
3937
|
dynamicSessionInfoSig: Signal<DynamicSessionInfo | null>;
|
|
@@ -3947,15 +3955,11 @@ declare class KnowledgeStack {
|
|
|
3947
3955
|
updateKnowledge(layerKey: LayerKey, key: string, data: AiKnowledgeSource | null): void;
|
|
3948
3956
|
}
|
|
3949
3957
|
declare function createStore_forTools(): {
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
definition: AiOpaqueToolDefinition;
|
|
3954
|
-
}[];
|
|
3955
|
-
addToolDefinition: (chatId: string, name: string, definition: AiOpaqueToolDefinition) => void;
|
|
3956
|
-
removeToolDefinition: (chatId: string, toolName: string) => void;
|
|
3958
|
+
getToolDescriptions: (chatId: string) => AiToolDescription[];
|
|
3959
|
+
getToolΣ: (name: string, chatId?: string) => DerivedSignal<AiOpaqueToolDefinition | undefined>;
|
|
3960
|
+
registerTool: (name: string, tool: AiOpaqueToolDefinition, chatId?: string) => () => void;
|
|
3957
3961
|
};
|
|
3958
|
-
declare function createStore_forChatMessages(toolsStore: ReturnType<typeof createStore_forTools>, setToolResult: (chatId: string, messageId: MessageId,
|
|
3962
|
+
declare function createStore_forChatMessages(toolsStore: ReturnType<typeof createStore_forTools>, setToolResult: (chatId: string, messageId: MessageId, invocationId: string, result: ToolResultData, options?: SetToolResultOptions) => Promise<SetToolResultResponse>): {
|
|
3959
3963
|
getMessageById: (messageId: MessageId) => AiChatMessage | undefined;
|
|
3960
3964
|
getChatMessagesForBranchΣ: (chatId: string, branch?: MessageId) => DerivedSignal<UiChatMessage[]>;
|
|
3961
3965
|
createOptimistically: {
|
|
@@ -3975,7 +3979,7 @@ declare function createStore_forUserAiChats(): {
|
|
|
3975
3979
|
getChatById: (chatId: string) => AiChat | undefined;
|
|
3976
3980
|
upsert: (chat: AiChat) => void;
|
|
3977
3981
|
upsertMany: (chats: AiChat[]) => void;
|
|
3978
|
-
|
|
3982
|
+
markDeleted: (chatId: string) => void;
|
|
3979
3983
|
};
|
|
3980
3984
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
3981
3985
|
type Ai = {
|
|
@@ -4007,16 +4011,16 @@ type Ai = {
|
|
|
4007
4011
|
id: MessageId;
|
|
4008
4012
|
parentMessageId: MessageId | null;
|
|
4009
4013
|
content: AiUserContentPart[];
|
|
4010
|
-
}, targetMessageId: MessageId, options?:
|
|
4014
|
+
}, targetMessageId: MessageId, options?: AskUserMessageInChatOptions) => Promise<AskInChatResponse>;
|
|
4011
4015
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4012
4016
|
abort: (messageId: MessageId) => Promise<AbortAiResponse>;
|
|
4013
4017
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4014
|
-
setToolResult: (chatId: string, messageId: MessageId,
|
|
4018
|
+
setToolResult: (chatId: string, messageId: MessageId, invocationId: string, result: ToolResultData, options?: SetToolResultOptions) => Promise<SetToolResultResponse>;
|
|
4015
4019
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4016
4020
|
signals: {
|
|
4017
4021
|
chatsΣ: DerivedSignal<AiChat[]>;
|
|
4018
4022
|
getChatMessagesForBranchΣ(chatId: string, branch?: MessageId): DerivedSignal<UiChatMessage[]>;
|
|
4019
|
-
|
|
4023
|
+
getToolΣ(name: string, chatId?: string): DerivedSignal<AiOpaqueToolDefinition | undefined>;
|
|
4020
4024
|
};
|
|
4021
4025
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4022
4026
|
getChatById: (chatId: string) => AiChat | undefined;
|
|
@@ -4027,9 +4031,7 @@ type Ai = {
|
|
|
4027
4031
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4028
4032
|
updateKnowledge: (layerKey: LayerKey, data: AiKnowledgeSource, key?: string) => void;
|
|
4029
4033
|
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4030
|
-
|
|
4031
|
-
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4032
|
-
unregisterChatTool: (chatId: string, toolName: string) => void;
|
|
4034
|
+
registerTool: (name: string, tool: AiOpaqueToolDefinition, chatId?: string) => () => void;
|
|
4033
4035
|
};
|
|
4034
4036
|
|
|
4035
4037
|
type CommentBodyParagraphElementArgs = {
|
|
@@ -4820,4 +4822,4 @@ declare const CommentsApiError: typeof HttpError;
|
|
|
4820
4822
|
/** @deprecated Use HttpError instead. */
|
|
4821
4823
|
declare const NotificationsApiError: typeof HttpError;
|
|
4822
4824
|
|
|
4823
|
-
export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiChat, type AiChatMessage, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, 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, CommentsApiError, 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 DE, type DM, type DP, type DRI, type DS, 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 History, type HistoryVersion, HttpError, 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 InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, type ManagedPool, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, NotificationsApiError, 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 Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, 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 ToolResultData, type URLSafeString, type
|
|
4825
|
+
export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUserMessage, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, 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, CommentsApiError, 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 DE, type DM, type DP, type DRI, type DS, 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 History, type HistoryVersion, HttpError, 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 InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, type ManagedPool, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, NotificationsApiError, 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 Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, 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 ToolResultData, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserNotificationSettings, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveUsersInCommentBody, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
|