@wacht/jsx 0.0.1-alpha.55 → 0.0.1-alpha.56
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.js +617 -1912
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +51 -134
- package/dist/index.es.js +8331 -10991
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { AgentContext } from '@wacht/types';
|
|
1
2
|
import { AgentIntegration } from '@wacht/types';
|
|
3
|
+
import { AgentWithIntegrations } from '@wacht/types';
|
|
2
4
|
import { ApiResult } from '@wacht/types';
|
|
3
5
|
import { ButtonHTMLAttributes } from 'react';
|
|
4
6
|
import { Client } from '@wacht/types';
|
|
7
|
+
import { ConsentURLResponse } from '@wacht/types';
|
|
8
|
+
import { ConversationMessage } from '@wacht/types';
|
|
9
|
+
import { CreateContextRequest } from '@wacht/types';
|
|
5
10
|
import { CreateEnterpriseConnectionPayload } from '@wacht/types';
|
|
6
11
|
import { CSSProperties } from 'react';
|
|
7
12
|
import { CurrentUser } from '@wacht/types';
|
|
@@ -17,11 +22,13 @@ import { FC } from 'react';
|
|
|
17
22
|
import { FormHTMLAttributes } from 'react';
|
|
18
23
|
import { ForwardRefExoticComponent } from 'react';
|
|
19
24
|
import { HTMLAttributes } from 'react';
|
|
25
|
+
import { ImageData as ImageData_2 } from '@wacht/types';
|
|
20
26
|
import { InputHTMLAttributes } from 'react';
|
|
21
27
|
import { IStyledComponentBase } from 'styled-components/dist/types';
|
|
22
28
|
import { JSX } from 'react/jsx-runtime';
|
|
23
29
|
import { KeyedMutator } from 'swr';
|
|
24
30
|
import { LabelHTMLAttributes } from 'react';
|
|
31
|
+
import { ListContextsOptions } from '@wacht/types';
|
|
25
32
|
import { NewDomain } from '@wacht/types';
|
|
26
33
|
import { NewOrgnization } from '@wacht/types';
|
|
27
34
|
import { Organization } from '@wacht/types';
|
|
@@ -50,6 +57,7 @@ import { Substitute } from 'styled-components/dist/types';
|
|
|
50
57
|
import { UpdateEnterpriseConnectionPayload } from '@wacht/types';
|
|
51
58
|
import { UserAuthenticator } from '@wacht/types';
|
|
52
59
|
import { UserEmailAddress } from '@wacht/types';
|
|
60
|
+
import { UserInputRequestContent } from '@wacht/types';
|
|
53
61
|
import { UserPasskey } from '@wacht/types';
|
|
54
62
|
import { UserPhoneNumber } from '@wacht/types';
|
|
55
63
|
import { Workspace } from '@wacht/types';
|
|
@@ -82,56 +90,6 @@ declare interface AcceptInviteProps {
|
|
|
82
90
|
onError?: (error: string) => void;
|
|
83
91
|
}
|
|
84
92
|
|
|
85
|
-
export declare function AgentConversation({ showBackButton, onBack, }: AgentConversationProps): JSX.Element;
|
|
86
|
-
|
|
87
|
-
declare interface AgentConversationContextValue {
|
|
88
|
-
agentName: string;
|
|
89
|
-
token: string;
|
|
90
|
-
platformAdapter?: PlatformAdapter_2;
|
|
91
|
-
sessions: ConversationSession[];
|
|
92
|
-
selectedSession: ConversationSession | null;
|
|
93
|
-
loadingSessions: boolean;
|
|
94
|
-
sessionError: Error | null;
|
|
95
|
-
selectSession: (session: ConversationSession | null) => void;
|
|
96
|
-
createSession: (title?: string) => Promise<ConversationSession>;
|
|
97
|
-
deleteSession: (sessionId: string) => Promise<void>;
|
|
98
|
-
refreshSessions: () => Promise<void>;
|
|
99
|
-
showHistory: boolean;
|
|
100
|
-
setShowHistory: (show: boolean) => void;
|
|
101
|
-
getFileUrl: (relativePath: string) => string;
|
|
102
|
-
onSessionCreated?: (session: ConversationSession) => void;
|
|
103
|
-
onSessionDeleted?: (sessionId: string) => void;
|
|
104
|
-
onError?: (error: string) => void;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export declare function AgentConversationHistory({ showBackButton, }: AgentConversationHistoryProps): JSX.Element;
|
|
108
|
-
|
|
109
|
-
declare interface AgentConversationHistoryProps {
|
|
110
|
-
showBackButton?: boolean;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export declare function AgentConversationHub(): JSX.Element;
|
|
114
|
-
|
|
115
|
-
declare interface AgentConversationProps {
|
|
116
|
-
showBackButton?: boolean;
|
|
117
|
-
onBack?: () => void;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export declare function AgentConversationProvider({ children, agentName, token, platformAdapter, defaultSessionId, onSessionCreated, onSessionDeleted, onError, }: AgentConversationProviderProps): JSX.Element;
|
|
121
|
-
|
|
122
|
-
declare interface AgentConversationProviderProps {
|
|
123
|
-
children: ReactNode;
|
|
124
|
-
agentName: string;
|
|
125
|
-
token: string;
|
|
126
|
-
platformAdapter?: PlatformAdapter_2;
|
|
127
|
-
defaultSessionId?: string;
|
|
128
|
-
onSessionCreated?: (session: ConversationSession) => void;
|
|
129
|
-
onSessionDeleted?: (sessionId: string) => void;
|
|
130
|
-
onError?: (error: string) => void;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export { AgentIntegration }
|
|
134
|
-
|
|
135
93
|
export declare function AuthFormImage(): JSX.Element | null;
|
|
136
94
|
|
|
137
95
|
export declare interface BulkUpdateResponse {
|
|
@@ -173,29 +131,6 @@ declare const CONNECTION_STATES: {
|
|
|
173
131
|
readonly ERROR: "error";
|
|
174
132
|
};
|
|
175
133
|
|
|
176
|
-
export declare interface ConversationMessage {
|
|
177
|
-
id: string | number;
|
|
178
|
-
role: "user" | "assistant" | "system";
|
|
179
|
-
content: string;
|
|
180
|
-
timestamp: Date;
|
|
181
|
-
isStreaming?: boolean;
|
|
182
|
-
images?: ImageData_2[];
|
|
183
|
-
metadata?: {
|
|
184
|
-
type?: "user_input_request" | "log";
|
|
185
|
-
userInputRequest?: UserInputRequest;
|
|
186
|
-
messageType?: string;
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export declare interface ConversationSession {
|
|
191
|
-
id: string;
|
|
192
|
-
title: string;
|
|
193
|
-
status: 'idle' | 'running' | 'waiting_for_input' | 'interrupted' | 'completed' | 'failed';
|
|
194
|
-
last_activity_at: string;
|
|
195
|
-
context_group?: string;
|
|
196
|
-
created_at: string;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
134
|
export declare const CreateOrganizationForm: React.FC<CreateOrganizationFormProps>;
|
|
200
135
|
|
|
201
136
|
declare interface CreateOrganizationFormProps {
|
|
@@ -203,11 +138,6 @@ declare interface CreateOrganizationFormProps {
|
|
|
203
138
|
onCancel?: () => void;
|
|
204
139
|
}
|
|
205
140
|
|
|
206
|
-
export declare interface CreateSessionRequest {
|
|
207
|
-
title: string;
|
|
208
|
-
system_instructions?: string;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
141
|
declare type CreateSignInStrategyResult = {
|
|
212
142
|
(strategy: "username"): SignInPlainUsername;
|
|
213
143
|
(strategy: "email"): SignInPlainEmail;
|
|
@@ -402,12 +332,6 @@ export declare interface IdentifyResult {
|
|
|
402
332
|
provider?: string;
|
|
403
333
|
}
|
|
404
334
|
|
|
405
|
-
declare interface ImageData_2 {
|
|
406
|
-
mime_type: string;
|
|
407
|
-
data?: string;
|
|
408
|
-
url?: string;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
335
|
declare type InitSSOResponseType = {
|
|
412
336
|
oauth_url: string;
|
|
413
337
|
session: Session;
|
|
@@ -431,18 +355,6 @@ export declare function isWorkspaceAdmin(membership: WithWsRoles): boolean;
|
|
|
431
355
|
|
|
432
356
|
export declare const Label: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
|
|
433
357
|
|
|
434
|
-
export declare interface ListSessionsOptions {
|
|
435
|
-
limit?: number;
|
|
436
|
-
offset?: number;
|
|
437
|
-
status?: string;
|
|
438
|
-
search?: string;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
export declare interface ListSessionsResponse {
|
|
442
|
-
data: ConversationSession[];
|
|
443
|
-
has_more: boolean;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
358
|
export declare interface MagicLinkParams {
|
|
447
359
|
token?: string;
|
|
448
360
|
attempt?: string;
|
|
@@ -666,11 +578,6 @@ export declare interface PlatformAdapter {
|
|
|
666
578
|
useNavigate(): ((to: string, options?: NavigateOptions) => void) | null;
|
|
667
579
|
}
|
|
668
580
|
|
|
669
|
-
declare interface PlatformAdapter_2 {
|
|
670
|
-
onPlatformEvent?: (eventName: string, eventData: unknown) => void;
|
|
671
|
-
onPlatformFunction?: (functionName: string, parameters: unknown, executionId: string) => Promise<unknown>;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
581
|
export declare interface PlatformAdapterContextType {
|
|
675
582
|
adapter: PlatformAdapter | null;
|
|
676
583
|
}
|
|
@@ -898,9 +805,9 @@ export declare const useActiveOrganization: () => {
|
|
|
898
805
|
loading: boolean;
|
|
899
806
|
refetch: () => Promise<void>;
|
|
900
807
|
getRoles: () => Promise<OrganizationRole[]>;
|
|
901
|
-
updateOrganization: (update: OrganizationUpdate) => Promise<
|
|
808
|
+
updateOrganization: (update: OrganizationUpdate) => Promise<{
|
|
902
809
|
data: Organization;
|
|
903
|
-
}>;
|
|
810
|
+
} | never[]>;
|
|
904
811
|
getMembers: () => Promise<OrganizationMembership[]>;
|
|
905
812
|
getDomains: () => Promise<OrganizationDomain[]>;
|
|
906
813
|
addDomain: (domain: NewDomain) => Promise<{
|
|
@@ -988,11 +895,12 @@ export declare const useActiveWorkspace: () => {
|
|
|
988
895
|
resendInvitation: (invitationId: string) => Promise<unknown>;
|
|
989
896
|
};
|
|
990
897
|
|
|
991
|
-
export declare function
|
|
898
|
+
export declare function useAgentContext({ contextId, agentName, platformAdapter, }: UseAgentContextProps): {
|
|
992
899
|
messages: ConversationMessage[];
|
|
993
900
|
quickQuestions: string[];
|
|
994
901
|
pendingMessage: string | null;
|
|
995
902
|
pendingImages: ImageData_2[] | null;
|
|
903
|
+
pendingFiles: File[] | null;
|
|
996
904
|
connectionState: {
|
|
997
905
|
status: (typeof CONNECTION_STATES)[keyof typeof CONNECTION_STATES];
|
|
998
906
|
};
|
|
@@ -1002,36 +910,51 @@ export declare function useAgentConversation({ contextId, agentName, token, plat
|
|
|
1002
910
|
isWaitingForInput: boolean;
|
|
1003
911
|
hasMoreMessages: boolean;
|
|
1004
912
|
isLoadingMore: boolean;
|
|
1005
|
-
sendMessage: (
|
|
1006
|
-
|
|
913
|
+
sendMessage: (message: string, images?: {
|
|
914
|
+
mime_type: string;
|
|
915
|
+
data?: string;
|
|
916
|
+
url?: string;
|
|
917
|
+
}[], files?: File[]) => Promise<void>;
|
|
918
|
+
submitUserInput: (input: string) => Promise<void>;
|
|
1007
919
|
clearMessages: () => void;
|
|
1008
920
|
loadMoreMessages: () => Promise<void>;
|
|
1009
|
-
cancelExecution: () => void
|
|
1010
|
-
connect: () =>
|
|
921
|
+
cancelExecution: () => Promise<void>;
|
|
922
|
+
connect: () => void;
|
|
1011
923
|
disconnect: () => void;
|
|
1012
924
|
};
|
|
1013
925
|
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
declare interface UseAgentConversationProps {
|
|
926
|
+
declare interface UseAgentContextProps {
|
|
1017
927
|
contextId: string;
|
|
1018
928
|
agentName: string;
|
|
1019
|
-
token: string;
|
|
1020
929
|
platformAdapter?: {
|
|
1021
930
|
onPlatformEvent?: (eventName: string, eventData: unknown) => void;
|
|
1022
931
|
onPlatformFunction?: (functionName: string, parameters: unknown, executionId: string) => Promise<unknown>;
|
|
1023
932
|
};
|
|
1024
|
-
onUserInputRequest?: (request:
|
|
1025
|
-
autoConnect?: boolean;
|
|
933
|
+
onUserInputRequest?: (request: UserInputRequestContent) => Promise<string>;
|
|
1026
934
|
}
|
|
1027
935
|
|
|
1028
|
-
export declare function
|
|
936
|
+
export declare function useAgentContexts(options?: ListContextsOptions): UseAgentContextsReturnType;
|
|
937
|
+
|
|
938
|
+
declare type UseAgentContextsReturnType = {
|
|
939
|
+
contexts: AgentContext[];
|
|
940
|
+
loading: boolean;
|
|
941
|
+
error: Error | null;
|
|
942
|
+
hasMore: boolean;
|
|
943
|
+
createContext: (request: CreateContextRequest) => Promise<AgentContext>;
|
|
944
|
+
deleteContext: (id: string) => Promise<void>;
|
|
945
|
+
updateContext: (id: string, updates: {
|
|
946
|
+
title?: string;
|
|
947
|
+
}) => Promise<void>;
|
|
948
|
+
refetch: () => Promise<void>;
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
export declare function useAgentIntegrations(agentName: string | null): UseAgentIntegrationsReturnType;
|
|
1029
952
|
|
|
1030
953
|
declare type UseAgentIntegrationsReturnType = {
|
|
1031
954
|
integrations: AgentIntegration[];
|
|
1032
955
|
loading: boolean;
|
|
1033
956
|
error: Error | null;
|
|
1034
|
-
|
|
957
|
+
generateConsentURL: (integrationId: string, redirectUrl?: string) => Promise<ConsentURLResponse>;
|
|
1035
958
|
removeIntegration: (integrationId: string) => Promise<void>;
|
|
1036
959
|
refetch: () => Promise<void>;
|
|
1037
960
|
};
|
|
@@ -1057,18 +980,15 @@ declare type UseClientReturnType = {
|
|
|
1057
980
|
loading: boolean;
|
|
1058
981
|
};
|
|
1059
982
|
|
|
1060
|
-
export declare function
|
|
983
|
+
export declare function useDeployment(): DeploymentContextType_2;
|
|
984
|
+
|
|
985
|
+
export declare function useExchangeTicket(ticket?: string | null): UseExchangeTicketResult;
|
|
1061
986
|
|
|
1062
|
-
declare
|
|
1063
|
-
|
|
987
|
+
declare interface UseExchangeTicketResult {
|
|
988
|
+
exchanged: boolean;
|
|
1064
989
|
loading: boolean;
|
|
1065
990
|
error: Error | null;
|
|
1066
|
-
|
|
1067
|
-
deleteSession: (id: string) => Promise<void>;
|
|
1068
|
-
refetch: () => Promise<void>;
|
|
1069
|
-
};
|
|
1070
|
-
|
|
1071
|
-
export declare function useDeployment(): DeploymentContextType_2;
|
|
991
|
+
}
|
|
1072
992
|
|
|
1073
993
|
export declare function useForgotPassword(): {
|
|
1074
994
|
loading: boolean;
|
|
@@ -1226,15 +1146,6 @@ declare interface UserControlsProps {
|
|
|
1226
1146
|
showNotifications?: boolean;
|
|
1227
1147
|
}
|
|
1228
1148
|
|
|
1229
|
-
export declare interface UserInputRequest {
|
|
1230
|
-
question: string;
|
|
1231
|
-
context: string;
|
|
1232
|
-
input_type: "text" | "number" | "select" | "multiselect" | "boolean" | "date";
|
|
1233
|
-
options?: string[];
|
|
1234
|
-
default_value?: string;
|
|
1235
|
-
placeholder?: string;
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
1149
|
declare type UsernameSignInParams = {
|
|
1239
1150
|
username: string;
|
|
1240
1151
|
password: string;
|
|
@@ -1242,6 +1153,12 @@ declare type UsernameSignInParams = {
|
|
|
1242
1153
|
|
|
1243
1154
|
export declare function useSession(): UseSessionReturnType;
|
|
1244
1155
|
|
|
1156
|
+
export declare function useSessionAgents(): {
|
|
1157
|
+
agents: AgentWithIntegrations[];
|
|
1158
|
+
loading: boolean;
|
|
1159
|
+
error: any;
|
|
1160
|
+
};
|
|
1161
|
+
|
|
1245
1162
|
declare type UseSessionReturnType = {
|
|
1246
1163
|
loading: true;
|
|
1247
1164
|
session: never;
|