@opentiny/next-sdk 0.1.15-beta.1 → 0.1.15-beta.3
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/agent/AgentModelProvider.ts +7 -1
- package/dist/index.es.dev.js +3 -0
- package/dist/index.es.js +1627 -1627
- package/dist/index.js +113 -113
- package/dist/index.umd.dev.js +3 -0
- package/dist/index.umd.js +26 -26
- package/dist/webagent.dev.js +3 -0
- package/dist/webagent.es.dev.js +3 -0
- package/dist/webagent.es.js +2047 -2047
- package/dist/webagent.js +30 -30
- package/package.json +1 -1
|
@@ -131,7 +131,8 @@ export class AgentModelProvider {
|
|
|
131
131
|
try {
|
|
132
132
|
const transport = client['__transport__']
|
|
133
133
|
|
|
134
|
-
// 如果是 InMemoryTransport,不关闭传输层
|
|
134
|
+
// 如果是 InMemoryTransport 或 MessageChannelTransport,不关闭传输层
|
|
135
|
+
// 因为它们是配对的,关闭一端会影响另一端(服务端)
|
|
135
136
|
if (
|
|
136
137
|
(transport && transport instanceof InMemoryTransport) ||
|
|
137
138
|
(transport && transport instanceof MessageChannelTransport)
|
|
@@ -139,6 +140,11 @@ export class AgentModelProvider {
|
|
|
139
140
|
return
|
|
140
141
|
}
|
|
141
142
|
|
|
143
|
+
// 因为它们是基于 Chrome 扩展的消息传递机制,关闭会影响服务端的连接
|
|
144
|
+
if (transport && transport instanceof ExtensionClientTransport) {
|
|
145
|
+
return
|
|
146
|
+
}
|
|
147
|
+
|
|
142
148
|
// 其他类型的传输正常关闭
|
|
143
149
|
await transport?.terminateSession?.()
|
|
144
150
|
await transport?.close?.()
|
package/dist/index.es.dev.js
CHANGED
|
@@ -45894,6 +45894,9 @@ class AgentModelProvider {
|
|
|
45894
45894
|
if (transport && transport instanceof InMemoryTransport || transport && transport instanceof MessageChannelTransport) {
|
|
45895
45895
|
return;
|
|
45896
45896
|
}
|
|
45897
|
+
if (transport && transport instanceof ExtensionClientTransport) {
|
|
45898
|
+
return;
|
|
45899
|
+
}
|
|
45897
45900
|
await transport?.terminateSession?.();
|
|
45898
45901
|
await transport?.close?.();
|
|
45899
45902
|
await client?.close?.();
|