@blade-hq/agent-client 2610.0.0-beta.25 → 2610.0.0-beta.26
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 +1 -3
- package/dist/blade-client.d.ts +2 -0
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/session/agent-session.d.ts +3 -0
- package/dist/types/socket-events.d.ts +6 -0
- package/package.json +1 -1
- package/public-api.md +2 -0
|
@@ -8,6 +8,7 @@ import type { AppCliAttachment, AppCliDefinition, FileEntry } from "../resources
|
|
|
8
8
|
import { type ConnectionStatus, type SessionState } from "./state";
|
|
9
9
|
/** SessionHub 注入给 AgentSession 的运行时依赖(socket 收发 + REST 补数)。 */
|
|
10
10
|
export interface SessionRuntime {
|
|
11
|
+
streamTokens: boolean;
|
|
11
12
|
emitEvent(event: string, data: unknown): void;
|
|
12
13
|
emitWithAck(event: string, data: unknown, timeoutMs: number): Promise<Record<string, unknown> | undefined>;
|
|
13
14
|
ensureConnected(): void;
|
|
@@ -52,6 +53,8 @@ export interface SendOptions {
|
|
|
52
53
|
deprecate_entry_ids: string[];
|
|
53
54
|
};
|
|
54
55
|
replayDecision?: "keep_replay" | "continue_replay";
|
|
56
|
+
/** 用户 @ 的知识库 id:后端先用原话在这些库里预检索,本轮 kb_search 也默认限定在这些库。 */
|
|
57
|
+
kbIds?: number[];
|
|
55
58
|
}
|
|
56
59
|
export declare function sessionStatusFromChatEnd(status: string | undefined): SessionStatus;
|
|
57
60
|
/**
|
|
@@ -32,6 +32,7 @@ export declare namespace ChatSendPayloadSchema {
|
|
|
32
32
|
[k: string]: unknown;
|
|
33
33
|
} | null);
|
|
34
34
|
type CompactionRatio = (number | null);
|
|
35
|
+
type KbIds = (number[] | null);
|
|
35
36
|
interface ChatSendPayload {
|
|
36
37
|
session_id: SessionId;
|
|
37
38
|
message: Message;
|
|
@@ -48,6 +49,7 @@ export declare namespace ChatSendPayloadSchema {
|
|
|
48
49
|
runtime_env?: RuntimeEnv;
|
|
49
50
|
app_context?: AppContext;
|
|
50
51
|
compaction_ratio?: CompactionRatio;
|
|
52
|
+
kb_ids?: KbIds;
|
|
51
53
|
[k: string]: unknown;
|
|
52
54
|
}
|
|
53
55
|
interface Message {
|
|
@@ -93,12 +95,14 @@ export declare namespace SessionSubscribePayloadSchema {
|
|
|
93
95
|
type EventFormat = "raw";
|
|
94
96
|
type AfterSequence = number;
|
|
95
97
|
type Resume = boolean;
|
|
98
|
+
type StreamTokens = boolean;
|
|
96
99
|
interface SessionSubscribePayload {
|
|
97
100
|
session_id: SessionId;
|
|
98
101
|
mode?: Mode;
|
|
99
102
|
event_format?: EventFormat;
|
|
100
103
|
after_sequence?: AfterSequence;
|
|
101
104
|
resume?: Resume;
|
|
105
|
+
stream_tokens?: StreamTokens;
|
|
102
106
|
[k: string]: unknown;
|
|
103
107
|
}
|
|
104
108
|
}
|
|
@@ -114,6 +118,7 @@ export declare namespace SessionSubscribeBatchPayloadSchema {
|
|
|
114
118
|
type EventFormat = "raw";
|
|
115
119
|
type AfterSequence = number;
|
|
116
120
|
type Resume = boolean;
|
|
121
|
+
type StreamTokens = boolean;
|
|
117
122
|
interface SessionSubscribeBatchPayload {
|
|
118
123
|
sessions: Sessions;
|
|
119
124
|
[k: string]: unknown;
|
|
@@ -124,6 +129,7 @@ export declare namespace SessionSubscribeBatchPayloadSchema {
|
|
|
124
129
|
event_format?: EventFormat;
|
|
125
130
|
after_sequence?: AfterSequence;
|
|
126
131
|
resume?: Resume;
|
|
132
|
+
stream_tokens?: StreamTokens;
|
|
127
133
|
[k: string]: unknown;
|
|
128
134
|
}
|
|
129
135
|
}
|
package/package.json
CHANGED
package/public-api.md
CHANGED
|
@@ -247,6 +247,7 @@ baseUrl: string
|
|
|
247
247
|
fetchImpl: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; } | undefined
|
|
248
248
|
onRefreshSuccess: (() => void | Promise<void>) | undefined
|
|
249
249
|
socketToken: string | (() => string | null | undefined) | undefined
|
|
250
|
+
streamTokens: boolean | undefined
|
|
250
251
|
token: string | (() => string | null | undefined) | undefined
|
|
251
252
|
tokenStorage: TokenStorageMode | undefined
|
|
252
253
|
```
|
|
@@ -997,6 +998,7 @@ SDK_VERSION: string
|
|
|
997
998
|
|
|
998
999
|
```ts
|
|
999
1000
|
askUserAnswer: Record<string, unknown> | undefined
|
|
1001
|
+
kbIds: number[] | undefined
|
|
1000
1002
|
mode: string | undefined
|
|
1001
1003
|
model: string | undefined
|
|
1002
1004
|
replayDecision: "keep_replay" | "continue_replay" | undefined
|