@liveblocks/core 2.25.0-aiprivatebeta7 → 2.25.0-aiprivatebeta9
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 +199 -134
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +215 -72
- package/dist/index.d.ts +215 -72
- package/dist/index.js +194 -129
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JSONSchema7 } from 'json-schema';
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -3540,7 +3540,7 @@ type DefineCmd<CmdName extends string, TRequest, TResponse> = [
|
|
|
3540
3540
|
cmdId: CmdId;
|
|
3541
3541
|
} & TResponse>
|
|
3542
3542
|
];
|
|
3543
|
-
type CommandPair = GetChatsPair | GetOrCreateChatPair | DeleteChatPair | GetMessageTreePair | DeleteMessagePair | ClearChatPair | AskInChatPair | AbortAiPair;
|
|
3543
|
+
type CommandPair = GetChatsPair | GetOrCreateChatPair | DeleteChatPair | GetMessageTreePair | DeleteMessagePair | ClearChatPair | AskInChatPair | AbortAiPair | SetToolResultPair;
|
|
3544
3544
|
type ServerCmdResponse<T extends CommandPair = CommandPair> = T[1];
|
|
3545
3545
|
type GetChatsResponse = ServerCmdResponse<GetChatsPair>;
|
|
3546
3546
|
type GetOrCreateChatResponse = ServerCmdResponse<GetOrCreateChatPair>;
|
|
@@ -3558,7 +3558,9 @@ type GetChatsPair = DefineCmd<"get-chats", {
|
|
|
3558
3558
|
nextCursor: Cursor | null;
|
|
3559
3559
|
}>;
|
|
3560
3560
|
type CreateChatOptions = {
|
|
3561
|
+
/** A human-friendly title for the chat. If not set, it will get auto-generated after the first response. */
|
|
3561
3562
|
title?: string;
|
|
3563
|
+
/** Arbitrary metadata to record for this chat. This can be later used to filter the list of chats by metadata. */
|
|
3562
3564
|
metadata?: Record<string, string | string[]>;
|
|
3563
3565
|
};
|
|
3564
3566
|
type GetOrCreateChatPair = DefineCmd<"get-or-create-chat", {
|
|
@@ -3597,10 +3599,10 @@ type AiGenerationOptions = {
|
|
|
3597
3599
|
* dashboard.
|
|
3598
3600
|
*/
|
|
3599
3601
|
copilotId?: CopilotId;
|
|
3600
|
-
stream
|
|
3601
|
-
tools?:
|
|
3602
|
+
stream?: boolean;
|
|
3603
|
+
tools?: AiToolDescription[];
|
|
3602
3604
|
knowledge?: AiKnowledgeSource[];
|
|
3603
|
-
timeout
|
|
3605
|
+
timeout?: number;
|
|
3604
3606
|
};
|
|
3605
3607
|
type AskInChatPair = DefineCmd<"ask-in-chat", {
|
|
3606
3608
|
chatId: ChatId;
|
|
@@ -3635,6 +3637,20 @@ type AbortAiPair = DefineCmd<"abort-ai", {
|
|
|
3635
3637
|
}, {
|
|
3636
3638
|
ok: true;
|
|
3637
3639
|
}>;
|
|
3640
|
+
type ToolResultData = Json;
|
|
3641
|
+
type SetToolResultPair = DefineCmd<"set-tool-result", {
|
|
3642
|
+
chatId: ChatId;
|
|
3643
|
+
messageId: MessageId;
|
|
3644
|
+
toolCallId: string;
|
|
3645
|
+
result: ToolResultData;
|
|
3646
|
+
clientId: ClientId;
|
|
3647
|
+
generationOptions: AiGenerationOptions;
|
|
3648
|
+
}, {
|
|
3649
|
+
ok: true;
|
|
3650
|
+
message: AiChatMessage;
|
|
3651
|
+
} | {
|
|
3652
|
+
ok: false;
|
|
3653
|
+
}>;
|
|
3638
3654
|
type ServerEvent = RebootedEvent | CmdFailedEvent | ErrorServerEvent | SyncServerEvent | DeltaServerEvent | SettleServerEvent;
|
|
3639
3655
|
type RebootedEvent = {
|
|
3640
3656
|
event: "rebooted";
|
|
@@ -3677,7 +3693,7 @@ type SettleServerEvent = {
|
|
|
3677
3693
|
event: "settle";
|
|
3678
3694
|
/** The client ID that originally made the request that led to this event */
|
|
3679
3695
|
clientId: ClientId;
|
|
3680
|
-
message: AiCompletedAssistantMessage | AiFailedAssistantMessage;
|
|
3696
|
+
message: AiAwaitingToolAssistantMessage | AiCompletedAssistantMessage | AiFailedAssistantMessage;
|
|
3681
3697
|
};
|
|
3682
3698
|
type AiChat = {
|
|
3683
3699
|
id: ChatId;
|
|
@@ -3687,16 +3703,33 @@ type AiChat = {
|
|
|
3687
3703
|
lastMessageAt?: ISODateString;
|
|
3688
3704
|
deletedAt?: ISODateString;
|
|
3689
3705
|
};
|
|
3690
|
-
type
|
|
3706
|
+
type AiToolDescription = {
|
|
3691
3707
|
name: string;
|
|
3692
3708
|
description?: string;
|
|
3693
|
-
parameters:
|
|
3709
|
+
parameters: JSONSchema7;
|
|
3710
|
+
};
|
|
3711
|
+
type AiToolInvocationPart<A extends JsonObject = JsonObject, R extends ToolResultData = ToolResultData> = Relax<AiReceivingToolInvocationPart | AiExecutingToolInvocationPart<A> | AiExecutedToolInvocationPart<A, R>>;
|
|
3712
|
+
type AiReceivingToolInvocationPart = {
|
|
3713
|
+
type: "tool-invocation";
|
|
3714
|
+
status: "receiving";
|
|
3715
|
+
toolCallId: string;
|
|
3716
|
+
toolName: string;
|
|
3717
|
+
partialArgs: Json;
|
|
3694
3718
|
};
|
|
3695
|
-
type
|
|
3696
|
-
type: "tool-
|
|
3719
|
+
type AiExecutingToolInvocationPart<A extends JsonObject = JsonObject> = {
|
|
3720
|
+
type: "tool-invocation";
|
|
3721
|
+
status: "executing";
|
|
3697
3722
|
toolCallId: string;
|
|
3698
3723
|
toolName: string;
|
|
3699
|
-
args:
|
|
3724
|
+
args: A;
|
|
3725
|
+
};
|
|
3726
|
+
type AiExecutedToolInvocationPart<A extends JsonObject = JsonObject, R extends ToolResultData = ToolResultData> = {
|
|
3727
|
+
type: "tool-invocation";
|
|
3728
|
+
status: "executed";
|
|
3729
|
+
toolCallId: string;
|
|
3730
|
+
toolName: string;
|
|
3731
|
+
args: A;
|
|
3732
|
+
result: R;
|
|
3700
3733
|
};
|
|
3701
3734
|
type AiTextPart = {
|
|
3702
3735
|
type: "text";
|
|
@@ -3716,7 +3749,6 @@ type AiReasoningDelta = Relax<{
|
|
|
3716
3749
|
type AiReasoningPart = {
|
|
3717
3750
|
type: "reasoning";
|
|
3718
3751
|
text: string;
|
|
3719
|
-
signature?: string;
|
|
3720
3752
|
};
|
|
3721
3753
|
type AiUploadedImagePart = {
|
|
3722
3754
|
type: "image";
|
|
@@ -3726,8 +3758,8 @@ type AiUploadedImagePart = {
|
|
|
3726
3758
|
mimeType: string;
|
|
3727
3759
|
};
|
|
3728
3760
|
type AiUserContentPart = AiTextPart | AiUploadedImagePart;
|
|
3729
|
-
type AiAssistantContentPart = AiReasoningPart | AiTextPart |
|
|
3730
|
-
type AiAssistantDeltaUpdate =
|
|
3761
|
+
type AiAssistantContentPart = AiReasoningPart | AiTextPart | AiToolInvocationPart;
|
|
3762
|
+
type AiAssistantDeltaUpdate = AiTextDelta | AiReasoningDelta | AiExecutingToolInvocationPart;
|
|
3731
3763
|
type AiUserMessage = {
|
|
3732
3764
|
id: MessageId;
|
|
3733
3765
|
chatId: ChatId;
|
|
@@ -3737,37 +3769,47 @@ type AiUserMessage = {
|
|
|
3737
3769
|
createdAt: ISODateString;
|
|
3738
3770
|
deletedAt?: ISODateString;
|
|
3739
3771
|
};
|
|
3740
|
-
type AiAssistantMessage = Relax<
|
|
3741
|
-
type
|
|
3772
|
+
type AiAssistantMessage = Relax<AiGeneratingAssistantMessage | AiAwaitingToolAssistantMessage | AiCompletedAssistantMessage | AiFailedAssistantMessage>;
|
|
3773
|
+
type AiGeneratingAssistantMessage = {
|
|
3742
3774
|
id: MessageId;
|
|
3743
3775
|
chatId: ChatId;
|
|
3744
3776
|
parentId: MessageId | null;
|
|
3745
3777
|
role: "assistant";
|
|
3746
|
-
content: AiAssistantContentPart[];
|
|
3747
3778
|
createdAt: ISODateString;
|
|
3748
3779
|
deletedAt?: ISODateString;
|
|
3749
|
-
status: "
|
|
3780
|
+
status: "generating";
|
|
3781
|
+
contentSoFar: AiAssistantContentPart[];
|
|
3750
3782
|
};
|
|
3751
|
-
type
|
|
3783
|
+
type AiAwaitingToolAssistantMessage = {
|
|
3752
3784
|
id: MessageId;
|
|
3753
3785
|
chatId: ChatId;
|
|
3754
3786
|
parentId: MessageId | null;
|
|
3755
3787
|
role: "assistant";
|
|
3756
3788
|
createdAt: ISODateString;
|
|
3757
3789
|
deletedAt?: ISODateString;
|
|
3758
|
-
status: "
|
|
3790
|
+
status: "awaiting-tool";
|
|
3759
3791
|
contentSoFar: AiAssistantContentPart[];
|
|
3760
|
-
errorReason: string;
|
|
3761
3792
|
};
|
|
3762
|
-
type
|
|
3793
|
+
type AiCompletedAssistantMessage = {
|
|
3794
|
+
id: MessageId;
|
|
3795
|
+
chatId: ChatId;
|
|
3796
|
+
parentId: MessageId | null;
|
|
3797
|
+
role: "assistant";
|
|
3798
|
+
content: AiAssistantContentPart[];
|
|
3799
|
+
createdAt: ISODateString;
|
|
3800
|
+
deletedAt?: ISODateString;
|
|
3801
|
+
status: "completed";
|
|
3802
|
+
};
|
|
3803
|
+
type AiFailedAssistantMessage = {
|
|
3763
3804
|
id: MessageId;
|
|
3764
3805
|
chatId: ChatId;
|
|
3765
3806
|
parentId: MessageId | null;
|
|
3766
3807
|
role: "assistant";
|
|
3767
3808
|
createdAt: ISODateString;
|
|
3768
3809
|
deletedAt?: ISODateString;
|
|
3769
|
-
status: "
|
|
3810
|
+
status: "failed";
|
|
3770
3811
|
contentSoFar: AiAssistantContentPart[];
|
|
3812
|
+
errorReason: string;
|
|
3771
3813
|
};
|
|
3772
3814
|
type AiChatMessage = AiUserMessage | AiAssistantMessage;
|
|
3773
3815
|
type AiKnowledgeSource = {
|
|
@@ -3775,25 +3817,113 @@ type AiKnowledgeSource = {
|
|
|
3775
3817
|
value: Json;
|
|
3776
3818
|
};
|
|
3777
3819
|
|
|
3778
|
-
type
|
|
3820
|
+
type InferFromSchema<T extends JSONSchema7> = JSONSchema7 extends T ? JsonObject : T extends {
|
|
3821
|
+
type: "object";
|
|
3822
|
+
properties: Record<string, JSONSchema7>;
|
|
3823
|
+
required: readonly string[];
|
|
3824
|
+
} ? Resolve<{
|
|
3825
|
+
-readonly [K in keyof T["properties"] as K extends string ? K extends Extract<K, T["required"][number]> ? K : never : never]: InferFromSchema<T["properties"][K]>;
|
|
3826
|
+
} & {
|
|
3827
|
+
-readonly [K in keyof T["properties"] as K extends string ? K extends Extract<K, T["required"][number]> ? never : K : never]?: InferFromSchema<T["properties"][K]>;
|
|
3828
|
+
}> : T extends {
|
|
3829
|
+
type: "object";
|
|
3830
|
+
properties: Record<string, JSONSchema7>;
|
|
3831
|
+
} ? {
|
|
3832
|
+
-readonly [K in keyof T["properties"]]?: InferFromSchema<T["properties"][K]>;
|
|
3833
|
+
} : T extends {
|
|
3834
|
+
type: "string";
|
|
3835
|
+
} ? string : T extends {
|
|
3836
|
+
type: "number";
|
|
3837
|
+
} ? number : T extends {
|
|
3838
|
+
type: "boolean";
|
|
3839
|
+
} ? boolean : T extends {
|
|
3840
|
+
type: "null";
|
|
3841
|
+
} ? null : T extends {
|
|
3842
|
+
type: "array";
|
|
3843
|
+
items: JSONSchema7;
|
|
3844
|
+
} ? InferFromSchema<T["items"]>[] : unknown;
|
|
3845
|
+
type AiToolTypePack<A extends JsonObject = JsonObject, R extends ToolResultData = ToolResultData> = {
|
|
3846
|
+
A: A;
|
|
3847
|
+
R: R;
|
|
3848
|
+
};
|
|
3849
|
+
type AiToolInvocationProps<A extends JsonObject, R extends ToolResultData> = Resolve<DistributiveOmit<AiToolInvocationPart<A, R>, "type"> & {
|
|
3850
|
+
respond: (result: R) => void;
|
|
3851
|
+
/**
|
|
3852
|
+
* Exposes specific inferred types as a "type pack" which we can pass
|
|
3853
|
+
* around statically to components to "bind" them to specific inferred
|
|
3854
|
+
* A and R values. There is no runtime presence for these.
|
|
3855
|
+
*/
|
|
3856
|
+
$types: AiToolTypePack<A, R>;
|
|
3857
|
+
[kInternal]: {
|
|
3858
|
+
execute: AiToolExecuteCallback<A, R> | undefined;
|
|
3859
|
+
};
|
|
3860
|
+
}>;
|
|
3861
|
+
type AiOpaqueToolInvocationProps = AiToolInvocationProps<JsonObject, ToolResultData>;
|
|
3862
|
+
type AiToolExecuteContext = {
|
|
3863
|
+
toolName: string;
|
|
3864
|
+
toolCallId: string;
|
|
3865
|
+
};
|
|
3866
|
+
type AiToolExecuteCallback<A extends JsonObject, R extends ToolResultData> = (args: A, context: AiToolExecuteContext) => Awaitable<R>;
|
|
3867
|
+
type AiToolDefinition<S extends JSONSchema7, A extends JsonObject, R extends ToolResultData> = {
|
|
3779
3868
|
description?: string;
|
|
3780
|
-
parameters:
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
}>;
|
|
3784
|
-
execute?: never;
|
|
3869
|
+
parameters: S;
|
|
3870
|
+
execute?: AiToolExecuteCallback<A, R>;
|
|
3871
|
+
render?: ComponentType<AiToolInvocationProps<A, R>>;
|
|
3785
3872
|
};
|
|
3873
|
+
type AiOpaqueToolDefinition = AiToolDefinition<JSONSchema7, JsonObject, ToolResultData>;
|
|
3874
|
+
/**
|
|
3875
|
+
* Helper function to help infer the types of `args`, `render`, and `result`.
|
|
3876
|
+
* This function has no runtime implementation and is only needed to make it
|
|
3877
|
+
* possible for TypeScript to infer types.
|
|
3878
|
+
*/
|
|
3879
|
+
declare function defineAiTool<R extends ToolResultData>(): <const S extends JSONSchema7>(def: AiToolDefinition<S, InferFromSchema<S> extends JsonObject ? InferFromSchema<S> : JsonObject, R>) => AiOpaqueToolDefinition;
|
|
3786
3880
|
type UiChatMessage = AiChatMessage & {
|
|
3787
|
-
|
|
3788
|
-
|
|
3881
|
+
navigation: {
|
|
3882
|
+
/**
|
|
3883
|
+
* The message ID of the parent message, or null if there is no parent.
|
|
3884
|
+
*/
|
|
3885
|
+
parent: MessageId | null;
|
|
3886
|
+
/**
|
|
3887
|
+
* The message ID of the left sibling message, or null if there is no left sibling.
|
|
3888
|
+
*/
|
|
3889
|
+
prev: MessageId | null;
|
|
3890
|
+
/**
|
|
3891
|
+
* The message ID of the right sibling message, or null if there is no right sibling.
|
|
3892
|
+
*/
|
|
3893
|
+
next: MessageId | null;
|
|
3894
|
+
};
|
|
3789
3895
|
};
|
|
3790
3896
|
type UiUserMessage = AiUserMessage & {
|
|
3791
|
-
|
|
3792
|
-
|
|
3897
|
+
navigation: {
|
|
3898
|
+
/**
|
|
3899
|
+
* The message ID of the parent message, or null if there is no parent.
|
|
3900
|
+
*/
|
|
3901
|
+
parent: MessageId | null;
|
|
3902
|
+
/**
|
|
3903
|
+
* The message ID of the left sibling message, or null if there is no left sibling.
|
|
3904
|
+
*/
|
|
3905
|
+
prev: MessageId | null;
|
|
3906
|
+
/**
|
|
3907
|
+
* The message ID of the right sibling message, or null if there is no right sibling.
|
|
3908
|
+
*/
|
|
3909
|
+
next: MessageId | null;
|
|
3910
|
+
};
|
|
3793
3911
|
};
|
|
3794
3912
|
type UiAssistantMessage = AiAssistantMessage & {
|
|
3795
|
-
|
|
3796
|
-
|
|
3913
|
+
navigation: {
|
|
3914
|
+
/**
|
|
3915
|
+
* The message ID of the parent message, or null if there is no parent.
|
|
3916
|
+
*/
|
|
3917
|
+
parent: MessageId | null;
|
|
3918
|
+
/**
|
|
3919
|
+
* The message ID of the left sibling message, or null if there is no left sibling.
|
|
3920
|
+
*/
|
|
3921
|
+
prev: MessageId | null;
|
|
3922
|
+
/**
|
|
3923
|
+
* The message ID of the right sibling message, or null if there is no right sibling.
|
|
3924
|
+
*/
|
|
3925
|
+
next: MessageId | null;
|
|
3926
|
+
};
|
|
3797
3927
|
};
|
|
3798
3928
|
type AiContext = {
|
|
3799
3929
|
staticSessionInfoSig: Signal<StaticSessionInfo | null>;
|
|
@@ -3805,27 +3935,30 @@ type AiContext = {
|
|
|
3805
3935
|
chatsStore: ReturnType<typeof createStore_forUserAiChats>;
|
|
3806
3936
|
toolsStore: ReturnType<typeof createStore_forTools>;
|
|
3807
3937
|
messagesStore: ReturnType<typeof createStore_forChatMessages>;
|
|
3808
|
-
|
|
3809
|
-
};
|
|
3810
|
-
type AskAiOptions = {
|
|
3811
|
-
copilotId?: CopilotId;
|
|
3812
|
-
stream?: boolean;
|
|
3813
|
-
timeout?: number;
|
|
3938
|
+
knowledge: KnowledgeStack;
|
|
3814
3939
|
};
|
|
3940
|
+
type LayerKey = Brand<string, "LayerKey">;
|
|
3941
|
+
declare class KnowledgeStack {
|
|
3942
|
+
#private;
|
|
3943
|
+
constructor();
|
|
3944
|
+
registerLayer(uniqueLayerId: string): LayerKey;
|
|
3945
|
+
deregisterLayer(layerKey: LayerKey): void;
|
|
3946
|
+
get(): AiKnowledgeSource[];
|
|
3947
|
+
invalidate(): void;
|
|
3948
|
+
updateKnowledge(layerKey: LayerKey, key: string, data: AiKnowledgeSource | null): void;
|
|
3949
|
+
}
|
|
3815
3950
|
declare function createStore_forTools(): {
|
|
3816
|
-
|
|
3951
|
+
getToolDefinitionΣ: (chatId: string, toolName: string) => Signal<AiOpaqueToolDefinition | undefined>;
|
|
3817
3952
|
getToolsForChat: (chatId: string) => {
|
|
3818
3953
|
name: string;
|
|
3819
|
-
definition:
|
|
3954
|
+
definition: AiOpaqueToolDefinition;
|
|
3820
3955
|
}[];
|
|
3821
|
-
addToolDefinition: (chatId: string, name: string, definition:
|
|
3956
|
+
addToolDefinition: (chatId: string, name: string, definition: AiOpaqueToolDefinition) => void;
|
|
3822
3957
|
removeToolDefinition: (chatId: string, toolName: string) => void;
|
|
3823
3958
|
};
|
|
3824
|
-
declare function createStore_forChatMessages(): {
|
|
3959
|
+
declare function createStore_forChatMessages(toolsStore: ReturnType<typeof createStore_forTools>, setToolResult: (chatId: string, messageId: MessageId, toolCallId: string, result: ToolResultData, options?: AiGenerationOptions) => Promise<AskInChatResponse>): {
|
|
3825
3960
|
getMessageById: (messageId: MessageId) => AiChatMessage | undefined;
|
|
3826
3961
|
getChatMessagesForBranchΣ: (chatId: string, branch?: MessageId) => DerivedSignal<UiChatMessage[]>;
|
|
3827
|
-
getMessagesForChatΣ: (chatId: string) => DerivedSignal<AiChatMessage[]>;
|
|
3828
|
-
getLatestUserMessageAncestor: (chatId: string, messageId: MessageId) => MessageId | null;
|
|
3829
3962
|
createOptimistically: {
|
|
3830
3963
|
(chatId: string, role: "user", parentId: MessageId | null, content: AiUserContentPart[]): MessageId;
|
|
3831
3964
|
(chatId: string, role: "assistant", parentId: MessageId | null): MessageId;
|
|
@@ -3839,55 +3972,65 @@ declare function createStore_forChatMessages(): {
|
|
|
3839
3972
|
};
|
|
3840
3973
|
declare function createStore_forUserAiChats(): {
|
|
3841
3974
|
chatsΣ: DerivedSignal<AiChat[]>;
|
|
3975
|
+
getChatById: (chatId: string) => AiChat | undefined;
|
|
3842
3976
|
upsert: (chat: AiChat) => void;
|
|
3843
3977
|
upsertMany: (chats: AiChat[]) => void;
|
|
3844
3978
|
remove: (chatId: string) => void;
|
|
3845
3979
|
};
|
|
3846
|
-
/** @private This
|
|
3980
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
3847
3981
|
type Ai = {
|
|
3848
3982
|
[kInternal]: {
|
|
3849
|
-
|
|
3983
|
+
context: AiContext;
|
|
3850
3984
|
};
|
|
3851
3985
|
connect: () => void;
|
|
3852
3986
|
reconnect: () => void;
|
|
3853
3987
|
disconnect: () => void;
|
|
3854
3988
|
getStatus: () => Status;
|
|
3855
|
-
/** @private This
|
|
3989
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
3856
3990
|
getChats: (options?: {
|
|
3857
3991
|
cursor?: Cursor;
|
|
3858
3992
|
}) => Promise<GetChatsResponse>;
|
|
3859
|
-
/** @private This
|
|
3993
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
3860
3994
|
getOrCreateChat: (
|
|
3861
3995
|
/** A unique identifier for the chat. */
|
|
3862
|
-
chatId: string,
|
|
3863
|
-
/**
|
|
3864
|
-
title?: string, options?: CreateChatOptions) => Promise<GetOrCreateChatResponse>;
|
|
3865
|
-
/** @private This AI will change, and is not considered stable. DO NOT RELY on it. */
|
|
3996
|
+
chatId: string, options?: CreateChatOptions) => Promise<GetOrCreateChatResponse>;
|
|
3997
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
3866
3998
|
deleteChat: (chatId: string) => Promise<DeleteChatResponse>;
|
|
3867
|
-
/** @private This
|
|
3999
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
3868
4000
|
getMessageTree: (chatId: string) => Promise<GetMessageTreeResponse>;
|
|
3869
|
-
/** @private This
|
|
4001
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
3870
4002
|
deleteMessage: (chatId: string, messageId: MessageId) => Promise<DeleteMessageResponse>;
|
|
3871
|
-
/** @private This
|
|
4003
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
3872
4004
|
clearChat: (chatId: string) => Promise<ClearChatResponse>;
|
|
3873
|
-
/** @private This
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
4005
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4006
|
+
askUserMessageInChat: (chatId: string, userMessage: MessageId | {
|
|
4007
|
+
id: MessageId;
|
|
4008
|
+
parentMessageId: MessageId | null;
|
|
4009
|
+
content: AiUserContentPart[];
|
|
4010
|
+
}, targetMessageId: MessageId, options?: AiGenerationOptions) => Promise<AskInChatResponse>;
|
|
4011
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
3878
4012
|
abort: (messageId: MessageId) => Promise<AbortAiResponse>;
|
|
3879
|
-
/** @private This
|
|
4013
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4014
|
+
setToolResult: (chatId: string, messageId: MessageId, toolCallId: string, result: ToolResultData, options?: AiGenerationOptions) => Promise<AskInChatResponse>;
|
|
4015
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
3880
4016
|
signals: {
|
|
3881
4017
|
chatsΣ: DerivedSignal<AiChat[]>;
|
|
3882
4018
|
getChatMessagesForBranchΣ(chatId: string, branch?: MessageId): DerivedSignal<UiChatMessage[]>;
|
|
3883
|
-
|
|
3884
|
-
getToolDefinitionΣ(chatId: string, toolName: string): Signal<ClientToolDefinition | undefined>;
|
|
4019
|
+
getToolDefinitionΣ(chatId: string, toolName: string): Signal<AiOpaqueToolDefinition | undefined>;
|
|
3885
4020
|
};
|
|
3886
|
-
/** @private This
|
|
3887
|
-
|
|
3888
|
-
/** @private This
|
|
3889
|
-
|
|
3890
|
-
/** @private This
|
|
4021
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4022
|
+
getChatById: (chatId: string) => AiChat | undefined;
|
|
4023
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4024
|
+
registerKnowledgeLayer: (uniqueLayerId: string) => LayerKey;
|
|
4025
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4026
|
+
deregisterKnowledgeLayer: (layerKey: LayerKey) => void;
|
|
4027
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4028
|
+
updateKnowledge: (layerKey: LayerKey, data: AiKnowledgeSource, key?: string) => void;
|
|
4029
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4030
|
+
debug_getAllKnowledge(): AiKnowledgeSource[];
|
|
4031
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
4032
|
+
registerChatTool: (chatId: string, name: string, definition: AiOpaqueToolDefinition) => void;
|
|
4033
|
+
/** @private This API will change, and is not considered stable. DO NOT RELY on it. */
|
|
3891
4034
|
unregisterChatTool: (chatId: string, toolName: string) => void;
|
|
3892
4035
|
};
|
|
3893
4036
|
|
|
@@ -4679,4 +4822,4 @@ declare const CommentsApiError: typeof HttpError;
|
|
|
4679
4822
|
/** @deprecated Use HttpError instead. */
|
|
4680
4823
|
declare const NotificationsApiError: typeof HttpError;
|
|
4681
4824
|
|
|
4682
|
-
export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiChat, type AiKnowledgeSource, 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
|
|
4825
|
+
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 UiAssistantMessage, type UiChatMessage, type UiUserMessage, 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 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 };
|