@blade-hq/agent-react 2610.0.0-beta.83 → 2610.0.0-beta.85

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
@@ -610,3 +610,11 @@ blade-chat::part(input-toolbar) { gap: 12px; }
610
610
  ### 子智能体卡片
611
611
 
612
612
  `AgentTaskCard` 提供共享的可折叠子智能体卡片,`AgentTaskCardProps` 接受任务 `title`、`status`、最新动作 `activity` 和详情 `children`。`AgentTaskStatus` 包含 `running`、`waiting_input`、`completed`、`failed`、`cancelled`;进入 `waiting_input` 时自动展开,提示图标持续轻缓闪动,并遵守系统减少动态效果设置。回答表单由宿主通过 `children` 提供,回答后应更新状态以停止提示。
613
+
614
+ ### 会话图片
615
+
616
+ `MessageImage` 是聊天组件共用的图片组件,属性类型为 `MessageImageProps`。它支持原生 `<img>` 属性,并从 `BladeProvider` 获取客户端;也可显式传入 `client`。会话资源使用带鉴权的独立请求,公开分享图片使用分享令牌授权,在接近可视区域时加载预览,卸载后回收对象 URL。传入 `original` 可用于原图预览。普通外部图片 URL 仍直接由浏览器加载。
617
+
618
+ ```tsx
619
+ <MessageImage src={imageUrl} alt="附件图片" width={width} height={height} />
620
+ ```
@@ -0,0 +1,9 @@
1
+ import type { BladeClient } from "@blade-hq/agent-client";
2
+ import { type ImgHTMLAttributes } from "react";
3
+ export interface MessageImageProps extends ImgHTMLAttributes<HTMLImageElement> {
4
+ client?: BladeClient | null;
5
+ /** Load the original only when explicitly requested, such as a lightbox. */
6
+ original?: boolean;
7
+ }
8
+ /** Shared image transport for live messages, history, tool results and lightboxes. */
9
+ export declare const MessageImage: import("react").ForwardRefExoticComponent<MessageImageProps & import("react").RefAttributes<HTMLImageElement>>;
package/dist/index.d.ts CHANGED
@@ -73,3 +73,4 @@ export type { AgentComputerLaunchOutcome } from "./lib/agent-computer-command";
73
73
  export * from "@blade-hq/agent-client";
74
74
  export { AgentTaskCard } from "./components/AgentTaskCard";
75
75
  export type { AgentTaskCardProps, AgentTaskStatus } from "./components/AgentTaskCard";
76
+ export { MessageImage, type MessageImageProps } from "./components/MessageImage";