@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
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { AgentSession, ReplaySpeed } from "@blade-hq/agent-client";
|
|
2
|
-
/** 回放中用户说的话和录制内容对不上,需要当场决定往哪走。 */
|
|
3
|
-
export interface ReplayMismatch {
|
|
4
|
-
/** 用户这次实际发出的内容。 */
|
|
5
|
-
actualMessage: string;
|
|
6
|
-
/** 源会话里录制的下一句。 */
|
|
7
|
-
expectedMessage: string;
|
|
8
|
-
/** keep_replay:按录制内容继续;continue_replay:从这里转为真实运行。 */
|
|
9
|
-
resolve: (decision: "keep_replay" | "continue_replay") => void;
|
|
10
|
-
}
|
|
11
|
-
export interface UseReplayResult {
|
|
12
|
-
/** 当前会话是不是正在回放(转自主运行后为 false)。 */
|
|
13
|
-
isReplay: boolean;
|
|
14
|
-
/** 当前播放倍速,非回放会话固定为 1。 */
|
|
15
|
-
speed: ReplaySpeed;
|
|
16
|
-
setSpeed: (speed: ReplaySpeed) => Promise<void>;
|
|
17
|
-
/** 退出回放,之后的对话交给真实模型运行。 */
|
|
18
|
-
exitToAutonomous: () => Promise<void>;
|
|
19
|
-
/** 待决策的输入冲突;处理完自动清空。 */
|
|
20
|
-
mismatch: ReplayMismatch | null;
|
|
21
|
-
/** 能不能改回放(改回放是 owner 专属)。只读身份下仍然显示"在回放",但不能操作。 */
|
|
22
|
-
canControl: boolean;
|
|
23
|
-
/** 当前会话能否作为回放来源(并行子智能体等场景不支持)。 */
|
|
24
|
-
canReplay: boolean;
|
|
25
|
-
/** canReplay 为 false 时的原因,可直接展示。 */
|
|
26
|
-
unsupportedReason: string | null;
|
|
27
|
-
/** 从当前会话派生一个回放会话,返回新会话 id。 */
|
|
28
|
-
startReplay: (speed?: ReplaySpeed) => Promise<string>;
|
|
29
|
-
isStarting: boolean;
|
|
30
|
-
/** 最近一次回放操作失败的原因。 */
|
|
31
|
-
error: Error | null;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* 会话回放(演示 / 彩排模式)。
|
|
35
|
-
*
|
|
36
|
-
* 回放会话不会自动播放:用户照常发消息,只要这句和源会话录制的下一句意图一致,
|
|
37
|
-
* 服务端就按倍速重放当时的回复和工具调用,完全不调用模型;对不上就抛出
|
|
38
|
-
* `mismatch` 交给界面决定。
|
|
39
|
-
*
|
|
40
|
-
* 同一个 hook 覆盖两种身份——传入的会话既可能是回放会话(isReplay / setSpeed /
|
|
41
|
-
* exitToAutonomous / mismatch),也可能是准备被回放的源会话(canReplay /
|
|
42
|
-
* startReplay)。
|
|
43
|
-
*
|
|
44
|
-
* 回放状态本身住在 `SessionState.replay` 里(非 React 宿主直接订阅它即可),
|
|
45
|
-
* 这里只做 React 绑定:订阅快照 + 接管冲突 + 拉一次 preview。
|
|
46
|
-
*
|
|
47
|
-
* **注册即接管**:底层的 `replayMismatch` 只交给最先注册的处理器。调用本 hook
|
|
48
|
-
* 就意味着由它接管冲突;不调用则维持 SDK 默认行为——直接转为真实运行。
|
|
49
|
-
*/
|
|
50
|
-
export declare function useReplay(session: AgentSession | null): UseReplayResult;
|