@blade-hq/agent-react 2612.0.0-beta.28 → 2612.0.0-beta.29

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.
Files changed (50) hide show
  1. package/dist/chat/AgentLoopBlock.d.ts +0 -2
  2. package/dist/chat/AssistantTurnBlock.d.ts +0 -8
  3. package/dist/chat/AttachmentPreviewDialog.d.ts +0 -1
  4. package/dist/chat/CurrentPlanPanel.d.ts +0 -3
  5. package/dist/chat/FileDeliveryCards.d.ts +0 -4
  6. package/dist/chat/FinalArtifactCards.d.ts +0 -1
  7. package/dist/chat/LiteMessageList.d.ts +1 -3
  8. package/dist/chat/MessageFileAttachmentList.d.ts +0 -5
  9. package/dist/chat/SessionReplayBar.d.ts +0 -1
  10. package/dist/chat/TextAttachmentPills.d.ts +0 -3
  11. package/dist/chat/TurnNavRail.d.ts +0 -3
  12. package/dist/chat/WorkflowRunBlock.d.ts +0 -2
  13. package/dist/chat/ai-elements/shimmer.d.ts +0 -4
  14. package/dist/chat/message-list-blocks.d.ts +0 -1
  15. package/dist/chat/runtime/actions.d.ts +1 -2
  16. package/dist/chat/runtime/background-task-dismissals.d.ts +0 -1
  17. package/dist/chat/runtime/composer-channels.d.ts +0 -3
  18. package/dist/chat/runtime/input-cache-reset.d.ts +0 -5
  19. package/dist/chat/runtime/session-source.d.ts +0 -5
  20. package/dist/chat/runtime/use-chat-actions.d.ts +0 -4
  21. package/dist/{chat-OCLOVB3H.css → chat-IHPRU35X.css} +5 -18
  22. package/dist/chat.css +5 -18
  23. package/dist/{chunk-66V4EOSO.js → chunk-M5NAFIU4.js} +340 -399
  24. package/dist/chunk-M5NAFIU4.js.map +1 -0
  25. package/dist/{chunk-PAZSK73V.js → chunk-PHWYZP6F.js} +3 -8
  26. package/dist/chunk-PHWYZP6F.js.map +1 -0
  27. package/dist/{chunk-PPREDKQ2.js → chunk-XTYNDVUV.js} +15 -3
  28. package/dist/chunk-XTYNDVUV.js.map +1 -0
  29. package/dist/components/ChatInput.d.ts +1 -15
  30. package/dist/components/LlmAdvancedSettings.d.ts +0 -1
  31. package/dist/components/PlanUpdateBlock.d.ts +0 -1
  32. package/dist/embed/blade-chat-element.d.ts +0 -8
  33. package/dist/embed/entry.d.ts +1 -13
  34. package/dist/hooks/use-message-pin.d.ts +1 -1
  35. package/dist/index.js +2 -2
  36. package/dist/internal.js +4 -6
  37. package/dist/internal.js.map +1 -1
  38. package/dist/lib/message-shortcuts.d.ts +5 -0
  39. package/dist/rich-input/ConnectButton.d.ts +0 -2
  40. package/dist/rich-input/SkillStatusBar.d.ts +0 -6
  41. package/dist/rich-input/lib/reference-candidates.d.ts +0 -1
  42. package/dist/rich-input/voice/VoiceWaveform.d.ts +0 -3
  43. package/dist/rich-input.js +90 -110
  44. package/dist/rich-input.js.map +1 -1
  45. package/dist/style.css +16 -55
  46. package/dist/style.full.css +23 -77
  47. package/package.json +2 -2
  48. package/dist/chunk-66V4EOSO.js.map +0 -1
  49. package/dist/chunk-PAZSK73V.js.map +0 -1
  50. package/dist/chunk-PPREDKQ2.js.map +0 -1
@@ -5,9 +5,7 @@ interface Props {
5
5
  sessionId: string;
6
6
  reasoning?: string;
7
7
  hideAskUserQuestions?: boolean;
8
- /** 初始展开(工作流步骤卡默认摊开,老 #1841 体验);等待回答仍强制展开。 */
9
8
  defaultExpanded?: boolean;
10
- /** 自定义卡头描述渲染(工作流用它把 {{ref}} 画成引用胶囊)。 */
11
9
  renderDescription?: (description: string) => ReactNode;
12
10
  }
13
11
  export declare function AgentLoopBlock({ toolCall, sessionId, reasoning, hideAskUserQuestions, defaultExpanded, renderDescription, }: Props): import("react/jsx-runtime").JSX.Element;
