genassist-chat-react 1.0.39 → 1.0.40
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/components/DynamicFormMessage.d.ts +8 -2
- package/dist/components/DynamicFormMessage.js +99 -55
- package/dist/components/GenAgentChat.js +128 -24
- package/dist/hooks/useChat.d.ts +4 -1
- package/dist/hooks/useChat.js +81 -39
- package/dist/services/chatService.d.ts +19 -2
- package/dist/services/chatService.js +46 -3
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.js +1 -1
- package/package.json +6 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChatMessage, AgentInfoResponse, AgentChatLocalesResponse, Attachment, AgentThinkingConfig, AgentWelcomeData, FileUploadResponse, InProgressPollMessage } from "../types";
|
|
1
|
+
import { ChatMessage, AgentInfoResponse, AgentChatLocalesResponse, FormNodeLocale, Attachment, AgentThinkingConfig, AgentWelcomeData, FileUploadResponse, InProgressPollMessage } from "../types";
|
|
2
2
|
export declare const GENASSIST_AGENT_METADATA_UPDATED = "genassist_agent_metadata_updated";
|
|
3
3
|
export declare class ChatService {
|
|
4
4
|
private baseUrl;
|
|
@@ -20,6 +20,7 @@ export declare class ChatService {
|
|
|
20
20
|
private welcomeData;
|
|
21
21
|
private thinkingConfig;
|
|
22
22
|
private chatInputMetadata;
|
|
23
|
+
private triggerStartForm;
|
|
23
24
|
private welcomeObjectUrl;
|
|
24
25
|
private tenant;
|
|
25
26
|
private agentId;
|
|
@@ -75,6 +76,11 @@ export declare class ChatService {
|
|
|
75
76
|
* Used to show workflow-defined metadata in the config panel.
|
|
76
77
|
*/
|
|
77
78
|
getChatInputMetadata(): Record<string, unknown>;
|
|
79
|
+
/**
|
|
80
|
+
* Whether the widget should auto-run the workflow as the conversation opens to surface
|
|
81
|
+
* a Human In The Loop form wired directly after Start (its "show_on_start" is enabled).
|
|
82
|
+
*/
|
|
83
|
+
shouldTriggerStartForm(): boolean;
|
|
78
84
|
/**
|
|
79
85
|
* Supported languages for the current agent (if provided by the server).
|
|
80
86
|
*/
|
|
@@ -96,6 +102,8 @@ export declare class ChatService {
|
|
|
96
102
|
thinkingPhrases: string[];
|
|
97
103
|
thinkingDelayMs: number;
|
|
98
104
|
} | null;
|
|
105
|
+
/** HITL form strings from the locale bundle, as `{ lang: { nodeId: slice } }`. */
|
|
106
|
+
getFormNodeLocales(): Record<string, Record<string, FormNodeLocale>>;
|
|
99
107
|
/**
|
|
100
108
|
* Load a saved conversation ID from localStorage
|
|
101
109
|
*/
|
|
@@ -125,7 +133,16 @@ export declare class ChatService {
|
|
|
125
133
|
getConversationCreateTime(): number | null;
|
|
126
134
|
isConversationFinalized(): boolean;
|
|
127
135
|
startConversation(reCaptchaToken?: string | undefined): Promise<string>;
|
|
128
|
-
sendMessage(message: string, attachments?: Attachment[], extraMetadata?: Record<string, any>, reCaptchaToken?: string
|
|
136
|
+
sendMessage(message: string, attachments?: Attachment[], extraMetadata?: Record<string, any>, reCaptchaToken?: string, opts?: {
|
|
137
|
+
silent?: boolean;
|
|
138
|
+
}): Promise<void>;
|
|
139
|
+
/**
|
|
140
|
+
* Run the workflow as the conversation opens to surface a Human In The Loop form wired
|
|
141
|
+
* directly after Start (its "show_on_start" is enabled). Sends an empty, invisible
|
|
142
|
+
* trigger message flagged so the backend runs the workflow but neither shows nor stores
|
|
143
|
+
* it — only the resulting form comes back through the normal response/WS path.
|
|
144
|
+
*/
|
|
145
|
+
sendStartFormTrigger(reCaptchaToken?: string): Promise<void>;
|
|
129
146
|
sendAudioMessage(audioBlob: Blob, audioFormat: string, extraMetadata?: Record<string, any>): Promise<void>;
|
|
130
147
|
uploadFile(chatId: string, file: File): Promise<FileUploadResponse | null>;
|
|
131
148
|
/**
|