mu-agent-bridge 1.0.66 → 1.0.67
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.
|
@@ -16,7 +16,7 @@ const session_history_1 = require("./session-history");
|
|
|
16
16
|
const desktop_launch_1 = require("../desktop-launch");
|
|
17
17
|
const desktop_launch_2 = require("./desktop-launch");
|
|
18
18
|
exports.workbuddyManifest = {
|
|
19
|
-
id: "workbuddy", version: "1.1.
|
|
19
|
+
id: "workbuddy", version: "1.1.30", displayName: "WorkBuddy", type: "agent",
|
|
20
20
|
entry: "dist/index.js", apiVersion: "1", process: "in-process",
|
|
21
21
|
capabilities: ["chat", "health"], configSchema: "config.schema.json",
|
|
22
22
|
};
|
|
@@ -364,7 +364,15 @@ class WorkbuddyPlugin {
|
|
|
364
364
|
if (this.knownSessions.has(sessionId)) {
|
|
365
365
|
const binding = this.sessionBindings.get(sessionId);
|
|
366
366
|
const conversationId = binding?.conversationId ?? (this.recoverableSessionId === sessionId ? this.recoverableConversationId : undefined);
|
|
367
|
-
if (!conversationId
|
|
367
|
+
if (!conversationId) {
|
|
368
|
+
// 旧版本可能在新任务校验前写入会话 ID,无法恢复时允许重新创建。
|
|
369
|
+
this.knownSessions.delete(sessionId);
|
|
370
|
+
this.sessionBindings.delete(sessionId);
|
|
371
|
+
await this.persistKnownSessions();
|
|
372
|
+
await this.createSession(sessionId);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (!this.client.activateConversation)
|
|
368
376
|
throw new Error("WorkBuddy 不支持恢复旧 WorkBuddy 会话");
|
|
369
377
|
await this.client.activateConversation(conversationId);
|
|
370
378
|
this.activeSessionId = sessionId;
|
|
@@ -1162,7 +1162,7 @@ const cdp_client_1 = require("../src-ts/plugins/workbuddy/cdp-client");
|
|
|
1162
1162
|
await strict_1.default.rejects(() => plugin.handle({ task: "调用文案写作专家改写" }), /sessionId|会话/);
|
|
1163
1163
|
strict_1.default.equal(calls, 1);
|
|
1164
1164
|
});
|
|
1165
|
-
(0, node_test_1.default)("workbuddy
|
|
1165
|
+
(0, node_test_1.default)("workbuddy 跨插件重启清理没有桌面绑定的旧会话并重新创建", async () => {
|
|
1166
1166
|
const dataDir = await (0, promises_1.mkdtemp)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "wb-sessions-"));
|
|
1167
1167
|
let creates = 0;
|
|
1168
1168
|
const client = {
|
|
@@ -1177,8 +1177,8 @@ const cdp_client_1 = require("../src-ts/plugins/workbuddy/cdp-client");
|
|
|
1177
1177
|
await first.deactivate("reload");
|
|
1178
1178
|
const second = new workbuddy_1.WorkbuddyPlugin({ client });
|
|
1179
1179
|
await second.activate(context);
|
|
1180
|
-
|
|
1181
|
-
strict_1.default.equal(creates,
|
|
1180
|
+
strict_1.default.equal((await second.handle({ task: "恢复旧会话", sessionId: "session-a" })).text, "恢复旧会话");
|
|
1181
|
+
strict_1.default.equal(creates, 2);
|
|
1182
1182
|
await second.deactivate("stop");
|
|
1183
1183
|
}
|
|
1184
1184
|
finally {
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ const session_history_1 = require("./session-history");
|
|
|
16
16
|
const desktop_launch_1 = require("../desktop-launch");
|
|
17
17
|
const desktop_launch_2 = require("./desktop-launch");
|
|
18
18
|
exports.workbuddyManifest = {
|
|
19
|
-
id: "workbuddy", version: "1.1.
|
|
19
|
+
id: "workbuddy", version: "1.1.30", displayName: "WorkBuddy", type: "agent",
|
|
20
20
|
entry: "dist/index.js", apiVersion: "1", process: "in-process",
|
|
21
21
|
capabilities: ["chat", "health"], configSchema: "config.schema.json",
|
|
22
22
|
};
|
|
@@ -364,7 +364,15 @@ class WorkbuddyPlugin {
|
|
|
364
364
|
if (this.knownSessions.has(sessionId)) {
|
|
365
365
|
const binding = this.sessionBindings.get(sessionId);
|
|
366
366
|
const conversationId = binding?.conversationId ?? (this.recoverableSessionId === sessionId ? this.recoverableConversationId : undefined);
|
|
367
|
-
if (!conversationId
|
|
367
|
+
if (!conversationId) {
|
|
368
|
+
// 旧版本可能在新任务校验前写入会话 ID,无法恢复时允许重新创建。
|
|
369
|
+
this.knownSessions.delete(sessionId);
|
|
370
|
+
this.sessionBindings.delete(sessionId);
|
|
371
|
+
await this.persistKnownSessions();
|
|
372
|
+
await this.createSession(sessionId);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (!this.client.activateConversation)
|
|
368
376
|
throw new Error("WorkBuddy 不支持恢复旧 WorkBuddy 会话");
|
|
369
377
|
await this.client.activateConversation(conversationId);
|
|
370
378
|
this.activeSessionId = sessionId;
|