@blade-hq/agent-client 2610.0.0-beta.89 → 2610.0.0-beta.90
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 +11 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +125 -99
- package/dist/index.js.map +1 -1
- package/dist/resources/chat-groups.d.ts +2 -0
- package/dist/schemas/message-utils.d.ts +2 -0
- package/dist/session/definition.d.ts +6 -1
- package/dist/session/events.d.ts +3 -1
- package/dist/shared/tool-ui-card.d.ts +5 -3
- package/package.json +1 -1
- package/public-api.md +24 -6
|
@@ -6,6 +6,7 @@ export interface ChatGroup {
|
|
|
6
6
|
created_at: string;
|
|
7
7
|
updated_at: string;
|
|
8
8
|
session_count: number;
|
|
9
|
+
initiator: "ui" | "sdk" | null;
|
|
9
10
|
workspace_path: string;
|
|
10
11
|
}
|
|
11
12
|
export declare class ChatGroupsResource {
|
|
@@ -15,6 +16,7 @@ export declare class ChatGroupsResource {
|
|
|
15
16
|
create(payload: {
|
|
16
17
|
name: string;
|
|
17
18
|
instructions?: string;
|
|
19
|
+
initiator?: "ui" | "sdk";
|
|
18
20
|
}): Promise<ChatGroup>;
|
|
19
21
|
update(groupId: string, payload: {
|
|
20
22
|
name?: string;
|
|
@@ -67,4 +67,6 @@ interface MessageGroup {
|
|
|
67
67
|
}[];
|
|
68
68
|
}
|
|
69
69
|
export declare function groupMessagesByLoop(messages: ChatMessage[]): MessageGroup[];
|
|
70
|
+
/** A typed wake input stays internal for navigation, but has a visible notice. */
|
|
71
|
+
export declare function isBackgroundWakeMessage(message: Pick<ChatMessage, "blocks">): boolean;
|
|
70
72
|
export {};
|
|
@@ -11,11 +11,16 @@ export type SolutionDefinition = {
|
|
|
11
11
|
files: TextFile[];
|
|
12
12
|
role?: string;
|
|
13
13
|
};
|
|
14
|
+
export type SkillFile = TextFile & {
|
|
15
|
+
/** 二进制内容使用 base64;省略时为 UTF-8 文本。 */
|
|
16
|
+
encoding?: "utf-8" | "base64";
|
|
17
|
+
executable?: boolean;
|
|
18
|
+
};
|
|
14
19
|
export interface SkillDefinition {
|
|
15
20
|
/** 会话内安装名,格式为 `组织/名称`。 */
|
|
16
21
|
name: string;
|
|
17
22
|
/** 必须包含根目录的 SKILL.md。 */
|
|
18
|
-
files:
|
|
23
|
+
files: SkillFile[];
|
|
19
24
|
}
|
|
20
25
|
export interface SessionConfig {
|
|
21
26
|
/** Server 模型目录中的 model ID。 */
|
package/dist/session/events.d.ts
CHANGED
|
@@ -83,8 +83,10 @@ export interface AgentSessionEvents {
|
|
|
83
83
|
};
|
|
84
84
|
/** 工具返回值带 _meta.ui 的可视化预览(resource HTML / URI)。 */
|
|
85
85
|
toolPreview: {
|
|
86
|
+
/** Source file identity when the preview comes from a local HTML file. */
|
|
87
|
+
sourcePath?: string;
|
|
86
88
|
toolCallId: string;
|
|
87
|
-
type: "resource-html" | "resource-uri";
|
|
89
|
+
type: "resource-html" | "resource-uri" | "resource-file";
|
|
88
90
|
content: string;
|
|
89
91
|
title: string;
|
|
90
92
|
mcpApp?: McpAppData;
|
|
@@ -11,6 +11,8 @@ export interface ToolUiCard {
|
|
|
11
11
|
resourceUri?: string;
|
|
12
12
|
resourceURI?: string;
|
|
13
13
|
resourceHTML?: string;
|
|
14
|
+
/** Local HTML source file; hosts can normalize it against the session workspace. */
|
|
15
|
+
sourcePath?: string;
|
|
14
16
|
/** 历史投影标记:绝不重新解析 resourceUri(刷新不重放 MCP/资源读取)。 */
|
|
15
17
|
archived?: boolean;
|
|
16
18
|
target: "inline" | "preview";
|
|
@@ -23,7 +25,7 @@ export interface ToolUiCard {
|
|
|
23
25
|
* 卡片一律判无效,消息流、侧栏、toolPreview 事件三处一致降级(不渲染、不发事件、
|
|
24
26
|
* 不推送)。后端 `_tool_ui_meta.py` 总会补齐 target/height 默认值,判无效即数据畸形。 */
|
|
25
27
|
export declare function isToolUiCard(value: unknown): value is ToolUiCard;
|
|
26
|
-
export type ToolUiCardContentType = "resource-html" | "resource-uri";
|
|
28
|
+
export type ToolUiCardContentType = "resource-html" | "resource-uri" | "resource-file";
|
|
27
29
|
/** 解析卡片实际要渲染的内容。archived 卡片只认留档 HTML,绝不回退到
|
|
28
30
|
* resourceUri——历史恢复/浏览器刷新不得因此重新发起 MCP 资源读取。 */
|
|
29
31
|
export declare function resolveToolUiCardContent(card: ToolUiCard): {
|
|
@@ -31,8 +33,8 @@ export declare function resolveToolUiCardContent(card: ToolUiCard): {
|
|
|
31
33
|
content: string;
|
|
32
34
|
} | null;
|
|
33
35
|
/** 卡片实例身份/去重键:uri 卡片按内容去重(同一 URI 多次产出只留一份),
|
|
34
|
-
*
|
|
35
|
-
export declare function buildToolUiCardKey(toolCallId: string, type: ToolUiCardContentType, content: string): string;
|
|
36
|
+
* 文件 HTML 按来源路径,无来源的 HTML 按 toolCallId 去重。 */
|
|
37
|
+
export declare function buildToolUiCardKey(toolCallId: string, type: ToolUiCardContentType, content: string, sourcePath?: string): string;
|
|
36
38
|
/** 内部「阶段进度」卡片不对用户展示入口。 */
|
|
37
39
|
export declare function isInternalStatusToolUiCard(card: {
|
|
38
40
|
title?: string | null;
|
package/package.json
CHANGED
package/public-api.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> 本文件由 `scripts/public-api-report.mjs` 生成,请勿手改。
|
|
4
4
|
> 公共面变更时重新生成本报告,并同步更新 README 对应章节——CI 会校验两者。
|
|
5
5
|
|
|
6
|
-
共
|
|
6
|
+
共 247 个公开声明。
|
|
7
7
|
|
|
8
8
|
## `acceptedPostChatFollowupCompletesLatestRun` (function)
|
|
9
9
|
|
|
@@ -138,7 +138,7 @@ sandboxOom: { toolCallId: string; }
|
|
|
138
138
|
sessionUpdated: { workspacePath?: string; chatGroupId?: string | null; intent?: string; status?: SessionStatus; model?: string | null; boundSkillId?: string | null; replayState?: Record<string, unknown> | null; }
|
|
139
139
|
taskListUpdated: { tasks: unknown[]; }
|
|
140
140
|
toolCall: { toolCall: ToolCallInfo; turn: TurnProjection; }
|
|
141
|
-
toolPreview: { toolCallId: string; type: "resource-html" | "resource-uri"; content: string; title: string; mcpApp?: McpAppData; }
|
|
141
|
+
toolPreview: { sourcePath?: string; toolCallId: string; type: "resource-html" | "resource-uri" | "resource-file"; content: string; title: string; mcpApp?: McpAppData; }
|
|
142
142
|
toolResult: { toolCall: ToolCallInfo; turn: TurnProjection; source: "live" | "bootstrap_replay" | "reconnect_replay"; }
|
|
143
143
|
workspaceChanged: { filePath?: string; }
|
|
144
144
|
```
|
|
@@ -330,7 +330,7 @@ buildMessageContent: (text: string, attachments: Array<{ kind: "file"; name: str
|
|
|
330
330
|
## `buildToolUiCardKey` (function)
|
|
331
331
|
|
|
332
332
|
```ts
|
|
333
|
-
buildToolUiCardKey: (toolCallId: string, type: ToolUiCardContentType, content: string) => string
|
|
333
|
+
buildToolUiCardKey: (toolCallId: string, type: ToolUiCardContentType, content: string, sourcePath?: string) => string
|
|
334
334
|
```
|
|
335
335
|
|
|
336
336
|
## `canCancelQueuedMessage` (function)
|
|
@@ -375,6 +375,7 @@ chatErrorForDisplay: (message: string, developer?: boolean) => string
|
|
|
375
375
|
```ts
|
|
376
376
|
created_at: string
|
|
377
377
|
id: string
|
|
378
|
+
initiator: "ui" | "sdk" | null
|
|
378
379
|
instructions: string
|
|
379
380
|
name: string
|
|
380
381
|
session_count: number
|
|
@@ -385,7 +386,7 @@ workspace_path: string
|
|
|
385
386
|
## `ChatGroupsResource` (class)
|
|
386
387
|
|
|
387
388
|
```ts
|
|
388
|
-
create: (payload: { name: string; instructions?: string; }) => Promise<ChatGroup>
|
|
389
|
+
create: (payload: { name: string; instructions?: string; initiator?: "ui" | "sdk"; }) => Promise<ChatGroup>
|
|
389
390
|
delete: (groupId: string, options?: { deleteWorkspace?: boolean; }) => Promise<{ deleted: boolean; deleted_sessions: number; }>
|
|
390
391
|
list: () => Promise<ChatGroup[]>
|
|
391
392
|
update: (groupId: string, payload: { name?: string; instructions?: string; }) => Promise<ChatGroup>
|
|
@@ -892,6 +893,12 @@ toolCallId: string
|
|
|
892
893
|
isAppDevToolUiCard: (card: ToolUiCard, isAppDev: boolean) => boolean
|
|
893
894
|
```
|
|
894
895
|
|
|
896
|
+
## `isBackgroundWakeMessage` (function)
|
|
897
|
+
|
|
898
|
+
```ts
|
|
899
|
+
isBackgroundWakeMessage: (message: Pick<ChatMessage, "blocks">) => boolean
|
|
900
|
+
```
|
|
901
|
+
|
|
895
902
|
## `isCommandEnvelope` (function)
|
|
896
903
|
|
|
897
904
|
```ts
|
|
@@ -1982,7 +1989,7 @@ total_pv: number
|
|
|
1982
1989
|
## `SkillDefinition` (interface)
|
|
1983
1990
|
|
|
1984
1991
|
```ts
|
|
1985
|
-
files:
|
|
1992
|
+
files: SkillFile[]
|
|
1986
1993
|
name: string
|
|
1987
1994
|
```
|
|
1988
1995
|
|
|
@@ -1992,6 +1999,16 @@ name: string
|
|
|
1992
1999
|
export type SkillEditorTemplateId = "skill_editor"
|
|
1993
2000
|
```
|
|
1994
2001
|
|
|
2002
|
+
## `SkillFile` (type)
|
|
2003
|
+
|
|
2004
|
+
```ts
|
|
2005
|
+
export type SkillFile = TextFile & {
|
|
2006
|
+
/** 二进制内容使用 base64;省略时为 UTF-8 文本。 */
|
|
2007
|
+
encoding?: "utf-8" | "base64"
|
|
2008
|
+
executable?: boolean
|
|
2009
|
+
}
|
|
2010
|
+
```
|
|
2011
|
+
|
|
1995
2012
|
## `SkillMentionAvailability` (interface)
|
|
1996
2013
|
|
|
1997
2014
|
```ts
|
|
@@ -2216,6 +2233,7 @@ mcpApp: McpAppData | undefined
|
|
|
2216
2233
|
resourceHTML: string | undefined
|
|
2217
2234
|
resourceUri: string | undefined
|
|
2218
2235
|
resourceURI: string | undefined
|
|
2236
|
+
sourcePath: string | undefined
|
|
2219
2237
|
target: "inline" | "preview"
|
|
2220
2238
|
title: string | undefined
|
|
2221
2239
|
```
|
|
@@ -2223,7 +2241,7 @@ title: string | undefined
|
|
|
2223
2241
|
## `ToolUiCardContentType` (type)
|
|
2224
2242
|
|
|
2225
2243
|
```ts
|
|
2226
|
-
export type ToolUiCardContentType = "resource-html" | "resource-uri"
|
|
2244
|
+
export type ToolUiCardContentType = "resource-html" | "resource-uri" | "resource-file"
|
|
2227
2245
|
```
|
|
2228
2246
|
|
|
2229
2247
|
## `toReplaySnapshot` (function)
|