@hsafa/ui-sdk 0.4.8 → 0.5.0
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 +14 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -174,10 +174,15 @@ interface HsafaChatProps {
|
|
|
174
174
|
HsafaTools?: Record<string, HsafaTool>;
|
|
175
175
|
componentAboveInput?: React__default.ComponentType<any>;
|
|
176
176
|
editProcessContent?: EditProcessContent;
|
|
177
|
+
presetPrompts?: Array<{
|
|
178
|
+
label: string;
|
|
179
|
+
prompt: string;
|
|
180
|
+
}>;
|
|
177
181
|
onStart?: (message: any) => void;
|
|
178
182
|
onFinish?: (message: any) => void;
|
|
179
183
|
currentChat?: string;
|
|
180
184
|
onChatChanged?: (chatId: string) => void;
|
|
185
|
+
templateParams?: Record<string, unknown>;
|
|
181
186
|
}
|
|
182
187
|
type EditProcessContent = {
|
|
183
188
|
title?: string;
|
|
@@ -258,6 +263,8 @@ interface UseHsafaAgentConfig {
|
|
|
258
263
|
controlledChatId?: string;
|
|
259
264
|
/** Optional callback when chat id changes */
|
|
260
265
|
onChatIdChange?: (chatId: string) => void;
|
|
266
|
+
/** Optional templating parameters merged into request body for server-side templating */
|
|
267
|
+
templateParams?: Record<string, any>;
|
|
261
268
|
}
|
|
262
269
|
interface HsafaAgentAPI {
|
|
263
270
|
/** Current input text */
|
|
@@ -603,7 +610,7 @@ declare function HsafaProvider({ baseUrl, dir, theme, children }: HsafaProviderP
|
|
|
603
610
|
*/
|
|
604
611
|
declare function useHsafa(): HsafaContextValue;
|
|
605
612
|
|
|
606
|
-
declare function HsafaChat({ agentId, theme, primaryColor, primaryColorDark, primaryColorLight, backgroundColor, borderColor, textColor, accentColor, baseUrl, initialMessages, onMessagesChange, defaultOpen, floatingButtonPosition, HsafaTools, HsafaUI, componentAboveInput, editProcessContent, onStart, onFinish, currentChat, onChatChanged, }: HsafaChatProps & {
|
|
613
|
+
declare function HsafaChat({ agentId, theme, primaryColor, primaryColorDark, primaryColorLight, backgroundColor, borderColor, textColor, accentColor, baseUrl, initialMessages, onMessagesChange, defaultOpen, floatingButtonPosition, HsafaTools, HsafaUI, componentAboveInput, editProcessContent, presetPrompts, onStart, onFinish, currentChat, onChatChanged, templateParams, }: HsafaChatProps & {
|
|
607
614
|
baseUrl?: string;
|
|
608
615
|
initialMessages?: any[];
|
|
609
616
|
onMessagesChange?: (messages: any[], chatId?: string) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -174,10 +174,15 @@ interface HsafaChatProps {
|
|
|
174
174
|
HsafaTools?: Record<string, HsafaTool>;
|
|
175
175
|
componentAboveInput?: React__default.ComponentType<any>;
|
|
176
176
|
editProcessContent?: EditProcessContent;
|
|
177
|
+
presetPrompts?: Array<{
|
|
178
|
+
label: string;
|
|
179
|
+
prompt: string;
|
|
180
|
+
}>;
|
|
177
181
|
onStart?: (message: any) => void;
|
|
178
182
|
onFinish?: (message: any) => void;
|
|
179
183
|
currentChat?: string;
|
|
180
184
|
onChatChanged?: (chatId: string) => void;
|
|
185
|
+
templateParams?: Record<string, unknown>;
|
|
181
186
|
}
|
|
182
187
|
type EditProcessContent = {
|
|
183
188
|
title?: string;
|
|
@@ -258,6 +263,8 @@ interface UseHsafaAgentConfig {
|
|
|
258
263
|
controlledChatId?: string;
|
|
259
264
|
/** Optional callback when chat id changes */
|
|
260
265
|
onChatIdChange?: (chatId: string) => void;
|
|
266
|
+
/** Optional templating parameters merged into request body for server-side templating */
|
|
267
|
+
templateParams?: Record<string, any>;
|
|
261
268
|
}
|
|
262
269
|
interface HsafaAgentAPI {
|
|
263
270
|
/** Current input text */
|
|
@@ -603,7 +610,7 @@ declare function HsafaProvider({ baseUrl, dir, theme, children }: HsafaProviderP
|
|
|
603
610
|
*/
|
|
604
611
|
declare function useHsafa(): HsafaContextValue;
|
|
605
612
|
|
|
606
|
-
declare function HsafaChat({ agentId, theme, primaryColor, primaryColorDark, primaryColorLight, backgroundColor, borderColor, textColor, accentColor, baseUrl, initialMessages, onMessagesChange, defaultOpen, floatingButtonPosition, HsafaTools, HsafaUI, componentAboveInput, editProcessContent, onStart, onFinish, currentChat, onChatChanged, }: HsafaChatProps & {
|
|
613
|
+
declare function HsafaChat({ agentId, theme, primaryColor, primaryColorDark, primaryColorLight, backgroundColor, borderColor, textColor, accentColor, baseUrl, initialMessages, onMessagesChange, defaultOpen, floatingButtonPosition, HsafaTools, HsafaUI, componentAboveInput, editProcessContent, presetPrompts, onStart, onFinish, currentChat, onChatChanged, templateParams, }: HsafaChatProps & {
|
|
607
614
|
baseUrl?: string;
|
|
608
615
|
initialMessages?: any[];
|
|
609
616
|
onMessagesChange?: (messages: any[], chatId?: string) => void;
|