@blueking/chat-helper 0.0.8 → 0.0.10-beta.1

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.
@@ -126,16 +126,17 @@ import { ref } from 'vue';
126
126
  var // 中止当前聊天
127
127
  _mediator_agent;
128
128
  (_mediator_agent = mediator.agent) === null || _mediator_agent === void 0 ? void 0 : _mediator_agent.abortChat();
129
- var _list_value_find;
130
- // 选择会话
131
- current.value = (_list_value_find = list.value.find((item)=>item.sessionCode === sessionCode)) !== null && _list_value_find !== void 0 ? _list_value_find : null;
129
+ // 从接口更新当前会话信息
130
+ yield getSession(sessionCode);
132
131
  // 默认加载消息,但允许跳过(新会话消息必定为空,无需加载)
133
132
  if ((options === null || options === void 0 ? void 0 : options.loadMessages) !== false) {
134
133
  var _mediator_message, // 继续聊天
135
- _mediator_agent1;
134
+ _mediator_agent1, // 轮询接口,判断是否可以继续聊天
135
+ _mediator_agent2;
136
136
  // 获取会话内容
137
137
  yield (_mediator_message = mediator.message) === null || _mediator_message === void 0 ? void 0 : _mediator_message.getMessages(sessionCode);
138
138
  (_mediator_agent1 = mediator.agent) === null || _mediator_agent1 === void 0 ? void 0 : _mediator_agent1.resumeStreamingChat(sessionCode);
139
+ (_mediator_agent2 = mediator.agent) === null || _mediator_agent2 === void 0 ? void 0 : _mediator_agent2.pollResumeSession(sessionCode);
139
140
  } else {
140
141
  // 新会话,清空消息列表
141
142
  if (mediator.message) {
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@blueking/chat-helper",
3
- "version": "0.0.8",
3
+ "version": "0.0.10-beta.1",
4
4
  "description": "",
5
5
  "main": "./dist/index.ts.js",
6
6
  "types": "./dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "bk-cli-service build && vue-tsc --emitDeclarationOnly"
9
+ },
7
10
  "keywords": [
8
11
  "chat-helper"
9
12
  ],
@@ -17,6 +20,7 @@
17
20
  "url": "https://github.com/TencentBlueKing/bk-aidev-agent.git",
18
21
  "directory": "src/frontend/ai-blueking/packages/chat-helper"
19
22
  },
23
+ "packageManager": "pnpm@10.17.1",
20
24
  "peerDependencies": {
21
25
  "vue": "^3.5.24"
22
26
  },
@@ -26,7 +30,7 @@
26
30
  "typescript": "^5.5.4",
27
31
  "vue-tsc": "^3.1.4"
28
32
  },
29
- "scripts": {
30
- "build": "bk-cli-service build && vue-tsc --emitDeclarationOnly"
33
+ "dependencies": {
34
+ "@types/json-schema": "^7.0.15"
31
35
  }
32
- }
36
+ }