@blade-hq/agent-react 2610.0.0-beta.48 → 2610.0.0-beta.49
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 +4 -0
- package/dist/components/AgentChat.d.ts +1 -1
- package/dist/components/SessionPluginSelector.d.ts +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +601 -462
- package/dist/index.js.map +1 -1
- package/dist/style.full.css +1 -1
- package/package.json +2 -2
- package/public-api.md +25 -3
package/README.md
CHANGED
|
@@ -389,3 +389,7 @@ blade-chat { --primary: 262 83% 58%; height: 640px; }
|
|
|
389
389
|
本包自有声明:`BladeProvider`、`BladeProviderProps`、`useBladeClient`、`useAgentSession`、`UseAgentSessionOptions`、`UseAgentSessionResult`、`useMessagePin`、`UseMessagePinOptions`、`useReplay`、`UseReplayResult`、`ReplayMismatch`、`ReplayBar`、`ReplayBarProps`、`ReplayMismatchPrompt`、`ReplayMismatchPromptProps`、`ChatView`、`ChatViewProps`、`ChatViewClassNames`、`ChatViewRenderers`、`ChatViewSlots`、`FollowupInteractionEvent`、`ToolCallRenderer`、`CurrentPlanPanel`、`PlanUpdateBlock`、`PlanUpdateData`、`PlanUpdateDisplayState`、`PlanStepStatus`、`getPlanUpdateDisplayState`、`isPlanUpdateTool`、`parsePlanUpdate`、`pickCurrentPlanStep`、`PLAN_AUTO_COLLAPSE_MS`、`MarkdownContent`、`MarkdownContentProps`、`parseWhatIfPrompt`、`ParsedWhatIfPrompt`、`WhatIfQuote`、`WhatIfUserBubble`、`WhatIfUserBubbleProps`。
|
|
390
390
|
|
|
391
391
|
`PollingBackoff` 从 agent-client 重导出,供自定义只读轮询计算退避时间;它不发送或重放请求。用法见 [agent-client 轮询说明](../agent-client/README.md#只读轮询退避)。
|
|
392
|
+
|
|
393
|
+
### 会话插件
|
|
394
|
+
|
|
395
|
+
默认 `AgentChat` / 智能体模式 `ChatView` 自带会话插件选择器,展开时查询 BH,选择按当前会话保存。准备失败会保留勾选并提供重试。独立嵌入可使用 `<SessionPluginSelector client={client} sessionId={id} />`;`sessionPluginControls` 可覆盖默认控件。组件参数类型为 `SessionPluginSelectorProps`。
|
|
@@ -14,7 +14,7 @@ export interface AgentChatProps extends ChatPresentationProps {
|
|
|
14
14
|
onSessionReady?: (session: AgentSession) => void;
|
|
15
15
|
/** 智能体下发给宿主页面的指令处理器(action → handler)。 */
|
|
16
16
|
commands?: Record<string, (data: unknown) => void>;
|
|
17
|
-
/**
|
|
17
|
+
/** 覆盖默认会话插件选择器。 */
|
|
18
18
|
sessionPluginControls?: (sessionId: string) => ReactNode;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BladeClient, SessionPluginActivation } from "@blade-hq/agent-client";
|
|
2
|
+
export interface SessionPluginSelectorProps {
|
|
3
|
+
client: BladeClient;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
side?: "top" | "bottom";
|
|
7
|
+
onChange?: (plugin: SessionPluginActivation) => void;
|
|
8
|
+
}
|
|
9
|
+
/** Shared selector for AgentChat and the built-in Web; no external query provider required. */
|
|
10
|
+
export declare function SessionPluginSelector(props: SessionPluginSelectorProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export type { UseMessagePinOptions } from "./hooks/use-message-pin";
|
|
|
10
10
|
export type { ChatCompletionTool, LlmChatOptions, LlmToolCall, UseLlmChatResult, } from "./hooks/use-llm-chat";
|
|
11
11
|
export { ChatView } from "./components/ChatView";
|
|
12
12
|
export type { ChatViewClassNames, ChatViewProps, ChatViewRenderers, ChatViewSlots, FollowupInteractionEvent, } from "./components/ChatView";
|
|
13
|
+
export { SessionPluginSelector } from "./components/SessionPluginSelector";
|
|
14
|
+
export type { SessionPluginSelectorProps } from "./components/SessionPluginSelector";
|
|
13
15
|
export { AgentChat } from "./components/AgentChat";
|
|
14
16
|
export type { AgentChatProps } from "./components/AgentChat";
|
|
15
17
|
export { LlmChat } from "./components/LlmChat";
|