@blade-hq/agent-react 2610.0.0-beta.47 → 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 CHANGED
@@ -387,3 +387,9 @@ blade-chat { --primary: 262 83% 58%; height: 640px; }
387
387
  为方便单包引入,本包 re-export 了 agent-client 的全部公开声明(`BladeClient`、`AgentSession`、`SessionState`、协议类型等),文档一律见 [agent-client 的 README](../agent-client/README.md)。完整签名见 [public-api.md](./public-api.md)。
388
388
 
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
+
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
- /** 会话插件状态与激活控件;由宿主注入以复用共享会话 API。 */
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;
@@ -18,6 +18,7 @@ declare function getChat(element: Element | null): Promise<AgentSession>;
18
18
  declare const BladeAgent: {
19
19
  BladeClient: typeof agentClient.BladeClient;
20
20
  BladeApiError: typeof agentClient.BladeApiError;
21
+ PollingBackoff: typeof agentClient.PollingBackoff;
21
22
  EMPTY_PLATFORM_ENDPOINTS: agentClient.PlatformEndpoints;
22
23
  loadPlatformEndpoints: typeof agentClient.loadPlatformEndpoints;
23
24
  resolveServiceUrl: typeof agentClient.resolveServiceUrl;
@@ -113,6 +114,8 @@ declare const BladeAgent: {
113
114
  acceptedPostChatFollowupCompletesLatestRun: typeof agentClient.acceptedPostChatFollowupCompletesLatestRun;
114
115
  acknowledgeTurnEvents: typeof agentClient.acknowledgeTurnEvents;
115
116
  ClientProjectionBuilder: typeof agentClient.ClientProjectionBuilder;
117
+ AuthBusyReconnect: typeof agentClient.AuthBusyReconnect;
118
+ authBusyRetryDelayMs: typeof agentClient.authBusyRetryDelayMs;
116
119
  createSocket: typeof agentClient.createSocket;
117
120
  getChat: typeof getChat;
118
121
  BladeChatElement: typeof BladeChatElement;
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";