@cadraos/sdk 0.1.12 → 0.1.13
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/chat/index.cjs +423 -149
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +29 -3
- package/dist/chat/index.d.ts +29 -3
- package/dist/chat/index.js +423 -149
- package/dist/chat/index.js.map +1 -1
- package/package.json +15 -14
package/dist/chat/index.d.cts
CHANGED
|
@@ -332,7 +332,7 @@ interface ChatMessageProps {
|
|
|
332
332
|
* />
|
|
333
333
|
* ```
|
|
334
334
|
*/
|
|
335
|
-
declare function ChatMessage({ message, enableMarkdown, showToolCalls, toolCallVerbosity
|
|
335
|
+
declare function ChatMessage({ message, enableMarkdown, showToolCalls, toolCallVerbosity, className, markdownComponents, markdownUrlTransform, markdownContentTransform, onImageClick, showThinking, showDelegation, showImages, renderToolCall, variant, }: ChatMessageProps): react_jsx_runtime.JSX.Element;
|
|
336
336
|
|
|
337
337
|
interface MessageListProps {
|
|
338
338
|
/** Array of messages to display */
|
|
@@ -1403,6 +1403,20 @@ interface AgentChatProps {
|
|
|
1403
1403
|
pollingEnabled?: boolean;
|
|
1404
1404
|
/** Callback fired when a delegation event occurs */
|
|
1405
1405
|
onDelegation?: (event: DelegationEvent) => void;
|
|
1406
|
+
/**
|
|
1407
|
+
* Callback ref that receives the attachment API when attachments are enabled.
|
|
1408
|
+
* Use this to programmatically add files from outside the chat (e.g., from an artifacts panel).
|
|
1409
|
+
*/
|
|
1410
|
+
onAttachmentsReady?: (api: {
|
|
1411
|
+
addExternalFile: (opts: {
|
|
1412
|
+
uuid: string;
|
|
1413
|
+
filename: string;
|
|
1414
|
+
mimeType: string;
|
|
1415
|
+
size: number;
|
|
1416
|
+
category?: "document" | "image" | "audio";
|
|
1417
|
+
previewUrl?: string;
|
|
1418
|
+
}) => void;
|
|
1419
|
+
}) => void;
|
|
1406
1420
|
}
|
|
1407
1421
|
/**
|
|
1408
1422
|
* Complete chat interface for interacting with AI agents
|
|
@@ -1425,7 +1439,7 @@ interface AgentChatProps {
|
|
|
1425
1439
|
* />
|
|
1426
1440
|
* ```
|
|
1427
1441
|
*/
|
|
1428
|
-
declare function AgentChat({ agentId, teamId, sessionId, adapter, onMessage, onError, onSessionCreated, onSessionStart, onToolCall, onToolResult, onClarification, initialMessages, placeholder, welcomeMessage, renderWelcome, maxHeight, className, theme, layout, enableAttachments, enableMarkdown, showToolCalls, toolCallVerbosity, markdownComponents, markdownUrlTransform, markdownContentTransform, onImageClick, hideHeader, renderAboveInput, renderBelowMessages, renderMessage, renderToolCall, messageVariant, showThinking, showDelegation, showImages, pollingInterval, pollingEnabled, onDelegation, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
1442
|
+
declare function AgentChat({ agentId, teamId, sessionId, adapter, onMessage, onError, onSessionCreated, onSessionStart, onToolCall, onToolResult, onClarification, initialMessages, placeholder, welcomeMessage, renderWelcome, maxHeight, className, theme, layout, enableAttachments, enableMarkdown, showToolCalls, toolCallVerbosity, markdownComponents, markdownUrlTransform, markdownContentTransform, onImageClick, hideHeader, renderAboveInput, renderBelowMessages, renderMessage, renderToolCall, messageVariant, showThinking, showDelegation, showImages, pollingInterval, pollingEnabled, onDelegation, onAttachmentsReady, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
1429
1443
|
|
|
1430
1444
|
/**
|
|
1431
1445
|
* Retry utility with exponential backoff
|
|
@@ -3325,6 +3339,18 @@ interface UseFileAttachmentsResult {
|
|
|
3325
3339
|
* If onSubmitUpload is not configured, returns getReadyUuids().
|
|
3326
3340
|
*/
|
|
3327
3341
|
prepareForSubmit: () => Promise<string[]>;
|
|
3342
|
+
/**
|
|
3343
|
+
* Add an already-uploaded file (e.g., from artifact/output panel).
|
|
3344
|
+
* Creates a ready-state AttachmentFile without going through the upload flow.
|
|
3345
|
+
*/
|
|
3346
|
+
addExternalFile: (opts: {
|
|
3347
|
+
uuid: string;
|
|
3348
|
+
filename: string;
|
|
3349
|
+
mimeType: string;
|
|
3350
|
+
size: number;
|
|
3351
|
+
category?: "document" | "image" | "audio";
|
|
3352
|
+
previewUrl?: string;
|
|
3353
|
+
}) => void;
|
|
3328
3354
|
/** Clear all attachments (revokes preview URLs) */
|
|
3329
3355
|
clear: () => void;
|
|
3330
3356
|
/** Whether any files are currently uploading */
|
|
@@ -3530,7 +3556,7 @@ interface ImageLightboxProps {
|
|
|
3530
3556
|
/**
|
|
3531
3557
|
* Fullscreen image viewer with prev/next navigation
|
|
3532
3558
|
*/
|
|
3533
|
-
declare function ImageLightbox({ images, currentIndex, onClose, onPrev, onNext, className, }: ImageLightboxProps):
|
|
3559
|
+
declare function ImageLightbox({ images, currentIndex, onClose, onPrev, onNext, className, }: ImageLightboxProps): React$1.ReactPortal | null;
|
|
3534
3560
|
|
|
3535
3561
|
interface AskUserPromptProps {
|
|
3536
3562
|
/** The question to display to the user */
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -332,7 +332,7 @@ interface ChatMessageProps {
|
|
|
332
332
|
* />
|
|
333
333
|
* ```
|
|
334
334
|
*/
|
|
335
|
-
declare function ChatMessage({ message, enableMarkdown, showToolCalls, toolCallVerbosity
|
|
335
|
+
declare function ChatMessage({ message, enableMarkdown, showToolCalls, toolCallVerbosity, className, markdownComponents, markdownUrlTransform, markdownContentTransform, onImageClick, showThinking, showDelegation, showImages, renderToolCall, variant, }: ChatMessageProps): react_jsx_runtime.JSX.Element;
|
|
336
336
|
|
|
337
337
|
interface MessageListProps {
|
|
338
338
|
/** Array of messages to display */
|
|
@@ -1403,6 +1403,20 @@ interface AgentChatProps {
|
|
|
1403
1403
|
pollingEnabled?: boolean;
|
|
1404
1404
|
/** Callback fired when a delegation event occurs */
|
|
1405
1405
|
onDelegation?: (event: DelegationEvent) => void;
|
|
1406
|
+
/**
|
|
1407
|
+
* Callback ref that receives the attachment API when attachments are enabled.
|
|
1408
|
+
* Use this to programmatically add files from outside the chat (e.g., from an artifacts panel).
|
|
1409
|
+
*/
|
|
1410
|
+
onAttachmentsReady?: (api: {
|
|
1411
|
+
addExternalFile: (opts: {
|
|
1412
|
+
uuid: string;
|
|
1413
|
+
filename: string;
|
|
1414
|
+
mimeType: string;
|
|
1415
|
+
size: number;
|
|
1416
|
+
category?: "document" | "image" | "audio";
|
|
1417
|
+
previewUrl?: string;
|
|
1418
|
+
}) => void;
|
|
1419
|
+
}) => void;
|
|
1406
1420
|
}
|
|
1407
1421
|
/**
|
|
1408
1422
|
* Complete chat interface for interacting with AI agents
|
|
@@ -1425,7 +1439,7 @@ interface AgentChatProps {
|
|
|
1425
1439
|
* />
|
|
1426
1440
|
* ```
|
|
1427
1441
|
*/
|
|
1428
|
-
declare function AgentChat({ agentId, teamId, sessionId, adapter, onMessage, onError, onSessionCreated, onSessionStart, onToolCall, onToolResult, onClarification, initialMessages, placeholder, welcomeMessage, renderWelcome, maxHeight, className, theme, layout, enableAttachments, enableMarkdown, showToolCalls, toolCallVerbosity, markdownComponents, markdownUrlTransform, markdownContentTransform, onImageClick, hideHeader, renderAboveInput, renderBelowMessages, renderMessage, renderToolCall, messageVariant, showThinking, showDelegation, showImages, pollingInterval, pollingEnabled, onDelegation, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
1442
|
+
declare function AgentChat({ agentId, teamId, sessionId, adapter, onMessage, onError, onSessionCreated, onSessionStart, onToolCall, onToolResult, onClarification, initialMessages, placeholder, welcomeMessage, renderWelcome, maxHeight, className, theme, layout, enableAttachments, enableMarkdown, showToolCalls, toolCallVerbosity, markdownComponents, markdownUrlTransform, markdownContentTransform, onImageClick, hideHeader, renderAboveInput, renderBelowMessages, renderMessage, renderToolCall, messageVariant, showThinking, showDelegation, showImages, pollingInterval, pollingEnabled, onDelegation, onAttachmentsReady, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
1429
1443
|
|
|
1430
1444
|
/**
|
|
1431
1445
|
* Retry utility with exponential backoff
|
|
@@ -3325,6 +3339,18 @@ interface UseFileAttachmentsResult {
|
|
|
3325
3339
|
* If onSubmitUpload is not configured, returns getReadyUuids().
|
|
3326
3340
|
*/
|
|
3327
3341
|
prepareForSubmit: () => Promise<string[]>;
|
|
3342
|
+
/**
|
|
3343
|
+
* Add an already-uploaded file (e.g., from artifact/output panel).
|
|
3344
|
+
* Creates a ready-state AttachmentFile without going through the upload flow.
|
|
3345
|
+
*/
|
|
3346
|
+
addExternalFile: (opts: {
|
|
3347
|
+
uuid: string;
|
|
3348
|
+
filename: string;
|
|
3349
|
+
mimeType: string;
|
|
3350
|
+
size: number;
|
|
3351
|
+
category?: "document" | "image" | "audio";
|
|
3352
|
+
previewUrl?: string;
|
|
3353
|
+
}) => void;
|
|
3328
3354
|
/** Clear all attachments (revokes preview URLs) */
|
|
3329
3355
|
clear: () => void;
|
|
3330
3356
|
/** Whether any files are currently uploading */
|
|
@@ -3530,7 +3556,7 @@ interface ImageLightboxProps {
|
|
|
3530
3556
|
/**
|
|
3531
3557
|
* Fullscreen image viewer with prev/next navigation
|
|
3532
3558
|
*/
|
|
3533
|
-
declare function ImageLightbox({ images, currentIndex, onClose, onPrev, onNext, className, }: ImageLightboxProps):
|
|
3559
|
+
declare function ImageLightbox({ images, currentIndex, onClose, onPrev, onNext, className, }: ImageLightboxProps): React$1.ReactPortal | null;
|
|
3534
3560
|
|
|
3535
3561
|
interface AskUserPromptProps {
|
|
3536
3562
|
/** The question to display to the user */
|