@blade-hq/agent-react 2610.0.0-beta.25 → 2610.0.0-beta.27
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/README.md +1 -1
- package/dist/components/AskUserQuestionBlock.d.ts +9 -0
- package/dist/components/ToolCallBlock.d.ts +4 -2
- package/dist/index.js +264 -252
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/public-api.md +1 -0
package/README.md
CHANGED
|
@@ -156,7 +156,7 @@ await replay.exitToAutonomous() // 退出回放,之后真的运
|
|
|
156
156
|
|
|
157
157
|
全部 props 见 `ChatViewProps`。样式说明:
|
|
158
158
|
|
|
159
|
-
`ChatView`
|
|
159
|
+
`ChatView` 的普通展示模式不显示只供诊断的项目说明、可用能力和当前工作环境。需要自建诊断界面时,可直接使用独立的 `ContextCard`,属性见 `ContextCardProps`;状态到文案的映射来自 agent-client 的 `getContextDisplayState`,不需要接入方重复判断。底层数据类型为 `ContextProjectionData` / `ContextProjectionFields`,展示结果为 `ContextDisplayState`,并保留 `ContextAction`、`ContextSourceInfo` 和 `contextProjectionData` 给 headless 消费方。
|
|
160
160
|
|
|
161
161
|
`onFollowupInteraction` 使用 `FollowupInteractionEvent`,覆盖下一步建议展示/采纳、成果展示/打开/下载以及结果评分。SDK 不内置 PostHog 等分析厂商;宿主回调抛错也不会中断用户点击或下载。
|
|
162
162
|
文件成果以文件名为文本的标准下载链接展示;Vue / 纯 HTML 使用的 `<blade-chat>` 与 `ChatView` 行为一致。
|
|
@@ -28,4 +28,13 @@ interface Props {
|
|
|
28
28
|
export declare function AskUserQuestionBlock({ data, answered, toolCallId, sessionStatus, answerData, onAnswer, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
/** 解析 AskUserQuestion 的工具结果/参数,容错 LLM 把 questions 输出为字符串的情况。 */
|
|
30
30
|
export declare function parseAskUserQuestion(toolResult: string | null | undefined): AskUserQuestionData | null;
|
|
31
|
+
export interface AskUserQuestionError {
|
|
32
|
+
message: string;
|
|
33
|
+
detail: string | null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Keep this parser synchronized with apps/web/AskUserQuestionBlock.tsx.
|
|
37
|
+
* The built-in Web cannot import agent-react, and this is not a public SDK protocol API.
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseAskUserQuestionError(toolResult: string | null | undefined): AskUserQuestionError | null;
|
|
31
40
|
export {};
|
|
@@ -8,6 +8,7 @@ interface Props {
|
|
|
8
8
|
answered?: boolean;
|
|
9
9
|
answerData?: AskUserAnswerData;
|
|
10
10
|
sessionStatus?: string;
|
|
11
|
+
isActiveQuestion?: boolean;
|
|
11
12
|
renderer?: ToolCallRenderer;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
@@ -19,10 +20,11 @@ interface Props {
|
|
|
19
20
|
* 会同时把已经回答过的旧提问重新变成可作答(历史加载不会带回 answerData),
|
|
20
21
|
* 而且会盖住投影层的错误——这个 bug 就是这么藏住的。
|
|
21
22
|
*/
|
|
22
|
-
export declare function resolveAskQuestionState({ toolStatus, hasAnswerData, fallbackAnswered, }: {
|
|
23
|
+
export declare function resolveAskQuestionState({ toolStatus, hasAnswerData, fallbackAnswered, fallbackAwaiting, }: {
|
|
23
24
|
toolStatus: ToolCallInfo["status"];
|
|
24
25
|
hasAnswerData: boolean;
|
|
25
26
|
fallbackAnswered?: boolean;
|
|
27
|
+
fallbackAwaiting?: boolean;
|
|
26
28
|
}): {
|
|
27
29
|
awaitingAnswer: boolean;
|
|
28
30
|
answered: boolean;
|
|
@@ -31,5 +33,5 @@ export declare function resolveAskQuestionState({ toolStatus, hasAnswerData, fal
|
|
|
31
33
|
* 极简工具调用块:状态 + 展示名一行,点开后是参数/结果的 <pre> 折叠展示。
|
|
32
34
|
* AskUserQuestion 特殊处理为提问选项卡片。
|
|
33
35
|
*/
|
|
34
|
-
export declare function ToolCallBlock({ toolCall, onAnswer, answered, answerData, sessionStatus, renderer, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare function ToolCallBlock({ toolCall, onAnswer, answered, answerData, sessionStatus, isActiveQuestion, renderer, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
35
37
|
export {};
|