@blade-hq/agent-react 2610.0.0-beta.16 → 2610.0.0-beta.18
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 -0
- package/dist/components/ContextCard.d.ts +7 -0
- package/dist/components/display-utils.d.ts +7 -0
- package/dist/embed/entry.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +257 -127
- package/dist/index.js.map +1 -1
- package/dist/style.css +61 -0
- package/dist/style.full.css +62 -1
- package/package.json +2 -2
- package/public-api.md +87 -2
package/README.md
CHANGED
|
@@ -150,6 +150,8 @@ await replay.exitToAutonomous() // 退出回放,之后真的运
|
|
|
150
150
|
|
|
151
151
|
全部 props 见 `ChatViewProps`。样式说明:
|
|
152
152
|
|
|
153
|
+
`ChatView` 会把项目说明、可用能力和当前工作环境显示为默认折叠的业务卡片。自建消息列表可直接使用 `ContextCard`,属性见 `ContextCardProps`;状态到文案的映射来自 agent-client 的 `getContextDisplayState`,不需要接入方重复判断。底层数据类型为 `ContextProjectionData` / `ContextProjectionFields`,展示结果为 `ContextDisplayState`,并保留 `ContextAction`、`ContextSourceInfo` 和 `contextProjectionData` 给 headless 消费方。
|
|
154
|
+
|
|
153
155
|
`onFollowupInteraction` 使用 `FollowupInteractionEvent`,覆盖下一步建议展示/采纳、成果展示/打开/下载以及结果评分。SDK 不内置 PostHog 等分析厂商;宿主回调抛错也不会中断用户点击或下载。
|
|
154
156
|
文件成果以文件名为文本的标准下载链接展示;Vue / 纯 HTML 使用的 `<blade-chat>` 与 `ChatView` 行为一致。
|
|
155
157
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ContextProjectionData } from "@blade-hq/agent-client";
|
|
2
|
+
export interface ContextCardProps {
|
|
3
|
+
context: ContextProjectionData;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
/** Business-facing Context summary. Native details keeps every card collapsed by default. */
|
|
7
|
+
export declare function ContextCard({ context, className }: ContextCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { ToolCallInfo } from "@blade-hq/agent-client";
|
|
2
2
|
export type ToolTone = "emerald" | "blue" | "amber" | "red";
|
|
3
|
+
/**
|
|
4
|
+
* 技能入口文件的所在目录就是技能名(`.agent/skills/<技能名>/SKILL.md`)。
|
|
5
|
+
* 只显示 "SKILL.md" 用户看不出读的是哪个技能。
|
|
6
|
+
*
|
|
7
|
+
* 改这里必须同步 apps/web/src/agent/components/chat/display-utils.ts 的同名函数。
|
|
8
|
+
*/
|
|
9
|
+
export declare function getSkillNameFromFilePath(filePath: string | null | undefined): string | null;
|
|
3
10
|
/** 归一化工具名:去掉命名空间前缀并映射到别名表(如 "fork:Agent" → "Agent")。 */
|
|
4
11
|
export declare function formatToolName(name: string): string;
|
|
5
12
|
/**
|
package/dist/embed/entry.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ declare const BladeAgent: {
|
|
|
43
43
|
isHiddenInternalMessage: typeof agentClient.isHiddenInternalMessage;
|
|
44
44
|
normalizeMessageContent: typeof agentClient.normalizeMessageContent;
|
|
45
45
|
transformSlashCommand: typeof agentClient.transformSlashCommand;
|
|
46
|
+
contextProjectionData: typeof agentClient.contextProjectionData;
|
|
47
|
+
getContextDisplayState: typeof agentClient.getContextDisplayState;
|
|
46
48
|
latestPostChatFollowup: typeof agentClient.latestPostChatFollowup;
|
|
47
49
|
DEFAULT_REPLAY_SPEED: agentClient.ReplaySpeed;
|
|
48
50
|
SessionInfo: import("arktype/internal/variants/object.ts").ObjectType<{
|
package/dist/index.d.ts
CHANGED
|
@@ -20,4 +20,6 @@ export type { ReplayBarProps } from "./components/ReplayBar";
|
|
|
20
20
|
export { ReplayMismatchPrompt } from "./components/ReplayMismatchPrompt";
|
|
21
21
|
export type { ReplayMismatchPromptProps } from "./components/ReplayMismatchPrompt";
|
|
22
22
|
export type { ToolCallRenderer } from "./components/ToolCallBlock";
|
|
23
|
+
export { ContextCard } from "./components/ContextCard";
|
|
24
|
+
export type { ContextCardProps } from "./components/ContextCard";
|
|
23
25
|
export * from "@blade-hq/agent-client";
|