@blade-hq/agent-react 2612.0.0-beta.112 → 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/{McpAppCard-PGME4ZPA.js → McpAppCard-NJEKKEEN.js} +2 -2
- package/dist/{McpAppFrame-YKQ7ZZX6.js → McpAppFrame-IQK5AOMD.js} +2 -2
- package/dist/chat/AskUserQuestionBlock.d.ts +3 -2
- package/dist/chat/AssistantTurnBlock.d.ts +3 -2
- package/dist/chat/AttachmentPreviewDialog.d.ts +1 -6
- package/dist/chat/ChatLoadingIndicator.d.ts +2 -1
- package/dist/chat/MessageList.d.ts +2 -2
- package/dist/chat/ToolCallBlock.d.ts +6 -11
- package/dist/chat/chat-run.d.ts +4 -0
- package/dist/chat/customization.d.ts +4 -3
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/message-list-blocks.d.ts +1 -0
- package/dist/chat/runtime/actions.d.ts +1 -4
- package/dist/chat/runtime/environment.d.ts +2 -2
- package/dist/{chunk-SWYLHUQM.js → chunk-4WFRH7FG.js} +27 -7
- package/dist/{chunk-SWYLHUQM.js.map → chunk-4WFRH7FG.js.map} +1 -1
- package/dist/{chunk-VON7UU2E.js → chunk-7UQ3RWAU.js} +4 -4
- 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-AOM334QU.js → chunk-C3G6F7UG.js} +9 -10
- package/dist/chunk-C3G6F7UG.js.map +1 -0
- package/dist/{chunk-B27HARE3.js → chunk-GZWQVVE7.js} +125 -77
- package/dist/chunk-GZWQVVE7.js.map +1 -0
- package/dist/{chunk-7TYNY2AX.js → chunk-HV3NKRZ2.js} +14 -13
- 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/components/McpAppFrame.d.ts +2 -0
- package/dist/components/use-session-plugin-activation.d.ts +3 -1
- package/dist/index.js +5 -5
- package/dist/internal.js +7 -7
- 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-7TYNY2AX.js.map +0 -1
- package/dist/chunk-AOM334QU.js.map +0 -1
- package/dist/chunk-B27HARE3.js.map +0 -1
- /package/dist/{McpAppCard-PGME4ZPA.js.map → McpAppCard-NJEKKEEN.js.map} +0 -0
- /package/dist/{McpAppFrame-YKQ7ZZX6.js.map → McpAppFrame-IQK5AOMD.js.map} +0 -0
- /package/dist/{chunk-VON7UU2E.js.map → chunk-7UQ3RWAU.js.map} +0 -0
- /package/dist/{chunk-5JDQG2JJ.js.map → chunk-XRNHTA7C.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
McpAppFrame
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4WFRH7FG.js";
|
|
4
4
|
import {
|
|
5
5
|
McpAppMessageContext
|
|
6
6
|
} from "./chunk-GRUDJLWG.js";
|
|
@@ -168,4 +168,4 @@ function McpAppCard({ sessionId, sourceId, client: suppliedClient, onMessage: su
|
|
|
168
168
|
export {
|
|
169
169
|
McpAppCard
|
|
170
170
|
};
|
|
171
|
-
//# sourceMappingURL=McpAppCard-
|
|
171
|
+
//# sourceMappingURL=McpAppCard-NJEKKEEN.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
McpAppFrame
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4WFRH7FG.js";
|
|
4
4
|
import "./chunk-3KJJIH5K.js";
|
|
5
5
|
import "./chunk-PR4QN5HX.js";
|
|
6
6
|
export {
|
|
7
7
|
McpAppFrame
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=McpAppFrame-
|
|
9
|
+
//# sourceMappingURL=McpAppFrame-IQK5AOMD.js.map
|
|
@@ -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;
|
|
@@ -27,7 +28,7 @@ export declare function resolveTurnDisplayMode({ isStreaming: _isStreaming, disp
|
|
|
27
28
|
isStreaming: boolean;
|
|
28
29
|
displayMode: TurnDisplayMode;
|
|
29
30
|
}): TurnDisplayMode;
|
|
30
|
-
export
|
|
31
|
+
export { formatExecutionDuration } from "./chat-run";
|
|
31
32
|
export declare function getExecutionDurationMs({ messages, isStreaming, now, }: {
|
|
32
33
|
messages: ChatMessage[];
|
|
33
34
|
isStreaming: boolean;
|
|
@@ -12,12 +12,7 @@ interface Props {
|
|
|
12
12
|
open: boolean;
|
|
13
13
|
onOpenChange: (open: boolean) => void;
|
|
14
14
|
filename: string;
|
|
15
|
-
/**
|
|
16
|
-
* 由调用方用 `getAuthedUrl()` 构造的完整 URL(baseUrl + 路径 + ?token=…)。
|
|
17
|
-
* 内部 fetch 直接用原串,**不**再走 `apiFetchText` —— 否则会二次拼 baseUrl,
|
|
18
|
-
* 在独立前后端部署时会得到形如 `http://api.xxxhttp://api.xxx/…` 的非法 URL。
|
|
19
|
-
* token 靠 query 字符串携带,因此也不需要再挂 Authorization header。
|
|
20
|
-
*/
|
|
15
|
+
/** 完整附件地址,已下载的上下文资料使用本地 blob URL。 */
|
|
21
16
|
url: string | null;
|
|
22
17
|
mode: "markdown" | "text" | "default";
|
|
23
18
|
}
|
|
@@ -8,7 +8,8 @@ export declare function resolveLoadingStageLabel({ preparing, elapsedMs, activeT
|
|
|
8
8
|
elapsedMs: number;
|
|
9
9
|
activeToolLabel?: string | null;
|
|
10
10
|
}): string;
|
|
11
|
-
export declare function ChatLoadingIndicator({ preparing, startedAtMs, activeToolLabel, }: {
|
|
11
|
+
export declare function ChatLoadingIndicator({ preparing, startedAtMs, activeToolLabel, useRunClock, }: {
|
|
12
|
+
useRunClock?: boolean;
|
|
12
13
|
preparing?: boolean;
|
|
13
14
|
startedAtMs?: number | null;
|
|
14
15
|
activeToolLabel?: string | null;
|
|
@@ -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 {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ChatMessage, RunTiming } from "@blade-hq/agent-client/internal";
|
|
2
|
+
export declare function lastChatRun(messages: ChatMessage[]): RunTiming | undefined;
|
|
3
|
+
export declare function formatExecutionDuration(durationMs: number): string;
|
|
4
|
+
export declare function terminalChatLabel(run: RunTiming | undefined): string | null;
|
|
@@ -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";
|
|
@@ -20,6 +20,7 @@ export type AssistantTurnRenderBlock = RenderBlockBase & {
|
|
|
20
20
|
export type RenderBlock = (RenderBlockBase & {
|
|
21
21
|
type: "message";
|
|
22
22
|
message: ChatMessage;
|
|
23
|
+
unansweredLabel?: string;
|
|
23
24
|
anchorId: string | null;
|
|
24
25
|
}) | AssistantTurnRenderBlock | (RenderBlockBase & {
|
|
25
26
|
type: "context_group";
|
|
@@ -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;
|
|
@@ -25756,9 +25756,11 @@ function McpAppFrame(props) {
|
|
|
25756
25756
|
useLayoutEffect(() => {
|
|
25757
25757
|
const dialog = panel.current;
|
|
25758
25758
|
if (!dialog) return;
|
|
25759
|
-
dialog.close();
|
|
25760
|
-
|
|
25761
|
-
|
|
25759
|
+
if (typeof dialog.close === "function") dialog.close();
|
|
25760
|
+
else dialog.removeAttribute("open");
|
|
25761
|
+
const show = expanded ? dialog.showModal : dialog.show;
|
|
25762
|
+
if (typeof show === "function") show.call(dialog);
|
|
25763
|
+
else dialog.setAttribute("open", "");
|
|
25762
25764
|
}, [expanded]);
|
|
25763
25765
|
useEffect(() => {
|
|
25764
25766
|
setError(null);
|
|
@@ -25770,7 +25772,10 @@ function McpAppFrame(props) {
|
|
|
25770
25772
|
let disposed = false;
|
|
25771
25773
|
let bridge;
|
|
25772
25774
|
const timer = window.setTimeout(() => {
|
|
25773
|
-
if (!disposed && !bridge?.getAppCapabilities())
|
|
25775
|
+
if (!disposed && !bridge?.getAppCapabilities()) {
|
|
25776
|
+
setError("\u5E94\u7528\u8FDE\u63A5\u8D85\u65F6");
|
|
25777
|
+
callbacks.current.onLoadError?.();
|
|
25778
|
+
}
|
|
25774
25779
|
}, 2e4);
|
|
25775
25780
|
const start = async () => {
|
|
25776
25781
|
if (!frame.current?.contentWindow) throw new Error("\u5E94\u7528\u4F1A\u8BDD\u4E0D\u53EF\u7528");
|
|
@@ -25810,6 +25815,8 @@ function McpAppFrame(props) {
|
|
|
25810
25815
|
return { mode: next };
|
|
25811
25816
|
};
|
|
25812
25817
|
bridge.onsizechange = (params) => {
|
|
25818
|
+
if (disposed) return;
|
|
25819
|
+
callbacks.current.onLayout?.();
|
|
25813
25820
|
if (callbacks.current.sizeChange) return callbacks.current.sizeChange(params);
|
|
25814
25821
|
if (params.height && Number.isFinite(params.height)) setHeight(Math.max(120, Math.min(1200, params.height)));
|
|
25815
25822
|
};
|
|
@@ -25825,7 +25832,10 @@ function McpAppFrame(props) {
|
|
|
25825
25832
|
};
|
|
25826
25833
|
void start().catch((error63) => {
|
|
25827
25834
|
window.clearTimeout(timer);
|
|
25828
|
-
if (!disposed)
|
|
25835
|
+
if (!disposed) {
|
|
25836
|
+
setError(error63 instanceof Error ? error63.message : "\u5E94\u7528\u52A0\u8F7D\u5931\u8D25");
|
|
25837
|
+
callbacks.current.onLoadError?.();
|
|
25838
|
+
}
|
|
25829
25839
|
});
|
|
25830
25840
|
return () => {
|
|
25831
25841
|
disposed = true;
|
|
@@ -25843,6 +25853,7 @@ function McpAppFrame(props) {
|
|
|
25843
25853
|
disposed = true;
|
|
25844
25854
|
};
|
|
25845
25855
|
}, [props.toolInput, ready]);
|
|
25856
|
+
const nativeDialog = typeof HTMLDialogElement !== "undefined" && typeof HTMLDialogElement.prototype.showModal === "function";
|
|
25846
25857
|
const toggle = () => {
|
|
25847
25858
|
setExpanded(!expanded);
|
|
25848
25859
|
bridgeRef.current?.setHostContext({ displayMode: expanded ? "inline" : "fullscreen" });
|
|
@@ -25851,6 +25862,15 @@ function McpAppFrame(props) {
|
|
|
25851
25862
|
"dialog",
|
|
25852
25863
|
{
|
|
25853
25864
|
ref: panel,
|
|
25865
|
+
role: nativeDialog ? void 0 : "dialog",
|
|
25866
|
+
"aria-modal": expanded || void 0,
|
|
25867
|
+
onKeyDown: (event) => {
|
|
25868
|
+
if (!nativeDialog && expanded && event.key === "Escape") {
|
|
25869
|
+
event.preventDefault();
|
|
25870
|
+
setExpanded(false);
|
|
25871
|
+
bridgeRef.current?.setHostContext({ displayMode: "inline" });
|
|
25872
|
+
}
|
|
25873
|
+
},
|
|
25854
25874
|
onCancel: () => {
|
|
25855
25875
|
setExpanded(false);
|
|
25856
25876
|
bridgeRef.current?.setHostContext({ displayMode: "inline" });
|
|
@@ -25875,7 +25895,7 @@ function McpAppFrame(props) {
|
|
|
25875
25895
|
boxShadow: "-4px 0 20px #0002",
|
|
25876
25896
|
display: "flex",
|
|
25877
25897
|
flexDirection: "column"
|
|
25878
|
-
} : { position: "relative", margin: 0, padding: 0, width: "100%", maxWidth: "none", maxHeight: "none", border: "1px solid #d4d4d8", borderRadius: 6, overflow: "hidden", background: "white" },
|
|
25898
|
+
} : { position: "relative", margin: 0, padding: 0, width: "100%", maxWidth: "none", maxHeight: "none", border: "1px solid #d4d4d8", borderRadius: 6, overflow: "hidden", background: "white", display: nativeDialog ? void 0 : "block" },
|
|
25879
25899
|
children: [
|
|
25880
25900
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", padding: "8px 12px", color: "#27272a" }, children: [
|
|
25881
25901
|
/* @__PURE__ */ jsx("span", { children: title }),
|
|
@@ -25910,4 +25930,4 @@ export {
|
|
|
25910
25930
|
* MIT Licensed
|
|
25911
25931
|
*)
|
|
25912
25932
|
*/
|
|
25913
|
-
//# sourceMappingURL=chunk-
|
|
25933
|
+
//# sourceMappingURL=chunk-4WFRH7FG.js.map
|