@blade-hq/agent-react 2610.0.0-beta.33 → 2610.0.0-beta.35
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/components/ChatInput.d.ts +4 -1
- package/dist/components/ChatSurface.d.ts +8 -1
- package/dist/components/MessageList.d.ts +7 -1
- package/dist/components/display-utils.d.ts +2 -0
- package/dist/embed/entry.d.ts +5 -0
- package/dist/index.js +302 -178
- package/dist/index.js.map +1 -1
- package/dist/style.full.css +1 -1
- package/package.json +2 -2
- package/public-api.md +69 -1
|
@@ -3,16 +3,19 @@ interface Props {
|
|
|
3
3
|
value: string;
|
|
4
4
|
onValueChange: (value: string) => void;
|
|
5
5
|
onSend: (text: string) => boolean | Promise<boolean>;
|
|
6
|
+
/** Optional direct insertion path used while another response streams. */
|
|
7
|
+
onAppend?: (text: string) => void;
|
|
6
8
|
onStop: () => void;
|
|
7
9
|
isStreaming: boolean;
|
|
8
10
|
isStopping?: boolean;
|
|
9
11
|
placeholder?: string;
|
|
10
12
|
className?: string;
|
|
13
|
+
queueKey?: string;
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
16
|
* 轻量聊天输入框:textarea(Enter 发送 / Shift+Enter 换行)+ 发送/停止按钮。
|
|
14
17
|
* 不含第一方版本的富文本编辑、@ 补全、技能菜单、语音输入与模型选择。
|
|
15
18
|
* 内容受控,session.attach() / insertText() 通过 ChatView 注入到这里。
|
|
16
19
|
*/
|
|
17
|
-
export declare function ChatInput({ value, onValueChange, onSend, onStop, isStreaming, isStopping, placeholder, className, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function ChatInput({ value, onValueChange, onSend, onAppend, onStop, isStreaming, isStopping, placeholder, className, queueKey, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
18
21
|
export {};
|
|
@@ -45,6 +45,7 @@ interface ChatSurfaceProps extends ChatPresentationProps {
|
|
|
45
45
|
onInputChange: (value: string) => void;
|
|
46
46
|
onSuggestion?: (value: string) => void;
|
|
47
47
|
onSend: (text: string) => Promise<boolean>;
|
|
48
|
+
onAppend?: (text: string) => void;
|
|
48
49
|
onStop: () => void;
|
|
49
50
|
sessionStatus?: string;
|
|
50
51
|
askAnswers?: Record<string, AskUserAnswerData>;
|
|
@@ -59,6 +60,12 @@ interface ChatSurfaceProps extends ChatPresentationProps {
|
|
|
59
60
|
showPlanUpdates?: boolean;
|
|
60
61
|
/** 仅实时成功的 update_plan 递增;历史 hydration 不得改变。 */
|
|
61
62
|
planRevealRevision?: number;
|
|
63
|
+
historyPaging?: {
|
|
64
|
+
hasOlder: boolean;
|
|
65
|
+
loading: boolean;
|
|
66
|
+
/** Resolves true only when the paging cursor advanced. */
|
|
67
|
+
loadOlder: (beforeCommit?: () => void) => Promise<boolean>;
|
|
68
|
+
};
|
|
62
69
|
/** 连接状态条下方的横幅(回放模式条用)。不传时不渲染任何节点。 */
|
|
63
70
|
banner?: ReactNode;
|
|
64
71
|
}
|
|
@@ -68,5 +75,5 @@ interface ChatSurfaceProps extends ChatPresentationProps {
|
|
|
68
75
|
* 这里的 DOM 结构受 tests/chat-view-compat.test.tsx 的快照保护——接入方拿
|
|
69
76
|
* .blade-chat-* 类名写了自己的样式,结构一动他们的页面就歪。
|
|
70
77
|
*/
|
|
71
|
-
export declare function ChatSurface({ theme, classNames, renderers, slots, placeholder, connection, errorMessage, messages, postChatFollowup, isStreaming, isStopping, inputText, onInputChange, onSuggestion, onSend, onStop, sessionStatus, askAnswers, onAnswer, sessionId, isViewer, resultFeedbackByEntry, onResultFeedbackSaved, onFollowupInteraction, beforeInput, showPlanUpdates, planRevealRevision, banner, }: ChatSurfaceProps): import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
export declare function ChatSurface({ theme, classNames, renderers, slots, placeholder, connection, errorMessage, messages, postChatFollowup, isStreaming, isStopping, inputText, onInputChange, onSuggestion, onSend, onAppend, onStop, sessionStatus, askAnswers, onAnswer, sessionId, isViewer, resultFeedbackByEntry, onResultFeedbackSaved, onFollowupInteraction, beforeInput, showPlanUpdates, planRevealRevision, historyPaging, banner, }: ChatSurfaceProps): import("react/jsx-runtime").JSX.Element;
|
|
72
79
|
export {};
|
|
@@ -20,10 +20,16 @@ interface Props {
|
|
|
20
20
|
onFollowupInteraction?: (event: FollowupInteractionEvent) => void;
|
|
21
21
|
resultFeedbackByEntry?: ReadonlyMap<string, ResultFeedback>;
|
|
22
22
|
onResultFeedbackSaved?: (feedback: ResultFeedback) => void;
|
|
23
|
+
historyPaging?: {
|
|
24
|
+
hasOlder: boolean;
|
|
25
|
+
loading: boolean;
|
|
26
|
+
/** Resolves true only when the paging cursor advanced. */
|
|
27
|
+
loadOlder: (beforeCommit?: () => void) => Promise<boolean>;
|
|
28
|
+
};
|
|
23
29
|
}
|
|
24
30
|
/**
|
|
25
31
|
* 消息列表:use-stick-to-bottom 自动滚动 + 按轮次分组渲染。
|
|
26
32
|
* 相比第一方版本去掉了轮次导航栏、吸顶状态条与规划摘要卡片。
|
|
27
33
|
*/
|
|
28
|
-
export declare function MessageList({ messages, postChatFollowup, onSuggestion, isStreaming, sessionStatus, askAnswers, onAnswer, toolCallRenderer, hidePlanUpdateTools, emptyState, className, sessionId, isViewer, onFollowupInteraction, resultFeedbackByEntry, onResultFeedbackSaved, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare function MessageList({ messages, postChatFollowup, onSuggestion, isStreaming, sessionStatus, askAnswers, onAnswer, toolCallRenderer, hidePlanUpdateTools, emptyState, className, sessionId, isViewer, onFollowupInteraction, resultFeedbackByEntry, onResultFeedbackSaved, historyPaging, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
29
35
|
export {};
|
|
@@ -10,6 +10,8 @@ export declare function getSkillNameFromFilePath(filePath: string | null | undef
|
|
|
10
10
|
/** 归一化工具名:去掉命名空间前缀并映射到别名表(如 "fork:Agent" → "Agent")。 */
|
|
11
11
|
export declare function formatToolName(name: string): string;
|
|
12
12
|
export declare function extractToolFilePath(toolCall: ToolCallInfo): string | null;
|
|
13
|
+
/** 从文件类工具参数中提取全部可定位的文件路径(按出现顺序去重)。 */
|
|
14
|
+
export declare function extractToolFilePaths(toolCall: ToolCallInfo): string[];
|
|
13
15
|
/**
|
|
14
16
|
* 返回工具调用的中文展示标签:优先取参数里的 description,
|
|
15
17
|
* 其次取后端下发的 display_name / 系统工具中文名。
|
package/dist/embed/entry.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ declare const BladeAgent: {
|
|
|
27
27
|
SessionHub: typeof agentClient.SessionHub;
|
|
28
28
|
SessionSetupError: typeof agentClient.SessionSetupError;
|
|
29
29
|
createInitialSessionState: typeof agentClient.createInitialSessionState;
|
|
30
|
+
reconcileHistoricalUserTurns: typeof agentClient.reconcileHistoricalUserTurns;
|
|
30
31
|
reconcileOptimisticUserTurns: typeof agentClient.reconcileOptimisticUserTurns;
|
|
31
32
|
toReplaySnapshot: typeof agentClient.toReplaySnapshot;
|
|
32
33
|
connectEmbedded: typeof agentClient.connectEmbedded;
|
|
@@ -37,6 +38,7 @@ declare const BladeAgent: {
|
|
|
37
38
|
computerState: typeof agentClient.computerState;
|
|
38
39
|
sortComputers: typeof agentClient.sortComputers;
|
|
39
40
|
ModelsResource: typeof agentClient.ModelsResource;
|
|
41
|
+
hasChatRunEvent: typeof agentClient.hasChatRunEvent;
|
|
40
42
|
buildMessageContent: typeof agentClient.buildMessageContent;
|
|
41
43
|
chatErrorForDisplay: typeof agentClient.chatErrorForDisplay;
|
|
42
44
|
contentPreview: typeof agentClient.contentPreview;
|
|
@@ -53,6 +55,8 @@ declare const BladeAgent: {
|
|
|
53
55
|
getContextGroupDisplayState: typeof agentClient.getContextGroupDisplayState;
|
|
54
56
|
groupAdjacentContextRuns: typeof agentClient.groupAdjacentContextRuns;
|
|
55
57
|
latestPostChatFollowup: typeof agentClient.latestPostChatFollowup;
|
|
58
|
+
prependOlder: typeof agentClient.prependOlder;
|
|
59
|
+
replaceWindow: typeof agentClient.replaceWindow;
|
|
56
60
|
DEFAULT_REPLAY_SPEED: agentClient.ReplaySpeed;
|
|
57
61
|
SessionInfo: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
58
62
|
id: string;
|
|
@@ -100,6 +104,7 @@ declare const BladeAgent: {
|
|
|
100
104
|
}, {}>;
|
|
101
105
|
TaskStatus: import("arktype/internal/variants/string.ts").StringType<"done" | "failed" | "in_progress" | "pending" | "skipped", {}>;
|
|
102
106
|
acceptedPostChatFollowupCompletesLatestRun: typeof agentClient.acceptedPostChatFollowupCompletesLatestRun;
|
|
107
|
+
acknowledgeTurnEvents: typeof agentClient.acknowledgeTurnEvents;
|
|
103
108
|
ClientProjectionBuilder: typeof agentClient.ClientProjectionBuilder;
|
|
104
109
|
createSocket: typeof agentClient.createSocket;
|
|
105
110
|
getChat: typeof getChat;
|