@meetsmore-oss/use-ai-client 1.10.0 → 1.12.0
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/bundled.js +4822 -4605
- package/dist/bundled.js.map +1 -1
- package/dist/index.d.ts +36 -4
- package/dist/index.js +454 -199
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export { z } from 'zod';
|
|
3
|
-
import { ToolAnnotations, ToolDefinition, WorkflowStatus, MultimodalContent, UseAIForwardedProps, AGUIEvent, Message as Message$1, AgentInfo, UseAIClientMessage, FeedbackValue, ToolApprovalRequestEvent } from '@meetsmore-oss/use-ai-core';
|
|
3
|
+
import { ToolAnnotations, ToolDefinition, WorkflowStatus, MultimodalContent, UseAIForwardedProps, AGUIEvent, ReasoningPart, Message as Message$1, AgentInfo, UseAIClientMessage, FeedbackValue, ToolApprovalRequestEvent } from '@meetsmore-oss/use-ai-core';
|
|
4
4
|
export { AgentInfo, ToolAnnotations, ToolDefinition } from '@meetsmore-oss/use-ai-core';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import React$1, { MutableRefObject, RefObject, ReactNode } from 'react';
|
|
@@ -371,6 +371,8 @@ declare class UseAIClient {
|
|
|
371
371
|
private _currentAssistantToolCalls;
|
|
372
372
|
private _pendingToolResults;
|
|
373
373
|
private currentToolCalls;
|
|
374
|
+
private _currentReasoningBlocks;
|
|
375
|
+
private _currentReasoningBlockText;
|
|
374
376
|
private _langfuseEnabled;
|
|
375
377
|
private langfuseConfigHandlers;
|
|
376
378
|
/**
|
|
@@ -466,6 +468,10 @@ declare class UseAIClient {
|
|
|
466
468
|
* Gets the current accumulated message content (useful during streaming).
|
|
467
469
|
*/
|
|
468
470
|
get currentMessageContent(): string;
|
|
471
|
+
/**
|
|
472
|
+
* Gets the current reasoning blocks collected during the current run.
|
|
473
|
+
*/
|
|
474
|
+
get currentReasoningBlocks(): ReasoningPart[];
|
|
469
475
|
/**
|
|
470
476
|
* Gets the current thread ID for this session.
|
|
471
477
|
* Generates a new one if not set.
|
|
@@ -758,6 +764,13 @@ interface PersistedToolCall {
|
|
|
758
764
|
/** JSON-serialized arguments */
|
|
759
765
|
arguments: string;
|
|
760
766
|
};
|
|
767
|
+
/**
|
|
768
|
+
* Encrypted reasoning context for multi-turn preservation.
|
|
769
|
+
* JSON-serialized provider metadata (e.g., Gemini's thoughtSignature).
|
|
770
|
+
* Required for Gemini models where thoughtSignature must be sent back
|
|
771
|
+
* on both tool-call and tool-result parts in subsequent turns.
|
|
772
|
+
*/
|
|
773
|
+
encryptedValue?: string;
|
|
761
774
|
}
|
|
762
775
|
interface PersistedMessage {
|
|
763
776
|
id: string;
|
|
@@ -777,6 +790,11 @@ interface PersistedMessage {
|
|
|
777
790
|
* @example "toolu_01abc123"
|
|
778
791
|
*/
|
|
779
792
|
toolCallId?: string;
|
|
793
|
+
/**
|
|
794
|
+
* Reasoning parts from extended thinking (only for assistant messages).
|
|
795
|
+
* Contains reasoning text and optional encrypted value for state continuity.
|
|
796
|
+
*/
|
|
797
|
+
reasoningParts?: ReasoningPart[];
|
|
780
798
|
}
|
|
781
799
|
/**
|
|
782
800
|
* Represents a stored chat conversation.
|
|
@@ -1132,6 +1150,12 @@ declare const defaultStrings: {
|
|
|
1132
1150
|
/** Error for unknown/unexpected errors */
|
|
1133
1151
|
UNKNOWN_ERROR: string;
|
|
1134
1152
|
};
|
|
1153
|
+
thinking: {
|
|
1154
|
+
/** Label shown while thinking is in progress */
|
|
1155
|
+
inProgress: string;
|
|
1156
|
+
/** Label shown when thinking is complete */
|
|
1157
|
+
complete: string;
|
|
1158
|
+
};
|
|
1135
1159
|
toolExecution: {
|
|
1136
1160
|
/** Fallback messages when no tool title is provided (one randomly selected) */
|
|
1137
1161
|
fallbackMessages: string[];
|
|
@@ -1378,6 +1402,10 @@ interface ChatPanelProps {
|
|
|
1378
1402
|
loading: boolean;
|
|
1379
1403
|
/** Whether the client is connected to the server */
|
|
1380
1404
|
connected: boolean;
|
|
1405
|
+
/** Optional currently streaming text from assistant */
|
|
1406
|
+
streamingText?: string;
|
|
1407
|
+
/** Optional currently streaming reasoning text from extended thinking */
|
|
1408
|
+
streamingReasoning?: string;
|
|
1381
1409
|
/** Optional array of suggestion strings to display when chat is empty */
|
|
1382
1410
|
suggestions?: string[];
|
|
1383
1411
|
/** List of available agents from the server */
|
|
@@ -1571,6 +1599,8 @@ interface UseAIChatPanelProps {
|
|
|
1571
1599
|
connected: boolean;
|
|
1572
1600
|
/** Currently streaming text from assistant (real-time updates) */
|
|
1573
1601
|
streamingText?: string;
|
|
1602
|
+
/** Currently streaming reasoning text from extended thinking */
|
|
1603
|
+
streamingReasoning?: string;
|
|
1574
1604
|
currentChatId?: string | null;
|
|
1575
1605
|
onNewChat?: () => Promise<string | void>;
|
|
1576
1606
|
onLoadChat?: (chatId: string) => Promise<void>;
|
|
@@ -1616,7 +1646,7 @@ interface UseAIChatPanelProps {
|
|
|
1616
1646
|
* Chat panel content - fills its container.
|
|
1617
1647
|
* Use directly for embedded mode, or wrap with UseAIFloatingChatWrapper for floating mode.
|
|
1618
1648
|
*/
|
|
1619
|
-
declare function UseAIChatPanel({ onSendMessage, messages, loading, connected, streamingText, currentChatId, onNewChat, onLoadChat, onDeleteChat, onListChats, onGetChat, suggestions, availableAgents, defaultAgent, selectedAgent, onAgentChange, fileUploadConfig, fileProcessing, commands, onSaveCommand, onRenameCommand, onDeleteCommand, closeButton, executingTool, feedbackEnabled, onFeedback, pendingApprovals, onApproveToolCall, onRejectToolCall, }: UseAIChatPanelProps): react_jsx_runtime.JSX.Element;
|
|
1649
|
+
declare function UseAIChatPanel({ onSendMessage, messages, loading, connected, streamingText, streamingReasoning, currentChatId, onNewChat, onLoadChat, onDeleteChat, onListChats, onGetChat, suggestions, availableAgents, defaultAgent, selectedAgent, onAgentChange, fileUploadConfig, fileProcessing, commands, onSaveCommand, onRenameCommand, onDeleteCommand, closeButton, executingTool, feedbackEnabled, onFeedback, pendingApprovals, onApproveToolCall, onRejectToolCall, }: UseAIChatPanelProps): react_jsx_runtime.JSX.Element;
|
|
1620
1650
|
|
|
1621
1651
|
/**
|
|
1622
1652
|
* Props for the floating chat wrapper.
|
|
@@ -2103,7 +2133,7 @@ interface UseChatManagementReturn {
|
|
|
2103
2133
|
* the turn are persisted before the final assistant message, preserving the
|
|
2104
2134
|
* complete tool call context for conversation history.
|
|
2105
2135
|
*/
|
|
2106
|
-
saveAIResponse: (content: string, displayMode?: 'default' | 'error', traceId?: string, turnMessages?: PersistedMessage[]) => Promise<void>;
|
|
2136
|
+
saveAIResponse: (content: string, displayMode?: 'default' | 'error', traceId?: string, turnMessages?: PersistedMessage[], reasoningParts?: ReasoningPart[]) => Promise<void>;
|
|
2107
2137
|
/** Reloads messages from storage for the given chat ID */
|
|
2108
2138
|
reloadMessages: (chatId: string) => Promise<void>;
|
|
2109
2139
|
/** Get the current chat object. Metadata is frozen to prevent accidental mutation. */
|
|
@@ -2265,7 +2295,7 @@ interface UseServerEventsOptions {
|
|
|
2265
2295
|
/** Tool system for executing tools and looking up tool metadata */
|
|
2266
2296
|
toolSystem: UseToolSystemReturn;
|
|
2267
2297
|
/** Saves an AI response to chat storage */
|
|
2268
|
-
saveAIResponse: (content: string, displayMode?: 'default' | 'error', traceId?: string, turnMessages?: PersistedMessage[]) => Promise<void>;
|
|
2298
|
+
saveAIResponse: (content: string, displayMode?: 'default' | 'error', traceId?: string, turnMessages?: PersistedMessage[], reasoningParts?: ReasoningPart[]) => Promise<void>;
|
|
2269
2299
|
/** UI strings for error messages and tool execution fallbacks */
|
|
2270
2300
|
strings: UseAIStrings;
|
|
2271
2301
|
}
|
|
@@ -2285,6 +2315,8 @@ interface UseServerEventsReturn {
|
|
|
2285
2315
|
executingTool: ExecutingToolDisplay | null;
|
|
2286
2316
|
/** Ref tracking which chat the current streaming text belongs to */
|
|
2287
2317
|
streamingChatIdRef: React.MutableRefObject<string | null>;
|
|
2318
|
+
/** Current streaming reasoning text from extended thinking */
|
|
2319
|
+
streamingReasoning: string;
|
|
2288
2320
|
/**
|
|
2289
2321
|
* Handles a server event. Called from the provider's client subscription.
|
|
2290
2322
|
* Takes the client instance so it can access client-internal state
|