@huyooo/ai-chat-frontend-react 0.2.40 → 0.2.41
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/index.d.ts +14 -20
- package/dist/index.js +1 -1
- package/package.json +7 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as _huyooo_ai_chat_types from '@huyooo/ai-chat-types';
|
|
1
2
|
import { SkillRecord } from '@huyooo/ai-chat-types';
|
|
2
3
|
export { ChatAdapter, ChatEvent, ChatEventType, ChatMode, ChatOptions, MessageRecord, ModelOption, ProviderType, SessionRecord, ThinkingMode } from '@huyooo/ai-chat-types';
|
|
3
4
|
import { ChatMode as ChatMode$1, ThinkingMode, ModelOption as ModelOption$1, SessionRecord as SessionRecord$1, ChatAdapter, AutoRunConfig } from '@huyooo/ai-chat-bridge-electron/renderer';
|
|
@@ -60,13 +61,6 @@ interface SaveMessageOptions {
|
|
|
60
61
|
operationIds?: string;
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
/**
|
|
64
|
-
* AI Chat 前端类型定义
|
|
65
|
-
* 核心类型从 bridge-electron 导出,保持类型一致性
|
|
66
|
-
*
|
|
67
|
-
* 架构:消息内容使用 ContentPart 数组,支持流式渲染和自定义 UI
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
64
|
type ChatMode = ChatMode$1;
|
|
71
65
|
type SessionRecord = SessionRecord$1;
|
|
72
66
|
type ModelOption = ModelOption$1;
|
|
@@ -113,6 +107,10 @@ interface ToolCallPart$1 {
|
|
|
113
107
|
stdout?: string;
|
|
114
108
|
stderr?: string;
|
|
115
109
|
};
|
|
110
|
+
/** 错误信息(status 为 error 时) */
|
|
111
|
+
error?: string;
|
|
112
|
+
/** 结构化错误(便于展示建议、重试按钮) */
|
|
113
|
+
toolError?: _huyooo_ai_chat_types.ToolErrorShape;
|
|
116
114
|
}
|
|
117
115
|
/** 图片 Part */
|
|
118
116
|
interface ImagePart$1 {
|
|
@@ -132,7 +130,7 @@ interface PlanStepItem {
|
|
|
132
130
|
title: string;
|
|
133
131
|
status: 'pending' | 'in_progress' | 'done' | 'failed';
|
|
134
132
|
}
|
|
135
|
-
/** 计划进度 Part(由 update_plan 工具的
|
|
133
|
+
/** 计划进度 Part(由 update_plan 工具的 ui: { type: 'render', name: 'plan' } 生成) */
|
|
136
134
|
interface PlanPart {
|
|
137
135
|
type: 'plan';
|
|
138
136
|
steps: PlanStepItem[];
|
|
@@ -238,22 +236,18 @@ interface ChatInputOptions {
|
|
|
238
236
|
* - ContentPart 数组存储消息内容,支持流式渲染和自定义 UI
|
|
239
237
|
*/
|
|
240
238
|
|
|
241
|
-
/**
|
|
242
|
-
interface
|
|
243
|
-
type:
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
message?: string;
|
|
239
|
+
/** 工具 UI 声明 */
|
|
240
|
+
interface ToolUIShape {
|
|
241
|
+
type: 'render' | 'action';
|
|
242
|
+
name: string;
|
|
243
|
+
props?: Record<string, unknown>;
|
|
247
244
|
}
|
|
248
245
|
/** 工具完成事件数据 */
|
|
249
246
|
interface ToolCompleteEvent {
|
|
250
247
|
name: string;
|
|
251
248
|
result: unknown;
|
|
252
|
-
/**
|
|
253
|
-
|
|
254
|
-
* 前端可根据此字段处理通知、刷新文件列表等
|
|
255
|
-
*/
|
|
256
|
-
sideEffects?: SideEffect[];
|
|
249
|
+
/** 工具声明的 UI(render 或 action) */
|
|
250
|
+
ui?: ToolUIShape;
|
|
257
251
|
}
|
|
258
252
|
interface UseChatOptions {
|
|
259
253
|
adapter: ChatAdapter;
|
|
@@ -675,4 +669,4 @@ interface ToastProps {
|
|
|
675
669
|
}
|
|
676
670
|
declare const Toast: FC<ToastProps>;
|
|
677
671
|
|
|
678
|
-
export { ChatHeader, ChatInput, type ChatInputContextValue, type ChatInputOptions, ChatInputProvider, type ChatMessage, ChatPanel, type ChatPanelHandle, ConfirmDialog, type ContentPart, type ContentPartType, type CreateSessionOptions, type ErrorDetails, type ErrorPart$1 as ErrorPart, ErrorPart as ErrorPartComponent, type ImageData, type ImagePart$1 as ImagePart, ImagePart as ImagePartComponent, MessageBubble, type PartRendererProps, type PartRenderers$1 as PartRenderers, PartRenderersContext, PartRenderersProvider, PartsRenderer, type SaveMessageOptions, type SearchPart$1 as SearchPart, SearchPart as SearchPartComponent, type SearchResult, type SendMessageOptions, type
|
|
672
|
+
export { ChatHeader, ChatInput, type ChatInputContextValue, type ChatInputOptions, ChatInputProvider, type ChatMessage, ChatPanel, type ChatPanelHandle, ConfirmDialog, type ContentPart, type ContentPartType, type CreateSessionOptions, type ErrorDetails, type ErrorPart$1 as ErrorPart, ErrorPart as ErrorPartComponent, type ImageData, type ImagePart$1 as ImagePart, ImagePart as ImagePartComponent, MessageBubble, type PartRendererProps, type PartRenderers$1 as PartRenderers, PartRenderersContext, PartRenderersProvider, PartsRenderer, type SaveMessageOptions, type SearchPart$1 as SearchPart, SearchPart as SearchPartComponent, type SearchResult, type SendMessageOptions, type TextPart$1 as TextPart, TextPart as TextPartComponent, type ThinkingData, type ThinkingPart$1 as ThinkingPart, ThinkingPart as ThinkingPartComponent, Toast, type ToolCallData, type ToolCallPart$1 as ToolCallPart, ToolCallPart as ToolCallPartComponent, type ToolCompleteEvent, type ToolResultData, type ToolUIShape, type UpdateSessionOptions, type UseChatOptions, type WelcomeConfig, type WelcomeFeature, WelcomeMessage, type WelcomeTask, defaultWelcomeConfig, getMessageText, useChat, useChatInputContext };
|