@yourgpt/copilot-sdk 2.0.1 → 2.0.2-beta.2
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/README.md +42 -0
- package/dist/{ThreadManager-JT0sqSSD.d.ts → ThreadManager-Dkp_eLty.d.ts} +1 -1
- package/dist/{ThreadManager-CUq5Ocu2.d.cts → ThreadManager-LfFRhr4e.d.cts} +1 -1
- package/dist/anthropic-6F5GRE3B.js +4 -0
- package/dist/anthropic-6F5GRE3B.js.map +1 -0
- package/dist/anthropic-DGalr_Fw.d.cts +17 -0
- package/dist/anthropic-DkCEDYOt.d.ts +17 -0
- package/dist/anthropic-NMTRABEH.cjs +21 -0
- package/dist/anthropic-NMTRABEH.cjs.map +1 -0
- package/dist/brave-DdnWb7Gb.d.cts +17 -0
- package/dist/brave-DsI9n7Wr.d.ts +17 -0
- package/dist/brave-OYKCOZEM.cjs +21 -0
- package/dist/brave-OYKCOZEM.cjs.map +1 -0
- package/dist/brave-XSASGGH2.js +4 -0
- package/dist/brave-XSASGGH2.js.map +1 -0
- package/dist/chunk-2FAWEBZS.cjs +88 -0
- package/dist/chunk-2FAWEBZS.cjs.map +1 -0
- package/dist/chunk-53UGJNHN.js +92 -0
- package/dist/chunk-53UGJNHN.js.map +1 -0
- package/dist/chunk-6T5XXJEP.cjs +80 -0
- package/dist/chunk-6T5XXJEP.cjs.map +1 -0
- package/dist/chunk-7K7HZMP4.cjs +1170 -0
- package/dist/chunk-7K7HZMP4.cjs.map +1 -0
- package/dist/chunk-7W7QLZNC.js +72 -0
- package/dist/chunk-7W7QLZNC.js.map +1 -0
- package/dist/{chunk-JM7PB2LP.js → chunk-7XFFRV7D.js} +10 -66
- package/dist/chunk-7XFFRV7D.js.map +1 -0
- package/dist/chunk-ASV6JLYG.cjs +99 -0
- package/dist/chunk-ASV6JLYG.cjs.map +1 -0
- package/dist/chunk-BH7MNDWW.js +1152 -0
- package/dist/chunk-BH7MNDWW.js.map +1 -0
- package/dist/chunk-BKO7DSPU.js +67 -0
- package/dist/chunk-BKO7DSPU.js.map +1 -0
- package/dist/chunk-CBAHCI4R.cjs +76 -0
- package/dist/chunk-CBAHCI4R.cjs.map +1 -0
- package/dist/chunk-CEKAYA2Q.cjs +74 -0
- package/dist/chunk-CEKAYA2Q.cjs.map +1 -0
- package/dist/chunk-CEOMTQTP.js +85 -0
- package/dist/chunk-CEOMTQTP.js.map +1 -0
- package/dist/chunk-DABZYCVX.js +84 -0
- package/dist/chunk-DABZYCVX.js.map +1 -0
- package/dist/chunk-DGUM43GV.js +10 -0
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/chunk-G4SF2PNQ.js +33 -0
- package/dist/chunk-G4SF2PNQ.js.map +1 -0
- package/dist/chunk-GANCV72Z.cjs +110 -0
- package/dist/chunk-GANCV72Z.cjs.map +1 -0
- package/dist/{chunk-BLSI67J6.cjs → chunk-H5XMKBBA.cjs} +425 -30
- package/dist/chunk-H5XMKBBA.cjs.map +1 -0
- package/dist/{chunk-CJ7UWN2Y.js → chunk-IXFV6AW6.js} +397 -7
- package/dist/chunk-IXFV6AW6.js.map +1 -0
- package/dist/chunk-JEQ2X3Z6.cjs +12 -0
- package/dist/chunk-JEQ2X3Z6.cjs.map +1 -0
- package/dist/chunk-JO4BHPAD.cjs +40 -0
- package/dist/chunk-JO4BHPAD.cjs.map +1 -0
- package/dist/chunk-MEBXW75C.cjs +89 -0
- package/dist/chunk-MEBXW75C.cjs.map +1 -0
- package/dist/chunk-MNDGIW47.js +76 -0
- package/dist/chunk-MNDGIW47.js.map +1 -0
- package/dist/chunk-PPFHA6IL.js +83 -0
- package/dist/chunk-PPFHA6IL.js.map +1 -0
- package/dist/chunk-RQ74USYU.js +128 -0
- package/dist/chunk-RQ74USYU.js.map +1 -0
- package/dist/chunk-TXLIY7GF.cjs +132 -0
- package/dist/chunk-TXLIY7GF.cjs.map +1 -0
- package/dist/chunk-UIWFYMAO.cjs +82 -0
- package/dist/chunk-UIWFYMAO.cjs.map +1 -0
- package/dist/{chunk-4PRWNAXQ.cjs → chunk-UOWLKFXK.cjs} +27 -89
- package/dist/chunk-UOWLKFXK.cjs.map +1 -0
- package/dist/chunk-VD74IPKB.js +106 -0
- package/dist/chunk-VD74IPKB.js.map +1 -0
- package/dist/chunk-W73FBYIH.cjs +87 -0
- package/dist/chunk-W73FBYIH.cjs.map +1 -0
- package/dist/chunk-XGITAEXU.js +93 -0
- package/dist/chunk-XGITAEXU.js.map +1 -0
- package/dist/chunk-XWOHNY3F.cjs +96 -0
- package/dist/chunk-XWOHNY3F.cjs.map +1 -0
- package/dist/chunk-ZPYQDMUX.js +79 -0
- package/dist/chunk-ZPYQDMUX.js.map +1 -0
- package/dist/core/index.cjs +156 -84
- package/dist/core/index.d.cts +16 -4
- package/dist/core/index.d.ts +16 -4
- package/dist/core/index.js +13 -1
- package/dist/exa-72KFY5A7.cjs +21 -0
- package/dist/exa-72KFY5A7.cjs.map +1 -0
- package/dist/exa-Dp9U-WTc.d.ts +17 -0
- package/dist/exa-NNVPBC2M.js +4 -0
- package/dist/exa-NNVPBC2M.js.map +1 -0
- package/dist/exa-jJSPhyUW.d.cts +17 -0
- package/dist/google-CHU2yycE.d.cts +17 -0
- package/dist/google-CTEK6SV2.js +4 -0
- package/dist/google-CTEK6SV2.js.map +1 -0
- package/dist/google-Da8IQxaI.d.ts +17 -0
- package/dist/google-IIUXFFVF.cjs +21 -0
- package/dist/google-IIUXFFVF.cjs.map +1 -0
- package/dist/index-2VtgKM8S.d.cts +206 -0
- package/dist/index-pWEH7pUE.d.ts +206 -0
- package/dist/mcp/index.cjs +670 -0
- package/dist/mcp/index.cjs.map +1 -0
- package/dist/mcp/index.d.cts +779 -0
- package/dist/mcp/index.d.ts +779 -0
- package/dist/mcp/index.js +574 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/openai-6KTCQ7PZ.cjs +21 -0
- package/dist/openai-6KTCQ7PZ.cjs.map +1 -0
- package/dist/openai-7W2PCNW5.js +4 -0
- package/dist/openai-7W2PCNW5.js.map +1 -0
- package/dist/openai-Cam8hF4f.d.ts +17 -0
- package/dist/openai-HVSCuXgO.d.cts +17 -0
- package/dist/react/index.cjs +75 -42
- package/dist/react/index.d.cts +270 -45
- package/dist/react/index.d.ts +270 -45
- package/dist/react/index.js +15 -2
- package/dist/searxng-AXLVGY7Z.js +4 -0
- package/dist/searxng-AXLVGY7Z.js.map +1 -0
- package/dist/searxng-EJKNY236.cjs +21 -0
- package/dist/searxng-EJKNY236.cjs.map +1 -0
- package/dist/searxng-K0qtY9vp.d.ts +17 -0
- package/dist/searxng-QGOte_Gq.d.cts +17 -0
- package/dist/serper-3JYJHJX6.js +4 -0
- package/dist/serper-3JYJHJX6.js.map +1 -0
- package/dist/serper-63FT4AOL.cjs +21 -0
- package/dist/serper-63FT4AOL.cjs.map +1 -0
- package/dist/serper-7Czya3PW.d.ts +17 -0
- package/dist/serper-JzdaSnS9.d.cts +17 -0
- package/dist/styles.css +38 -0
- package/dist/tavily-AWFP4RM7.cjs +21 -0
- package/dist/tavily-AWFP4RM7.cjs.map +1 -0
- package/dist/tavily-C8cXXojE.d.cts +17 -0
- package/dist/tavily-CIWAAZPH.js +4 -0
- package/dist/tavily-CIWAAZPH.js.map +1 -0
- package/dist/tavily-DdSGVgkE.d.ts +17 -0
- package/dist/themes/catppuccin.css +2 -0
- package/dist/themes/claude.css +2 -0
- package/dist/themes/linear.css +2 -0
- package/dist/themes/modern-minimal.css +2 -0
- package/dist/themes/posthog.css +2 -0
- package/dist/themes/supabase.css +2 -0
- package/dist/themes/twitter.css +2 -0
- package/dist/themes/vercel.css +2 -0
- package/dist/tools/anthropic/index.cjs +61 -0
- package/dist/tools/anthropic/index.cjs.map +1 -0
- package/dist/tools/anthropic/index.d.cts +67 -0
- package/dist/tools/anthropic/index.d.ts +67 -0
- package/dist/tools/anthropic/index.js +56 -0
- package/dist/tools/anthropic/index.js.map +1 -0
- package/dist/tools/brave/index.cjs +85 -0
- package/dist/tools/brave/index.cjs.map +1 -0
- package/dist/tools/brave/index.d.cts +91 -0
- package/dist/tools/brave/index.d.ts +91 -0
- package/dist/tools/brave/index.js +80 -0
- package/dist/tools/brave/index.js.map +1 -0
- package/dist/tools/exa/index.cjs +90 -0
- package/dist/tools/exa/index.cjs.map +1 -0
- package/dist/tools/exa/index.d.cts +92 -0
- package/dist/tools/exa/index.d.ts +92 -0
- package/dist/tools/exa/index.js +85 -0
- package/dist/tools/exa/index.js.map +1 -0
- package/dist/tools/google/index.cjs +81 -0
- package/dist/tools/google/index.cjs.map +1 -0
- package/dist/tools/google/index.d.cts +81 -0
- package/dist/tools/google/index.d.ts +81 -0
- package/dist/tools/google/index.js +76 -0
- package/dist/tools/google/index.js.map +1 -0
- package/dist/tools/openai/index.cjs +83 -0
- package/dist/tools/openai/index.cjs.map +1 -0
- package/dist/tools/openai/index.d.cts +84 -0
- package/dist/tools/openai/index.d.ts +84 -0
- package/dist/tools/openai/index.js +78 -0
- package/dist/tools/openai/index.js.map +1 -0
- package/dist/tools/searxng/index.cjs +85 -0
- package/dist/tools/searxng/index.cjs.map +1 -0
- package/dist/tools/searxng/index.d.cts +91 -0
- package/dist/tools/searxng/index.d.ts +91 -0
- package/dist/tools/searxng/index.js +80 -0
- package/dist/tools/searxng/index.js.map +1 -0
- package/dist/tools/serper/index.cjs +85 -0
- package/dist/tools/serper/index.cjs.map +1 -0
- package/dist/tools/serper/index.d.cts +91 -0
- package/dist/tools/serper/index.d.ts +91 -0
- package/dist/tools/serper/index.js +80 -0
- package/dist/tools/serper/index.js.map +1 -0
- package/dist/tools/tavily/index.cjs +91 -0
- package/dist/tools/tavily/index.cjs.map +1 -0
- package/dist/tools/tavily/index.d.cts +95 -0
- package/dist/tools/tavily/index.d.ts +95 -0
- package/dist/tools/tavily/index.js +86 -0
- package/dist/tools/tavily/index.js.map +1 -0
- package/dist/tools/web-search/index.cjs +31 -0
- package/dist/tools/web-search/index.cjs.map +1 -0
- package/dist/tools/web-search/index.d.cts +3 -0
- package/dist/tools/web-search/index.d.ts +3 -0
- package/dist/tools/web-search/index.js +14 -0
- package/dist/tools/web-search/index.js.map +1 -0
- package/dist/{types-BtAaOV07.d.cts → tools-DDWrco4h.d.cts} +43 -367
- package/dist/{types-BtAaOV07.d.ts → tools-DDWrco4h.d.ts} +43 -367
- package/dist/types-B20VCJXL.d.cts +347 -0
- package/dist/types-B20VCJXL.d.ts +347 -0
- package/dist/types-Cizh9K_f.d.ts +441 -0
- package/dist/types-DG2ya08y.d.cts +367 -0
- package/dist/types-DG2ya08y.d.ts +367 -0
- package/dist/types-DjSfYNKj.d.cts +441 -0
- package/dist/types-ZguuKEs_.d.cts +127 -0
- package/dist/types-ZguuKEs_.d.ts +127 -0
- package/dist/ui/index.cjs +1075 -148
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.cts +410 -4
- package/dist/ui/index.d.ts +410 -4
- package/dist/ui/index.js +1007 -96
- package/dist/ui/index.js.map +1 -1
- package/package.json +52 -2
- package/dist/chunk-4PRWNAXQ.cjs.map +0 -1
- package/dist/chunk-BLSI67J6.cjs.map +0 -1
- package/dist/chunk-CJ7UWN2Y.js.map +0 -1
- package/dist/chunk-JM7PB2LP.js.map +0 -1
package/dist/ui/index.d.ts
CHANGED
|
@@ -4,7 +4,10 @@ import React__default from 'react';
|
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
6
6
|
import * as use_stick_to_bottom from 'use-stick-to-bottom';
|
|
7
|
-
import {
|
|
7
|
+
import { d as WebSearchResult, f as WebSearchResponse } from '../types-ZguuKEs_.js';
|
|
8
|
+
import { T as Thread, b as ThreadStorageAdapter, A as AsyncThreadStorageAdapter } from '../types-DG2ya08y.js';
|
|
9
|
+
import { T as ToolDefinition } from '../tools-DDWrco4h.js';
|
|
10
|
+
import { d as MCPUIIntent, n as MCPUIFrameProps, M as MCPUIResource } from '../types-B20VCJXL.js';
|
|
8
11
|
import { ClassValue } from 'clsx';
|
|
9
12
|
|
|
10
13
|
interface LoaderProps {
|
|
@@ -177,6 +180,302 @@ type SourceContentProps = {
|
|
|
177
180
|
className?: string;
|
|
178
181
|
};
|
|
179
182
|
declare function SourceContent({ title, description, className, }: SourceContentProps): react_jsx_runtime.JSX.Element;
|
|
183
|
+
type SourceItem = {
|
|
184
|
+
href: string;
|
|
185
|
+
title?: string;
|
|
186
|
+
description?: string;
|
|
187
|
+
};
|
|
188
|
+
type SourceGroupProps = {
|
|
189
|
+
/** Array of sources to display */
|
|
190
|
+
sources: SourceItem[];
|
|
191
|
+
/** Label text (default: "Sources") */
|
|
192
|
+
label?: string;
|
|
193
|
+
/** Maximum sources to show before "+N more" */
|
|
194
|
+
maxVisible?: number;
|
|
195
|
+
/** Show favicon for each source */
|
|
196
|
+
showFavicon?: boolean;
|
|
197
|
+
/** Use numbered labels (1, 2, 3...) instead of domain */
|
|
198
|
+
numbered?: boolean;
|
|
199
|
+
/** Additional CSS classes */
|
|
200
|
+
className?: string;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Display a group of sources in a horizontal layout.
|
|
204
|
+
* Each source shows a hover card with details on hover.
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```tsx
|
|
208
|
+
* <SourceGroup
|
|
209
|
+
* sources={[
|
|
210
|
+
* { href: "https://example.com", title: "Example", description: "..." },
|
|
211
|
+
* ]}
|
|
212
|
+
* numbered
|
|
213
|
+
* showFavicon
|
|
214
|
+
* />
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
declare function SourceGroup({ sources, label, maxVisible, showFavicon, numbered, className, }: SourceGroupProps): react_jsx_runtime.JSX.Element | null;
|
|
218
|
+
type SimpleSourceProps = {
|
|
219
|
+
/** Source URL */
|
|
220
|
+
href: string;
|
|
221
|
+
/** Label (number or text) */
|
|
222
|
+
label?: string | number;
|
|
223
|
+
/** Show favicon */
|
|
224
|
+
showFavicon?: boolean;
|
|
225
|
+
/** Additional CSS classes */
|
|
226
|
+
className?: string;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Simple source badge without hover card.
|
|
230
|
+
* Use for inline citations like [1], [2], etc.
|
|
231
|
+
*/
|
|
232
|
+
declare function SimpleSource({ href, label, showFavicon, className, }: SimpleSourceProps): react_jsx_runtime.JSX.Element;
|
|
233
|
+
|
|
234
|
+
interface SearchResultsProps {
|
|
235
|
+
/** Search results to display */
|
|
236
|
+
results: WebSearchResult[];
|
|
237
|
+
/** Additional CSS classes */
|
|
238
|
+
className?: string;
|
|
239
|
+
/** Display variant */
|
|
240
|
+
variant?: "cards" | "list" | "compact";
|
|
241
|
+
/** Maximum results to show (default: all) */
|
|
242
|
+
maxResults?: number;
|
|
243
|
+
/** Show relevance scores (if available) */
|
|
244
|
+
showScores?: boolean;
|
|
245
|
+
/** Show publication dates (if available) */
|
|
246
|
+
showDates?: boolean;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Display web search results with multiple layout options.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```tsx
|
|
253
|
+
* // Compact inline citations
|
|
254
|
+
* <SearchResults results={searchResults} variant="compact" />
|
|
255
|
+
*
|
|
256
|
+
* // Card layout with full details
|
|
257
|
+
* <SearchResults results={searchResults} variant="cards" />
|
|
258
|
+
*
|
|
259
|
+
* // List layout
|
|
260
|
+
* <SearchResults results={searchResults} variant="list" />
|
|
261
|
+
* ```
|
|
262
|
+
*/
|
|
263
|
+
declare function SearchResults({ results, className, variant, maxResults, showScores, showDates, }: SearchResultsProps): react_jsx_runtime.JSX.Element;
|
|
264
|
+
interface SearchAnswerProps {
|
|
265
|
+
/** AI-generated answer from search */
|
|
266
|
+
answer: string;
|
|
267
|
+
/** Additional CSS classes */
|
|
268
|
+
className?: string;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Display an AI-generated answer summary from web search.
|
|
272
|
+
* Useful when using providers like Tavily that generate summaries.
|
|
273
|
+
*/
|
|
274
|
+
declare function SearchAnswer({ answer, className }: SearchAnswerProps): react_jsx_runtime.JSX.Element;
|
|
275
|
+
interface SearchResultsWithAnswerProps {
|
|
276
|
+
/** Full web search response */
|
|
277
|
+
response: WebSearchResponse;
|
|
278
|
+
/** Additional CSS classes */
|
|
279
|
+
className?: string;
|
|
280
|
+
/** Results variant */
|
|
281
|
+
variant?: "cards" | "list" | "compact";
|
|
282
|
+
/** Show the AI answer (if available) */
|
|
283
|
+
showAnswer?: boolean;
|
|
284
|
+
/** Maximum results to show */
|
|
285
|
+
maxResults?: number;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Display complete web search response including answer and results.
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* ```tsx
|
|
292
|
+
* <SearchResultsWithAnswer
|
|
293
|
+
* response={webSearchResponse}
|
|
294
|
+
* showAnswer={true}
|
|
295
|
+
* variant="cards"
|
|
296
|
+
* />
|
|
297
|
+
* ```
|
|
298
|
+
*/
|
|
299
|
+
declare function SearchResultsWithAnswer({ response, className, variant, showAnswer, maxResults, }: SearchResultsWithAnswerProps): react_jsx_runtime.JSX.Element;
|
|
300
|
+
|
|
301
|
+
interface Citation {
|
|
302
|
+
/** Citation number (1-based) */
|
|
303
|
+
index: number;
|
|
304
|
+
/** Source URL */
|
|
305
|
+
url: string;
|
|
306
|
+
/** Source title */
|
|
307
|
+
title: string;
|
|
308
|
+
/** Domain name */
|
|
309
|
+
domain?: string;
|
|
310
|
+
/** Favicon URL */
|
|
311
|
+
favicon?: string;
|
|
312
|
+
}
|
|
313
|
+
interface CitationsConfig {
|
|
314
|
+
/** Show citations (default: true) */
|
|
315
|
+
enabled?: boolean;
|
|
316
|
+
/** Citation style */
|
|
317
|
+
style?: "badges" | "numbered" | "superscript";
|
|
318
|
+
/** Where to show sources */
|
|
319
|
+
sourcesPosition?: "bottom" | "inline" | "collapsible";
|
|
320
|
+
/** Max sources to show initially */
|
|
321
|
+
maxVisible?: number;
|
|
322
|
+
}
|
|
323
|
+
interface CitationBadgeProps {
|
|
324
|
+
/** Citation number */
|
|
325
|
+
index: number;
|
|
326
|
+
/** Source URL for linking */
|
|
327
|
+
url?: string;
|
|
328
|
+
/** Hover tooltip */
|
|
329
|
+
title?: string;
|
|
330
|
+
/** Size variant */
|
|
331
|
+
size?: "sm" | "md";
|
|
332
|
+
/** Additional CSS classes */
|
|
333
|
+
className?: string;
|
|
334
|
+
/** Click handler */
|
|
335
|
+
onClick?: () => void;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Inline citation badge like [1], [2], etc.
|
|
339
|
+
* Similar to Perplexity and ChatGPT citation style.
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* ```tsx
|
|
343
|
+
* <CitationBadge index={1} url="https://example.com" title="Source" />
|
|
344
|
+
* ```
|
|
345
|
+
*/
|
|
346
|
+
declare function CitationBadge({ index, url, title, size, className, onClick, }: CitationBadgeProps): react_jsx_runtime.JSX.Element;
|
|
347
|
+
interface CitationSuperscriptProps {
|
|
348
|
+
index: number;
|
|
349
|
+
url?: string;
|
|
350
|
+
title?: string;
|
|
351
|
+
className?: string;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Superscript citation like academic papers.
|
|
355
|
+
*/
|
|
356
|
+
declare function CitationSuperscript({ index, url, title, className, }: CitationSuperscriptProps): react_jsx_runtime.JSX.Element;
|
|
357
|
+
interface SourcePillProps {
|
|
358
|
+
/** Citation data */
|
|
359
|
+
citation: Citation;
|
|
360
|
+
/** Show index number */
|
|
361
|
+
showIndex?: boolean;
|
|
362
|
+
/** Additional CSS classes */
|
|
363
|
+
className?: string;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Compact source pill with favicon and domain.
|
|
367
|
+
* Used in horizontal source bars.
|
|
368
|
+
*/
|
|
369
|
+
declare function SourcePill({ citation, showIndex, className, }: SourcePillProps): react_jsx_runtime.JSX.Element;
|
|
370
|
+
interface SourcesBarProps {
|
|
371
|
+
/** List of citations */
|
|
372
|
+
citations: Citation[];
|
|
373
|
+
/** Label text (default: "Sources") */
|
|
374
|
+
label?: string;
|
|
375
|
+
/** Max sources to show */
|
|
376
|
+
maxVisible?: number;
|
|
377
|
+
/** Additional CSS classes */
|
|
378
|
+
className?: string;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Horizontal bar of source pills.
|
|
382
|
+
* Similar to Perplexity's sources section.
|
|
383
|
+
*
|
|
384
|
+
* @example
|
|
385
|
+
* ```tsx
|
|
386
|
+
* <SourcesBar
|
|
387
|
+
* citations={[
|
|
388
|
+
* { index: 1, url: "https://...", title: "Source 1" },
|
|
389
|
+
* { index: 2, url: "https://...", title: "Source 2" },
|
|
390
|
+
* ]}
|
|
391
|
+
* />
|
|
392
|
+
* ```
|
|
393
|
+
*/
|
|
394
|
+
declare function SourcesBar({ citations, label, maxVisible, className, }: SourcesBarProps): react_jsx_runtime.JSX.Element | null;
|
|
395
|
+
interface SourcesCollapsibleProps {
|
|
396
|
+
/** List of citations */
|
|
397
|
+
citations: Citation[];
|
|
398
|
+
/** Label text (default: "Sources") */
|
|
399
|
+
label?: string;
|
|
400
|
+
/** Start expanded (default: false) */
|
|
401
|
+
defaultExpanded?: boolean;
|
|
402
|
+
/** Additional CSS classes */
|
|
403
|
+
className?: string;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Collapsible sources section that expands to show full list.
|
|
407
|
+
*
|
|
408
|
+
* @example
|
|
409
|
+
* ```tsx
|
|
410
|
+
* <SourcesCollapsible
|
|
411
|
+
* citations={citations}
|
|
412
|
+
* defaultExpanded={false}
|
|
413
|
+
* />
|
|
414
|
+
* ```
|
|
415
|
+
*/
|
|
416
|
+
declare function SourcesCollapsible({ citations, label, defaultExpanded, className, }: SourcesCollapsibleProps): react_jsx_runtime.JSX.Element | null;
|
|
417
|
+
interface SourcesListProps {
|
|
418
|
+
/** List of citations */
|
|
419
|
+
citations: Citation[];
|
|
420
|
+
/** Additional CSS classes */
|
|
421
|
+
className?: string;
|
|
422
|
+
/** Compact mode */
|
|
423
|
+
compact?: boolean;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Simple numbered list of sources.
|
|
427
|
+
*
|
|
428
|
+
* @example
|
|
429
|
+
* ```tsx
|
|
430
|
+
* <SourcesList citations={citations} compact />
|
|
431
|
+
* ```
|
|
432
|
+
*/
|
|
433
|
+
declare function SourcesList({ citations, className, compact, }: SourcesListProps): react_jsx_runtime.JSX.Element | null;
|
|
434
|
+
interface MessageWithCitationsProps {
|
|
435
|
+
/** Message content (can contain citation placeholders) */
|
|
436
|
+
children: React$1.ReactNode;
|
|
437
|
+
/** Citations for this message */
|
|
438
|
+
citations: Citation[];
|
|
439
|
+
/** Citation display configuration */
|
|
440
|
+
config?: CitationsConfig;
|
|
441
|
+
/** Additional CSS classes */
|
|
442
|
+
className?: string;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Wraps a message with citation support.
|
|
446
|
+
* Shows sources bar or collapsible section based on config.
|
|
447
|
+
*
|
|
448
|
+
* @example
|
|
449
|
+
* ```tsx
|
|
450
|
+
* <MessageWithCitations
|
|
451
|
+
* citations={[
|
|
452
|
+
* { index: 1, url: "...", title: "Source 1" },
|
|
453
|
+
* ]}
|
|
454
|
+
* config={{ sourcesPosition: "bottom" }}
|
|
455
|
+
* >
|
|
456
|
+
* <p>According to research <CitationBadge index={1} />, ...</p>
|
|
457
|
+
* </MessageWithCitations>
|
|
458
|
+
* ```
|
|
459
|
+
*/
|
|
460
|
+
declare function MessageWithCitations({ children, citations, config, className, }: MessageWithCitationsProps): react_jsx_runtime.JSX.Element;
|
|
461
|
+
/**
|
|
462
|
+
* Convert OpenAI annotations to Citation format
|
|
463
|
+
*/
|
|
464
|
+
declare function annotationsToCitations(annotations: Array<{
|
|
465
|
+
type: string;
|
|
466
|
+
url?: string;
|
|
467
|
+
title?: string;
|
|
468
|
+
start_index?: number;
|
|
469
|
+
end_index?: number;
|
|
470
|
+
}>): Citation[];
|
|
471
|
+
/**
|
|
472
|
+
* Convert WebSearchResult array to Citation format
|
|
473
|
+
*/
|
|
474
|
+
declare function resultsToCitations(results: Array<{
|
|
475
|
+
url: string;
|
|
476
|
+
title: string;
|
|
477
|
+
domain?: string;
|
|
478
|
+
}>): Citation[];
|
|
180
479
|
|
|
181
480
|
interface ReasoningProps {
|
|
182
481
|
children: React$1.ReactNode;
|
|
@@ -925,6 +1224,23 @@ interface ToolExecutionData {
|
|
|
925
1224
|
message?: string;
|
|
926
1225
|
error?: string;
|
|
927
1226
|
data?: unknown;
|
|
1227
|
+
/**
|
|
1228
|
+
* MCP-UI resources for rendering interactive UI components.
|
|
1229
|
+
* These are extracted from MCP tool results and rendered as iframes.
|
|
1230
|
+
*/
|
|
1231
|
+
_uiResources?: Array<{
|
|
1232
|
+
uri: string;
|
|
1233
|
+
mimeType: "text/html" | "text/uri-list" | "application/vnd.mcp-ui.remote-dom";
|
|
1234
|
+
content?: string;
|
|
1235
|
+
blob?: string;
|
|
1236
|
+
metadata?: {
|
|
1237
|
+
title?: string;
|
|
1238
|
+
width?: string;
|
|
1239
|
+
height?: string;
|
|
1240
|
+
sandbox?: string[];
|
|
1241
|
+
className?: string;
|
|
1242
|
+
};
|
|
1243
|
+
}>;
|
|
928
1244
|
};
|
|
929
1245
|
error?: string;
|
|
930
1246
|
timestamp: number;
|
|
@@ -937,6 +1253,24 @@ interface ToolExecutionData {
|
|
|
937
1253
|
approvalData?: Record<string, unknown>;
|
|
938
1254
|
}
|
|
939
1255
|
|
|
1256
|
+
/**
|
|
1257
|
+
* Configuration for displaying citations/sources from web search tools.
|
|
1258
|
+
* Sources are automatically extracted from web_search tool results.
|
|
1259
|
+
*/
|
|
1260
|
+
type CitationConfig = {
|
|
1261
|
+
/** Enable citation display (default: true) */
|
|
1262
|
+
enabled?: boolean;
|
|
1263
|
+
/** Show favicon for each source (default: true) */
|
|
1264
|
+
showFavicon?: boolean;
|
|
1265
|
+
/** Use numbered labels (1, 2, 3...) instead of domain (default: true) */
|
|
1266
|
+
numbered?: boolean;
|
|
1267
|
+
/** Maximum sources to show before "+N more" (default: 5) */
|
|
1268
|
+
maxVisible?: number;
|
|
1269
|
+
/** Label text (default: "Sources") */
|
|
1270
|
+
label?: string;
|
|
1271
|
+
/** Custom className for source group */
|
|
1272
|
+
className?: string;
|
|
1273
|
+
};
|
|
940
1274
|
/**
|
|
941
1275
|
* Message attachment (images, files, etc.)
|
|
942
1276
|
*
|
|
@@ -977,6 +1311,8 @@ type ChatMessage = {
|
|
|
977
1311
|
arguments: string;
|
|
978
1312
|
};
|
|
979
1313
|
}>;
|
|
1314
|
+
/** Additional metadata (citations, etc.) */
|
|
1315
|
+
metadata?: Record<string, unknown>;
|
|
980
1316
|
};
|
|
981
1317
|
|
|
982
1318
|
/**
|
|
@@ -1247,6 +1583,12 @@ type ChatProps = {
|
|
|
1247
1583
|
suggestions?: string;
|
|
1248
1584
|
footer?: string;
|
|
1249
1585
|
};
|
|
1586
|
+
/**
|
|
1587
|
+
* Configuration for displaying citations from web search results.
|
|
1588
|
+
* Set to `false` to disable, or pass config object to customize.
|
|
1589
|
+
* @default { enabled: true }
|
|
1590
|
+
*/
|
|
1591
|
+
citations?: CitationConfig | false;
|
|
1250
1592
|
/** Called when starting a new chat (clears messages, returns to home) */
|
|
1251
1593
|
onNewChat?: () => void;
|
|
1252
1594
|
/** Available threads (passed from connected-chat when persistence enabled) */
|
|
@@ -1367,7 +1709,7 @@ declare function BackButton({ className, children, disabled, "aria-label": ariaL
|
|
|
1367
1709
|
*/
|
|
1368
1710
|
type ThreadPickerCompoundProps = Omit<ThreadPickerProps, "value" | "threads" | "onSelect" | "onNewThread" | "onDeleteThread" | "disabled">;
|
|
1369
1711
|
declare function ThreadPickerCompound(props: ThreadPickerCompoundProps): react_jsx_runtime.JSX.Element | null;
|
|
1370
|
-
declare function ChatComponent({ messages, onSendMessage, onStop, isLoading, children, placeholder, welcomeMessage, title, showHeader, header, threadPicker, logo, name, onClose, showPoweredBy, showUserAvatar, userAvatar: userAvatarProp, assistantAvatar: assistantAvatarProp, loaderVariant, fontSize, maxFileSize, allowedFileTypes, attachmentsEnabled, attachmentsDisabledTooltip, processAttachment: processAttachmentProp, suggestions, onSuggestionClick, welcome, recentThreads, onSelectThread, onDeleteThread, onViewMoreThreads, isProcessing, registeredTools, toolRenderers, onApproveToolExecution, onRejectToolExecution, showFollowUps, followUpClassName, followUpButtonClassName, renderMessage, renderInput, renderHeader, className, classNames, onNewChat, threads, currentThreadId, onSwitchThread, isThreadBusy, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
1712
|
+
declare function ChatComponent({ messages, onSendMessage, onStop, isLoading, children, placeholder, welcomeMessage, title, showHeader, header, threadPicker, logo, name, onClose, showPoweredBy, showUserAvatar, userAvatar: userAvatarProp, assistantAvatar: assistantAvatarProp, loaderVariant, fontSize, maxFileSize, allowedFileTypes, attachmentsEnabled, attachmentsDisabledTooltip, processAttachment: processAttachmentProp, suggestions, onSuggestionClick, welcome, recentThreads, onSelectThread, onDeleteThread, onViewMoreThreads, isProcessing, registeredTools, toolRenderers, onApproveToolExecution, onRejectToolExecution, showFollowUps, followUpClassName, followUpButtonClassName, citations, renderMessage, renderInput, renderHeader, className, classNames, onNewChat, threads, currentThreadId, onSwitchThread, isThreadBusy, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
1371
1713
|
/**
|
|
1372
1714
|
* Chat component with compound component pattern.
|
|
1373
1715
|
*
|
|
@@ -1488,13 +1830,21 @@ interface ToolExecutionMessageProps {
|
|
|
1488
1830
|
message?: string;
|
|
1489
1831
|
};
|
|
1490
1832
|
}>>;
|
|
1833
|
+
/**
|
|
1834
|
+
* Callback when an MCP-UI intent is received from an interactive UI component.
|
|
1835
|
+
* Use this with useMCPUIIntents hook to handle tool calls, actions, etc.
|
|
1836
|
+
*/
|
|
1837
|
+
onUIIntent?: (intent: MCPUIIntent, context: {
|
|
1838
|
+
toolName: string;
|
|
1839
|
+
toolCallId: string;
|
|
1840
|
+
}) => void;
|
|
1491
1841
|
className?: string;
|
|
1492
1842
|
}
|
|
1493
1843
|
/**
|
|
1494
1844
|
* Standalone tool execution message shown during agentic loop
|
|
1495
1845
|
* Displays tool calls with status, progress, and approval UI
|
|
1496
1846
|
*/
|
|
1497
|
-
declare function ToolExecutionMessage({ executions, assistantAvatar, onApprove, onReject, toolRenderers, className, }: ToolExecutionMessageProps): react_jsx_runtime.JSX.Element | null;
|
|
1847
|
+
declare function ToolExecutionMessage({ executions, assistantAvatar, onApprove, onReject, toolRenderers, onUIIntent, className, }: ToolExecutionMessageProps): react_jsx_runtime.JSX.Element | null;
|
|
1498
1848
|
|
|
1499
1849
|
/**
|
|
1500
1850
|
* localStorage persistence (zero config)
|
|
@@ -1710,6 +2060,62 @@ declare function AlertTriangleIcon({ className }: {
|
|
|
1710
2060
|
className?: string;
|
|
1711
2061
|
}): react_jsx_runtime.JSX.Element;
|
|
1712
2062
|
|
|
2063
|
+
/**
|
|
2064
|
+
* MCPUIFrame - Renders MCP-UI resources in a sandboxed iframe
|
|
2065
|
+
*
|
|
2066
|
+
* This component provides secure rendering of interactive UI components
|
|
2067
|
+
* returned by MCP tools. It handles:
|
|
2068
|
+
* - Inline HTML content (text/html)
|
|
2069
|
+
* - External URLs (text/uri-list)
|
|
2070
|
+
* - PostMessage communication for intents
|
|
2071
|
+
*
|
|
2072
|
+
* @example
|
|
2073
|
+
* ```tsx
|
|
2074
|
+
* <MCPUIFrame
|
|
2075
|
+
* resource={{
|
|
2076
|
+
* uri: "ui://shop/product/123",
|
|
2077
|
+
* mimeType: "text/html",
|
|
2078
|
+
* content: "<div class='product'>...</div>",
|
|
2079
|
+
* metadata: { height: "300px" }
|
|
2080
|
+
* }}
|
|
2081
|
+
* onIntent={(intent) => {
|
|
2082
|
+
* if (intent.type === "tool") {
|
|
2083
|
+
* callTool(intent.name, intent.arguments);
|
|
2084
|
+
* }
|
|
2085
|
+
* }}
|
|
2086
|
+
* />
|
|
2087
|
+
* ```
|
|
2088
|
+
*/
|
|
2089
|
+
declare function MCPUIFrame({ resource, onIntent, onError, onLoad, className, style, sandbox, showLoading, testId, }: MCPUIFrameProps): react_jsx_runtime.JSX.Element;
|
|
2090
|
+
/**
|
|
2091
|
+
* MCPUIFrameList - Renders multiple MCP-UI resources
|
|
2092
|
+
*
|
|
2093
|
+
* Convenience component for rendering an array of UI resources.
|
|
2094
|
+
*
|
|
2095
|
+
* @example
|
|
2096
|
+
* ```tsx
|
|
2097
|
+
* <MCPUIFrameList
|
|
2098
|
+
* resources={execution.result?._uiResources}
|
|
2099
|
+
* onIntent={handleIntent}
|
|
2100
|
+
* />
|
|
2101
|
+
* ```
|
|
2102
|
+
*/
|
|
2103
|
+
interface MCPUIFrameListProps {
|
|
2104
|
+
/** Array of UI resources to render */
|
|
2105
|
+
resources?: MCPUIResource[];
|
|
2106
|
+
/** Callback when any UI emits an intent */
|
|
2107
|
+
onIntent?: (intent: MCPUIIntent, resourceIndex: number) => void;
|
|
2108
|
+
/** Callback when an error occurs */
|
|
2109
|
+
onError?: (error: Error, resourceIndex: number) => void;
|
|
2110
|
+
/** Additional CSS class names */
|
|
2111
|
+
className?: string;
|
|
2112
|
+
/** Class name for individual frames */
|
|
2113
|
+
frameClassName?: string;
|
|
2114
|
+
/** Gap between frames */
|
|
2115
|
+
gap?: "sm" | "md" | "lg";
|
|
2116
|
+
}
|
|
2117
|
+
declare function MCPUIFrameList({ resources, onIntent, onError, className, frameClassName, gap, }: MCPUIFrameListProps): react_jsx_runtime.JSX.Element | null;
|
|
2118
|
+
|
|
1713
2119
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1714
2120
|
|
|
1715
|
-
export { AlertTriangleIcon, type BackButtonProps, BotIcon, Button, CapabilityBadge, type CapabilityBadgeProps, CapabilityList, type CapabilityListProps, type CapabilityType, Chat, ChatContainerContent, ChatContainerRoot, ChatContainerScrollAnchor, type ChatMessage, type ChatProps, type ChatViewProps, ChatWelcome, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronUpIcon, CloseIcon, type CloudPersistenceConfig, CodeBlock, CompactPermissionConfirmation, type CompactPermissionConfirmationProps, Confirmation, ConfirmationActions, type ConfirmationActionsProps, ConfirmationApproved, type ConfirmationApprovedProps, ConfirmationMessage, type ConfirmationMessageProps, ConfirmationPending, type ConfirmationPendingProps, type ConfirmationProps, ConfirmationRejected, type ConfirmationRejectedProps, type ConfirmationState$1 as ConfirmationState, ConnectedChat, type ConnectedChatProps, CopilotChat, type CopilotChatClassNames, type CopilotChatPersistenceConfig, type CopilotChatProps, type CopilotUIConfig, type CopilotUIContextValue, CopilotUIProvider, type CopilotUIProviderProps, CopyIcon, DEFAULT_PERMISSION_OPTIONS, DevLogger, type DevLoggerProps, type DevLoggerState, FeedbackBar, type FollowUpProps, FollowUpQuestions, type FooterProps, type HeaderProps, type HomeViewProps as HomeProps, type HomeViewProps, InlineToolSteps, type InlineToolStepsProps, Loader, type LocalPersistenceConfig, Markdown, MessageAvatar, MessageContent, Message as MessagePrimitive, type ModelOption, ModelSelector, type ModelSelectorProps, PermissionConfirmation, type PermissionConfirmationProps, type PermissionLevel, type PermissionOption, PoweredBy, type PoweredByProps, PromptInput, PromptInputAction, PromptInputActions, PromptInputTextarea, type ProviderGroup, Reasoning, ReasoningContent, type ReasoningContentProps, type ReasoningProps, ReasoningTrigger, type ReasoningTriggerProps, RefreshIcon, ScrollButton, SendIcon, type ServerPersistenceConfig, SimpleConfirmation, type SimpleConfirmationProps, SimpleModelSelector, type SimpleModelSelectorProps, SimpleReasoning, type SimpleReasoningProps, Source, SourceContent, SourceTrigger, StopIcon, ThreadCard, type ThreadCardProps, ThreadList, type ThreadListProps, ThreadPicker, type ThreadPickerCompoundProps, type ThreadPickerProps, ThumbsDownIcon, ThumbsUpIcon, ToolExecutionMessage, type ToolRendererProps, type ToolRenderers, ToolStep, type ToolStepData, type ToolStepProps, type ToolStepStatus, ToolSteps, type ToolStepsProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps, UserIcon, type WelcomeConfig, XIcon, cn, parseFollowUps, useChatContainer, useCopilotChatContext, useCopilotUI };
|
|
2121
|
+
export { AlertTriangleIcon, type BackButtonProps, BotIcon, Button, CapabilityBadge, type CapabilityBadgeProps, CapabilityList, type CapabilityListProps, type CapabilityType, Chat, ChatContainerContent, ChatContainerRoot, ChatContainerScrollAnchor, type ChatMessage, type ChatProps, type ChatViewProps, ChatWelcome, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronUpIcon, type Citation, CitationBadge, type CitationBadgeProps, type CitationConfig, CitationSuperscript, type CitationSuperscriptProps, type CitationsConfig, CloseIcon, type CloudPersistenceConfig, CodeBlock, CompactPermissionConfirmation, type CompactPermissionConfirmationProps, Confirmation, ConfirmationActions, type ConfirmationActionsProps, ConfirmationApproved, type ConfirmationApprovedProps, ConfirmationMessage, type ConfirmationMessageProps, ConfirmationPending, type ConfirmationPendingProps, type ConfirmationProps, ConfirmationRejected, type ConfirmationRejectedProps, type ConfirmationState$1 as ConfirmationState, ConnectedChat, type ConnectedChatProps, CopilotChat, type CopilotChatClassNames, type CopilotChatPersistenceConfig, type CopilotChatProps, type CopilotUIConfig, type CopilotUIContextValue, CopilotUIProvider, type CopilotUIProviderProps, CopyIcon, DEFAULT_PERMISSION_OPTIONS, DevLogger, type DevLoggerProps, type DevLoggerState, FeedbackBar, type FollowUpProps, FollowUpQuestions, type FooterProps, type HeaderProps, type HomeViewProps as HomeProps, type HomeViewProps, InlineToolSteps, type InlineToolStepsProps, Loader, type LocalPersistenceConfig, MCPUIFrame, MCPUIFrameList, type MCPUIFrameListProps, MCPUIFrameProps, Markdown, MessageAvatar, MessageContent, Message as MessagePrimitive, MessageWithCitations, type MessageWithCitationsProps, type ModelOption, ModelSelector, type ModelSelectorProps, PermissionConfirmation, type PermissionConfirmationProps, type PermissionLevel, type PermissionOption, PoweredBy, type PoweredByProps, PromptInput, PromptInputAction, PromptInputActions, PromptInputTextarea, type ProviderGroup, Reasoning, ReasoningContent, type ReasoningContentProps, type ReasoningProps, ReasoningTrigger, type ReasoningTriggerProps, RefreshIcon, ScrollButton, SearchAnswer, type SearchAnswerProps, SearchResults, type SearchResultsProps, SearchResultsWithAnswer, type SearchResultsWithAnswerProps, SendIcon, type ServerPersistenceConfig, SimpleConfirmation, type SimpleConfirmationProps, SimpleModelSelector, type SimpleModelSelectorProps, SimpleReasoning, type SimpleReasoningProps, SimpleSource, type SimpleSourceProps, Source, SourceContent, type SourceContentProps, SourceGroup, type SourceGroupProps, type SourceItem, SourcePill, type SourcePillProps, type SourceProps, SourceTrigger, type SourceTriggerProps, SourcesBar, type SourcesBarProps, SourcesCollapsible, type SourcesCollapsibleProps, SourcesList, type SourcesListProps, StopIcon, ThreadCard, type ThreadCardProps, ThreadList, type ThreadListProps, ThreadPicker, type ThreadPickerCompoundProps, type ThreadPickerProps, ThumbsDownIcon, ThumbsUpIcon, ToolExecutionMessage, type ToolRendererProps, type ToolRenderers, ToolStep, type ToolStepData, type ToolStepProps, type ToolStepStatus, ToolSteps, type ToolStepsProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps, UserIcon, type WelcomeConfig, XIcon, annotationsToCitations, cn, parseFollowUps, resultsToCitations, useChatContainer, useCopilotChatContext, useCopilotUI };
|