@@ -7,14 +7,6 @@ interface Props {
7
7
  sessionId: string;
8
8
  messages: ChatMessage[];
9
9
  isStreaming?: boolean;
10
- /**
11
- * 打字机式显示节流下,"正文还没播完"跟"思考过程本身有没有说完"是两条
12
- * 独立时间线——正文通常比思考过程晚播完很久。"正在思考"/"已思考" 这个
13
- * 标签只该看思考过程自己有没有播完,不能被 isStreaming(含正文节流)
14
- * 拖着一起等正文播完才翻,否则会出现"正文都在吐字好几秒了,还显示正在
15
- * 思考"这种跟视觉进度对不上的观感。不传时按旧行为处理(等价于思考过程
16
- * 跟 isStreaming 同步)。
17
- */
18
10
  isReasoningRevealing?: boolean;
19
11
  isLastTurn?: boolean;
20
12
  askAnswers?: Record<string, AskUserAnswerData>;
@@ -19,7 +19,6 @@ interface Props {
19
19
  * token 靠 query 字符串携带,因此也不需要再挂 Authorization header。
20
20
  */
21
21
  url: string | null;
22
- /** text-like 视为"可文本预览";其他只显示下载按钮。 */
23
22
  mode: "markdown" | "text" | "default";
24
23
  }
25
24
  export declare function AttachmentPreviewDialog({ open, onOpenChange, filename, url, mode }: Props): import("react/jsx-runtime").JSX.Element | null;
@@ -1,11 +1,8 @@
1
1
  import type { ChatMessage } from "@blade-hq/agent-client/internal";
2
2
  export declare function CurrentPlanPanelContent({ messages, running, autoReveal, sessionId, hideTodo, }: {
3
3
  messages: ChatMessage[];
4
- /** 会话是否还在执行;停止或加载历史时进度里的步骤不再转圈。 */
5
4
  running?: boolean;
6
- /** 仅当前这次消息变更来自实时成功的 update_plan 时为 true。 */
7
5
  autoReveal?: boolean;
8
- /** Key the plan block by session so switching sessions resets its local UI state. */
9
6
  sessionId?: string;
10
7
  hideTodo?: boolean;
11
8
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -5,15 +5,11 @@ export declare function collectDeliveredFiles(toolCalls: ToolCallInfo[], session
5
5
  name: string;
6
6
  }>;
7
7
  export declare function DeliveryCard({ path, name, sessionId, description, displayName, compact, onOpen, onDownloadStarted, onDownloadSucceeded, }: {
8
- /** 文件路径:工作目录下的相对路径,或容器内的绝对路径。 */
9
8
  path: string;
10
9
  name: string;
11
10
  sessionId: string;
12
- /** 副标题;不传时按扩展名显示「Markdown · AI 生成」这类默认说明。 */
13
11
  description?: string;
14
- /** 卡片可读名称;下载文件名仍使用 name。 */
15
12
  displayName?: string;
16
- /** 会话总结使用正文 MEDIA 卡片的紧凑样式。 */
17
13
  compact?: boolean;
18
14
  onOpen?: () => void;
19
15
  onDownloadStarted?: () => void;
@@ -3,6 +3,5 @@ import type { FinalArtifact } from "@blade-hq/agent-client/internal";
3
3
  export declare function FinalArtifactCards({ artifacts, sessionId, assistantEntryId, }: {
4
4
  artifacts: FinalArtifact[];
5
5
  sessionId: string;
6
- /** 所属回复;交互事件(`onFollowupInteraction`)用它指明是哪一轮的成果。 */
7
6
  assistantEntryId: string;
8
7
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -10,9 +10,7 @@ type TextRow = {
10
10
  text: string;
11
11
  entryIds: string[];
12
12
  failed?: boolean;
13
- /** 本轮(含子智能体循环)真实检索到的引用证据,只有 assistant 文本行才有——
14
- * 跟 AssistantTurnBlock.tsx 的 turnToolCalls/citations 同一套算法,不然轻量
15
- * 模式下 插件引用的 [n] 角标只能停在纯文本,点不开、也 hover 不出来源。 */
13
+ sending?: boolean;
16
14
  citations?: Record<number, CitationEntry>;
17
15
  };
18
16
  type MemoryRefsRow = {
@@ -2,11 +2,6 @@ import type { FileContentPart } from "@blade-hq/agent-client/internal";
2
2
  interface MessageFileAttachmentListProps {
3
3
  files: FileContentPart[];
4
4
  className?: string;
5
- /**
6
- * R6:点击 pill 时的预览回调。不传时 pill 保持纯展示(向后兼容,Home /
7
- * ChatDev 等复用点零改动)。调用方自己决定 URL 来源 + 渲染什么(lightbox /
8
- * FilePreviewDialog / 下载等)。
9
- */
10
5
  onPreview?: (file: FileContentPart) => void;
11
6
  }
12
7
  export declare function MessageFileAttachmentList({ files, className, onPreview, }: MessageFileAttachmentListProps): import("react/jsx-runtime").JSX.Element | null;
@@ -7,6 +7,5 @@
7
7
  export declare function SessionReplayBar({ sessionId, className, onExit, }: {
8
8
  sessionId: string;
9
9
  className?: string;
10
- /** 宿主自己接管了「输入对不上录制内容」的处理时传入:退出要先了结那次待定的决定。 */
11
10
  onExit?: () => void;
12
11
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,6 @@
1
1
  import type { ParsedTextAttachment } from "@blade-hq/agent-client/internal";
2
2
  interface TextAttachmentPillsProps {
3
3
  attachments: ParsedTextAttachment[];
4
- /**
5
- * R6:点击 pill 时的预览回调。不传时保持纯展示(向后兼容)。
6
- */
7
4
  onPreview?: (attachment: ParsedTextAttachment) => void;
8
5
  }
9
6
  export declare function TextAttachmentPills({ attachments, onPreview }: TextAttachmentPillsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -6,11 +6,8 @@ interface TurnNavRailProps {
6
6
  items: TurnNavItem[];
7
7
  activeTurnId: string | null;
8
8
  onSelectTurn: (turnId: string) => void;
9
- /** 正在请求定位的目标;null / 不传表示没有在途定位(开发者列表不传)。 */
10
9
  loadingTurnId?: string | null;
11
- /** 定位失败提示。 */
12
10
  error?: string | null;
13
- /** 定位失败的那条发言;重试按钮就再点它一次。 */
14
11
  failedTurnId?: string | null;
15
12
  }
16
13
  export declare function TurnNavRail({ items, activeTurnId, onSelectTurn, loadingTurnId, error, failedTurnId, }: TurnNavRailProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,7 +1,6 @@
1
1
  import type { WorkflowRunEntry } from "@blade-hq/agent-client";
2
2
  import type { ToolCallInfo } from "@blade-hq/agent-client/internal";
3
3
  interface Props {
4
- /** 触发这次运行的 workflow:run 工具调用。 */
5
4
  toolCall: ToolCallInfo;
6
5
  sessionId: string;
7
6
  }
@@ -10,7 +9,6 @@ type StepGroup = {
10
9
  desc: string;
11
10
  stepId: string;
12
11
  stepKind: string;
13
- /** 落史的终态(刷新重建时有);实时运行中没有,由运行状态推断。 */
14
12
  status?: string;
15
13
  logs: string[];
16
14
  };
@@ -6,10 +6,6 @@ export interface TextShimmerProps {
6
6
  duration?: number;
7
7
  spread?: number;
8
8
  }
9
- /**
10
- * 流式等待时的扫光文字。动画是纯 CSS(`blade-shimmer-sweep`,定义在 chat.css),
11
- * 不引入动画库。
12
- */
13
9
  declare const ShimmerComponent: ({ children, as: Component, className, duration, spread, }: TextShimmerProps) => import("react/jsx-runtime").JSX.Element;
14
10
  export declare const Shimmer: import("react").MemoExoticComponent<typeof ShimmerComponent>;
15
11
  export {};
@@ -78,7 +78,6 @@ export declare function selectActiveTurnAtViewportPosition({ visibleTurns, conta
78
78
  containerBottom: number;
79
79
  fallbackTurnId: string | null;
80
80
  currentTurnId?: string | null;
81
- /** 滚动容器已到底。 */
82
81
  atBottom?: boolean;
83
82
  }): string | null;
84
83
  /** 测试双通道最终渲染计划时忽略仅影响布局的 wrapper。 */
@@ -15,8 +15,7 @@ export interface ChatSendExtras {
15
15
  whatif?: SendOptions["whatif"];
16
16
  replayDecision?: SendOptions["replayDecision"];
17
17
  /**
18
- * 声明「会话在跑就把这条消息放进等待队列」。只有渲染了队列面板、能展示等待消息的宿主才该传:
19
- * 没有面板时排队等于消息凭空消失。
18
+ * 默认发送引导消息;显式为 true 时,等待当前运行结束后处理。
20
19
  */
21
20
  queueWhenRunning?: boolean;
22
21
  }
@@ -3,7 +3,6 @@ export declare const backgroundTaskDismissals: {
3
3
  getState: () => Dismissed;
4
4
  subscribe(listener: () => void): () => void;
5
5
  dismiss(sessionId: string, taskId: string): void;
6
- /** 换身份:清空。 */
7
6
  reset(): void;
8
7
  };
9
8
  export declare function useDismissedBackgroundTasks(sessionId: string): string[];
@@ -38,11 +38,8 @@ export declare const composerChannels: {
38
38
  clearSendRequests(sessionId: string): void;
39
39
  setModelDraft(sessionId: string, model: string): void;
40
40
  clearModelDraft(sessionId: string): void;
41
- /** 回退到某一步后,把那一步的用户原话放回输入框(null 清除)。 */
42
41
  setRewindDraft(sessionId: string, text: string | null): void;
43
- /** 会话被关闭 / 删除:清掉它还没被取走的信号。 */
44
42
  clearSession(sessionId: string): void;
45
- /** 换身份:清空全部通道。 */
46
43
  reset(): void;
47
44
  };
48
45
  export type ComposerChannels = typeof composerChannels;
@@ -1,8 +1,3 @@
1
- /**
2
- * 换身份(登出、换账号、换后端)时清掉富输入按 client 缓存的数据(技能菜单、模型目录等),
3
- * 新身份不会看到上一个身份的清单。富输入的缓存在这里登记清理函数;宿主在身份变化时调用
4
- * `resetInputCaches`。放在 internal 入口,宿主调用它不必引入富输入。
5
- */
6
1
  import type { BladeClient } from "@blade-hq/agent-client";
7
2
  export declare function onInputCachesReset(client: BladeClient, reset: () => void): () => void;
8
3
  export declare function resetInputCaches(client: BladeClient): void;
@@ -1,8 +1,3 @@
1
- /**
2
- * 聊天组件读会话状态的来源。组件只认 `AgentSession`,不关心实例由谁持有:
3
- * 内置 Web 用自己的会话登记表(含静态会话、保留区),SDK 的 ChatView / `<blade-chat>` / 插件
4
- * 用 `useAgentSession` 持有的那一个实例(`createSingleSessionSource`)。
5
- */
6
1
  import { type AgentSession, type SessionState } from "@blade-hq/agent-client/internal";
7
2
  import { type ReactNode } from "react";
8
3
  export interface SessionSource {
@@ -1,7 +1,3 @@
1
- /**
2
- * 聊天面板的动作与交互态:发送(等待回答时自动当作作答)、停止(带「停止中」)、等待消息队列命令
3
- * (冲突提示与进行中的条目)。全部直接作用在会话实例上。
4
- */
5
1
  import type { MessageContent } from "@blade-hq/agent-client/internal";
6
2
  import { type ChatSendExtras } from "./actions";
7
3
  export declare function useChatActions(sessionId: string): {
@@ -1,9 +1,3 @@
1
- /*
2
- * 聊天组件共用的非 Tailwind 规则(Markdown 排版、入场动画、扫光)。内置 Web 与插件经 agent/style.css
3
- * 引入这一份;<blade-chat> 与 npm 样式由 scripts/gen-embed-styles.mjs 放进 blade-chat-overrides 层。
4
- * 只写聊天组件自己用到的规则,页面级补丁不放这里。
5
- */
6
-
7
1
  [data-theme="light"] .prose-invert {
8
2
  --tw-prose-body: hsl(var(--foreground));
9
3
  --tw-prose-headings: hsl(var(--foreground));
@@ -25,9 +19,7 @@
25
19
  color: hsl(var(--primary));
26
20
  }
27
21
 
28
- /* --- chat markdown density: 收紧块间距,避免松散 ---------------- */
29
- /* typography 插件默认 p/li/heading 外边距偏大(1.25em/0.5em),聊天里读起来太松。
30
- plain 选择器特异性高于插件的 :where(),可直接覆盖。 */
22
+
31
23
  .chat-prose p {
32
24
  margin-top: 0.5em;
33
25
  margin-bottom: 0.5em;
@@ -85,12 +77,7 @@
85
77
  margin-bottom: 1.2em;
86
78
  }
87
79
 
88
- /* 未闭合的加粗/斜体/行内代码,在闭合符真正到达前先按最终标签
89
- * 渲染、只用透明度标出"待确认"——内容和标签结构全程不变,闭合符到达后
90
- * 这条规则自然不再匹配,恢复完全不透明,DOM 节点没有被替换过。这个属性
91
- * 只由 MarkdownRenderer 引擎自己产出,不区分调用方用的是哪套 prose 外壳
92
- * (`.chat-prose`/`.prose`/`.lite-chat-markdown`/无外壳),不按外壳类名
93
- * 逐个补,直接全局生效。 */
80
+
94
81
  [data-markdown-pending="true"] {
95
82
  opacity: 0.6;
96
83
  }
@@ -108,7 +95,7 @@
108
95
  overflow-x: auto;
109
96
  }
110
97
 
111
- /* Message entrance animation */
98
+
112
99
  @keyframes msg-in {
113
100
  from {
114
101
  opacity: 0;
@@ -124,7 +111,7 @@
124
111
  animation: msg-in 0.15s ease-out forwards;
125
112
  }
126
113
 
127
- /* Running-state sweep, borrowed from deepseek-harness's ReasoningRow. */
114
+
128
115
  .status-sweep::after {
129
116
  content: "";
130
117
  position: absolute;
@@ -153,7 +140,7 @@
153
140
  }
154
141
  }
155
142
 
156
- /* 流式等待的扫光文字(ai-elements/shimmer.tsx) */
143
+
157
144
  @keyframes blade-shimmer-sweep {
158
145
  from {
159
146
  background-position: 100% center;
package/dist/chat.css CHANGED
@@ -1,9 +1,3 @@
1
- /*
2
- * 聊天组件共用的非 Tailwind 规则(Markdown 排版、入场动画、扫光)。内置 Web 与插件经 agent/style.css
3
- * 引入这一份;<blade-chat> 与 npm 样式由 scripts/gen-embed-styles.mjs 放进 blade-chat-overrides 层。
4
- * 只写聊天组件自己用到的规则,页面级补丁不放这里。
5
- */
6
-
7
1
  [data-theme="light"] .prose-invert {
8
2
  --tw-prose-body: hsl(var(--foreground));
9
3
  --tw-prose-headings: hsl(var(--foreground));
@@ -25,9 +19,7 @@
25
19
  color: hsl(var(--primary));
26
20
  }
27
21
 
28
- /* --- chat markdown density: 收紧块间距,避免松散 ---------------- */
29
- /* typography 插件默认 p/li/heading 外边距偏大(1.25em/0.5em),聊天里读起来太松。
30
- plain 选择器特异性高于插件的 :where(),可直接覆盖。 */
22
+
31
23
  .chat-prose p {
32
24
  margin-top: 0.5em;
33
25
  margin-bottom: 0.5em;
@@ -85,12 +77,7 @@
85
77
  margin-bottom: 1.2em;
86
78
  }
87
79
 
88
- /* 未闭合的加粗/斜体/行内代码,在闭合符真正到达前先按最终标签
89
- * 渲染、只用透明度标出"待确认"——内容和标签结构全程不变,闭合符到达后
90
- * 这条规则自然不再匹配,恢复完全不透明,DOM 节点没有被替换过。这个属性
91
- * 只由 MarkdownRenderer 引擎自己产出,不区分调用方用的是哪套 prose 外壳
92
- * (`.chat-prose`/`.prose`/`.lite-chat-markdown`/无外壳),不按外壳类名
93
- * 逐个补,直接全局生效。 */
80
+
94
81
  [data-markdown-pending="true"] {
95
82
  opacity: 0.6;
96
83
  }
@@ -108,7 +95,7 @@
108
95
  overflow-x: auto;
109
96
  }
110
97
 
111
- /* Message entrance animation */
98
+
112
99
  @keyframes msg-in {
113
100
  from {
114
101
  opacity: 0;
@@ -124,7 +111,7 @@
124
111
  animation: msg-in 0.15s ease-out forwards;
125
112
  }
126
113
 
127
- /* Running-state sweep, borrowed from deepseek-harness's ReasoningRow. */
114
+
128
115
  .status-sweep::after {
129
116
  content: "";
130
117
  position: absolute;
@@ -153,7 +140,7 @@
153
140
  }
154
141
  }
155
142
 
156
- /* 流式等待的扫光文字(ai-elements/shimmer.tsx) */
143
+
157
144
  @keyframes blade-shimmer-sweep {
158
145
  from {
159
146
  background-position: 100% center;