@cadraos/sdk 0.3.7 → 0.3.8
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 +4 -2
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +9 -1
- package/dist/chat/index.d.ts +9 -1
- package/dist/chat/index.js +4 -2
- package/dist/chat/index.js.map +1 -1
- package/package.json +16 -15
package/dist/chat/index.d.cts
CHANGED
|
@@ -1624,6 +1624,14 @@ interface AgentChatProps {
|
|
|
1624
1624
|
onClarification?: (data: ClarificationData) => void;
|
|
1625
1625
|
/** Initial messages to populate the chat */
|
|
1626
1626
|
initialMessages?: ChatMessage$1[];
|
|
1627
|
+
/**
|
|
1628
|
+
* Extra messages MERGED into the rendered list by timestamp on every render
|
|
1629
|
+
* (interleaved chronologically, deduped by id). Use for durable turns that
|
|
1630
|
+
* arrive out-of-band on a separate delivery plane — e.g. human-operator /
|
|
1631
|
+
* system replies in a webchat handoff — so they don't dock at the bottom.
|
|
1632
|
+
* Unlike `initialMessages`, these are NOT seeded into internal state.
|
|
1633
|
+
*/
|
|
1634
|
+
injectedMessages?: ChatMessage$1[];
|
|
1627
1635
|
/** Placeholder text for the input */
|
|
1628
1636
|
placeholder?: string;
|
|
1629
1637
|
/** Welcome message shown when chat is empty */
|
|
@@ -1787,7 +1795,7 @@ interface AgentChatProps {
|
|
|
1787
1795
|
* />
|
|
1788
1796
|
* ```
|
|
1789
1797
|
*/
|
|
1790
|
-
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, hideAvatars, agentName, hideHeaderWhileEmpty, hideTypingIndicator, onInputChange, onInputControlReady, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
1798
|
+
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, hideAvatars, agentName, hideHeaderWhileEmpty, hideTypingIndicator, onInputChange, onInputControlReady, injectedMessages, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
1791
1799
|
|
|
1792
1800
|
/**
|
|
1793
1801
|
* Retry utility with exponential backoff
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -1624,6 +1624,14 @@ interface AgentChatProps {
|
|
|
1624
1624
|
onClarification?: (data: ClarificationData) => void;
|
|
1625
1625
|
/** Initial messages to populate the chat */
|
|
1626
1626
|
initialMessages?: ChatMessage$1[];
|
|
1627
|
+
/**
|
|
1628
|
+
* Extra messages MERGED into the rendered list by timestamp on every render
|
|
1629
|
+
* (interleaved chronologically, deduped by id). Use for durable turns that
|
|
1630
|
+
* arrive out-of-band on a separate delivery plane — e.g. human-operator /
|
|
1631
|
+
* system replies in a webchat handoff — so they don't dock at the bottom.
|
|
1632
|
+
* Unlike `initialMessages`, these are NOT seeded into internal state.
|
|
1633
|
+
*/
|
|
1634
|
+
injectedMessages?: ChatMessage$1[];
|
|
1627
1635
|
/** Placeholder text for the input */
|
|
1628
1636
|
placeholder?: string;
|
|
1629
1637
|
/** Welcome message shown when chat is empty */
|
|
@@ -1787,7 +1795,7 @@ interface AgentChatProps {
|
|
|
1787
1795
|
* />
|
|
1788
1796
|
* ```
|
|
1789
1797
|
*/
|
|
1790
|
-
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, hideAvatars, agentName, hideHeaderWhileEmpty, hideTypingIndicator, onInputChange, onInputControlReady, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
1798
|
+
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, hideAvatars, agentName, hideHeaderWhileEmpty, hideTypingIndicator, onInputChange, onInputControlReady, injectedMessages, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
1791
1799
|
|
|
1792
1800
|
/**
|
|
1793
1801
|
* Retry utility with exponential backoff
|
package/dist/chat/index.js
CHANGED
|
@@ -8630,7 +8630,8 @@ function AgentChat({
|
|
|
8630
8630
|
hideHeaderWhileEmpty = false,
|
|
8631
8631
|
hideTypingIndicator = false,
|
|
8632
8632
|
onInputChange,
|
|
8633
|
-
onInputControlReady
|
|
8633
|
+
onInputControlReady,
|
|
8634
|
+
injectedMessages
|
|
8634
8635
|
}) {
|
|
8635
8636
|
const {
|
|
8636
8637
|
messages,
|
|
@@ -8694,8 +8695,9 @@ function AgentChat({
|
|
|
8694
8695
|
},
|
|
8695
8696
|
[enableAttachments, attachments, sendMessage]
|
|
8696
8697
|
);
|
|
8698
|
+
const renderedMessages = injectedMessages && injectedMessages.length > 0 ? [...messages, ...injectedMessages].filter((m, i, arr) => arr.findIndex((x) => x.id === m.id) === i).sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime()) : messages;
|
|
8697
8699
|
const messageListProps = {
|
|
8698
|
-
messages,
|
|
8700
|
+
messages: renderedMessages,
|
|
8699
8701
|
welcomeMessage: hideHeader ? void 0 : welcomeMessage,
|
|
8700
8702
|
renderWelcome: hideHeader ? void 0 : renderWelcome,
|
|
8701
8703
|
isLoading,
|