@blade-hq/agent-react 2608.0.8-beta.0 → 2608.0.8
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 +2 -151
- package/dist/components/AssistantTurnBlock.d.ts +1 -1
- package/dist/components/ChatView.d.ts +39 -19
- package/dist/components/ConnectionBanner.d.ts +1 -1
- package/dist/components/FileCard.d.ts +3 -3
- package/dist/components/MarkdownContent.d.ts +2 -2
- package/dist/components/MessageList.d.ts +1 -1
- package/dist/embed/entry.d.ts +3 -2
- package/dist/index.d.ts +0 -13
- package/dist/index.js +329 -1221
- package/dist/index.js.map +1 -1
- package/dist/lib/media-tags.d.ts +3 -3
- package/dist/style.css +11 -38
- package/dist/style.full.css +12 -39
- package/package.json +2 -2
- package/public-api.md +25 -255
- package/dist/components/AgentChat.d.ts +0 -18
- package/dist/components/ChatSurface.d.ts +0 -59
- package/dist/components/LlmAdvancedSettings.d.ts +0 -40
- package/dist/components/LlmChat.d.ts +0 -29
- package/dist/components/ReplayBar.d.ts +0 -13
- package/dist/components/ReplayMismatchPrompt.d.ts +0 -8
- package/dist/hooks/use-llm-chat.d.ts +0 -57
- package/dist/hooks/use-replay.d.ts +0 -50
package/README.md
CHANGED
|
@@ -68,66 +68,6 @@ await session?.send("你好")
|
|
|
68
68
|
- 自动创建只发生一次(含 React StrictMode 双跑);创建出的 id 通过 `onSessionCreated` 交还,重挂载时把它作为 `sessionId` 传回即可复用会话。
|
|
69
69
|
- 同一 `sessionId` 的多次调用复用同一 `AgentSession` 实例(引用计数);卸载后延迟释放,路由抖动不会断连。
|
|
70
70
|
|
|
71
|
-
## useReplay
|
|
72
|
-
|
|
73
|
-
会话回放(演示 / 彩排):拿一个已经聊完的会话当素材,重现当时的回复和工具调用,
|
|
74
|
-
**完全不调用模型**。
|
|
75
|
-
|
|
76
|
-
**进入回放是"派生一个新会话",不是把当前会话切模式**:`startReplay()` 返回的是新会话
|
|
77
|
-
的 id,拿它去渲染(`<ChatView sessionId={newId} />` 或自己 `connect`)才进入回放。源会话
|
|
78
|
-
原样不动。连上之后也不会自动播——用户照着源会话的问题问,才逐句重现。
|
|
79
|
-
|
|
80
|
-
同一个 hook 覆盖两种身份——传进去的会话既可能是准备被回放的**源会话**,也可能是**回放中**的会话:
|
|
81
|
-
|
|
82
|
-
```tsx
|
|
83
|
-
// —— 源会话页面:提供"开始回放"入口 ——
|
|
84
|
-
const { session: sourceSession } = useAgentSession(sourceId)
|
|
85
|
-
const source = useReplay(sourceSession)
|
|
86
|
-
|
|
87
|
-
source.canReplay // false 时 source.unsupportedReason 可直接展示
|
|
88
|
-
const replayId = await source.startReplay(5) // 返回**新建的**回放会话 id,路由过去
|
|
89
|
-
|
|
90
|
-
// —— 回放会话页面:状态与控制 ——
|
|
91
|
-
const { session: replaySession } = useAgentSession(replayId)
|
|
92
|
-
const replay = useReplay(replaySession)
|
|
93
|
-
|
|
94
|
-
replay.isReplay // 是不是在回放
|
|
95
|
-
replay.speed // 当前倍速
|
|
96
|
-
replay.canControl // 改回放是 owner 专属;分享出去的只读会话为 false
|
|
97
|
-
replay.mismatch // 输入和录制对不上时的待决策项
|
|
98
|
-
await replay.setSpeed(2)
|
|
99
|
-
await replay.exitToAutonomous() // 退出回放,之后真的运行
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
配套两个组件,直接接上 `useReplay()` 的返回值即可:
|
|
103
|
-
|
|
104
|
-
```tsx
|
|
105
|
-
<ReplayBar
|
|
106
|
-
isReplay={replay.isReplay}
|
|
107
|
-
speed={replay.speed}
|
|
108
|
-
canControl={replay.canControl}
|
|
109
|
-
onSpeedChange={(s) => void replay.setSpeed(s)}
|
|
110
|
-
onExit={() => void replay.exitToAutonomous()}
|
|
111
|
-
/>
|
|
112
|
-
<ReplayMismatchPrompt mismatch={replay.mismatch} />
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
返回值见 `UseReplayResult`,冲突项见 `ReplayMismatch`,组件属性见 `ReplayBarProps` /
|
|
116
|
-
`ReplayMismatchPromptProps`。
|
|
117
|
-
|
|
118
|
-
只读身份(分享链接打开的会话)仍然会显示「回放模式」——这是会话事实,藏起来会让分享出去的
|
|
119
|
-
回放看着像真实运行;但倍速和退出会被禁用,因为服务端的 `PATCH` 是 owner 专属。
|
|
120
|
-
|
|
121
|
-
**`ChatView` 已经自带这一整套**——用它打开回放会话,状态条、倍速、退出、冲突卡片都在,
|
|
122
|
-
不用自己接。下面这些 API 是给自建 UI 用的。
|
|
123
|
-
|
|
124
|
-
**注册即接管**:底层的 `replayMismatch` 只交给最先注册的处理器。调用 `useReplay()`(或用
|
|
125
|
-
`ChatView`)就意味着由它接管冲突;两者都不用则维持 SDK 默认行为——静默转为真实运行。
|
|
126
|
-
|
|
127
|
-
回放状态本身住在 `SessionState.replay` 里,本 hook 只是它的 React 绑定。非 React 宿主
|
|
128
|
-
(Vue、Svelte、自建 UI)直接订阅快照即可,不需要这个包,用法见
|
|
129
|
-
[agent-client 的会话回放章节](../agent-client/README.md#会话回放演示--彩排)。
|
|
130
|
-
|
|
131
71
|
## ChatView
|
|
132
72
|
|
|
133
73
|
完整聊天界面:消息列表(Markdown、代码高亮、工具调用、提问卡片)+ 输入框 + 连接状态条 + 登录引导。
|
|
@@ -156,95 +96,6 @@ await replay.exitToAutonomous() // 退出回放,之后真的运
|
|
|
156
96
|
- `renderers.toolCall` 返回 `null` 时回落到默认工具卡片。
|
|
157
97
|
- **内边距按容器宽度伸缩**,嵌进窄侧栏(300–400px)时会自动收窄,不看浏览器视口。代价是聊天容器需要有确定宽度——放在 flex/grid 里被拉伸,或显式给宽度都可以;放进 `width: fit-content`、`inline-flex` 这类由内容决定宽度的父容器会塌缩。
|
|
158
98
|
|
|
159
|
-
## 纯 LLM 模式(不建会话)
|
|
160
|
-
|
|
161
|
-
有些应用只要「一问一答」——分类、改写、总结,不需要智能体、不需要会话、也不需要用户登录
|
|
162
|
-
Blade。这时把 `ChatView` 切到 `mode="llm"`,或者直接用下层的 `LlmChat`,界面完全一样:
|
|
163
|
-
|
|
164
|
-
```tsx
|
|
165
|
-
<ChatView /> // 默认:智能体模式,行为不变
|
|
166
|
-
<ChatView mode="llm" llm={{ baseURL: "/api/llm", model }} /> // 切成纯 LLM
|
|
167
|
-
<LlmChat baseURL="/api/llm" model={model} /> // 或者直接用(LlmChatProps)
|
|
168
|
-
<AgentChat sessionId={id} /> // 智能体那侧同样可以直接用(AgentChatProps)
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
**协议就是 OpenAI 的**:`POST {baseURL}/chat/completions`,`stream: true`,读
|
|
172
|
-
`choices[0].delta`。任何 OpenAI 兼容实现(Blade 网关、vLLM、Ollama、OpenAI 本身、你自己的
|
|
173
|
-
透传代理)都能直接接,不用为这个组件专门写后端。
|
|
174
|
-
|
|
175
|
-
**密钥默认不进浏览器**:把 `baseURL` 指向自己后端的一个路径,后端补上 `Authorization` 再原样
|
|
176
|
-
转发即可(协议是标准的,这个代理就是纯转发)。确实要前端直连时才传 `apiKey`——只适合受控内网、
|
|
177
|
-
演示,或密钥本身就属于当前用户的场景。
|
|
178
|
-
|
|
179
|
-
**模型服务地址和模型名别写死**,用 `client.models.list()` 拿,各部署端口不一样:
|
|
180
|
-
|
|
181
|
-
```tsx
|
|
182
|
-
const { baseUrl, defaultServiceModel, models } = await client.models.list()
|
|
183
|
-
|
|
184
|
-
// 后端透传(推荐):baseURL 指向自己的路径,模型名仍然要用 defaultServiceModel
|
|
185
|
-
<ChatView mode="llm" llm={{ baseURL: "/api/llm", model: defaultServiceModel }} />
|
|
186
|
-
|
|
187
|
-
// 浏览器直连:仅当 baseUrl 对浏览器也可达时
|
|
188
|
-
<ChatView mode="llm" llm={{ baseURL: baseUrl, model: defaultServiceModel, apiKey }} />
|
|
189
|
-
|
|
190
|
-
// 让用户选模型时,过滤掉不在这个服务上的
|
|
191
|
-
models.filter((m) => m.serviceModelId)
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
**模型名要用 `defaultServiceModel` / `serviceModelId`,不是 `default` / `id`。** 后者是平台内部
|
|
195
|
-
标识,平台接了多个模型服务时形如 `provider-xxx::deepseek-v4-flash`,发给模型服务只会得到
|
|
196
|
-
「模型不存在」。`baseUrl` 同理是服务端视角的地址,平台常配成 `http://127.0.0.1:30000/v1`,
|
|
197
|
-
那是给自己后端转发用的,不能直接丢给浏览器。
|
|
198
|
-
|
|
199
|
-
**工具调用走 OpenAI 标准的多轮流程**,不需要任何私有扩展:声明 `tools`,在 `onToolCall`
|
|
200
|
-
(收到 `LlmToolCall`)里执行——通常就是调你自己应用的同源接口——返回值会作为
|
|
201
|
-
`role: "tool"` 消息回喂给模型,直到它给出最终回答或达到 `maxToolRounds`(默认 4)。
|
|
202
|
-
每一轮工具调用都会渲染成和智能体模式一样的工具卡片。
|
|
203
|
-
|
|
204
|
-
```tsx
|
|
205
|
-
<LlmChat
|
|
206
|
-
baseURL="/api/llm"
|
|
207
|
-
model={model}
|
|
208
|
-
system="你是订单助手"
|
|
209
|
-
tools={[{ type: "function", function: { name: "query_orders", parameters: schema } }]} // ChatCompletionTool
|
|
210
|
-
onToolCall={async ({ name, arguments: args }) => {
|
|
211
|
-
if (name !== "query_orders") throw new Error(`没有这个函数:${name}`)
|
|
212
|
-
// 参数是模型生成的不可信输入:先校验类型,再用 URLSearchParams 拼,
|
|
213
|
-
// 直接塞进查询串的话,一个 `李航&limit=all` 就能多带出参数
|
|
214
|
-
const { owner } = JSON.parse(args || "{}")
|
|
215
|
-
if (typeof owner !== "string") throw new Error("owner 必须是字符串")
|
|
216
|
-
const query = new URLSearchParams({ owner })
|
|
217
|
-
const resp = await fetch(`/api/orders?${query}`)
|
|
218
|
-
if (!resp.ok) throw new Error(`订单接口返回 ${resp.status}`)
|
|
219
|
-
return resp.json()
|
|
220
|
-
}}
|
|
221
|
-
onReady={(handle) => setChat(handle)} // LlmChatHandle:insertText / send / reset
|
|
222
|
-
/>
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
### 让用户自己改模型服务地址
|
|
226
|
-
|
|
227
|
-
传 `advanced` 就在输入框上方多一行「高级设置」(默认收起),用户可以改模型服务地址和模型名;
|
|
228
|
-
改过之后会显示「已自定义」,也能一键恢复默认。不传就一个节点都不渲染。
|
|
229
|
-
|
|
230
|
-
```tsx
|
|
231
|
-
<LlmChat baseURL="/api/llm" model={model} advanced />
|
|
232
|
-
<LlmChat baseURL="/api/llm" model={model} advanced={{ apiKey: true, storage: "memory" }} />
|
|
233
|
-
<ChatView mode="llm" llm={{ baseURL: "/api/llm", model, advanced: true }} />
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
`LlmAdvancedSettings` 可细调:`baseURL` / `model` 各自能不能改(默认都能)、`apiKey` 要不要
|
|
237
|
-
出现(**默认不出现**,打开意味着密钥存在浏览器里,只适合受控场景)、`storage` 是记住选择
|
|
238
|
-
(`local`,默认)还是只在本次有效(`memory`)、`storageKey` 自定义存储键。用户改了会回调
|
|
239
|
-
`onOverrideChange`(`LlmOverride`),宿主想自己也记一份时用。
|
|
240
|
-
|
|
241
|
-
其余可选项见 `LlmChatOptions`:`headers`、`historyTurns`(默认 12 轮)、`temperature`、
|
|
242
|
-
`extraBody`、`fetchImpl`。只要状态机、界面自己写的,用 `useLlmChat`(返回
|
|
243
|
-
`UseLlmChatResult`:`messages` / `isStreaming` / `error` / `send` / `stop` / `reset`)。
|
|
244
|
-
|
|
245
|
-
纯 LLM 模式不做会话持久化、文件上传、提问卡片、记忆和检查点——那些是智能体协议的能力,
|
|
246
|
-
需要就用默认模式。
|
|
247
|
-
|
|
248
99
|
## MarkdownContent
|
|
249
100
|
|
|
250
101
|
单独渲染一段智能体消息 Markdown(含代码复制按钮、XSS 消毒;HTML 经 sanitize 白名单处理,不接受任意 raw HTML):
|
|
@@ -253,7 +104,7 @@ models.filter((m) => m.serviceModelId)
|
|
|
253
104
|
<MarkdownContent content={markdownText} />
|
|
254
105
|
```
|
|
255
106
|
|
|
256
|
-
传了 `sessionId` 才会把智能体产出文件的 `MEDIA:`
|
|
107
|
+
传了 `sessionId` 才会把智能体产出文件的 `MEDIA:` 行折叠成以文件名为文本的下载链接(下载要用它)。`ChatView` 内部已经传好,只有单独用 `MarkdownContent` 时需要自己给:
|
|
257
108
|
|
|
258
109
|
```tsx
|
|
259
110
|
<MarkdownContent sessionId={sessionId}>{markdownText}</MarkdownContent>
|
|
@@ -302,4 +153,4 @@ blade-chat { --primary: 262 83% 58%; height: 640px; }
|
|
|
302
153
|
|
|
303
154
|
为方便单包引入,本包 re-export 了 agent-client 的全部公开声明(`BladeClient`、`AgentSession`、`SessionState`、协议类型等),文档一律见 [agent-client 的 README](../agent-client/README.md)。完整签名见 [public-api.md](./public-api.md)。
|
|
304
155
|
|
|
305
|
-
本包自有声明:`BladeProvider`、`BladeProviderProps`、`useBladeClient`、`useAgentSession`、`UseAgentSessionOptions`、`UseAgentSessionResult`、`
|
|
156
|
+
本包自有声明:`BladeProvider`、`BladeProviderProps`、`useBladeClient`、`useAgentSession`、`UseAgentSessionOptions`、`UseAgentSessionResult`、`ChatView`、`ChatViewProps`、`ChatViewClassNames`、`ChatViewRenderers`、`ChatViewSlots`、`ToolCallRenderer`、`MarkdownContent`、`MarkdownContentProps`。
|
|
@@ -7,7 +7,7 @@ interface Props {
|
|
|
7
7
|
onAnswer?: (answer: string, toolCallId: string, answerData: AskUserAnswerData) => void;
|
|
8
8
|
sessionStatus?: string;
|
|
9
9
|
toolCallRenderer?: ToolCallRenderer;
|
|
10
|
-
/** 传给 Markdown 渲染,用于把 MEDIA
|
|
10
|
+
/** 传给 Markdown 渲染,用于把 MEDIA 行折叠成文件下载链接。 */
|
|
11
11
|
sessionId?: string;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
@@ -1,23 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import type { AgentSession, CreateSessionRequest } from "@blade-hq/agent-client";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import type { ToolCallRenderer } from "./ToolCallBlock";
|
|
4
|
+
export interface ChatViewClassNames {
|
|
5
|
+
root?: string;
|
|
6
|
+
banner?: string;
|
|
7
|
+
messageList?: string;
|
|
8
|
+
chatInput?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ChatViewRenderers {
|
|
11
|
+
/** 自定义工具调用渲染;返回 null 走默认渲染。 */
|
|
12
|
+
toolCall?: ToolCallRenderer;
|
|
13
|
+
}
|
|
14
|
+
export interface ChatViewSlots {
|
|
15
|
+
/** 消息列表上方的自定义区域。 */
|
|
16
|
+
header?: ReactNode;
|
|
17
|
+
/** 无消息时的空状态。 */
|
|
18
|
+
emptyState?: ReactNode;
|
|
19
|
+
/** 输入框下方的自定义区域。 */
|
|
20
|
+
footer?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export interface ChatViewProps {
|
|
23
|
+
/** 连接既有会话;不传则按 createOptions 自动新建。 */
|
|
24
|
+
sessionId?: string;
|
|
25
|
+
createOptions?: CreateSessionRequest;
|
|
26
|
+
/** 自动创建出的 sessionId 通过此回调交还调用方持有。 */
|
|
27
|
+
onSessionCreated?: (sessionId: string) => void;
|
|
28
|
+
/** 会话连接完成后回调(页面协作场景拿 AgentSession 实例用)。 */
|
|
29
|
+
onSessionReady?: (session: AgentSession) => void;
|
|
30
|
+
/** 智能体下发给宿主页面的指令处理器(action → handler)。 */
|
|
31
|
+
commands?: Record<string, (data: unknown) => void>;
|
|
32
|
+
classNames?: ChatViewClassNames;
|
|
33
|
+
renderers?: ChatViewRenderers;
|
|
34
|
+
slots?: ChatViewSlots;
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
/** 配色主题,默认浅色。宿主已经在祖先元素上写了 data-theme 时不用传。 */
|
|
37
|
+
theme?: "light" | "dark";
|
|
16
38
|
}
|
|
17
39
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* 这一层只做分流:两种模式各自是独立组件,已经确定要哪一种的可以直接用
|
|
21
|
-
* `<AgentChat>` 或 `<LlmChat>`。
|
|
40
|
+
* 开箱即用的聊天界面:连接(或新建)一个会话,渲染消息流与输入框。
|
|
41
|
+
* 状态全部来自 useAgentSession,不依赖任何全局 store。
|
|
22
42
|
*/
|
|
23
43
|
export declare function ChatView(props: ChatViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,6 +3,6 @@ interface Props {
|
|
|
3
3
|
connection: ConnectionStatus;
|
|
4
4
|
className?: string;
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
6
|
+
/** 连接状态提示条:短暂断线静默,超过容错时间后再逐级提示。 */
|
|
7
7
|
export declare function ConnectionBanner({ connection, className }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
8
8
|
export {};
|
|
@@ -8,9 +8,9 @@ export type FileCardProps = ComponentPropsWithRef<"span"> & ExtraProps & {
|
|
|
8
8
|
sessionId?: string;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* 智能体产出文件的下载链接(由 MEDIA 行折叠而来)。
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* href 让 Vue/纯 HTML 宿主看到标准的「文件名→URL」语义;普通点击仍交给
|
|
14
|
+
* downloadFile,避免跨域时 download 属性被忽略,也确保使用点击时的最新 token。
|
|
15
15
|
*/
|
|
16
16
|
export declare function FileCard({ node, "data-path": pathAttribute, "data-name": nameAttribute, dataPath, dataName, sessionId, children, className, ...props }: FileCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,13 +4,13 @@ export interface MarkdownContentProps {
|
|
|
4
4
|
/** 流式渲染传 "streaming",历史静态内容默认 "static"。 */
|
|
5
5
|
mode?: "streaming" | "static";
|
|
6
6
|
/**
|
|
7
|
-
* 会话 id。传了才会把 `MEDIA:`
|
|
7
|
+
* 会话 id。传了才会把 `MEDIA:` 行折叠成文件下载链接——下载要用它。
|
|
8
8
|
* 不要给用户消息传:用户自己在输入框打一行 `MEDIA:` 不该被当成平台产物。
|
|
9
9
|
*/
|
|
10
10
|
sessionId?: string;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* SDK 版 Markdown
|
|
13
|
+
* SDK 版 Markdown 渲染:附带代码块复制按钮、智能体产出文件的下载链接;
|
|
14
14
|
* 相比第一方版本去掉了 mermaid、外链确认弹窗与文件预览。
|
|
15
15
|
*/
|
|
16
16
|
export declare function MarkdownContent({ children, className, mode, sessionId }: MarkdownContentProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/embed/entry.d.ts
CHANGED
|
@@ -18,13 +18,15 @@ 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
|
+
EMPTY_PLATFORM_ENDPOINTS: agentClient.PlatformEndpoints;
|
|
22
|
+
loadPlatformEndpoints: typeof agentClient.loadPlatformEndpoints;
|
|
23
|
+
resolveServiceUrl: typeof agentClient.resolveServiceUrl;
|
|
21
24
|
SDK_NAME: "agent-client";
|
|
22
25
|
SDK_VERSION: string;
|
|
23
26
|
AgentSession: typeof AgentSession;
|
|
24
27
|
SessionHub: typeof agentClient.SessionHub;
|
|
25
28
|
SessionSetupError: typeof agentClient.SessionSetupError;
|
|
26
29
|
createInitialSessionState: typeof agentClient.createInitialSessionState;
|
|
27
|
-
toReplaySnapshot: typeof agentClient.toReplaySnapshot;
|
|
28
30
|
connectEmbedded: typeof agentClient.connectEmbedded;
|
|
29
31
|
isCommandEnvelope: typeof agentClient.isCommandEnvelope;
|
|
30
32
|
isInboundEnvelope: typeof agentClient.isInboundEnvelope;
|
|
@@ -39,7 +41,6 @@ declare const BladeAgent: {
|
|
|
39
41
|
isHiddenInternalMessage: typeof agentClient.isHiddenInternalMessage;
|
|
40
42
|
normalizeMessageContent: typeof agentClient.normalizeMessageContent;
|
|
41
43
|
transformSlashCommand: typeof agentClient.transformSlashCommand;
|
|
42
|
-
DEFAULT_REPLAY_SPEED: agentClient.ReplaySpeed;
|
|
43
44
|
SessionInfo: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
44
45
|
id: string;
|
|
45
46
|
intent: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,22 +2,9 @@ export { BladeProvider, useBladeClient } from "./context";
|
|
|
2
2
|
export type { BladeProviderProps } from "./context";
|
|
3
3
|
export { useAgentSession } from "./hooks/use-agent-session";
|
|
4
4
|
export type { UseAgentSessionOptions, UseAgentSessionResult } from "./hooks/use-agent-session";
|
|
5
|
-
export { useReplay } from "./hooks/use-replay";
|
|
6
|
-
export type { ReplayMismatch, UseReplayResult } from "./hooks/use-replay";
|
|
7
|
-
export { useLlmChat } from "./hooks/use-llm-chat";
|
|
8
|
-
export type { ChatCompletionTool, LlmChatOptions, LlmToolCall, UseLlmChatResult, } from "./hooks/use-llm-chat";
|
|
9
5
|
export { ChatView } from "./components/ChatView";
|
|
10
6
|
export type { ChatViewClassNames, ChatViewProps, ChatViewRenderers, ChatViewSlots, } from "./components/ChatView";
|
|
11
|
-
export { AgentChat } from "./components/AgentChat";
|
|
12
|
-
export type { AgentChatProps } from "./components/AgentChat";
|
|
13
|
-
export { LlmChat } from "./components/LlmChat";
|
|
14
|
-
export type { LlmChatHandle, LlmChatProps } from "./components/LlmChat";
|
|
15
|
-
export type { LlmAdvancedSettings, LlmOverride } from "./components/LlmAdvancedSettings";
|
|
16
7
|
export { MarkdownContent } from "./components/MarkdownContent";
|
|
17
8
|
export type { MarkdownContentProps } from "./components/MarkdownContent";
|
|
18
|
-
export { ReplayBar } from "./components/ReplayBar";
|
|
19
|
-
export type { ReplayBarProps } from "./components/ReplayBar";
|
|
20
|
-
export { ReplayMismatchPrompt } from "./components/ReplayMismatchPrompt";
|
|
21
|
-
export type { ReplayMismatchPromptProps } from "./components/ReplayMismatchPrompt";
|
|
22
9
|
export type { ToolCallRenderer } from "./components/ToolCallBlock";
|
|
23
10
|
export * from "@blade-hq/agent-client";
|