@blade-hq/agent-client 2610.0.0-beta.23 → 2610.0.0-beta.25

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 CHANGED
@@ -82,10 +82,12 @@ new BladeClient({
82
82
  baseUrl: "https://blade.example.com", // 后端地址;同域部署可传 ""
83
83
  token: "sk-blade-xxx", // 可选:PAT。不传则用 cookie 或 login()
84
84
  tokenStorage: "local", // 可选:login() 的令牌存哪("local" 默认 / "memory")
85
- streamTokens: false, // 可选:只接收完成态内容,不订阅逐 token 增量
86
85
  })
87
86
  ```
88
87
 
88
+ SDK 会固定订阅普通聊天所需的完整实时事件。产品内置 Web 的精简/开发者展示模式不属于
89
+ 公共 SDK 契约,也没有对应的构造参数或 Socket.IO 字段。
90
+
89
91
  > **`baseUrl` 填哪个地址?** 必须是 Blade Agent 后端的地址(形如 `http://<主机>:8020`),只要域名和端口、不带路径。
90
92
  > 注意别填成你平时打开的 Blade OS 地址(同主机的 `:80`)—— 那是另一套接口,SDK 连不上。
91
93
 
@@ -23,8 +23,6 @@ export interface BladeClientOptions {
23
23
  tokenStorage?: TokenStorageMode;
24
24
  fetchImpl?: typeof fetch;
25
25
  onRefreshSuccess?: () => void | Promise<void>;
26
- /** 是否订阅逐 token 增量,默认 true。关闭后仍接收完整消息和语义事件。 */
27
- streamTokens?: boolean;
28
26
  }
29
27
  export declare class BladeClient {
30
28
  private refreshPromise;
package/dist/index.js CHANGED
@@ -352,8 +352,7 @@ var HeadlessResource = class {
352
352
  socket.on("system:error", onSystemError);
353
353
  socket.emit("session:subscribe", {
354
354
  session_id,
355
- event_format: "raw",
356
- stream_tokens: this.client.options.streamTokens !== false
355
+ event_format: "raw"
357
356
  });
358
357
  socket.emit(
359
358
  "chat:send",
@@ -3540,7 +3539,6 @@ var AgentSession = class _AgentSession {
3540
3539
  const session = new _AgentSession(
3541
3540
  sessionId,
3542
3541
  {
3543
- streamTokens: false,
3544
3542
  emitEvent: readonlyError,
3545
3543
  emitWithAck: async () => readonlyError(),
3546
3544
  ensureConnected: readonlyError,
@@ -3695,8 +3693,7 @@ var AgentSession = class _AgentSession {
3695
3693
  thinking_override: options.thinkingOverride,
3696
3694
  whatif: options.whatif,
3697
3695
  replay_decision: options.replayDecision,
3698
- app_context: appContext,
3699
- kb_ids: options.kbIds && options.kbIds.length > 0 ? options.kbIds : void 0
3696
+ app_context: appContext
3700
3697
  };
3701
3698
  try {
3702
3699
  await this.ensureJoined();
@@ -4273,8 +4270,7 @@ var AgentSession = class _AgentSession {
4273
4270
  {
4274
4271
  session_id: this.sessionId,
4275
4272
  event_format: "raw",
4276
- resume: true,
4277
- stream_tokens: this.runtime.streamTokens
4273
+ resume: true
4278
4274
  },
4279
4275
  5e3
4280
4276
  ).then((response) => {
@@ -4411,7 +4407,6 @@ var SessionHub = class {
4411
4407
  }
4412
4408
  runtimeFor() {
4413
4409
  return {
4414
- streamTokens: this.client.options?.streamTokens !== false,
4415
4410
  emitEvent: (event, data) => {
4416
4411
  ;
4417
4412
  this.client.socket().emit(event, data);
@@ -4651,7 +4646,7 @@ function resolveAuthToken(options) {
4651
4646
 
4652
4647
  // src/version.ts
4653
4648
  var SDK_NAME = "agent-client";
4654
- var SDK_VERSION = true ? "2610.0.0-beta.23" : "1.1.1";
4649
+ var SDK_VERSION = true ? "2610.0.0-beta.25" : "1.1.1";
4655
4650
 
4656
4651
  // src/socket.ts
4657
4652
  function withSdkIdentity(auth) {