mu-agent-bridge 1.0.67 → 1.0.68
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/dist/src-ts/plugins/workbuddy/cdp-client.js +1 -1
- package/dist/src-ts/plugins/workbuddy/index.js +1 -1
- package/dist/tests-ts/workbuddy-plugin.test.js +18 -2
- package/package.json +1 -1
- package/plugins/abweb/package.json +1 -1
- package/plugins/abweb/plugin.json +1 -1
- package/plugins/doubao/package.json +1 -1
- package/plugins/doubao/plugin.json +1 -1
- package/plugins/workbuddy/dist/src-ts/plugins/workbuddy/cdp-client.js +1 -1
- package/plugins/workbuddy/dist/src-ts/plugins/workbuddy/index.js +1 -1
- package/plugins/workbuddy/package.json +1 -1
- package/plugins/workbuddy/plugin.json +1 -1
|
@@ -129,7 +129,7 @@ class WorkbuddyCdpClient {
|
|
|
129
129
|
throw new Error("WorkBuddy 尚未登录,请先在桌面端登录后重试");
|
|
130
130
|
await this.waitFor(`(() => { const button = [...document.querySelectorAll('button,[role="button"],[role="tab"]')].find(item => { const label = [item.innerText, item.textContent, item.getAttribute('aria-label'), item.getAttribute('title'), item.getAttribute('data-testid')].filter(Boolean).map(value => String(value).normalize('NFKC').replace(/\\s+/g, ' ').trim().toLowerCase()); return label.some(value => /^(?:新建任务|新建会话|新建对话|开始新任务|new (?:task|chat|conversation))$/.test(value)) && (!item.getClientRects || item.getClientRects().length > 0); }); if (!button || button.disabled || button.getAttribute('aria-disabled') === 'true') return false; button.click(); return true; })()`, "WorkBuddy 新建任务入口未找到或不可用");
|
|
131
131
|
// WorkBuddy 首页不分配任务 ID;此时仅接受无选中任务的空白首页。
|
|
132
|
-
await this.waitFor(`(() => { const state = ${snapshot}; const blank = state.editor !== null && state.editor.trim() === '' && state.messages === 0; return blank && ((state.conversationId && state.conversationId !== ${JSON.stringify(before.conversationId)}) || state.url !== ${JSON.stringify(before.url)} || (state.home && !state.selected)); })()`, "WorkBuddy 新任务状态校验失败");
|
|
132
|
+
await this.waitFor(`(() => { const state = ${snapshot}; const blank = state.editor !== null && state.editor.trim() === '' && state.messages === 0; const clearedToUnselected = ${before.selected} && !state.selected && state.messages < ${before.messages}; return blank && ((state.conversationId && state.conversationId !== ${JSON.stringify(before.conversationId)}) || state.url !== ${JSON.stringify(before.url)} || (state.home && !state.selected) || clearedToUnselected); })()`, "WorkBuddy 新任务状态校验失败");
|
|
133
133
|
this.pendingInteraction = undefined;
|
|
134
134
|
const temporaryPaths = this.pendingInteractionCleanup;
|
|
135
135
|
this.pendingInteractionCleanup = undefined;
|
|
@@ -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.31", 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
|
};
|
|
@@ -936,8 +936,8 @@ const cdp_client_1 = require("../src-ts/plugins/workbuddy/cdp-client");
|
|
|
936
936
|
strict_1.default.equal(creates, 1);
|
|
937
937
|
fail = true;
|
|
938
938
|
await strict_1.default.rejects(() => plugin.controlSession({ operation: "new", sessionId: "failed-session" }), /校验失败/);
|
|
939
|
-
await strict_1.default.rejects(() => plugin.handle({ task: "续聊", sessionId: "new-session" }),
|
|
940
|
-
strict_1.default.equal(creates,
|
|
939
|
+
await strict_1.default.rejects(() => plugin.handle({ task: "续聊", sessionId: "new-session" }), /校验失败/);
|
|
940
|
+
strict_1.default.equal(creates, 3);
|
|
941
941
|
});
|
|
942
942
|
(0, node_test_1.default)("workbuddy auto 选择 CLI 时不会创建无关桌面任务", async () => {
|
|
943
943
|
const root = await (0, promises_1.mkdtemp)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "wb-cli-session-"));
|
|
@@ -1018,6 +1018,22 @@ const cdp_client_1 = require("../src-ts/plugins/workbuddy/cdp-client");
|
|
|
1018
1018
|
await client.createTask();
|
|
1019
1019
|
}
|
|
1020
1020
|
});
|
|
1021
|
+
(0, node_test_1.default)("workbuddy CDP 新建接受旧版界面清空消息并取消旧任务选中", async () => {
|
|
1022
|
+
let selected = true;
|
|
1023
|
+
let messages = 1;
|
|
1024
|
+
const button = { textContent: "新建任务", disabled: false, getAttribute: () => null, click: () => { selected = false; messages = 0; } };
|
|
1025
|
+
const editor = { innerText: "今天帮你做些什么?", querySelector: () => null, cloneNode: () => ({ textContent: "", querySelectorAll: () => [] }) };
|
|
1026
|
+
const document = {
|
|
1027
|
+
querySelectorAll: (selector) => selector === '.cr-agent[data-message-id]' ? Array(messages).fill({}) : selector === '[data-conversation-id]' ? selected ? [{ className: "_selected_old", getAttribute: () => "old-conversation" }] : [] : [button],
|
|
1028
|
+
querySelector: () => editor,
|
|
1029
|
+
};
|
|
1030
|
+
const client = new cdp_client_1.WorkbuddyCdpClient({ timeoutMs: 1 });
|
|
1031
|
+
const internal = client;
|
|
1032
|
+
internal.evaluate = async (expression) => (0, node_vm_1.runInNewContext)(expression, { document, location: { href: "app://workbuddy/task/old" } });
|
|
1033
|
+
await client.createTask();
|
|
1034
|
+
strict_1.default.equal(selected, false);
|
|
1035
|
+
strict_1.default.equal(messages, 0);
|
|
1036
|
+
});
|
|
1021
1037
|
(0, node_test_1.default)("workbuddy CDP 等待新建任务入口完成渲染后再点击", async () => {
|
|
1022
1038
|
let lookups = 0;
|
|
1023
1039
|
let clicked = false;
|
package/package.json
CHANGED
|
@@ -129,7 +129,7 @@ class WorkbuddyCdpClient {
|
|
|
129
129
|
throw new Error("WorkBuddy 尚未登录,请先在桌面端登录后重试");
|
|
130
130
|
await this.waitFor(`(() => { const button = [...document.querySelectorAll('button,[role="button"],[role="tab"]')].find(item => { const label = [item.innerText, item.textContent, item.getAttribute('aria-label'), item.getAttribute('title'), item.getAttribute('data-testid')].filter(Boolean).map(value => String(value).normalize('NFKC').replace(/\\s+/g, ' ').trim().toLowerCase()); return label.some(value => /^(?:新建任务|新建会话|新建对话|开始新任务|new (?:task|chat|conversation))$/.test(value)) && (!item.getClientRects || item.getClientRects().length > 0); }); if (!button || button.disabled || button.getAttribute('aria-disabled') === 'true') return false; button.click(); return true; })()`, "WorkBuddy 新建任务入口未找到或不可用");
|
|
131
131
|
// WorkBuddy 首页不分配任务 ID;此时仅接受无选中任务的空白首页。
|
|
132
|
-
await this.waitFor(`(() => { const state = ${snapshot}; const blank = state.editor !== null && state.editor.trim() === '' && state.messages === 0; return blank && ((state.conversationId && state.conversationId !== ${JSON.stringify(before.conversationId)}) || state.url !== ${JSON.stringify(before.url)} || (state.home && !state.selected)); })()`, "WorkBuddy 新任务状态校验失败");
|
|
132
|
+
await this.waitFor(`(() => { const state = ${snapshot}; const blank = state.editor !== null && state.editor.trim() === '' && state.messages === 0; const clearedToUnselected = ${before.selected} && !state.selected && state.messages < ${before.messages}; return blank && ((state.conversationId && state.conversationId !== ${JSON.stringify(before.conversationId)}) || state.url !== ${JSON.stringify(before.url)} || (state.home && !state.selected) || clearedToUnselected); })()`, "WorkBuddy 新任务状态校验失败");
|
|
133
133
|
this.pendingInteraction = undefined;
|
|
134
134
|
const temporaryPaths = this.pendingInteractionCleanup;
|
|
135
135
|
this.pendingInteractionCleanup = undefined;
|
|
@@ -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.31", 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
|
};
|