@blade-hq/agent-react 2610.0.1 → 2612.0.0-beta.1
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 +88 -258
- package/dist/chat/AgentLoopBlock.d.ts +14 -0
- package/dist/{components → chat}/AskUserQuestionBlock.d.ts +3 -7
- package/dist/chat/AssistantTurnBlock.d.ts +50 -0
- package/dist/chat/AttachmentPreviewDialog.d.ts +26 -0
- package/dist/chat/ChatPanel.d.ts +64 -0
- package/dist/chat/CompactionCard.d.ts +6 -0
- package/dist/chat/ConnectionBanner.d.ts +10 -0
- package/dist/chat/CurrentPlanPanel.d.ts +20 -0
- package/dist/chat/FileDeliveryCards.d.ts +26 -0
- package/dist/chat/FinalArtifactCards.d.ts +8 -0
- package/dist/chat/ImageLightbox.d.ts +11 -0
- package/dist/chat/LightComposer.d.ts +7 -0
- package/dist/chat/LiteMessageList.d.ts +82 -0
- package/dist/chat/MessageActions.d.ts +6 -0
- package/dist/chat/MessageContextPills.d.ts +6 -0
- package/dist/chat/MessageFileAttachmentList.d.ts +13 -0
- package/dist/chat/MessageList.d.ts +54 -0
- package/dist/chat/PostChatFollowupBlock.d.ts +11 -0
- package/dist/{components → chat}/RenderErrorBoundary.d.ts +0 -1
- package/dist/chat/ResultFeedback.d.ts +11 -0
- package/dist/chat/SessionReplayBar.d.ts +12 -0
- package/dist/chat/TextAttachmentPills.d.ts +10 -0
- package/dist/chat/ToolCallBlock.d.ts +48 -0
- package/dist/chat/ToolUiCard.d.ts +6 -0
- package/dist/chat/TurnNavRail.d.ts +17 -0
- package/dist/chat/UserMessageBubble.d.ts +20 -0
- package/dist/chat/WorkflowRunBlock.d.ts +13 -0
- package/dist/chat/ai-elements/reasoning.d.ts +32 -0
- package/dist/chat/ai-elements/shimmer.d.ts +15 -0
- package/dist/chat/assistant-turn-questions.d.ts +14 -0
- package/dist/chat/card/CardContext.d.ts +7 -0
- package/dist/chat/chat-theme.d.ts +19 -0
- package/dist/chat/customization.d.ts +214 -0
- package/dist/chat/display-utils.d.ts +48 -0
- package/dist/{components/PostChatFollowupBlock.d.ts → chat/followup-interaction.d.ts} +5 -17
- package/dist/chat/index.d.ts +100 -0
- package/dist/chat/lib/citations.d.ts +30 -0
- package/dist/chat/lib/code-language.d.ts +5 -0
- package/dist/chat/lib/loopback.d.ts +8 -0
- package/dist/chat/lib/markdown-asset-url.d.ts +5 -0
- package/dist/chat/lib/preview-dispatch.d.ts +24 -0
- package/dist/chat/lib/skill-name.d.ts +9 -0
- package/dist/chat/lib/skill-visibility.d.ts +8 -0
- package/dist/chat/lib/ui-meta.d.ts +5 -0
- package/dist/chat/lib/use-async-value.d.ts +8 -0
- package/dist/chat/markdown/ExternalAnchor.d.ts +9 -0
- package/dist/chat/markdown/MarkdownContent.d.ts +40 -0
- package/dist/chat/markdown/text.d.ts +11 -0
- package/dist/chat/message-list-blocks.d.ts +92 -0
- package/dist/chat/plan/PlanSummaryCard.d.ts +10 -0
- package/dist/chat/plan/extract-plan-messages.d.ts +4 -0
- package/dist/chat/plan/parse-plan-messages.d.ts +10 -0
- package/dist/chat/plan/parse-plan-tree.d.ts +16 -0
- package/dist/chat/plan/types.d.ts +56 -0
- package/dist/chat/reasoning-visibility.d.ts +2 -0
- package/dist/chat/runtime/actions.d.ts +22 -0
- package/dist/chat/runtime/background-task-dismissals.d.ts +10 -0
- package/dist/chat/runtime/composer-channels.d.ts +46 -0
- package/dist/chat/runtime/environment.d.ts +152 -0
- package/dist/chat/runtime/input-cache-reset.d.ts +8 -0
- package/dist/chat/runtime/input-services.d.ts +111 -0
- package/dist/chat/runtime/session-source.d.ts +49 -0
- package/dist/chat/runtime/use-chat-actions.d.ts +19 -0
- package/dist/chat/runtime/use-session-replay.d.ts +16 -0
- package/dist/chat/scroll-anchor.d.ts +46 -0
- package/dist/chat/tool-renderers/BashRenderer.d.ts +2 -0
- package/dist/chat/tool-renderers/FileEditRenderer.d.ts +2 -0
- package/dist/chat/tool-renderers/FileReadRenderer.d.ts +2 -0
- package/dist/chat/tool-renderers/KbSearchRenderer.d.ts +2 -0
- package/dist/chat/tool-renderers/SearchRenderer.d.ts +2 -0
- package/dist/chat/tool-renderers/SubmitResultRenderer.d.ts +2 -0
- package/dist/chat/tool-renderers/kb-search-result.d.ts +19 -0
- package/dist/chat/tool-renderers/registry.d.ts +5 -0
- package/dist/chat/tool-renderers/shared.d.ts +30 -0
- package/dist/chat/tool-renderers/write-preview-scroll.d.ts +5 -0
- package/dist/chat-OCLOVB3H.css +175 -0
- package/dist/chat.css +175 -0
- package/dist/chunk-6ZDOQEWK.js +49365 -0
- package/dist/chunk-6ZDOQEWK.js.map +1 -0
- package/dist/chunk-FQQJP2GJ.js +26986 -0
- package/dist/chunk-FQQJP2GJ.js.map +1 -0
- package/dist/{chunk-G3PMV62Z.js → chunk-PR4QN5HX.js} +9 -2
- package/dist/chunk-WCMGQJLE.js +258 -0
- package/dist/chunk-WCMGQJLE.js.map +1 -0
- package/dist/components/AgentChat.d.ts +3 -3
- package/dist/components/ChatView.d.ts +2 -2
- package/dist/components/ConnectorPanel.d.ts +1 -1
- package/dist/components/ContextCard.d.ts +1 -1
- package/dist/components/LlmChat.d.ts +1 -1
- package/dist/components/McpAppCard.d.ts +1 -1
- package/dist/components/PlanUpdateBlock.d.ts +0 -8
- package/dist/components/PluginConnectorList.d.ts +1 -1
- package/dist/components/ReplayBar.d.ts +1 -1
- package/dist/components/SessionPluginConfigDialog.d.ts +1 -1
- package/dist/components/SessionPluginConfigForm.d.ts +1 -1
- package/dist/components/SessionPluginIcon.d.ts +1 -1
- package/dist/components/SessionPluginSelector.d.ts +1 -1
- package/dist/components/SessionQueuePanel.d.ts +1 -1
- package/dist/components/ToolUiCardView.d.ts +1 -1
- package/dist/components/plugin-config-draft.d.ts +1 -1
- package/dist/components/plugin-config-schema.d.ts +1 -1
- package/dist/components/plugin-connector.d.ts +1 -1
- package/dist/components/use-session-plugin-activation.d.ts +1 -1
- package/dist/context.d.ts +11 -2
- package/dist/embed/blade-chat-element.d.ts +14 -1
- package/dist/embed/entry.d.ts +8 -78
- package/dist/hooks/use-replay.d.ts +1 -1
- package/dist/hooks/use-turn-navigation.d.ts +1 -1
- package/dist/host.d.ts +54 -0
- package/dist/index.d.ts +11 -69
- package/dist/index.js +12 -63525
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +60 -0
- package/dist/internal.js +656 -0
- package/dist/internal.js.map +1 -0
- package/dist/lib/mount-renderers.d.ts +25 -0
- package/dist/lib/use-effect-event.d.ts +3 -0
- package/dist/rich-input/BackgroundTasksPill.d.ts +3 -0
- package/dist/rich-input/ChatInput.d.ts +59 -0
- package/dist/rich-input/ComposerAttachmentViewport.d.ts +3 -0
- package/dist/rich-input/ConnectButton.d.ts +24 -0
- package/dist/rich-input/FileCompletionMenu.d.ts +44 -0
- package/dist/rich-input/FileSizeLimitDialog.d.ts +9 -0
- package/dist/rich-input/ModelSelector.d.ts +10 -0
- package/dist/rich-input/PlanningToggle.d.ts +7 -0
- package/dist/rich-input/ProgressCircle.d.ts +12 -0
- package/dist/rich-input/ReasoningModeSelect.d.ts +9 -0
- package/dist/rich-input/SkillCompletionMenu.d.ts +9 -0
- package/dist/rich-input/SkillStatusBar.d.ts +15 -0
- package/dist/rich-input/extensions/file-mention.d.ts +12 -0
- package/dist/rich-input/extensions/kb-mention.d.ts +18 -0
- package/dist/rich-input/extensions/skill-mention.d.ts +48 -0
- package/dist/rich-input/extensions/workflow-mention.d.ts +10 -0
- package/dist/rich-input/index.d.ts +48 -0
- package/dist/rich-input/input-keyboard.d.ts +13 -0
- package/dist/rich-input/lib/attachment-upload.d.ts +10 -0
- package/dist/rich-input/lib/background-tasks-view.d.ts +31 -0
- package/dist/rich-input/lib/client-query.d.ts +32 -0
- package/dist/rich-input/lib/composer-content.d.ts +42 -0
- package/dist/rich-input/lib/image-input-availability.d.ts +3 -0
- package/dist/rich-input/lib/kb-suggestions.d.ts +37 -0
- package/dist/rich-input/lib/reasoning-levels.d.ts +1 -0
- package/dist/rich-input/lib/session-data.d.ts +20 -0
- package/dist/rich-input/lib/skill-suggestions.d.ts +19 -0
- package/dist/rich-input/lib/token-estimate.d.ts +2 -0
- package/dist/rich-input/lib/token-pressure.d.ts +8 -0
- package/dist/rich-input/lib/upload-results.d.ts +8 -0
- package/dist/rich-input/lib/user-home.d.ts +33 -0
- package/dist/rich-input/model/model-data.d.ts +6 -0
- package/dist/rich-input/model/resolve-model.d.ts +59 -0
- package/dist/rich-input/model/use-composer-model.d.ts +24 -0
- package/dist/rich-input/services.d.ts +22 -0
- package/dist/rich-input/use-dismiss-skill-suggestions-on-mode-change.d.ts +3 -0
- package/dist/rich-input/use-input-history.d.ts +14 -0
- package/dist/rich-input/voice/VoiceWaveform.d.ts +10 -0
- package/dist/rich-input/voice/use-tiptap-voice-input.d.ts +47 -0
- package/dist/rich-input/voice/use-voice-input.d.ts +2 -0
- package/dist/rich-input/voice/voice-input-support.d.ts +5 -0
- package/dist/rich-input.js +29853 -0
- package/dist/rich-input.js.map +1 -0
- package/dist/style.css +30 -64
- package/dist/style.full.css +210 -65
- package/dist/{webapi-W3IB5DO4.js → webapi-E7K2CNM7.js} +2 -2
- package/package.json +12 -3
- package/public-api.md +206 -3603
- package/dist/components/AgentLoopBlock.d.ts +0 -8
- package/dist/components/AgentTaskCard.d.ts +0 -12
- package/dist/components/AssistantTurnBlock.d.ts +0 -36
- package/dist/components/ChatSurface.d.ts +0 -199
- package/dist/components/ConnectionBanner.d.ts +0 -8
- package/dist/components/MarkdownContent.d.ts +0 -30
- package/dist/components/MessageList.d.ts +0 -62
- package/dist/components/Shimmer.d.ts +0 -7
- package/dist/components/ToolCallBlock.d.ts +0 -41
- package/dist/components/TurnNavRail.d.ts +0 -23
- package/dist/components/UserMessageBubble.d.ts +0 -25
- package/dist/components/display-utils.d.ts +0 -4
- /package/dist/{chunk-G3PMV62Z.js.map → chunk-PR4QN5HX.js.map} +0 -0
- /package/dist/{webapi-W3IB5DO4.js.map → webapi-E7K2CNM7.js.map} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* R6:用户上传的附件(文本 / 未知类型)预览弹窗。
|
|
3
|
+
*
|
|
4
|
+
* 图片走独立的 ImageLightbox;本组件处理:
|
|
5
|
+
* - .md → markdown 渲染
|
|
6
|
+
* - .json / .txt / .yaml / .yml / 其他文本 → 纯文本等宽展示
|
|
7
|
+
* - 不可在浏览器内渲染的类型 → 下载链接兜底
|
|
8
|
+
*
|
|
9
|
+
* 无 URL 时兜底为只显示文件名 + 下载入口。
|
|
10
|
+
*/
|
|
11
|
+
interface Props {
|
|
12
|
+
open: boolean;
|
|
13
|
+
onOpenChange: (open: boolean) => void;
|
|
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
|
+
*/
|
|
21
|
+
url: string | null;
|
|
22
|
+
/** text-like 视为"可文本预览";其他只显示下载按钮。 */
|
|
23
|
+
mode: "markdown" | "text" | "default";
|
|
24
|
+
}
|
|
25
|
+
export declare function AttachmentPreviewDialog({ open, onOpenChange, filename, url, mode }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type MessageContent, type QueuedMessage } from "@blade-hq/agent-client/internal";
|
|
3
|
+
import { type ChatViewCustomization } from "./customization";
|
|
4
|
+
import { type FollowupInteractionEvent } from "./followup-interaction";
|
|
5
|
+
import { type ChatRenderMode } from "./runtime/environment";
|
|
6
|
+
/**
|
|
7
|
+
* 队列条目上移 / 下移后的完整 pending 顺序;越界或条目不在 pending 里返回 null。
|
|
8
|
+
*
|
|
9
|
+
* 服务端要求 `ordered_ids` 是当前 pending 条目的完整集合(顺序任意),所以这里
|
|
10
|
+
* 始终提交全量,而不是只报移动的那一条;`delivering` 条目固定位置、不参与。
|
|
11
|
+
*/
|
|
12
|
+
export declare function nextQueuedOrder(items: QueuedMessage[], itemId: string, delta: -1 | 1): string[] | null;
|
|
13
|
+
export interface ChatPanelProps extends ChatViewCustomization {
|
|
14
|
+
sessionId: string;
|
|
15
|
+
/** 配色主题;宿主已经在祖先元素上写了 data-theme 时不用传。 */
|
|
16
|
+
theme?: "light" | "dark";
|
|
17
|
+
/** 下一条消息的模式与切换(内置 Web 由会话 store 管);不传时用会话自己的模式、不给切换。 */
|
|
18
|
+
mode?: "planning" | "executing";
|
|
19
|
+
onToggleMode?: () => void;
|
|
20
|
+
/** 连接状态条下方的横幅(插件选择、回放冲突提示等)。 */
|
|
21
|
+
banner?: ReactNode;
|
|
22
|
+
/** 消息列表上方 / 输入框下方的自定义区域,无消息时的空状态。 */
|
|
23
|
+
header?: ReactNode;
|
|
24
|
+
footer?: ReactNode;
|
|
25
|
+
emptyState?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* 回放条的「退出回放」。SDK 外壳用 `useReplay` 接管了「输入对不上录制内容」的决定,退出要先了结
|
|
28
|
+
* 待定的那次决定,所以由它传入;不传时回放条直接退出回放。
|
|
29
|
+
*/
|
|
30
|
+
onExitReplay?: () => void;
|
|
31
|
+
/** 额外的出错说明(例如 SDK 外壳的连接失败),显示在出错条里。 */
|
|
32
|
+
errorMessage?: string | null;
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
onFollowupInteraction?: (event: FollowupInteractionEvent) => void;
|
|
35
|
+
renderAttachments?: () => ReactNode;
|
|
36
|
+
onBeforeSend?: (content: MessageContent) => MessageContent | Promise<MessageContent>;
|
|
37
|
+
onCommand?: (commandId: string) => void | Promise<void>;
|
|
38
|
+
/** 宿主是否接住了「创建后台任务」;见输入框上的说明。 */
|
|
39
|
+
canCreateBoardTask?: boolean;
|
|
40
|
+
canShareSession?: boolean;
|
|
41
|
+
onResyncSkills?: () => void;
|
|
42
|
+
isResyncingSkills?: boolean;
|
|
43
|
+
/** 打开技能页;由宿主导航。 */
|
|
44
|
+
onOpenSkills?: () => void;
|
|
45
|
+
inputLabel?: string;
|
|
46
|
+
onDoubleEscape?: (anchorRect: DOMRect | null) => void;
|
|
47
|
+
composerHint?: ReactNode;
|
|
48
|
+
composerBanner?: ReactNode;
|
|
49
|
+
scrollToStartKey?: string | null;
|
|
50
|
+
scrollToEntryKey?: string | null;
|
|
51
|
+
initialDraft?: string;
|
|
52
|
+
initialDraftKey?: string;
|
|
53
|
+
renderMode?: ChatRenderMode;
|
|
54
|
+
/**
|
|
55
|
+
* 开发者视图专用的输入框底部统计插槽。宿主(内置 Web 页面)注入;普通与精简视图不会调用它,
|
|
56
|
+
* 因此也不会发出统计请求。
|
|
57
|
+
*/
|
|
58
|
+
renderComposerStats?: (sessionId: string) => ReactNode;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* 聊天面板:消息流 + 队列 + 输入框。数据只来自 SessionSourceProvider 提供的会话实例与 props;
|
|
62
|
+
* 内置 Web、浏览器插件与 SDK 的 ChatView / `<blade-chat>` 渲染的都是它。
|
|
63
|
+
*/
|
|
64
|
+
export declare function ChatPanel({ sessionId, theme, mode: providedMode, onToggleMode, banner, header, footer, emptyState, errorMessage: externalError, onExitReplay, placeholder, onFollowupInteraction, renderAttachments, onBeforeSend, onCommand, canCreateBoardTask, canShareSession, onResyncSkills, isResyncingSkills, onOpenSkills, inputLabel, onDoubleEscape, composerHint, composerBanner, scrollToStartKey, scrollToEntryKey, initialDraft, initialDraftKey, renderMode: requestedRenderMode, renderComposerStats, classNames, components, renderers, }: ChatPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CompactionInfo } from "@blade-hq/agent-client/internal";
|
|
2
|
+
export declare function CompactionCard({ sessionId, compaction, status, }: {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
compaction?: CompactionInfo | null;
|
|
5
|
+
status?: "streaming" | "completed" | "paused" | "failed" | "interrupted";
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ConnectionStatus } from "@blade-hq/agent-client/internal";
|
|
2
|
+
/**
|
|
3
|
+
* 连接状态提示:短暂断线不打扰(3 秒容错),恢复不了再提示。`hasEverConnected` 不传时按本组件
|
|
4
|
+
* 挂载以来是否连上过判断(决定文案是「无法恢复」还是「无法连接」)。
|
|
5
|
+
*/
|
|
6
|
+
export declare function ConnectionBanner({ connection, hasEverConnected: hasEverConnectedProp, className, }: {
|
|
7
|
+
connection: ConnectionStatus;
|
|
8
|
+
hasEverConnected?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ChatMessage } from "@blade-hq/agent-client/internal";
|
|
2
|
+
export declare function CurrentPlanPanelContent({ messages, running, autoReveal, sessionId, hideTodo, }: {
|
|
3
|
+
messages: ChatMessage[];
|
|
4
|
+
/** 会话是否还在执行;停止或加载历史时进度里的步骤不再转圈。 */
|
|
5
|
+
running?: boolean;
|
|
6
|
+
/** 仅当前这次消息变更来自实时成功的 update_plan 时为 true。 */
|
|
7
|
+
autoReveal?: boolean;
|
|
8
|
+
/** Key the plan block by session so switching sessions resets its local UI state. */
|
|
9
|
+
sessionId?: string;
|
|
10
|
+
hideTodo?: boolean;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export declare function CurrentPlanPanel({ sessionId, className, }: {
|
|
13
|
+
sessionId: string;
|
|
14
|
+
/**
|
|
15
|
+
* Wrapper classes applied only when there is a plan to show, so callers can
|
|
16
|
+
* add chrome (e.g. the composer's bottom divider) without leaving an empty
|
|
17
|
+
* bordered strip behind when the session never called `update_plan`.
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ToolCallInfo } from "@blade-hq/agent-client/internal";
|
|
2
|
+
/** 从该轮工具调用中提取智能体写入的工作区文件(去重、按出现顺序)。 */
|
|
3
|
+
export declare function collectDeliveredFiles(toolCalls: ToolCallInfo[], sessionId: string): Array<{
|
|
4
|
+
relPath: string;
|
|
5
|
+
name: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function DeliveryCard({ path, name, sessionId, description, displayName, compact, onOpen, onDownloadStarted, onDownloadSucceeded, }: {
|
|
8
|
+
/** 文件路径:工作目录下的相对路径,或容器内的绝对路径。 */
|
|
9
|
+
path: string;
|
|
10
|
+
name: string;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
/** 副标题;不传时按扩展名显示「Markdown · AI 生成」这类默认说明。 */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** 卡片可读名称;下载文件名仍使用 name。 */
|
|
15
|
+
displayName?: string;
|
|
16
|
+
/** 会话总结使用正文 MEDIA 卡片的紧凑样式。 */
|
|
17
|
+
compact?: boolean;
|
|
18
|
+
onOpen?: () => void;
|
|
19
|
+
onDownloadStarted?: () => void;
|
|
20
|
+
onDownloadSucceeded?: () => void;
|
|
21
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
/** 文件交付卡片组(需求 10):助手在本轮写入的工作区文件,以卡片形式内联展示。 */
|
|
23
|
+
export declare function FileDeliveryCards({ toolCalls, sessionId, }: {
|
|
24
|
+
toolCalls: ToolCallInfo[];
|
|
25
|
+
sessionId: string;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FinalArtifact } from "@blade-hq/agent-client/internal";
|
|
2
|
+
/** 会话小结里的产物卡片:本轮交付的文件和网址,点击直接打开。 */
|
|
3
|
+
export declare function FinalArtifactCards({ artifacts, sessionId, assistantEntryId, }: {
|
|
4
|
+
artifacts: FinalArtifact[];
|
|
5
|
+
sessionId: string;
|
|
6
|
+
/** 所属回复;交互事件(`onFollowupInteraction`)用它指明是哪一轮的成果。 */
|
|
7
|
+
assistantEntryId: string;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface ImageLightboxProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onOpenChange: (open: boolean) => void;
|
|
4
|
+
images: {
|
|
5
|
+
src: string;
|
|
6
|
+
alt: string;
|
|
7
|
+
}[];
|
|
8
|
+
initialIndex?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function ImageLightbox({ open, onOpenChange, images, initialIndex }: ImageLightboxProps): import("react").ReactPortal | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComposerProps } from "./customization";
|
|
2
|
+
/**
|
|
3
|
+
* 轻输入(SDK 与 `<blade-chat>` 的默认输入框):纯文本 textarea,不带富文本编辑、提及、`/` 菜单、
|
|
4
|
+
* 语音与模型选择。`AgentSession.attach()` / `insertText()`(页面协作、跟进建议、MCP 应用消息)
|
|
5
|
+
* 都落进这里的文本。
|
|
6
|
+
*/
|
|
7
|
+
export declare function LightComposer({ sessionId, onSend, onStop, isStreaming, isStopping, queueWhileRunning, mergesWithPanelAbove, planPanel, placeholderText, className, innerClassName, maxWidthClassName, initialDraft, initialDraftKey, }: ComposerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type CitationEntry } from "./lib/citations";
|
|
2
|
+
import type { ChatMessage, ToolCallInfo } from "@blade-hq/agent-client/internal";
|
|
3
|
+
import type { PostChatFollowup } from "@blade-hq/agent-client/internal";
|
|
4
|
+
import type { ResultFeedback as SavedResultFeedback } from "@blade-hq/agent-client/internal";
|
|
5
|
+
import type { AskUserAnswerData } from "./AskUserQuestionBlock";
|
|
6
|
+
type TextRow = {
|
|
7
|
+
type: "text";
|
|
8
|
+
key: string;
|
|
9
|
+
role: "user" | "assistant" | "error";
|
|
10
|
+
text: string;
|
|
11
|
+
entryIds: string[];
|
|
12
|
+
failed?: boolean;
|
|
13
|
+
/** 本轮(含子智能体循环)真实检索到的引用证据,只有 assistant 文本行才有——
|
|
14
|
+
* 跟 AssistantTurnBlock.tsx 的 turnToolCalls/citations 同一套算法,不然轻量
|
|
15
|
+
* 模式下 kb_search 的 [n] 角标只能停在纯文本,点不开、也 hover 不出来源。 */
|
|
16
|
+
citations?: Record<number, CitationEntry>;
|
|
17
|
+
};
|
|
18
|
+
type MemoryRefsRow = {
|
|
19
|
+
type: "memory-refs";
|
|
20
|
+
key: string;
|
|
21
|
+
refs: NonNullable<ChatMessage["memory_refs"]>;
|
|
22
|
+
};
|
|
23
|
+
type FollowupRow = {
|
|
24
|
+
type: "followup";
|
|
25
|
+
key: string;
|
|
26
|
+
followup: PostChatFollowup;
|
|
27
|
+
};
|
|
28
|
+
type HistoricalFeedbackRow = {
|
|
29
|
+
type: "historical-feedback";
|
|
30
|
+
key: string;
|
|
31
|
+
feedback: SavedResultFeedback;
|
|
32
|
+
};
|
|
33
|
+
type QuestionRow = {
|
|
34
|
+
type: "question";
|
|
35
|
+
key: string;
|
|
36
|
+
toolCall: ToolCallInfo;
|
|
37
|
+
turnBlocks: ChatMessage["blocks"];
|
|
38
|
+
};
|
|
39
|
+
type ToolDescriptionRow = {
|
|
40
|
+
type: "tool-description";
|
|
41
|
+
key: string;
|
|
42
|
+
description: string;
|
|
43
|
+
running: boolean;
|
|
44
|
+
};
|
|
45
|
+
type ContextGroupRow = {
|
|
46
|
+
type: "context-group";
|
|
47
|
+
key: string;
|
|
48
|
+
contexts: NonNullable<ChatMessage["context"]>[];
|
|
49
|
+
};
|
|
50
|
+
type ContextDividerRow = {
|
|
51
|
+
type: "context-divider";
|
|
52
|
+
key: string;
|
|
53
|
+
};
|
|
54
|
+
type LiteRow = {
|
|
55
|
+
type: "background-wakeup";
|
|
56
|
+
key: string;
|
|
57
|
+
} | TextRow | MemoryRefsRow | FollowupRow | HistoricalFeedbackRow | QuestionRow | ToolDescriptionRow | ContextGroupRow | ContextDividerRow;
|
|
58
|
+
export declare function buildLiteRows({ messages, followup, sessionMessages, agentLoops, resultFeedbackByEntry, showContexts, }: {
|
|
59
|
+
messages: ChatMessage[];
|
|
60
|
+
followup: PostChatFollowup | null;
|
|
61
|
+
sessionMessages?: ChatMessage[];
|
|
62
|
+
agentLoops?: Record<string, {
|
|
63
|
+
toolCallId: string;
|
|
64
|
+
}>;
|
|
65
|
+
resultFeedbackByEntry?: ReadonlyMap<string, SavedResultFeedback>;
|
|
66
|
+
showContexts?: boolean;
|
|
67
|
+
}): LiteRow[];
|
|
68
|
+
export declare function LiteMessageList({ sessionId, messages, followup, isViewer, isLoadingHistory, sessionStatus, isStreaming, resultFeedbackByEntry, onResultFeedbackSaved, onAnswer, onLoadOlder, historyLoadRevision, }: {
|
|
69
|
+
sessionId: string;
|
|
70
|
+
messages: ChatMessage[];
|
|
71
|
+
followup: PostChatFollowup | null;
|
|
72
|
+
isViewer: boolean;
|
|
73
|
+
isLoadingHistory: boolean;
|
|
74
|
+
sessionStatus?: string;
|
|
75
|
+
isStreaming?: boolean;
|
|
76
|
+
resultFeedbackByEntry?: ReadonlyMap<string, SavedResultFeedback>;
|
|
77
|
+
onResultFeedbackSaved?: (feedback: SavedResultFeedback) => void;
|
|
78
|
+
onAnswer?: (answer: string, toolCallId: string, answerData: AskUserAnswerData) => void;
|
|
79
|
+
onLoadOlder?: (beforeCommit?: () => void) => Promise<boolean>;
|
|
80
|
+
historyLoadRevision?: number;
|
|
81
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ParsedTextContext } from "@blade-hq/agent-client/internal";
|
|
2
|
+
interface MessageContextPillsProps {
|
|
3
|
+
contexts: ParsedTextContext[];
|
|
4
|
+
}
|
|
5
|
+
export declare function MessageContextPills({ contexts }: MessageContextPillsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FileContentPart } from "@blade-hq/agent-client/internal";
|
|
2
|
+
interface MessageFileAttachmentListProps {
|
|
3
|
+
files: FileContentPart[];
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* R6:点击 pill 时的预览回调。不传时 pill 保持纯展示(向后兼容,Home /
|
|
7
|
+
* ChatDev 等复用点零改动)。调用方自己决定 URL 来源 + 渲染什么(lightbox /
|
|
8
|
+
* FilePreviewDialog / 下载等)。
|
|
9
|
+
*/
|
|
10
|
+
onPreview?: (file: FileContentPart) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function MessageFileAttachmentList({ files, className, onPreview, }: MessageFileAttachmentListProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { ChatMessage } from "@blade-hq/agent-client/internal";
|
|
3
|
+
import type { PostChatFollowup } from "@blade-hq/agent-client/internal";
|
|
4
|
+
import type { ResultFeedback } from "@blade-hq/agent-client/internal";
|
|
5
|
+
import type { AskUserAnswerData } from "./AskUserQuestionBlock";
|
|
6
|
+
import type { ChatViewCustomization } from "./customization";
|
|
7
|
+
export { shouldAppendPendingAssistantTurn } from "./message-list-blocks";
|
|
8
|
+
export interface MessageListProps {
|
|
9
|
+
sessionId: string;
|
|
10
|
+
messages: ChatMessage[];
|
|
11
|
+
onAnswer?: (answer: string, toolCallId: string, answerData: AskUserAnswerData) => void;
|
|
12
|
+
sessionStatus?: string;
|
|
13
|
+
onConfirmPlan?: (action: "execute" | "revise", text?: string) => void;
|
|
14
|
+
customization?: ChatViewCustomization;
|
|
15
|
+
scrollToStartKey?: string | null;
|
|
16
|
+
scrollToEntryKey?: string | null;
|
|
17
|
+
postChatFollowup?: PostChatFollowup | null;
|
|
18
|
+
resultFeedbackByEntry?: ReadonlyMap<string, ResultFeedback>;
|
|
19
|
+
onResultFeedbackSaved?: (feedback: ResultFeedback) => void;
|
|
20
|
+
isViewer?: boolean;
|
|
21
|
+
/** 历史消息还在加载中(大会话要等几秒)。 */
|
|
22
|
+
isLoadingHistory?: boolean;
|
|
23
|
+
onLoadOlder?: (beforeCommit?: () => void) => Promise<boolean>;
|
|
24
|
+
historyLoadRevision?: number;
|
|
25
|
+
/** 外部改写 timeline(rewind / checkout / 修复重载)的次数:导航目录据此作废。 */
|
|
26
|
+
historyRewriteRevision?: number;
|
|
27
|
+
/**
|
|
28
|
+
* 用户点了停止(还没等服务端确认)——打字机式显示节流要在这一刻立刻整段
|
|
29
|
+
* 显示已到达内容,不能等 chat:stop 的服务端回包才响应。跟 sessionIsStreaming
|
|
30
|
+
* 翻转成 false 不是一回事:那个信号来得晚,点击到服务端确认之间有一段
|
|
31
|
+
* 网络往返,这段时间里节流动画不该继续播。
|
|
32
|
+
*/
|
|
33
|
+
isStopping?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 打字机式显示节流是否还没追平目标全文——调用方需要跟 isStreaming 做
|
|
36
|
+
* `||` 判断输入框"运行中"状态,否则输入框会先于文字播完就翻回可输入。
|
|
37
|
+
*/
|
|
38
|
+
onRevealingChange?: (revealing: boolean) => void;
|
|
39
|
+
/**
|
|
40
|
+
* 是否正在回放(演示 / 彩排)而非真正的实时直播——回放期间即使内容在
|
|
41
|
+
* 增长也不进入打字机式节流,直接整段显示:这是"流式与历史必须产生相同
|
|
42
|
+
* 结果"这条硬规则的一部分,节流只在真正的实时直播里生效。
|
|
43
|
+
*/
|
|
44
|
+
isReplay?: boolean;
|
|
45
|
+
/** 无消息时的空状态;不传时用默认的「开始对话」。 */
|
|
46
|
+
emptyState?: ReactNode;
|
|
47
|
+
/** 是否正在生成;不传时读会话状态(纯 LLM 模式没有会话,由调用方给)。 */
|
|
48
|
+
isStreaming?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 消息列表。单独使用时(方案布局、开发调试页)没有聊天面板提供的「当前会话」,这里按传入的
|
|
52
|
+
* 会话补上,用户消息里的附件预览、工具卡的文件入口据此找到会话文件。
|
|
53
|
+
*/
|
|
54
|
+
export declare function MessageList(props: MessageListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ResultFeedback as SavedResultFeedback } from "@blade-hq/agent-client/internal";
|
|
2
|
+
import type { PostChatFollowup } from "@blade-hq/agent-client/internal";
|
|
3
|
+
interface Props {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
followup: PostChatFollowup | null;
|
|
6
|
+
isViewer: boolean;
|
|
7
|
+
savedFeedback?: SavedResultFeedback;
|
|
8
|
+
onFeedbackSaved?: (feedback: SavedResultFeedback) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function PostChatFollowupBlock({ sessionId, followup, isViewer, savedFeedback, onFeedbackSaved, }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -9,7 +9,6 @@ interface State {
|
|
|
9
9
|
componentStack: string;
|
|
10
10
|
error: Error | null;
|
|
11
11
|
}
|
|
12
|
-
/** 消息级渲染错误边界:单条消息渲染崩溃时降级为提示卡片,不拖垮整个列表。 */
|
|
13
12
|
export declare class RenderErrorBoundary extends Component<Props, State> {
|
|
14
13
|
state: State;
|
|
15
14
|
static getDerivedStateFromError(error: Error): State;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PostChatFollowup, ResultFeedback as SavedResultFeedback } from "@blade-hq/agent-client/internal";
|
|
2
|
+
export declare function HistoricalResultFeedback({ feedback }: {
|
|
3
|
+
feedback: SavedResultFeedback;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function ResultFeedback({ sessionId, followup, isViewer, savedFeedback, onSaved, }: {
|
|
6
|
+
sessionId: string;
|
|
7
|
+
followup: PostChatFollowup;
|
|
8
|
+
isViewer: boolean;
|
|
9
|
+
savedFeedback?: SavedResultFeedback;
|
|
10
|
+
onSaved?: (feedback: SavedResultFeedback) => void;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 回放会话的状态条:说明"现在是在重现之前的对话",并给出倍速和退出。
|
|
3
|
+
*
|
|
4
|
+
* 没有它的话,带方案的回放会话(软件工厂、Solution 会话)看起来和普通对话一模一样——
|
|
5
|
+
* 既不知道自己在回放,也退不出来。只读身份也显示(控件禁用)。
|
|
6
|
+
*/
|
|
7
|
+
export declare function SessionReplayBar({ sessionId, className, onExit, }: {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
/** 宿主自己接管了「输入对不上录制内容」的处理时传入:退出要先了结那次待定的决定。 */
|
|
11
|
+
onExit?: () => void;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ParsedTextAttachment } from "@blade-hq/agent-client/internal";
|
|
2
|
+
interface TextAttachmentPillsProps {
|
|
3
|
+
attachments: ParsedTextAttachment[];
|
|
4
|
+
/**
|
|
5
|
+
* R6:点击 pill 时的预览回调。不传时保持纯展示(向后兼容)。
|
|
6
|
+
*/
|
|
7
|
+
onPreview?: (attachment: ParsedTextAttachment) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function TextAttachmentPills({ attachments, onPreview }: TextAttachmentPillsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ToolCallInfo } from "@blade-hq/agent-client/internal";
|
|
2
|
+
import type { ContentBlock } from "@blade-hq/agent-client/internal";
|
|
3
|
+
import { type AskUserAnswerData } from "./AskUserQuestionBlock";
|
|
4
|
+
import type { ChatViewCustomization } from "./customization";
|
|
5
|
+
export declare function getFilePreviewName(filePath: string): string;
|
|
6
|
+
export declare function ToolFilePreviewAction({ toolCall, sessionId, className, }: {
|
|
7
|
+
toolCall: ToolCallInfo;
|
|
8
|
+
sessionId?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
interface Props {
|
|
12
|
+
toolCall: ToolCallInfo;
|
|
13
|
+
onAnswer?: (answer: string, toolCallId: string, answerData: AskUserAnswerData) => void;
|
|
14
|
+
answered?: boolean;
|
|
15
|
+
answerData?: AskUserAnswerData;
|
|
16
|
+
sessionId?: string;
|
|
17
|
+
sessionStatus?: string;
|
|
18
|
+
isActiveQuestion?: boolean;
|
|
19
|
+
level?: 1 | 2;
|
|
20
|
+
turnBlocks?: ContentBlock[];
|
|
21
|
+
reasoning?: string;
|
|
22
|
+
customization?: ChatViewCustomization;
|
|
23
|
+
}
|
|
24
|
+
export declare function ToolPreviewAction({ toolCall, sessionId: providedSessionId, turnBlocks, className, }: {
|
|
25
|
+
toolCall: ToolCallInfo;
|
|
26
|
+
sessionId?: string;
|
|
27
|
+
turnBlocks?: ContentBlock[];
|
|
28
|
+
className?: string;
|
|
29
|
+
}): 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, }: {
|
|
39
|
+
toolStatus: ToolCallInfo["status"];
|
|
40
|
+
hasAnswerData: boolean;
|
|
41
|
+
fallbackAnswered?: boolean;
|
|
42
|
+
fallbackAwaiting?: boolean;
|
|
43
|
+
}): {
|
|
44
|
+
awaitingAnswer: boolean;
|
|
45
|
+
answered: boolean;
|
|
46
|
+
};
|
|
47
|
+
export declare function ToolCallBlock({ toolCall, onAnswer, answered, answerData, sessionId: providedSessionId, sessionStatus, isActiveQuestion, level, turnBlocks, reasoning, customization, }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ToolUiCard as ToolUiCardData } from "@blade-hq/agent-client/internal";
|
|
2
|
+
/** 消息里的 tool_ui 卡片:宿主注入了渲染器就用宿主的(内置 Web 的资源桥接),否则用 SDK 的。 */
|
|
3
|
+
export declare function ToolUiCard({ card, sessionId }: {
|
|
4
|
+
card: ToolUiCardData;
|
|
5
|
+
sessionId: string;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface TurnNavItem {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
}
|
|
5
|
+
interface TurnNavRailProps {
|
|
6
|
+
items: TurnNavItem[];
|
|
7
|
+
activeTurnId: string | null;
|
|
8
|
+
onSelectTurn: (turnId: string) => void;
|
|
9
|
+
/** 正在请求定位的目标;null / 不传表示没有在途定位(开发者列表不传)。 */
|
|
10
|
+
loadingTurnId?: string | null;
|
|
11
|
+
/** 定位失败提示。 */
|
|
12
|
+
error?: string | null;
|
|
13
|
+
/** 定位失败的那条发言;重试按钮就再点它一次。 */
|
|
14
|
+
failedTurnId?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare function TurnNavRail({ items, activeTurnId, onSelectTurn, loadingTurnId, error, failedTurnId, }: TurnNavRailProps): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ChatMessage } from "@blade-hq/agent-client/internal";
|
|
2
|
+
export type UserChatMessage = ChatMessage & {
|
|
3
|
+
role: "user";
|
|
4
|
+
};
|
|
5
|
+
export type ErrorChatMessage = ChatMessage & {
|
|
6
|
+
role: "error";
|
|
7
|
+
};
|
|
8
|
+
export declare function isUserMessage(message: ChatMessage): message is UserChatMessage;
|
|
9
|
+
export declare function isErrorMessage(message: ChatMessage): message is ErrorChatMessage;
|
|
10
|
+
interface UserMessageProps {
|
|
11
|
+
message: UserChatMessage;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const USER_MESSAGE_MARKDOWN_CLASS = "prose prose-invert chat-prose max-w-none [&_li>p]:inline [&_li>p]:whitespace-pre-wrap [&_p]:whitespace-pre-wrap";
|
|
15
|
+
export declare function UserMessageBubble({ message, className }: UserMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function ErrorMessageBlock({ message, className, }: {
|
|
17
|
+
message: ErrorChatMessage;
|
|
18
|
+
className?: string;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ToolCallInfo } from "@blade-hq/agent-client/internal";
|
|
2
|
+
interface Props {
|
|
3
|
+
/** 触发这次运行的 workflow:run 工具调用。 */
|
|
4
|
+
toolCall: ToolCallInfo;
|
|
5
|
+
sessionId: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 「工作流运行」块:一次 workflow:run 的执行呈现——每个步骤一张卡顺序铺开
|
|
9
|
+
* (agent 步骤=完整子智能体卡,命令/条件步骤=描述+输出的小卡),头部可整体折叠。
|
|
10
|
+
* 渲染在触发它的回合内部(思考折叠区之后、总结之前),随回合持久。
|
|
11
|
+
*/
|
|
12
|
+
export declare function WorkflowRunBlock({ toolCall, sessionId }: Props): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@blade-hq/ui/components/collapsible";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
interface ReasoningContextValue {
|
|
4
|
+
isStreaming: boolean;
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
setIsOpen: (open: boolean) => void;
|
|
7
|
+
duration: number | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare const useReasoning: () => ReasoningContextValue;
|
|
10
|
+
export type ReasoningProps = ComponentProps<typeof Collapsible> & {
|
|
11
|
+
isStreaming?: boolean;
|
|
12
|
+
open?: boolean;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
duration?: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const Reasoning: import("react").MemoExoticComponent<({ className, isStreaming, open, defaultOpen, onOpenChange, duration: durationProp, children, ...props }: ReasoningProps) => import("react/jsx-runtime").JSX.Element>;
|
|
18
|
+
export type ReasoningTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
|
|
19
|
+
wordCount: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const ReasoningTrigger: import("react").MemoExoticComponent<({ className, children, wordCount, ...props }: ReasoningTriggerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
22
|
+
export type ReasoningContentProps = ComponentProps<typeof CollapsibleContent> & {
|
|
23
|
+
children: string;
|
|
24
|
+
};
|
|
25
|
+
export declare const ReasoningContent: import("react").MemoExoticComponent<({ className, children, ...props }: ReasoningContentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
26
|
+
export type ThinkingBadgeProps = {
|
|
27
|
+
reasoning: string;
|
|
28
|
+
variant?: "inline" | "block";
|
|
29
|
+
onClick?: ComponentProps<"button">["onClick"];
|
|
30
|
+
};
|
|
31
|
+
export declare function ThinkingBadge({ reasoning, variant, onClick }: ThinkingBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ElementType } from "react";
|
|
2
|
+
export interface TextShimmerProps {
|
|
3
|
+
children: string;
|
|
4
|
+
as?: ElementType;
|
|
5
|
+
className?: string;
|
|
6
|
+
duration?: number;
|
|
7
|
+
spread?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 流式等待时的扫光文字。动画是纯 CSS(`blade-shimmer-sweep`,定义在 chat.css),
|
|
11
|
+
* 不引入动画库。
|
|
12
|
+
*/
|
|
13
|
+
declare const ShimmerComponent: ({ children, as: Component, className, duration, spread, }: TextShimmerProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const Shimmer: import("react").MemoExoticComponent<typeof ShimmerComponent>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChatMessage, ToolCallInfo } from "@blade-hq/agent-client/internal";
|
|
2
|
+
import type { AskUserAnswerData } from "./AskUserQuestionBlock";
|
|
3
|
+
export declare function collectTurnMessages({ rootMessages, sessionMessages, agentLoops, }: {
|
|
4
|
+
rootMessages: ChatMessage[];
|
|
5
|
+
sessionMessages: ChatMessage[];
|
|
6
|
+
agentLoops: Record<string, {
|
|
7
|
+
toolCallId: string;
|
|
8
|
+
}>;
|
|
9
|
+
}): ChatMessage[];
|
|
10
|
+
export declare function getPersistentAskUserQuestions(messages: ChatMessage[]): {
|
|
11
|
+
toolCall: ToolCallInfo;
|
|
12
|
+
turnBlocks: import("@blade-hq/agent-client/internal").ContentBlock[] | undefined;
|
|
13
|
+
}[];
|
|
14
|
+
export declare function toolCallAnswered(toolCall: ToolCallInfo, sessionStatus: string | undefined, answerData: AskUserAnswerData | undefined): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface CardContextValue {
|
|
2
|
+
sendMessage?: (content: string) => Promise<void>;
|
|
3
|
+
sessionId?: string;
|
|
4
|
+
messageId?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const CardContext: import("react").Context<CardContextValue>;
|
|
7
|
+
export declare const useCardContext: () => CardContextValue;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 聊天区的语义配色。
|
|
3
|
+
*
|
|
4
|
+
* 全站共用一套令牌(见仓库根 DESIGN.md):中性灰负责层级,颜色只表达状态。
|
|
5
|
+
* 所以「进行中」「思考中」这类过程态走中性色,只有成功 / 警告 / 失败三种结果态
|
|
6
|
+
* 才允许带颜色。
|
|
7
|
+
*
|
|
8
|
+
* 不要在组件里直接写调色板类(text-blue-500 这种)——它们不走 CSS 变量,
|
|
9
|
+
* 切主题时不会变。需要新的语义时加到下面的 TONE_CLASSES 里。
|
|
10
|
+
*/
|
|
11
|
+
/** 颜色表达的是什么,而不是它长什么样。 */
|
|
12
|
+
export type ChatTone = "running" | "reasoning" | "success" | "warning" | "danger";
|
|
13
|
+
interface ToneStyle {
|
|
14
|
+
text: string;
|
|
15
|
+
border: string;
|
|
16
|
+
surface: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function chatTone(tone: ChatTone): ToneStyle;
|
|
19
|
+
export {};
|