@clikvn/agent-widget-embedded 1.0.33-dev → 1.0.35-dev

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.
@@ -0,0 +1,111 @@
1
+ import { ToolUsage } from '../types/flowise.type';
2
+ /**
3
+ * Parse tool output data from JSON string
4
+ * @param outputData - The tool output data to parse
5
+ * @returns Parsed JSON object or null if parsing fails
6
+ */
7
+ export declare const parseToolOutput: (outputData: any) => any;
8
+ /**
9
+ * Check if a tool name matches a specific prefix
10
+ * @param toolName - Tool name to check
11
+ * @param prefix - Prefix to match against
12
+ * @returns True if the tool name starts with the prefix
13
+ */
14
+ export declare const hasToolPrefix: (toolName: string, prefix: string) => boolean;
15
+ /**
16
+ * Check if a tool is a product list tool by prefix
17
+ * @param toolName - Tool name to check
18
+ * @returns True if the tool is a product list tool
19
+ */
20
+ export declare const isProductListTool: (toolName: string) => boolean;
21
+ /**
22
+ * Check if a tool is a product detail tool by prefix
23
+ * @param toolName - Tool name to check
24
+ * @returns True if the tool is a product detail tool
25
+ */
26
+ export declare const isProductDetailToolByPrefix: (toolName: string) => boolean;
27
+ /**
28
+ * Check if a tool is a products list tool
29
+ * @param tool - Tool name to check
30
+ * @returns True if the tool is a products list tool
31
+ */
32
+ export declare const isProductsTool: (tool: string) => boolean;
33
+ /**
34
+ * Check if a tool is a product detail tool
35
+ * @param tool - Tool name to check
36
+ * @returns True if the tool is a product detail tool
37
+ */
38
+ export declare const isProductDetailTool: (tool: string) => boolean;
39
+ /**
40
+ * Check if a tool is a scenarios tool
41
+ * @param tool - Tool name to check
42
+ * @returns True if the tool is a scenarios tool
43
+ */
44
+ export declare const isScenariosTool: (tool: string) => boolean;
45
+ /**
46
+ * Check if a tool is a command tool
47
+ * @param tool - Tool name to check
48
+ * @returns True if the tool is a command tool
49
+ */
50
+ export declare const isCommandTool: (tool: string) => boolean;
51
+ /**
52
+ * Check if a tool is a product command tool
53
+ * @param tool - Tool name to check
54
+ * @returns True if the tool is a product command tool
55
+ */
56
+ export declare const isProductCommandTool: (tool: string) => boolean;
57
+ /**
58
+ * Check if a tool is a weather tool
59
+ * @param tool - Tool name to check
60
+ * @returns True if the tool is a weather tool
61
+ */
62
+ export declare const isWeatherTool: (tool: string) => boolean;
63
+ /**
64
+ * Check if a tool is a location tool
65
+ * @param tool - Tool name to check
66
+ * @returns True if the tool is a location tool
67
+ */
68
+ export declare const isLocationTool: (tool: string) => boolean;
69
+ /**
70
+ * Check if a tool usage contains HTML content
71
+ * @param toolUsage - The tool usage object to check
72
+ * @returns True if the tool contains HTML content
73
+ */
74
+ export declare const isHtmlContent: (toolUsage: ToolUsage) => boolean;
75
+ /**
76
+ * Check if a tool should be treated as a custom tool result
77
+ * @param tool - Tool name to check
78
+ * @returns True if the tool is a custom tool
79
+ */
80
+ export declare const isCustomTool: (tool: string) => boolean;
81
+ /**
82
+ * Check if a tool should focus the tool output (hide message content)
83
+ * @param tool - Tool name to check
84
+ * @returns True if the tool should focus output
85
+ */
86
+ export declare const shouldFocusToolOutput: (tool: string) => boolean;
87
+ /**
88
+ * Categorize tools from a list of tool usages
89
+ * @param usedTools - Array of tool usages
90
+ * @param isNewMessage - Whether this is a new message
91
+ * @returns Categorized tools object
92
+ */
93
+ export declare const categorizeTools: (usedTools: ToolUsage[], isNewMessage?: boolean) => {
94
+ customToolResults: ToolUsage[];
95
+ toolResults: ToolUsage[];
96
+ cmdToolResult: null;
97
+ };
98
+ /**
99
+ * Check if any tool in the list should focus output
100
+ * @param usedTools - Array of tool usages
101
+ * @returns True if any tool should focus output
102
+ */
103
+ export declare const hasFocusToolOutput: (usedTools: ToolUsage[]) => boolean;
104
+ /**
105
+ * Remove tool output from message content
106
+ * @param content - Original message content (can be undefined)
107
+ * @param usedTools - Array of tool usages
108
+ * @returns Content with tool outputs removed, or empty string if content is undefined
109
+ */
110
+ export declare const removeToolOutputFromContent: (content: string | undefined, usedTools: ToolUsage[]) => string;
111
+ //# sourceMappingURL=toolUtils.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