@blade-hq/agent-react 2612.0.0-beta.113 → 2612.0.0-beta.114
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/chat/AskUserQuestionBlock.d.ts +3 -2
- package/dist/chat/AssistantTurnBlock.d.ts +2 -1
- package/dist/chat/MessageList.d.ts +2 -2
- package/dist/chat/ToolCallBlock.d.ts +6 -11
- package/dist/chat/customization.d.ts +4 -3
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/runtime/actions.d.ts +1 -4
- package/dist/chat/runtime/environment.d.ts +2 -2
- package/dist/{chunk-XLG3BTUA.js → chunk-7UQ3RWAU.js} +3 -3
- package/dist/{chunk-AZVPNN6K.js → chunk-AMWLYUD7.js} +1 -1
- package/dist/{chunk-AZVPNN6K.js.map → chunk-AMWLYUD7.js.map} +1 -1
- package/dist/{chunk-VYTLF6JE.js → chunk-C3G6F7UG.js} +3 -3
- package/dist/{chunk-5XLLPGSU.js → chunk-GZWQVVE7.js} +50 -48
- package/dist/chunk-GZWQVVE7.js.map +1 -0
- package/dist/{chunk-M6SNZHK3.js → chunk-HV3NKRZ2.js} +4 -6
- package/dist/chunk-HV3NKRZ2.js.map +1 -0
- package/dist/{chunk-5JDQG2JJ.js → chunk-XRNHTA7C.js} +2 -2
- package/dist/components/ChatInput.d.ts +2 -1
- package/dist/index.js +5 -5
- package/dist/internal.js +6 -6
- package/dist/questions.js +2 -2
- package/dist/rich-input.js +5 -4
- package/dist/rich-input.js.map +1 -1
- package/dist/tool-details.js +3 -3
- package/package.json +2 -2
- package/dist/chunk-5XLLPGSU.js.map +0 -1
- package/dist/chunk-M6SNZHK3.js.map +0 -1
- /package/dist/{chunk-XLG3BTUA.js.map → chunk-7UQ3RWAU.js.map} +0 -0
- /package/dist/{chunk-VYTLF6JE.js.map → chunk-C3G6F7UG.js.map} +0 -0
- /package/dist/{chunk-5JDQG2JJ.js.map → chunk-XRNHTA7C.js.map} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AskUserAnswerData, AskUserQuestionData } from "@blade-hq/agent-client";
|
|
2
2
|
export { parseAskUserQuestion } from "@blade-hq/agent-client";
|
|
3
3
|
export type { AskUserAnswerData, AskUserQuestionData };
|
|
4
|
+
export type AskUserAnswerHandler = ((answer: string, toolCallId: string, answerData: AskUserAnswerData, signal?: AbortSignal) => boolean | undefined | Promise<boolean | undefined>) | ((answer: string, toolCallId: string, answerData: AskUserAnswerData, signal?: AbortSignal) => void);
|
|
4
5
|
interface Props {
|
|
5
6
|
data: AskUserQuestionData;
|
|
6
7
|
answered: boolean;
|
|
@@ -8,9 +9,9 @@ interface Props {
|
|
|
8
9
|
toolCallId: string;
|
|
9
10
|
sessionStatus: string;
|
|
10
11
|
answerData?: AskUserAnswerData | undefined;
|
|
11
|
-
onAnswer?:
|
|
12
|
+
onAnswer?: AskUserAnswerHandler;
|
|
12
13
|
}
|
|
13
|
-
export declare function AskUserQuestionBlock(
|
|
14
|
+
export declare function AskUserQuestionBlock(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export interface AskUserQuestionError {
|
|
15
16
|
message: string;
|
|
16
17
|
detail: string | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AskUserAnswerHandler } from "./AskUserQuestionBlock";
|
|
1
2
|
import type { ChatMessage, MemoryRefInfo } from "@blade-hq/agent-client/internal";
|
|
2
3
|
import type { AskUserAnswerData } from "./AskUserQuestionBlock";
|
|
3
4
|
import { type ChatViewCustomization } from "./customization";
|
|
@@ -10,7 +11,7 @@ interface Props {
|
|
|
10
11
|
isReasoningRevealing?: boolean;
|
|
11
12
|
isLastTurn?: boolean;
|
|
12
13
|
askAnswers?: Record<string, AskUserAnswerData>;
|
|
13
|
-
onAnswer?:
|
|
14
|
+
onAnswer?: AskUserAnswerHandler;
|
|
14
15
|
sessionStatus?: string;
|
|
15
16
|
level?: 1 | 2;
|
|
16
17
|
forceExpanded?: boolean;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import type { AskUserAnswerHandler } from "./AskUserQuestionBlock";
|
|
1
2
|
import { type ReactNode } from "react";
|
|
2
3
|
import type { ChatMessage } from "@blade-hq/agent-client/internal";
|
|
3
4
|
import type { PostChatFollowup } from "@blade-hq/agent-client/internal";
|
|
4
5
|
import type { ResultFeedback } from "@blade-hq/agent-client/internal";
|
|
5
|
-
import type { AskUserAnswerData } from "./AskUserQuestionBlock";
|
|
6
6
|
import type { ChatViewCustomization } from "./customization";
|
|
7
7
|
export { shouldAppendPendingAssistantTurn } from "./message-list-blocks";
|
|
8
8
|
export declare function isReasoningRevealingForMessage(message: ChatMessage | undefined, isRevealing: boolean, isStopping?: boolean): boolean;
|
|
9
9
|
export interface MessageListProps {
|
|
10
10
|
sessionId: string;
|
|
11
11
|
messages: ChatMessage[];
|
|
12
|
-
onAnswer?:
|
|
12
|
+
onAnswer?: AskUserAnswerHandler;
|
|
13
13
|
sessionStatus?: string;
|
|
14
14
|
onConfirmPlan?: (action: "execute" | "revise", text?: string) => void;
|
|
15
15
|
customization?: ChatViewCustomization;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AskUserAnswerHandler } from "./AskUserQuestionBlock";
|
|
1
2
|
import type { ToolCallInfo } from "@blade-hq/agent-client/internal";
|
|
2
3
|
import type { ContentBlock } from "@blade-hq/agent-client/internal";
|
|
3
4
|
import { type AskUserAnswerData } from "./AskUserQuestionBlock";
|
|
@@ -10,11 +11,12 @@ export declare function ToolFilePreviewAction({ toolCall, sessionId, className,
|
|
|
10
11
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
11
12
|
interface Props {
|
|
12
13
|
toolCall: ToolCallInfo;
|
|
13
|
-
onAnswer?:
|
|
14
|
+
onAnswer?: AskUserAnswerHandler;
|
|
14
15
|
answered?: boolean;
|
|
15
16
|
answerData?: AskUserAnswerData;
|
|
16
17
|
sessionId?: string;
|
|
17
18
|
sessionStatus?: string;
|
|
19
|
+
/** @deprecated 可答状态由 toolCall.status 提供。 */
|
|
18
20
|
isActiveQuestion?: boolean;
|
|
19
21
|
level?: 1 | 2;
|
|
20
22
|
turnBlocks?: ContentBlock[];
|
|
@@ -27,22 +29,15 @@ export declare function ToolPreviewAction({ toolCall, sessionId: providedSession
|
|
|
27
29
|
turnBlocks?: ContentBlock[];
|
|
28
30
|
className?: string;
|
|
29
31
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
30
|
-
|
|
31
|
-
* 只认工具状态。改这里必须同步 packages/agent-react/src/components/ToolCallBlock.tsx
|
|
32
|
-
* 的同名函数,否则同一份会话在内置页面能点、在 SDK 里点不动。
|
|
33
|
-
*
|
|
34
|
-
* 不要再拿 sessionStatus 兜底。历史投影算错时用 waiting_for_input 补救,
|
|
35
|
-
* 会同时把已经回答过的旧提问重新变成可作答(历史加载不会带回 answerData),
|
|
36
|
-
* 而且会盖住投影层的错误——PR #1597 的 bug 就是这么藏住的。
|
|
37
|
-
*/
|
|
38
|
-
export declare function resolveAskQuestionState({ toolStatus, hasAnswerData, fallbackAnswered, fallbackAwaiting, }: {
|
|
32
|
+
export declare function resolveAskQuestionState({ toolStatus, hasAnswerData, fallbackAnswered, }: {
|
|
39
33
|
toolStatus: ToolCallInfo["status"];
|
|
40
34
|
hasAnswerData: boolean;
|
|
41
35
|
fallbackAnswered?: boolean;
|
|
36
|
+
/** @deprecated 可答状态由 toolStatus 提供。 */
|
|
42
37
|
fallbackAwaiting?: boolean;
|
|
43
38
|
}): {
|
|
44
39
|
awaitingAnswer: boolean;
|
|
45
40
|
answered: boolean;
|
|
46
41
|
};
|
|
47
|
-
export declare function ToolCallBlock({ toolCall, onAnswer, answered, answerData, sessionId: providedSessionId, sessionStatus,
|
|
42
|
+
export declare function ToolCallBlock({ toolCall, onAnswer, answered, answerData, sessionId: providedSessionId, sessionStatus, level, turnBlocks, reasoning, customization, }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
48
43
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AskUserAnswerHandler } from "./AskUserQuestionBlock";
|
|
1
2
|
import { type ComponentType, type ReactNode } from "react";
|
|
2
3
|
import type { ChatMessage, MessageContent, ToolCallInfo } from "@blade-hq/agent-client/internal";
|
|
3
4
|
import type { ContentBlock } from "@blade-hq/agent-client/internal";
|
|
@@ -116,7 +117,7 @@ export interface AskUserQuestionRendererProps {
|
|
|
116
117
|
toolCallId: string;
|
|
117
118
|
sessionStatus: string;
|
|
118
119
|
answerData?: AskUserAnswerData;
|
|
119
|
-
onAnswer?:
|
|
120
|
+
onAnswer?: AskUserAnswerHandler;
|
|
120
121
|
}
|
|
121
122
|
/** 计划面板渲染器:`plan` 是最近一次成功的 update_plan 解析结果。 */
|
|
122
123
|
export interface PlanUpdateRendererProps {
|
|
@@ -155,7 +156,7 @@ export interface AssistantTurnComponentProps {
|
|
|
155
156
|
isReasoningRevealing?: boolean;
|
|
156
157
|
isLastTurn?: boolean;
|
|
157
158
|
askAnswers?: Record<string, AskUserAnswerData>;
|
|
158
|
-
onAnswer?:
|
|
159
|
+
onAnswer?: AskUserAnswerHandler;
|
|
159
160
|
sessionStatus?: string;
|
|
160
161
|
level?: 1 | 2;
|
|
161
162
|
forceExpanded?: boolean;
|
|
@@ -163,7 +164,7 @@ export interface AssistantTurnComponentProps {
|
|
|
163
164
|
}
|
|
164
165
|
export interface ToolCallComponentProps {
|
|
165
166
|
toolCall: ToolCallInfo;
|
|
166
|
-
onAnswer?:
|
|
167
|
+
onAnswer?: AskUserAnswerHandler;
|
|
167
168
|
answered?: boolean;
|
|
168
169
|
answerData?: AskUserAnswerData;
|
|
169
170
|
sessionId?: string;
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { AgentLoopBlock } from "./AgentLoopBlock";
|
|
2
2
|
export { AskUserQuestionBlock, parseAskUserQuestion, parseAskUserQuestionError } from "./AskUserQuestionBlock";
|
|
3
|
-
export type { AskUserQuestionData, AskUserQuestionError, AskUserAnswerData } from "./AskUserQuestionBlock";
|
|
3
|
+
export type { AskUserAnswerHandler, AskUserQuestionData, AskUserQuestionError, AskUserAnswerData } from "./AskUserQuestionBlock";
|
|
4
4
|
export { defaultTurnDisplayMode, resolveTurnDisplayMode, formatExecutionDuration, getExecutionDurationMs, AssistantTurnBlock, collectMemoryRefs, MemoryRefsHint } from "./AssistantTurnBlock";
|
|
5
5
|
export type { TurnDisplayMode } from "./AssistantTurnBlock";
|
|
6
6
|
export { AttachmentPreviewDialog } from "./AttachmentPreviewDialog";
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type AgentSession, type InputKind, type MessageContent, type SendOptions, type SessionState } from "@blade-hq/agent-client/internal";
|
|
2
|
-
/**
|
|
3
|
-
* 等待回答时直接在输入框里打字:把这段文字当作最近一个子回路 AskUserQuestion 的自由作答,
|
|
4
|
-
* 服务端据此恢复运行,而不是另起一轮。
|
|
5
|
-
*/
|
|
2
|
+
/** @deprecated 请通过卡片发送显式回答。 */
|
|
6
3
|
export declare function buildPendingAskUserAnswer(state: SessionState, message: MessageContent): Record<string, unknown> | undefined;
|
|
7
4
|
/** 发送附加项(模型、推理档位、知识库等由富输入给出)。 */
|
|
8
5
|
export interface ChatSendExtras {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AskUserAnswerHandler } from "../AskUserQuestionBlock";
|
|
1
2
|
/**
|
|
2
3
|
* 聊天环境(第一方内部):内置 Web 需要、`<blade-chat>` 不需要的能力。每一项都可选,
|
|
3
4
|
* 缺省时走轻量实现——重依赖(虚拟列表、代码高亮、mermaid、streamdown、富输入)因此只在
|
|
@@ -7,7 +8,6 @@
|
|
|
7
8
|
*/
|
|
8
9
|
import type { PostChatFollowup, ResultFeedback, SessionInfo, ToolCallInfo, ToolUiCard, TurnProjection } from "@blade-hq/agent-client/internal";
|
|
9
10
|
import type { PlanAgentActions } from "../plan/presentation";
|
|
10
|
-
import type { AskUserAnswerData } from "../AskUserQuestionBlock";
|
|
11
11
|
import type { ComposerProps } from "../customization";
|
|
12
12
|
import { type ComponentPropsWithoutRef, type ComponentType, type ReactNode } from "react";
|
|
13
13
|
import type { CodeBlockOverrides } from "../../components/markdown";
|
|
@@ -53,7 +53,7 @@ export interface DeveloperMessageListProps {
|
|
|
53
53
|
postChatFollowup?: PostChatFollowup | null;
|
|
54
54
|
resultFeedbackByEntry?: ReadonlyMap<string, ResultFeedback>;
|
|
55
55
|
onResultFeedbackSaved?: (feedback: ResultFeedback) => void;
|
|
56
|
-
onAnswer?:
|
|
56
|
+
onAnswer?: AskUserAnswerHandler;
|
|
57
57
|
onLoadOlder?: (beforeCommit?: () => void) => Promise<boolean>;
|
|
58
58
|
isLoadingOlder?: boolean;
|
|
59
59
|
historyLoadRevision?: number;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MarkdownContent
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XRNHTA7C.js";
|
|
4
4
|
import {
|
|
5
5
|
cn,
|
|
6
6
|
extractToolFilePath,
|
|
7
7
|
formatToolFileName,
|
|
8
8
|
formatToolName,
|
|
9
9
|
useHighlightedCode
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AMWLYUD7.js";
|
|
11
11
|
import {
|
|
12
12
|
useBladeClient,
|
|
13
13
|
useOptionalBladeClient
|
|
@@ -1401,4 +1401,4 @@ export {
|
|
|
1401
1401
|
SubmitResultRenderer,
|
|
1402
1402
|
getRenderer
|
|
1403
1403
|
};
|
|
1404
|
-
//# sourceMappingURL=chunk-
|
|
1404
|
+
//# sourceMappingURL=chunk-7UQ3RWAU.js.map
|