@cadraos/sdk 0.3.11 → 0.3.12

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.
@@ -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
@@ -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
@@ -8587,7 +8587,8 @@ function AgentChat({
8587
8587
  hideHeaderWhileEmpty = false,
8588
8588
  hideTypingIndicator = false,
8589
8589
  onInputChange,
8590
- onInputControlReady
8590
+ onInputControlReady,
8591
+ injectedMessages
8591
8592
  }) {
8592
8593
  const {
8593
8594
  messages,
@@ -8651,8 +8652,9 @@ function AgentChat({
8651
8652
  },
8652
8653
  [enableAttachments, attachments, sendMessage]
8653
8654
  );
8655
+ 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;
8654
8656
  const messageListProps = {
8655
- messages,
8657
+ messages: renderedMessages,
8656
8658
  welcomeMessage: hideHeader ? void 0 : welcomeMessage,
8657
8659
  renderWelcome: hideHeader ? void 0 : renderWelcome,
8658
8660
  isLoading,