@langchain/xai 1.0.3-dev-1765433794876 → 1.1.1

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,145 @@
1
+ //#region src/live_search.d.ts
2
+ /**
3
+ * Web search source configuration for xAI Live Search.
4
+ * Corresponds to a `{"type": "web", ...}` entry in `search_parameters.sources`.
5
+ */
6
+ interface XAIWebSource {
7
+ type: "web";
8
+ /**
9
+ * Optional ISO alpha-2 country code used to bias results
10
+ * towards a specific country/region.
11
+ */
12
+ country?: string;
13
+ /**
14
+ * Websites that should be excluded from the search results.
15
+ * Maximum of 5 entries.
16
+ */
17
+ excluded_websites?: string[];
18
+ /**
19
+ * Websites that should be exclusively included in the search results.
20
+ * Maximum of 5 entries.
21
+ */
22
+ allowed_websites?: string[];
23
+ /**
24
+ * Whether to enable safe search filtering for this source.
25
+ */
26
+ safe_search?: boolean;
27
+ }
28
+ /**
29
+ * News search source configuration for xAI Live Search.
30
+ * Corresponds to a `{"type": "news", ...}` entry in `search_parameters.sources`.
31
+ */
32
+ interface XAINewsSource {
33
+ type: "news";
34
+ /**
35
+ * Optional ISO alpha-2 country code used to bias results
36
+ * towards a specific country/region.
37
+ */
38
+ country?: string;
39
+ /**
40
+ * Websites that should be excluded from the search results.
41
+ * Maximum of 5 entries.
42
+ */
43
+ excluded_websites?: string[];
44
+ /**
45
+ * Whether to enable safe search filtering for this source.
46
+ */
47
+ safe_search?: boolean;
48
+ }
49
+ /**
50
+ * X (formerly Twitter) search source configuration for xAI Live Search.
51
+ * Corresponds to a `{"type": "x", ...}` entry in `search_parameters.sources`.
52
+ */
53
+ interface XAIXSource {
54
+ type: "x";
55
+ /**
56
+ * X handles that should be explicitly included in the search.
57
+ * Maximum of 10 entries.
58
+ */
59
+ included_x_handles?: string[];
60
+ /**
61
+ * X handles that should be excluded from the search.
62
+ * Maximum of 10 entries.
63
+ */
64
+ excluded_x_handles?: string[];
65
+ /**
66
+ * Minimum number of favorites a post must have to be included.
67
+ */
68
+ post_favorite_count?: number;
69
+ /**
70
+ * Minimum number of views a post must have to be included.
71
+ */
72
+ post_view_count?: number;
73
+ }
74
+ /**
75
+ * RSS feed search source configuration for xAI Live Search.
76
+ * Corresponds to a `{"type": "rss", ...}` entry in `search_parameters.sources`.
77
+ */
78
+ interface XAIRssSource {
79
+ type: "rss";
80
+ /**
81
+ * Links to RSS feeds to be used as a data source.
82
+ * The API currently expects a single URL.
83
+ */
84
+ links: string[];
85
+ }
86
+ type XAISearchSource = XAIWebSource | XAINewsSource | XAIXSource | XAIRssSource;
87
+ /**
88
+ * Search parameters for xAI's Live Search API.
89
+ * Controls how the model searches for and retrieves real-time information.
90
+ *
91
+ * @note The Live Search API is being deprecated by xAI in favor of
92
+ * the agentic tool calling approach. Consider using `tools: [{ type: "live_search" }]`
93
+ * for future compatibility.
94
+ */
95
+ interface XAISearchParameters {
96
+ /**
97
+ * Controls when the model should perform a search.
98
+ * - "auto": Let the model decide when to search (default)
99
+ * - "on": Always search for every request
100
+ * - "off": Never search
101
+ */
102
+ mode?: "auto" | "on" | "off";
103
+ /**
104
+ * Maximum number of search results to return.
105
+ * @default 20
106
+ */
107
+ max_search_results?: number;
108
+ /**
109
+ * Filter search results to only include content from after this date.
110
+ * Format: ISO 8601 date string (e.g., "2024-01-01")
111
+ */
112
+ from_date?: string;
113
+ /**
114
+ * Filter search results to only include content from before this date.
115
+ * Format: ISO 8601 date string (e.g., "2024-12-31")
116
+ */
117
+ to_date?: string;
118
+ /**
119
+ * Whether to return citations/sources for the search results.
120
+ * @default true
121
+ */
122
+ return_citations?: boolean;
123
+ /**
124
+ * Specific web/news/X/RSS sources that can be used for the search.
125
+ * Each entry corresponds to a `{"type": "...", ...}` object in
126
+ * `search_parameters.sources` as documented in the xAI Live Search docs.
127
+ *
128
+ * If omitted, xAI will default to enabling `web`, `news` and `x` sources.
129
+ */
130
+ sources?: XAISearchSource[];
131
+ }
132
+ /**
133
+ * Concrete payload shape sent as `search_parameters` to the xAI API.
134
+ */
135
+ interface XAISearchParametersPayload {
136
+ mode: "auto" | "on" | "off";
137
+ max_search_results?: number;
138
+ from_date?: string;
139
+ to_date?: string;
140
+ return_citations?: boolean;
141
+ sources?: XAISearchSource[];
142
+ }
143
+ //#endregion
144
+ export { XAISearchParameters, XAISearchParametersPayload };
145
+ //# sourceMappingURL=live_search.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live_search.d.cts","names":["XAIWebSource","XAINewsSource","XAIXSource","XAIRssSource","XAISearchSource","XAISearchParameters","XAISearchParametersPayload","mergeSearchParams","buildSearchParametersPayload","filterXAIBuiltInTools","T"],"sources":["../src/live_search.d.ts"],"sourcesContent":["/**\n * Web search source configuration for xAI Live Search.\n * Corresponds to a `{\"type\": \"web\", ...}` entry in `search_parameters.sources`.\n */\nexport interface XAIWebSource {\n type: \"web\";\n /**\n * Optional ISO alpha-2 country code used to bias results\n * towards a specific country/region.\n */\n country?: string;\n /**\n * Websites that should be excluded from the search results.\n * Maximum of 5 entries.\n */\n excluded_websites?: string[];\n /**\n * Websites that should be exclusively included in the search results.\n * Maximum of 5 entries.\n */\n allowed_websites?: string[];\n /**\n * Whether to enable safe search filtering for this source.\n */\n safe_search?: boolean;\n}\n/**\n * News search source configuration for xAI Live Search.\n * Corresponds to a `{\"type\": \"news\", ...}` entry in `search_parameters.sources`.\n */\nexport interface XAINewsSource {\n type: \"news\";\n /**\n * Optional ISO alpha-2 country code used to bias results\n * towards a specific country/region.\n */\n country?: string;\n /**\n * Websites that should be excluded from the search results.\n * Maximum of 5 entries.\n */\n excluded_websites?: string[];\n /**\n * Whether to enable safe search filtering for this source.\n */\n safe_search?: boolean;\n}\n/**\n * X (formerly Twitter) search source configuration for xAI Live Search.\n * Corresponds to a `{\"type\": \"x\", ...}` entry in `search_parameters.sources`.\n */\nexport interface XAIXSource {\n type: \"x\";\n /**\n * X handles that should be explicitly included in the search.\n * Maximum of 10 entries.\n */\n included_x_handles?: string[];\n /**\n * X handles that should be excluded from the search.\n * Maximum of 10 entries.\n */\n excluded_x_handles?: string[];\n /**\n * Minimum number of favorites a post must have to be included.\n */\n post_favorite_count?: number;\n /**\n * Minimum number of views a post must have to be included.\n */\n post_view_count?: number;\n}\n/**\n * RSS feed search source configuration for xAI Live Search.\n * Corresponds to a `{\"type\": \"rss\", ...}` entry in `search_parameters.sources`.\n */\nexport interface XAIRssSource {\n type: \"rss\";\n /**\n * Links to RSS feeds to be used as a data source.\n * The API currently expects a single URL.\n */\n links: string[];\n}\nexport type XAISearchSource = XAIWebSource | XAINewsSource | XAIXSource | XAIRssSource;\n/**\n * Search parameters for xAI's Live Search API.\n * Controls how the model searches for and retrieves real-time information.\n *\n * @note The Live Search API is being deprecated by xAI in favor of\n * the agentic tool calling approach. Consider using `tools: [{ type: \"live_search\" }]`\n * for future compatibility.\n */\nexport interface XAISearchParameters {\n /**\n * Controls when the model should perform a search.\n * - \"auto\": Let the model decide when to search (default)\n * - \"on\": Always search for every request\n * - \"off\": Never search\n */\n mode?: \"auto\" | \"on\" | \"off\";\n /**\n * Maximum number of search results to return.\n * @default 20\n */\n max_search_results?: number;\n /**\n * Filter search results to only include content from after this date.\n * Format: ISO 8601 date string (e.g., \"2024-01-01\")\n */\n from_date?: string;\n /**\n * Filter search results to only include content from before this date.\n * Format: ISO 8601 date string (e.g., \"2024-12-31\")\n */\n to_date?: string;\n /**\n * Whether to return citations/sources for the search results.\n * @default true\n */\n return_citations?: boolean;\n /**\n * Specific web/news/X/RSS sources that can be used for the search.\n * Each entry corresponds to a `{\"type\": \"...\", ...}` object in\n * `search_parameters.sources` as documented in the xAI Live Search docs.\n *\n * If omitted, xAI will default to enabling `web`, `news` and `x` sources.\n */\n sources?: XAISearchSource[];\n}\n/**\n * Concrete payload shape sent as `search_parameters` to the xAI API.\n */\nexport interface XAISearchParametersPayload {\n mode: \"auto\" | \"on\" | \"off\";\n max_search_results?: number;\n from_date?: string;\n to_date?: string;\n return_citations?: boolean;\n sources?: XAISearchSource[];\n}\n/**\n * Merge search parameters from instance defaults, tool definition\n * and per-call overrides.\n *\n * Precedence (lowest → highest):\n * 1. tool-level configuration (e.g. from xaiLiveSearch)\n * 2. instance-level defaults\n * 3. per-call overrides passed via `searchParameters`\n */\nexport declare function mergeSearchParams(instanceParams?: XAISearchParameters, callParams?: XAISearchParameters, toolParams?: XAISearchParameters): XAISearchParameters | undefined;\n/**\n * Build the `search_parameters` payload to send to the xAI API\n * from high-level `XAISearchParameters`.\n */\nexport declare function buildSearchParametersPayload(params?: XAISearchParameters): XAISearchParametersPayload | undefined;\n/**\n * Filter out xAI built-in tools (like `live_search`) from a tools array.\n * Used before sending the request to the xAI API, since built-in tools\n * are controlled via `search_parameters` instead.\n */\nexport declare function filterXAIBuiltInTools<T extends {\n [key: string]: any;\n}>(payload?: {\n tools?: T[];\n excludedTypes?: string[];\n}): T[] | undefined;\n//# sourceMappingURL=live_search.d.ts.map"],"mappings":";;AAIA;AA0BA;AAqBA;AAyBiBG,UAxEAH,YAAAA,CAwEY;EAQjBI,IAAAA,EAAAA,KAAAA;EAAkBJ;;;;EAAwD,OAAA,CAAA,EAAA,MAAA;EASrEK;AAwCjB;;;;;;;;;;;;;;;;;;UAvGiBJ,aAAAA;;;;;;;;;;;;;;;;;;;;;UAqBAC,UAAAA;;;;;;;;;;;;;;;;;;;;;;;;;UAyBAC,YAAAA;;;;;;;;KAQLC,eAAAA,GAAkBJ,eAAeC,gBAAgBC,aAAaC;;;;;;;;;UASzDE,mBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAmCHD;;;;;UAKGE,0BAAAA;;;;;;YAMHF"}
@@ -0,0 +1,145 @@
1
+ //#region src/live_search.d.ts
2
+ /**
3
+ * Web search source configuration for xAI Live Search.
4
+ * Corresponds to a `{"type": "web", ...}` entry in `search_parameters.sources`.
5
+ */
6
+ interface XAIWebSource {
7
+ type: "web";
8
+ /**
9
+ * Optional ISO alpha-2 country code used to bias results
10
+ * towards a specific country/region.
11
+ */
12
+ country?: string;
13
+ /**
14
+ * Websites that should be excluded from the search results.
15
+ * Maximum of 5 entries.
16
+ */
17
+ excluded_websites?: string[];
18
+ /**
19
+ * Websites that should be exclusively included in the search results.
20
+ * Maximum of 5 entries.
21
+ */
22
+ allowed_websites?: string[];
23
+ /**
24
+ * Whether to enable safe search filtering for this source.
25
+ */
26
+ safe_search?: boolean;
27
+ }
28
+ /**
29
+ * News search source configuration for xAI Live Search.
30
+ * Corresponds to a `{"type": "news", ...}` entry in `search_parameters.sources`.
31
+ */
32
+ interface XAINewsSource {
33
+ type: "news";
34
+ /**
35
+ * Optional ISO alpha-2 country code used to bias results
36
+ * towards a specific country/region.
37
+ */
38
+ country?: string;
39
+ /**
40
+ * Websites that should be excluded from the search results.
41
+ * Maximum of 5 entries.
42
+ */
43
+ excluded_websites?: string[];
44
+ /**
45
+ * Whether to enable safe search filtering for this source.
46
+ */
47
+ safe_search?: boolean;
48
+ }
49
+ /**
50
+ * X (formerly Twitter) search source configuration for xAI Live Search.
51
+ * Corresponds to a `{"type": "x", ...}` entry in `search_parameters.sources`.
52
+ */
53
+ interface XAIXSource {
54
+ type: "x";
55
+ /**
56
+ * X handles that should be explicitly included in the search.
57
+ * Maximum of 10 entries.
58
+ */
59
+ included_x_handles?: string[];
60
+ /**
61
+ * X handles that should be excluded from the search.
62
+ * Maximum of 10 entries.
63
+ */
64
+ excluded_x_handles?: string[];
65
+ /**
66
+ * Minimum number of favorites a post must have to be included.
67
+ */
68
+ post_favorite_count?: number;
69
+ /**
70
+ * Minimum number of views a post must have to be included.
71
+ */
72
+ post_view_count?: number;
73
+ }
74
+ /**
75
+ * RSS feed search source configuration for xAI Live Search.
76
+ * Corresponds to a `{"type": "rss", ...}` entry in `search_parameters.sources`.
77
+ */
78
+ interface XAIRssSource {
79
+ type: "rss";
80
+ /**
81
+ * Links to RSS feeds to be used as a data source.
82
+ * The API currently expects a single URL.
83
+ */
84
+ links: string[];
85
+ }
86
+ type XAISearchSource = XAIWebSource | XAINewsSource | XAIXSource | XAIRssSource;
87
+ /**
88
+ * Search parameters for xAI's Live Search API.
89
+ * Controls how the model searches for and retrieves real-time information.
90
+ *
91
+ * @note The Live Search API is being deprecated by xAI in favor of
92
+ * the agentic tool calling approach. Consider using `tools: [{ type: "live_search" }]`
93
+ * for future compatibility.
94
+ */
95
+ interface XAISearchParameters {
96
+ /**
97
+ * Controls when the model should perform a search.
98
+ * - "auto": Let the model decide when to search (default)
99
+ * - "on": Always search for every request
100
+ * - "off": Never search
101
+ */
102
+ mode?: "auto" | "on" | "off";
103
+ /**
104
+ * Maximum number of search results to return.
105
+ * @default 20
106
+ */
107
+ max_search_results?: number;
108
+ /**
109
+ * Filter search results to only include content from after this date.
110
+ * Format: ISO 8601 date string (e.g., "2024-01-01")
111
+ */
112
+ from_date?: string;
113
+ /**
114
+ * Filter search results to only include content from before this date.
115
+ * Format: ISO 8601 date string (e.g., "2024-12-31")
116
+ */
117
+ to_date?: string;
118
+ /**
119
+ * Whether to return citations/sources for the search results.
120
+ * @default true
121
+ */
122
+ return_citations?: boolean;
123
+ /**
124
+ * Specific web/news/X/RSS sources that can be used for the search.
125
+ * Each entry corresponds to a `{"type": "...", ...}` object in
126
+ * `search_parameters.sources` as documented in the xAI Live Search docs.
127
+ *
128
+ * If omitted, xAI will default to enabling `web`, `news` and `x` sources.
129
+ */
130
+ sources?: XAISearchSource[];
131
+ }
132
+ /**
133
+ * Concrete payload shape sent as `search_parameters` to the xAI API.
134
+ */
135
+ interface XAISearchParametersPayload {
136
+ mode: "auto" | "on" | "off";
137
+ max_search_results?: number;
138
+ from_date?: string;
139
+ to_date?: string;
140
+ return_citations?: boolean;
141
+ sources?: XAISearchSource[];
142
+ }
143
+ //#endregion
144
+ export { XAISearchParameters, XAISearchParametersPayload };
145
+ //# sourceMappingURL=live_search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live_search.d.ts","names":["XAIWebSource","XAINewsSource","XAIXSource","XAIRssSource","XAISearchSource","XAISearchParameters","XAISearchParametersPayload","mergeSearchParams","buildSearchParametersPayload","filterXAIBuiltInTools","T"],"sources":["../src/live_search.d.ts"],"sourcesContent":["/**\n * Web search source configuration for xAI Live Search.\n * Corresponds to a `{\"type\": \"web\", ...}` entry in `search_parameters.sources`.\n */\nexport interface XAIWebSource {\n type: \"web\";\n /**\n * Optional ISO alpha-2 country code used to bias results\n * towards a specific country/region.\n */\n country?: string;\n /**\n * Websites that should be excluded from the search results.\n * Maximum of 5 entries.\n */\n excluded_websites?: string[];\n /**\n * Websites that should be exclusively included in the search results.\n * Maximum of 5 entries.\n */\n allowed_websites?: string[];\n /**\n * Whether to enable safe search filtering for this source.\n */\n safe_search?: boolean;\n}\n/**\n * News search source configuration for xAI Live Search.\n * Corresponds to a `{\"type\": \"news\", ...}` entry in `search_parameters.sources`.\n */\nexport interface XAINewsSource {\n type: \"news\";\n /**\n * Optional ISO alpha-2 country code used to bias results\n * towards a specific country/region.\n */\n country?: string;\n /**\n * Websites that should be excluded from the search results.\n * Maximum of 5 entries.\n */\n excluded_websites?: string[];\n /**\n * Whether to enable safe search filtering for this source.\n */\n safe_search?: boolean;\n}\n/**\n * X (formerly Twitter) search source configuration for xAI Live Search.\n * Corresponds to a `{\"type\": \"x\", ...}` entry in `search_parameters.sources`.\n */\nexport interface XAIXSource {\n type: \"x\";\n /**\n * X handles that should be explicitly included in the search.\n * Maximum of 10 entries.\n */\n included_x_handles?: string[];\n /**\n * X handles that should be excluded from the search.\n * Maximum of 10 entries.\n */\n excluded_x_handles?: string[];\n /**\n * Minimum number of favorites a post must have to be included.\n */\n post_favorite_count?: number;\n /**\n * Minimum number of views a post must have to be included.\n */\n post_view_count?: number;\n}\n/**\n * RSS feed search source configuration for xAI Live Search.\n * Corresponds to a `{\"type\": \"rss\", ...}` entry in `search_parameters.sources`.\n */\nexport interface XAIRssSource {\n type: \"rss\";\n /**\n * Links to RSS feeds to be used as a data source.\n * The API currently expects a single URL.\n */\n links: string[];\n}\nexport type XAISearchSource = XAIWebSource | XAINewsSource | XAIXSource | XAIRssSource;\n/**\n * Search parameters for xAI's Live Search API.\n * Controls how the model searches for and retrieves real-time information.\n *\n * @note The Live Search API is being deprecated by xAI in favor of\n * the agentic tool calling approach. Consider using `tools: [{ type: \"live_search\" }]`\n * for future compatibility.\n */\nexport interface XAISearchParameters {\n /**\n * Controls when the model should perform a search.\n * - \"auto\": Let the model decide when to search (default)\n * - \"on\": Always search for every request\n * - \"off\": Never search\n */\n mode?: \"auto\" | \"on\" | \"off\";\n /**\n * Maximum number of search results to return.\n * @default 20\n */\n max_search_results?: number;\n /**\n * Filter search results to only include content from after this date.\n * Format: ISO 8601 date string (e.g., \"2024-01-01\")\n */\n from_date?: string;\n /**\n * Filter search results to only include content from before this date.\n * Format: ISO 8601 date string (e.g., \"2024-12-31\")\n */\n to_date?: string;\n /**\n * Whether to return citations/sources for the search results.\n * @default true\n */\n return_citations?: boolean;\n /**\n * Specific web/news/X/RSS sources that can be used for the search.\n * Each entry corresponds to a `{\"type\": \"...\", ...}` object in\n * `search_parameters.sources` as documented in the xAI Live Search docs.\n *\n * If omitted, xAI will default to enabling `web`, `news` and `x` sources.\n */\n sources?: XAISearchSource[];\n}\n/**\n * Concrete payload shape sent as `search_parameters` to the xAI API.\n */\nexport interface XAISearchParametersPayload {\n mode: \"auto\" | \"on\" | \"off\";\n max_search_results?: number;\n from_date?: string;\n to_date?: string;\n return_citations?: boolean;\n sources?: XAISearchSource[];\n}\n/**\n * Merge search parameters from instance defaults, tool definition\n * and per-call overrides.\n *\n * Precedence (lowest → highest):\n * 1. tool-level configuration (e.g. from xaiLiveSearch)\n * 2. instance-level defaults\n * 3. per-call overrides passed via `searchParameters`\n */\nexport declare function mergeSearchParams(instanceParams?: XAISearchParameters, callParams?: XAISearchParameters, toolParams?: XAISearchParameters): XAISearchParameters | undefined;\n/**\n * Build the `search_parameters` payload to send to the xAI API\n * from high-level `XAISearchParameters`.\n */\nexport declare function buildSearchParametersPayload(params?: XAISearchParameters): XAISearchParametersPayload | undefined;\n/**\n * Filter out xAI built-in tools (like `live_search`) from a tools array.\n * Used before sending the request to the xAI API, since built-in tools\n * are controlled via `search_parameters` instead.\n */\nexport declare function filterXAIBuiltInTools<T extends {\n [key: string]: any;\n}>(payload?: {\n tools?: T[];\n excludedTypes?: string[];\n}): T[] | undefined;\n//# sourceMappingURL=live_search.d.ts.map"],"mappings":";;AAIA;AA0BA;AAqBA;AAyBiBG,UAxEAH,YAAAA,CAwEY;EAQjBI,IAAAA,EAAAA,KAAAA;EAAkBJ;;;;EAAwD,OAAA,CAAA,EAAA,MAAA;EASrEK;AAwCjB;;;;;;;;;;;;;;;;;;UAvGiBJ,aAAAA;;;;;;;;;;;;;;;;;;;;;UAqBAC,UAAAA;;;;;;;;;;;;;;;;;;;;;;;;;UAyBAC,YAAAA;;;;;;;;KAQLC,eAAAA,GAAkBJ,eAAeC,gBAAgBC,aAAaC;;;;;;;;;UASzDE,mBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAmCHD;;;;;UAKGE,0BAAAA;;;;;;YAMHF"}
@@ -0,0 +1,51 @@
1
+ //#region src/live_search.ts
2
+ /**
3
+ * Merge search parameters from instance defaults, tool definition
4
+ * and per-call overrides.
5
+ *
6
+ * Precedence (lowest → highest):
7
+ * 1. tool-level configuration (e.g. from xaiLiveSearch)
8
+ * 2. instance-level defaults
9
+ * 3. per-call overrides passed via `searchParameters`
10
+ */
11
+ function mergeSearchParams(instanceParams, callParams, toolParams) {
12
+ if (!instanceParams && !callParams && !toolParams) return void 0;
13
+ return {
14
+ ...toolParams ?? {},
15
+ ...instanceParams ?? {},
16
+ ...callParams ?? {}
17
+ };
18
+ }
19
+ /**
20
+ * Build the `search_parameters` payload to send to the xAI API
21
+ * from high-level `XAISearchParameters`.
22
+ */
23
+ function buildSearchParametersPayload(params) {
24
+ if (!params) return void 0;
25
+ const payload = { mode: params.mode ?? "auto" };
26
+ if (params.max_search_results !== void 0) payload.max_search_results = params.max_search_results;
27
+ if (params.from_date !== void 0) payload.from_date = params.from_date;
28
+ if (params.to_date !== void 0) payload.to_date = params.to_date;
29
+ if (params.return_citations !== void 0) payload.return_citations = params.return_citations;
30
+ if (params.sources && params.sources.length > 0) payload.sources = params.sources;
31
+ return payload;
32
+ }
33
+ /**
34
+ * Filter out xAI built-in tools (like `live_search`) from a tools array.
35
+ * Used before sending the request to the xAI API, since built-in tools
36
+ * are controlled via `search_parameters` instead.
37
+ */
38
+ function filterXAIBuiltInTools(payload) {
39
+ if (!payload?.tools) return void 0;
40
+ const filtered = payload.tools.filter((tool) => {
41
+ if (tool == null || typeof tool !== "object") return true;
42
+ if (!("type" in tool)) return true;
43
+ if (!payload?.excludedTypes?.length) return true;
44
+ return !payload.excludedTypes.includes(tool.type);
45
+ });
46
+ return filtered.length > 0 ? filtered : void 0;
47
+ }
48
+
49
+ //#endregion
50
+ export { buildSearchParametersPayload, filterXAIBuiltInTools, mergeSearchParams };
51
+ //# sourceMappingURL=live_search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live_search.js","names":["instanceParams?: XAISearchParameters","callParams?: XAISearchParameters","toolParams?: XAISearchParameters","params?: XAISearchParameters","payload: XAISearchParametersPayload","payload?: { tools?: T[]; excludedTypes?: string[] }"],"sources":["../src/live_search.ts"],"sourcesContent":["/**\n * Web search source configuration for xAI Live Search.\n * Corresponds to a `{\"type\": \"web\", ...}` entry in `search_parameters.sources`.\n */\nexport interface XAIWebSource {\n type: \"web\";\n /**\n * Optional ISO alpha-2 country code used to bias results\n * towards a specific country/region.\n */\n country?: string;\n /**\n * Websites that should be excluded from the search results.\n * Maximum of 5 entries.\n */\n excluded_websites?: string[];\n /**\n * Websites that should be exclusively included in the search results.\n * Maximum of 5 entries.\n */\n allowed_websites?: string[];\n /**\n * Whether to enable safe search filtering for this source.\n */\n safe_search?: boolean;\n}\n\n/**\n * News search source configuration for xAI Live Search.\n * Corresponds to a `{\"type\": \"news\", ...}` entry in `search_parameters.sources`.\n */\nexport interface XAINewsSource {\n type: \"news\";\n /**\n * Optional ISO alpha-2 country code used to bias results\n * towards a specific country/region.\n */\n country?: string;\n /**\n * Websites that should be excluded from the search results.\n * Maximum of 5 entries.\n */\n excluded_websites?: string[];\n /**\n * Whether to enable safe search filtering for this source.\n */\n safe_search?: boolean;\n}\n\n/**\n * X (formerly Twitter) search source configuration for xAI Live Search.\n * Corresponds to a `{\"type\": \"x\", ...}` entry in `search_parameters.sources`.\n */\nexport interface XAIXSource {\n type: \"x\";\n /**\n * X handles that should be explicitly included in the search.\n * Maximum of 10 entries.\n */\n included_x_handles?: string[];\n /**\n * X handles that should be excluded from the search.\n * Maximum of 10 entries.\n */\n excluded_x_handles?: string[];\n /**\n * Minimum number of favorites a post must have to be included.\n */\n post_favorite_count?: number;\n /**\n * Minimum number of views a post must have to be included.\n */\n post_view_count?: number;\n}\n\n/**\n * RSS feed search source configuration for xAI Live Search.\n * Corresponds to a `{\"type\": \"rss\", ...}` entry in `search_parameters.sources`.\n */\nexport interface XAIRssSource {\n type: \"rss\";\n /**\n * Links to RSS feeds to be used as a data source.\n * The API currently expects a single URL.\n */\n links: string[];\n}\n\nexport type XAISearchSource =\n | XAIWebSource\n | XAINewsSource\n | XAIXSource\n | XAIRssSource;\n\n/**\n * Search parameters for xAI's Live Search API.\n * Controls how the model searches for and retrieves real-time information.\n *\n * @note The Live Search API is being deprecated by xAI in favor of\n * the agentic tool calling approach. Consider using `tools: [{ type: \"live_search\" }]`\n * for future compatibility.\n */\nexport interface XAISearchParameters {\n /**\n * Controls when the model should perform a search.\n * - \"auto\": Let the model decide when to search (default)\n * - \"on\": Always search for every request\n * - \"off\": Never search\n */\n mode?: \"auto\" | \"on\" | \"off\";\n /**\n * Maximum number of search results to return.\n * @default 20\n */\n max_search_results?: number;\n /**\n * Filter search results to only include content from after this date.\n * Format: ISO 8601 date string (e.g., \"2024-01-01\")\n */\n from_date?: string;\n /**\n * Filter search results to only include content from before this date.\n * Format: ISO 8601 date string (e.g., \"2024-12-31\")\n */\n to_date?: string;\n /**\n * Whether to return citations/sources for the search results.\n * @default true\n */\n return_citations?: boolean;\n /**\n * Specific web/news/X/RSS sources that can be used for the search.\n * Each entry corresponds to a `{\"type\": \"...\", ...}` object in\n * `search_parameters.sources` as documented in the xAI Live Search docs.\n *\n * If omitted, xAI will default to enabling `web`, `news` and `x` sources.\n */\n sources?: XAISearchSource[];\n}\n\n/**\n * Concrete payload shape sent as `search_parameters` to the xAI API.\n */\nexport interface XAISearchParametersPayload {\n mode: \"auto\" | \"on\" | \"off\";\n max_search_results?: number;\n from_date?: string;\n to_date?: string;\n return_citations?: boolean;\n sources?: XAISearchSource[];\n}\n\n/**\n * Merge search parameters from instance defaults, tool definition\n * and per-call overrides.\n *\n * Precedence (lowest → highest):\n * 1. tool-level configuration (e.g. from xaiLiveSearch)\n * 2. instance-level defaults\n * 3. per-call overrides passed via `searchParameters`\n */\nexport function mergeSearchParams(\n instanceParams?: XAISearchParameters,\n callParams?: XAISearchParameters,\n toolParams?: XAISearchParameters\n): XAISearchParameters | undefined {\n if (!instanceParams && !callParams && !toolParams) {\n return undefined;\n }\n\n return {\n ...(toolParams ?? {}),\n ...(instanceParams ?? {}),\n ...(callParams ?? {}),\n };\n}\n\n/**\n * Build the `search_parameters` payload to send to the xAI API\n * from high-level `XAISearchParameters`.\n */\nexport function buildSearchParametersPayload(\n params?: XAISearchParameters\n): XAISearchParametersPayload | undefined {\n if (!params) {\n return undefined;\n }\n\n const payload: XAISearchParametersPayload = {\n mode: params.mode ?? \"auto\",\n };\n\n if (params.max_search_results !== undefined) {\n payload.max_search_results = params.max_search_results;\n }\n if (params.from_date !== undefined) {\n payload.from_date = params.from_date;\n }\n if (params.to_date !== undefined) {\n payload.to_date = params.to_date;\n }\n if (params.return_citations !== undefined) {\n payload.return_citations = params.return_citations;\n }\n if (params.sources && params.sources.length > 0) {\n payload.sources = params.sources;\n }\n\n return payload;\n}\n\n/**\n * Filter out xAI built-in tools (like `live_search`) from a tools array.\n * Used before sending the request to the xAI API, since built-in tools\n * are controlled via `search_parameters` instead.\n */\nexport function filterXAIBuiltInTools<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends { [key: string]: any }\n>(payload?: { tools?: T[]; excludedTypes?: string[] }): T[] | undefined {\n if (!payload?.tools) {\n return undefined;\n }\n\n const filtered = payload.tools.filter((tool) => {\n if (tool == null || typeof tool !== \"object\") {\n return true;\n }\n\n if (!(\"type\" in tool)) {\n return true;\n }\n\n if (!payload?.excludedTypes?.length) {\n return true;\n }\n\n return !payload.excludedTypes.includes(tool.type);\n });\n\n return filtered.length > 0 ? filtered : undefined;\n}\n"],"mappings":";;;;;;;;;;AAiKA,SAAgB,kBACdA,gBACAC,YACAC,YACiC;AACjC,KAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,WACrC,QAAO;AAGT,QAAO;EACL,GAAI,cAAc,CAAE;EACpB,GAAI,kBAAkB,CAAE;EACxB,GAAI,cAAc,CAAE;CACrB;AACF;;;;;AAMD,SAAgB,6BACdC,QACwC;AACxC,KAAI,CAAC,OACH,QAAO;CAGT,MAAMC,UAAsC,EAC1C,MAAM,OAAO,QAAQ,OACtB;AAED,KAAI,OAAO,uBAAuB,QAChC,QAAQ,qBAAqB,OAAO;AAEtC,KAAI,OAAO,cAAc,QACvB,QAAQ,YAAY,OAAO;AAE7B,KAAI,OAAO,YAAY,QACrB,QAAQ,UAAU,OAAO;AAE3B,KAAI,OAAO,qBAAqB,QAC9B,QAAQ,mBAAmB,OAAO;AAEpC,KAAI,OAAO,WAAW,OAAO,QAAQ,SAAS,GAC5C,QAAQ,UAAU,OAAO;AAG3B,QAAO;AACR;;;;;;AAOD,SAAgB,sBAGdC,SAAsE;AACtE,KAAI,CAAC,SAAS,MACZ,QAAO;CAGT,MAAM,WAAW,QAAQ,MAAM,OAAO,CAAC,SAAS;AAC9C,MAAI,QAAQ,QAAQ,OAAO,SAAS,SAClC,QAAO;AAGT,MAAI,EAAE,UAAU,MACd,QAAO;AAGT,MAAI,CAAC,SAAS,eAAe,OAC3B,QAAO;AAGT,SAAO,CAAC,QAAQ,cAAc,SAAS,KAAK,KAAK;CAClD,EAAC;AAEF,QAAO,SAAS,SAAS,IAAI,WAAW;AACzC"}
@@ -0,0 +1,8 @@
1
+ const require_live_search = require('./live_search.cjs');
2
+
3
+ //#region src/tools/index.ts
4
+ const tools = { xaiLiveSearch: require_live_search.xaiLiveSearch };
5
+
6
+ //#endregion
7
+ exports.tools = tools;
8
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/tools/index.ts"],"sourcesContent":["import { xaiLiveSearch } from \"./live_search.js\";\n\nexport const tools = {\n xaiLiveSearch,\n};\n"],"mappings":";;;AAEA,MAAa,QAAQ,EACnB,iDACD"}
@@ -0,0 +1,9 @@
1
+ import { xaiLiveSearch } from "./live_search.cjs";
2
+
3
+ //#region src/tools/index.d.ts
4
+ declare const tools: {
5
+ xaiLiveSearch: typeof xaiLiveSearch;
6
+ };
7
+ //#endregion
8
+ export { tools };
9
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":["xaiLiveSearch","tools"],"sources":["../../src/tools/index.d.ts"],"sourcesContent":["import { xaiLiveSearch } from \"./live_search.js\";\nexport declare const tools: {\n xaiLiveSearch: typeof xaiLiveSearch;\n};\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;cACqBC;wBACKD;AAD1B,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { xaiLiveSearch } from "./live_search.js";
2
+
3
+ //#region src/tools/index.d.ts
4
+ declare const tools: {
5
+ xaiLiveSearch: typeof xaiLiveSearch;
6
+ };
7
+ //#endregion
8
+ export { tools };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":["xaiLiveSearch","tools"],"sources":["../../src/tools/index.d.ts"],"sourcesContent":["import { xaiLiveSearch } from \"./live_search.js\";\nexport declare const tools: {\n xaiLiveSearch: typeof xaiLiveSearch;\n};\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;cACqBC;wBACKD;AAD1B,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { xaiLiveSearch } from "./live_search.js";
2
+
3
+ //#region src/tools/index.ts
4
+ const tools = { xaiLiveSearch };
5
+
6
+ //#endregion
7
+ export { tools };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/tools/index.ts"],"sourcesContent":["import { xaiLiveSearch } from \"./live_search.js\";\n\nexport const tools = {\n xaiLiveSearch,\n};\n"],"mappings":";;;AAEA,MAAa,QAAQ,EACnB,cACD"}
@@ -0,0 +1,80 @@
1
+
2
+ //#region src/tools/live_search.ts
3
+ /**
4
+ * xAI's deprecated live_search tool type.
5
+ */
6
+ const XAI_LIVE_SEARCH_TOOL_TYPE = "live_search_deprecated_20251215";
7
+ const XAI_LIVE_SEARCH_TOOL_NAME = "live_search";
8
+ function mapToolSourceToSearchSource(source) {
9
+ switch (source.type) {
10
+ case "web": return {
11
+ type: "web",
12
+ ...source.country !== void 0 && { country: source.country },
13
+ ...source.allowedWebsites !== void 0 && { allowed_websites: source.allowedWebsites },
14
+ ...source.excludedWebsites !== void 0 && { excluded_websites: source.excludedWebsites },
15
+ ...source.safeSearch !== void 0 && { safe_search: source.safeSearch }
16
+ };
17
+ case "news": return {
18
+ type: "news",
19
+ ...source.country !== void 0 && { country: source.country },
20
+ ...source.excludedWebsites !== void 0 && { excluded_websites: source.excludedWebsites },
21
+ ...source.safeSearch !== void 0 && { safe_search: source.safeSearch }
22
+ };
23
+ case "x": return {
24
+ type: "x",
25
+ ...source.includedXHandles !== void 0 && { included_x_handles: source.includedXHandles },
26
+ ...source.excludedXHandles !== void 0 && { excluded_x_handles: source.excludedXHandles },
27
+ ...source.postFavoriteCount !== void 0 && { post_favorite_count: source.postFavoriteCount },
28
+ ...source.postViewCount !== void 0 && { post_view_count: source.postViewCount }
29
+ };
30
+ case "rss": return {
31
+ type: "rss",
32
+ links: source.links
33
+ };
34
+ default: {
35
+ const _exhaustive = source;
36
+ return _exhaustive;
37
+ }
38
+ }
39
+ }
40
+ /**
41
+ * Creates an xAI built-in live search tool.
42
+ * Enables the model to search the web for real-time information.
43
+ *
44
+ * This tool is executed server-side by the xAI API.
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * import { ChatXAI, tools } from "@langchain/xai";
49
+ *
50
+ * const llm = new ChatXAI({
51
+ * model: "grok-beta",
52
+ * });
53
+ *
54
+ * const searchTool = tools.xaiLiveSearch({
55
+ * maxSearchResults: 5,
56
+ * fromDate: "2024-01-01",
57
+ * returnCitations: true
58
+ * });
59
+ *
60
+ * const llmWithSearch = llm.bindTools([searchTool]);
61
+ * const result = await llmWithSearch.invoke("What happened in tech today?");
62
+ * ```
63
+ */
64
+ function xaiLiveSearch(options = {}) {
65
+ return {
66
+ type: XAI_LIVE_SEARCH_TOOL_TYPE,
67
+ name: XAI_LIVE_SEARCH_TOOL_NAME,
68
+ mode: options?.mode,
69
+ max_search_results: options?.maxSearchResults,
70
+ from_date: options?.fromDate,
71
+ to_date: options?.toDate,
72
+ return_citations: options?.returnCitations,
73
+ sources: options?.sources?.map(mapToolSourceToSearchSource)
74
+ };
75
+ }
76
+
77
+ //#endregion
78
+ exports.XAI_LIVE_SEARCH_TOOL_TYPE = XAI_LIVE_SEARCH_TOOL_TYPE;
79
+ exports.xaiLiveSearch = xaiLiveSearch;
80
+ //# sourceMappingURL=live_search.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live_search.cjs","names":["source: XAISearchToolSource","_exhaustive: never","options: XAILiveSearchToolOptions"],"sources":["../../src/tools/live_search.ts"],"sourcesContent":["import type { XAISearchParameters, XAISearchSource } from \"../live_search.js\";\n\n/**\n * xAI's deprecated live_search tool type.\n */\nexport const XAI_LIVE_SEARCH_TOOL_TYPE = \"live_search_deprecated_20251215\";\nexport const XAI_LIVE_SEARCH_TOOL_NAME = \"live_search\";\n\n/**\n * xAI's built-in live_search tool type.\n * Enables the model to search the web for real-time information.\n */\nexport interface XAILiveSearchTool extends XAISearchParameters {\n /**\n * The name of the tool. Must be \"live_search\" for xAI's built-in search.\n */\n name: typeof XAI_LIVE_SEARCH_TOOL_NAME;\n /**\n * The type of the tool. This uses a deprecated Live Search API shape:\n * the advanced agentic search capabilities powering grok.com are generally\n * available in the new agentic tool calling API, and the Live Search API\n * will be deprecated by December 15, 2025.\n */\n type: typeof XAI_LIVE_SEARCH_TOOL_TYPE;\n}\n\n/**\n * Web search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIWebSource` internally.\n */\nexport interface XAIWebSearchToolSource {\n type: \"web\";\n country?: string;\n excludedWebsites?: string[];\n allowedWebsites?: string[];\n safeSearch?: boolean;\n}\n\n/**\n * News search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAINewsSource` internally.\n */\nexport interface XAINewsSearchToolSource {\n type: \"news\";\n country?: string;\n excludedWebsites?: string[];\n safeSearch?: boolean;\n}\n\n/**\n * X (formerly Twitter) search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIXSource` internally.\n */\nexport interface XAIXSearchToolSource {\n type: \"x\";\n includedXHandles?: string[];\n excludedXHandles?: string[];\n postFavoriteCount?: number;\n postViewCount?: number;\n}\n\n/**\n * RSS feed search source configuration for the xAI live search tool.\n * The structure matches `XAIRssSource` (only `links`).\n */\nexport interface XAIRssSearchToolSource {\n type: \"rss\";\n links: string[];\n}\n\nexport type XAISearchToolSource =\n | XAIWebSearchToolSource\n | XAINewsSearchToolSource\n | XAIXSearchToolSource\n | XAIRssSearchToolSource;\n\n/**\n * Options for the xAI live search tool (camelCase).\n * All fields are camel-cased for the TypeScript API and are mapped to the\n * corresponding snake_case fields in the underlying `XAISearchParameters`\n * object that is sent to xAI's deprecated Live Search API.\n */\nexport interface XAILiveSearchToolOptions {\n /**\n * Controls when the model should perform a search.\n * - \"auto\": Let the model decide when to search (default)\n * - \"on\": Always search for every request\n * - \"off\": Never search\n */\n mode?: \"auto\" | \"on\" | \"off\";\n /**\n * Maximum number of search results to return.\n * @default 20\n */\n maxSearchResults?: number;\n /**\n * Filter search results to only include content from after this date.\n * Format: ISO 8601 date string (e.g., \"2024-01-01\")\n */\n fromDate?: string;\n /**\n * Filter search results to only include content from before this date.\n * Format: ISO 8601 date string (e.g., \"2024-12-31\")\n */\n toDate?: string;\n /**\n * Whether to return citations/sources for the search results.\n * @default true\n */\n returnCitations?: boolean;\n /**\n * Specific web/news/X/RSS sources that can be used for the search.\n * These are converted to the snake_case `XAISearchSource` structures\n * used by the underlying xAI Live Search API.\n */\n sources?: XAISearchToolSource[];\n}\n\nfunction mapToolSourceToSearchSource(\n source: XAISearchToolSource\n): XAISearchSource {\n switch (source.type) {\n case \"web\":\n return {\n type: \"web\",\n ...(source.country !== undefined && { country: source.country }),\n ...(source.allowedWebsites !== undefined && {\n allowed_websites: source.allowedWebsites,\n }),\n ...(source.excludedWebsites !== undefined && {\n excluded_websites: source.excludedWebsites,\n }),\n ...(source.safeSearch !== undefined && {\n safe_search: source.safeSearch,\n }),\n };\n case \"news\":\n return {\n type: \"news\",\n ...(source.country !== undefined && { country: source.country }),\n ...(source.excludedWebsites !== undefined && {\n excluded_websites: source.excludedWebsites,\n }),\n ...(source.safeSearch !== undefined && {\n safe_search: source.safeSearch,\n }),\n };\n case \"x\":\n return {\n type: \"x\",\n ...(source.includedXHandles !== undefined && {\n included_x_handles: source.includedXHandles,\n }),\n ...(source.excludedXHandles !== undefined && {\n excluded_x_handles: source.excludedXHandles,\n }),\n ...(source.postFavoriteCount !== undefined && {\n post_favorite_count: source.postFavoriteCount,\n }),\n ...(source.postViewCount !== undefined && {\n post_view_count: source.postViewCount,\n }),\n };\n case \"rss\":\n return {\n type: \"rss\",\n links: source.links,\n };\n default: {\n const _exhaustive: never = source;\n return _exhaustive;\n }\n }\n}\n\n/**\n * Creates an xAI built-in live search tool.\n * Enables the model to search the web for real-time information.\n *\n * This tool is executed server-side by the xAI API.\n *\n * @example\n * ```typescript\n * import { ChatXAI, tools } from \"@langchain/xai\";\n *\n * const llm = new ChatXAI({\n * model: \"grok-beta\",\n * });\n *\n * const searchTool = tools.xaiLiveSearch({\n * maxSearchResults: 5,\n * fromDate: \"2024-01-01\",\n * returnCitations: true\n * });\n *\n * const llmWithSearch = llm.bindTools([searchTool]);\n * const result = await llmWithSearch.invoke(\"What happened in tech today?\");\n * ```\n */\nexport function xaiLiveSearch(\n options: XAILiveSearchToolOptions = {}\n): XAILiveSearchTool {\n return {\n type: XAI_LIVE_SEARCH_TOOL_TYPE,\n name: XAI_LIVE_SEARCH_TOOL_NAME,\n mode: options?.mode,\n max_search_results: options?.maxSearchResults,\n from_date: options?.fromDate,\n to_date: options?.toDate,\n return_citations: options?.returnCitations,\n sources: options?.sources?.map(mapToolSourceToSearchSource),\n } satisfies XAILiveSearchTool;\n}\n"],"mappings":";;;;;AAKA,MAAa,4BAA4B;AACzC,MAAa,4BAA4B;AAgHzC,SAAS,4BACPA,QACiB;AACjB,SAAQ,OAAO,MAAf;EACE,KAAK,MACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,YAAY,UAAa,EAAE,SAAS,OAAO,QAAS;GAC/D,GAAI,OAAO,oBAAoB,UAAa,EAC1C,kBAAkB,OAAO,gBAC1B;GACD,GAAI,OAAO,qBAAqB,UAAa,EAC3C,mBAAmB,OAAO,iBAC3B;GACD,GAAI,OAAO,eAAe,UAAa,EACrC,aAAa,OAAO,WACrB;EACF;EACH,KAAK,OACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,YAAY,UAAa,EAAE,SAAS,OAAO,QAAS;GAC/D,GAAI,OAAO,qBAAqB,UAAa,EAC3C,mBAAmB,OAAO,iBAC3B;GACD,GAAI,OAAO,eAAe,UAAa,EACrC,aAAa,OAAO,WACrB;EACF;EACH,KAAK,IACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,qBAAqB,UAAa,EAC3C,oBAAoB,OAAO,iBAC5B;GACD,GAAI,OAAO,qBAAqB,UAAa,EAC3C,oBAAoB,OAAO,iBAC5B;GACD,GAAI,OAAO,sBAAsB,UAAa,EAC5C,qBAAqB,OAAO,kBAC7B;GACD,GAAI,OAAO,kBAAkB,UAAa,EACxC,iBAAiB,OAAO,cACzB;EACF;EACH,KAAK,MACH,QAAO;GACL,MAAM;GACN,OAAO,OAAO;EACf;EACH,SAAS;GACP,MAAMC,cAAqB;AAC3B,UAAO;EACR;CACF;AACF;;;;;;;;;;;;;;;;;;;;;;;;;AA0BD,SAAgB,cACdC,UAAoC,CAAE,GACnB;AACnB,QAAO;EACL,MAAM;EACN,MAAM;EACN,MAAM,SAAS;EACf,oBAAoB,SAAS;EAC7B,WAAW,SAAS;EACpB,SAAS,SAAS;EAClB,kBAAkB,SAAS;EAC3B,SAAS,SAAS,SAAS,IAAI,4BAA4B;CAC5D;AACF"}