mu-agent-bridge 1.0.73 → 1.0.78
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 +12 -8
- package/dist/src-ts/cli.js +67 -37
- package/dist/src-ts/control-server.js +7 -28
- package/dist/src-ts/core-updater.js +141 -33
- package/dist/src-ts/daemon-process.js +2 -1
- package/dist/src-ts/dsh-agent.js +7 -2
- package/dist/src-ts/http-agent.js +36 -0
- package/dist/src-ts/plugin-manager.js +185 -58
- package/dist/src-ts/plugins/abweb/index.js +1 -1
- package/dist/src-ts/plugins/abweb/public/app.js +8 -6
- package/dist/src-ts/plugins/abweb/public/index.html +3 -3
- package/dist/src-ts/plugins/aun/attachments.js +3 -21
- package/dist/src-ts/plugins/aun/index.js +89 -11
- package/dist/src-ts/plugins/aun/messages.js +1 -1
- package/dist/src-ts/plugins/aun/public/app.js +2 -1
- package/dist/src-ts/plugins/aun/public/index.html +1 -1
- package/dist/src-ts/plugins/cdp-draft.js +5 -2
- package/dist/src-ts/plugins/chatgpt/index.js +3 -2
- package/dist/src-ts/plugins/claude-cli/index.js +1 -1
- package/dist/src-ts/plugins/desktop-launch.js +44 -3
- package/dist/src-ts/plugins/doubao/cdp-client.js +231 -45
- package/dist/src-ts/plugins/doubao/index.js +119 -7
- package/dist/src-ts/plugins/doubao/native-task.js +134 -0
- package/dist/src-ts/plugins/dsh/cdp-client.js +334 -0
- package/dist/src-ts/plugins/dsh/index.js +102 -23
- package/dist/src-ts/plugins/dsh/session-history.js +31 -3
- package/dist/src-ts/plugins/feishu/index.js +1 -1
- package/dist/src-ts/plugins/personal-assistant/index.js +29 -8
- package/dist/src-ts/plugins/personal-assistant/model-client.js +20 -6
- package/dist/src-ts/plugins/personal-assistant/session-memory.js +124 -0
- package/dist/src-ts/plugins/personal-assistant/tools.js +4 -3
- package/dist/src-ts/plugins/qwenwork/cdp-client.js +43 -7
- package/dist/src-ts/plugins/qwenwork/index.js +52 -18
- package/dist/src-ts/plugins/workbuddy/cdp-client.js +349 -83
- package/dist/src-ts/plugins/workbuddy/index.js +24 -12
- package/dist/src-ts/plugins/zcode/cdp-client.js +500 -0
- package/dist/src-ts/plugins/zcode/index.js +97 -0
- package/dist/src-ts/session-management.js +27 -8
- package/dist/src-ts/version-manager.js +6 -3
- package/dist/tests-ts/abweb-model-config.test.js +44 -41
- package/dist/tests-ts/aun-attachments.test.js +19 -17
- package/dist/tests-ts/aun-default-owner-page.test.js +2 -1
- package/dist/tests-ts/aun-messages.test.js +14 -0
- package/dist/tests-ts/aun-plugin.test.js +207 -19
- package/dist/tests-ts/bundled-package.test.js +1 -1
- package/dist/tests-ts/cdp-draft-recovery.test.js +182 -3
- package/dist/tests-ts/chatgpt-plugin.test.js +19 -0
- package/dist/tests-ts/control-server.test.js +20 -0
- package/dist/tests-ts/core-updater.test.js +215 -46
- package/dist/tests-ts/daemon-process.test.js +126 -1
- package/dist/tests-ts/desktop-launch.test.js +73 -0
- package/dist/tests-ts/doubao-native-task.test.js +237 -0
- package/dist/tests-ts/doubao-plugin.test.js +688 -19
- package/dist/tests-ts/dsh-agent.test.js +91 -19
- package/dist/tests-ts/dsh-cdp.test.js +148 -0
- package/dist/tests-ts/dsh-history.test.js +37 -0
- package/dist/tests-ts/feishu-plugin.test.js +1 -1
- package/dist/tests-ts/http-agent.test.js +18 -0
- package/dist/tests-ts/local-cli.test.js +29 -2
- package/dist/tests-ts/model-provider-cancellation.test.js +2 -0
- package/dist/tests-ts/native-session-management.test.js +8 -7
- package/dist/tests-ts/personal-assistant-coordination.test.js +16 -0
- package/dist/tests-ts/personal-assistant-extensions.test.js +7 -1
- package/dist/tests-ts/personal-assistant-memory.test.js +117 -0
- package/dist/tests-ts/personal-assistant.test.js +277 -3
- package/dist/tests-ts/platform-integration.test.js +60 -1
- package/dist/tests-ts/plugin-manager.test.js +78 -6
- package/dist/tests-ts/plugin-upgrade-deadline.test.js +354 -0
- package/dist/tests-ts/publish-packages.test.js +1 -1
- package/dist/tests-ts/qwenwork-plugin.test.js +30 -0
- package/dist/tests-ts/qwenwork-reconnect.test.js +195 -0
- package/dist/tests-ts/qwenwork-sse.test.js +33 -0
- package/dist/tests-ts/session-access-defaults.test.js +112 -0
- package/dist/tests-ts/session-management.test.js +8 -8
- package/dist/tests-ts/version-manager.test.js +40 -0
- package/dist/tests-ts/workbuddy-cdp-recovery.test.js +311 -0
- package/dist/tests-ts/workbuddy-plugin.test.js +356 -13
- package/dist/tests-ts/zcode-cdp.test.js +894 -0
- package/dist/tests-ts/zcode-plugin.test.js +396 -0
- package/package.json +1 -1
- package/plugins/abweb/dist/src-ts/plugins/abweb/index.js +1 -1
- package/plugins/abweb/dist/src-ts/plugins/abweb/public/app.js +8 -6
- package/plugins/abweb/dist/src-ts/plugins/abweb/public/app.ts +7 -5
- package/plugins/abweb/dist/src-ts/plugins/abweb/public/index.html +3 -3
- package/plugins/abweb/package.json +1 -1
- package/plugins/abweb/plugin.json +1 -1
- package/plugins/aun/config.schema.json +1 -1
- package/plugins/aun/dist/src-ts/plugins/aun/attachments.js +3 -21
- package/plugins/aun/dist/src-ts/plugins/aun/index.js +89 -11
- package/plugins/aun/dist/src-ts/plugins/aun/messages.js +1 -1
- package/plugins/aun/dist/src-ts/plugins/aun/public/app.js +2 -1
- package/plugins/aun/dist/src-ts/plugins/aun/public/index.html +1 -1
- package/plugins/aun/package.json +1 -1
- package/plugins/aun/plugin.json +1 -1
- package/plugins/chatgpt/dist/src-ts/plugins/cdp-draft.js +5 -2
- package/plugins/chatgpt/dist/src-ts/plugins/chatgpt/index.js +3 -2
- package/plugins/chatgpt/dist/src-ts/plugins/desktop-launch.js +44 -3
- package/plugins/claude-cli/dist/src-ts/plugins/claude-cli/index.js +1 -1
- package/plugins/claude-cli/package.json +1 -1
- package/plugins/claude-cli/plugin.json +1 -1
- package/plugins/doubao/config.schema.json +2 -1
- package/plugins/doubao/dist/src-ts/plugins/desktop-launch.js +44 -3
- package/plugins/doubao/dist/src-ts/plugins/doubao/cdp-client.js +231 -45
- package/plugins/doubao/dist/src-ts/plugins/doubao/index.js +119 -7
- package/plugins/doubao/dist/src-ts/plugins/doubao/native-task.js +134 -0
- package/plugins/doubao/package.json +1 -1
- package/plugins/doubao/plugin.json +1 -1
- package/plugins/dsh/config.schema.json +5 -2
- package/plugins/dsh/dist/src-ts/dsh-agent.js +7 -2
- package/plugins/dsh/dist/src-ts/plugins/desktop-launch.js +44 -3
- package/plugins/dsh/dist/src-ts/plugins/dsh/cdp-client.js +334 -0
- package/plugins/dsh/dist/src-ts/plugins/dsh/index.js +102 -23
- package/plugins/dsh/dist/src-ts/plugins/dsh/session-history.js +31 -3
- package/plugins/dsh/package.json +1 -1
- package/plugins/dsh/plugin.json +1 -1
- package/plugins/feishu/dist/src-ts/plugins/feishu/index.js +1 -1
- package/plugins/feishu/package.json +1 -1
- package/plugins/feishu/plugin.json +1 -1
- package/plugins/personal-assistant/config.schema.json +3 -2
- package/plugins/personal-assistant/dist/src-ts/attachments.js +62 -0
- package/plugins/personal-assistant/dist/src-ts/plugins/personal-assistant/index.js +29 -8
- package/plugins/personal-assistant/dist/src-ts/plugins/personal-assistant/model-client.js +20 -6
- package/plugins/personal-assistant/dist/src-ts/plugins/personal-assistant/session-memory.js +124 -0
- package/plugins/personal-assistant/dist/src-ts/plugins/personal-assistant/tools.js +4 -3
- package/plugins/personal-assistant/package.json +2 -2
- package/plugins/personal-assistant/plugin.json +1 -1
- package/plugins/qwenwork/dist/src-ts/plugins/cdp-draft.js +5 -2
- package/plugins/qwenwork/dist/src-ts/plugins/desktop-launch.js +44 -3
- package/plugins/qwenwork/dist/src-ts/plugins/qwenwork/cdp-client.js +43 -7
- package/plugins/qwenwork/dist/src-ts/plugins/qwenwork/index.js +52 -18
- package/plugins/qwenwork/package.json +1 -1
- package/plugins/qwenwork/plugin.json +1 -1
- package/plugins/workbuddy/config.schema.json +1 -1
- package/plugins/workbuddy/dist/src-ts/plugins/desktop-launch.js +44 -3
- package/plugins/workbuddy/dist/src-ts/plugins/workbuddy/cdp-client.js +349 -83
- package/plugins/workbuddy/dist/src-ts/plugins/workbuddy/index.js +24 -12
- package/plugins/workbuddy/package.json +1 -1
- package/plugins/workbuddy/plugin.json +1 -1
- package/plugins/zcode/config.schema.json +13 -0
- package/plugins/zcode/dist/src-ts/agent.js +69 -0
- package/plugins/zcode/dist/src-ts/attachments.js +62 -0
- package/plugins/zcode/dist/src-ts/plugin.js +13 -0
- package/plugins/zcode/dist/src-ts/plugins/desktop-launch.js +238 -0
- package/plugins/zcode/dist/src-ts/plugins/workbuddy/cdp-client.js +896 -0
- package/plugins/zcode/dist/src-ts/plugins/workbuddy/cli-client.js +39 -0
- package/plugins/zcode/dist/src-ts/plugins/workbuddy/desktop-launch.js +10 -0
- package/plugins/zcode/dist/src-ts/plugins/workbuddy/index.js +567 -0
- package/plugins/zcode/dist/src-ts/plugins/workbuddy/session-history.js +121 -0
- package/plugins/zcode/dist/src-ts/plugins/zcode/cdp-client.js +500 -0
- package/plugins/zcode/dist/src-ts/plugins/zcode/index.js +97 -0
- package/plugins/zcode/package.json +16 -0
- package/plugins/zcode/plugin.json +11 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZcodePlugin = exports.zcodeManifest = void 0;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const agent_1 = require("../../agent");
|
|
6
|
+
const plugin_1 = require("../../plugin");
|
|
7
|
+
const cdp_client_1 = require("./cdp-client");
|
|
8
|
+
const workbuddy_1 = require("../workbuddy");
|
|
9
|
+
const desktop_launch_1 = require("../desktop-launch");
|
|
10
|
+
exports.zcodeManifest = {
|
|
11
|
+
id: "zcode", version: "1.0.8", displayName: "ZCode", type: "agent",
|
|
12
|
+
entry: "dist/src-ts/plugins/zcode/index.js", apiVersion: "1", process: "in-process",
|
|
13
|
+
capabilities: ["chat", "health"], configSchema: "config.schema.json",
|
|
14
|
+
};
|
|
15
|
+
class ZcodePlugin {
|
|
16
|
+
options;
|
|
17
|
+
manifest = exports.zcodeManifest;
|
|
18
|
+
delegate;
|
|
19
|
+
process;
|
|
20
|
+
constructor(options = {}) {
|
|
21
|
+
this.options = options;
|
|
22
|
+
}
|
|
23
|
+
get sessionOperations() { return this.delegate?.sessionOperations ?? []; }
|
|
24
|
+
async activate(context) {
|
|
25
|
+
const port = (0, plugin_1.resolveRuntimePort)(context.config, context.runtime, "zcode", "ZCODE_CDP_PORT", this.options.cdpPort ?? 9231);
|
|
26
|
+
const args = context.config.startupArgs ?? [];
|
|
27
|
+
if (!Array.isArray(args) || args.some(arg => typeof arg !== "string" || /^--remote-debugging-(?:port|address)(?:=|$)/i.test(arg)))
|
|
28
|
+
throw new Error("startupArgs 必须为字符串数组,CDP 地址和端口由插件配置管理");
|
|
29
|
+
const client = this.options.client ?? new cdp_client_1.ZcodeCdpClient({ port });
|
|
30
|
+
if (!this.options.client) {
|
|
31
|
+
const connect = client.connect.bind(client);
|
|
32
|
+
client.connect = async () => {
|
|
33
|
+
try {
|
|
34
|
+
await connect();
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
const failure = error;
|
|
38
|
+
if (context.config.autoStart === false || process.platform !== "win32" || failure.code !== "ECONNREFUSED" && failure.cause?.code !== "ECONNREFUSED")
|
|
39
|
+
throw error;
|
|
40
|
+
const executable = await (0, desktop_launch_1.findWindowsExecutable)("ZCode.exe", typeof context.config.executablePath === "string" ? context.config.executablePath : undefined);
|
|
41
|
+
if (!executable)
|
|
42
|
+
throw new Error("未找到 ZCode.exe,请检查开始菜单安装记录或配置 executablePath");
|
|
43
|
+
context.logger.info("正在启动 ZCode 并等待 CDP", { executable, port });
|
|
44
|
+
const env = { ...process.env };
|
|
45
|
+
delete env.ELECTRON_RUN_AS_NODE;
|
|
46
|
+
try {
|
|
47
|
+
await (0, desktop_launch_1.launchManagedAndWait)(executable, [...args, "--remote-debugging-address=127.0.0.1", `--remote-debugging-port=${port}`], undefined, connect, typeof context.config.startupTimeoutMs === "number" ? context.config.startupTimeoutMs : 30_000, child => { this.process = child; }, (file, argv) => (0, node_child_process_1.spawn)(file, argv, { env, detached: true, stdio: "ignore", windowsHide: false }));
|
|
48
|
+
}
|
|
49
|
+
catch (cause) {
|
|
50
|
+
const code = cause.code ?? (cause.cause?.code);
|
|
51
|
+
if (code === "ENOENT" || code === "EACCES")
|
|
52
|
+
throw new Error(`无法启动 ZCode:${cause instanceof Error ? cause.message : String(cause)}`, { cause });
|
|
53
|
+
throw new Error(`ZCode 已启动,但 CDP ${port} 未就绪;若桌面已打开,请先退出 ZCode,再重载插件使调试参数生效`, { cause });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
this.delegate = new workbuddy_1.WorkbuddyPlugin({ client, expertSelection: false, replyTimeoutLimitMs: Infinity });
|
|
59
|
+
await this.delegate.activate({ ...context, config: { ...context.config, transport: "cdp", cdpPort: port, autoStart: false, dailyPoints: false } });
|
|
60
|
+
}
|
|
61
|
+
async deactivate(reason) {
|
|
62
|
+
try {
|
|
63
|
+
await this.delegate?.deactivate(reason);
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
const child = this.process;
|
|
67
|
+
this.process = undefined;
|
|
68
|
+
this.delegate = undefined;
|
|
69
|
+
await (0, desktop_launch_1.terminateOwnedProcess)(child);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async health() {
|
|
73
|
+
return this.delegate ? this.delegate.health() : { status: "failed", message: "ZCode 插件尚未激活" };
|
|
74
|
+
}
|
|
75
|
+
async handle(request) {
|
|
76
|
+
if (!this.delegate)
|
|
77
|
+
throw new Error("ZCode 插件尚未激活");
|
|
78
|
+
try {
|
|
79
|
+
return await this.delegate.handle(request);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (!(error instanceof agent_1.AgentOperationError) || error.code !== "WORKBUDDY_TASK_FAILED")
|
|
83
|
+
throw error;
|
|
84
|
+
const cause = error.cause;
|
|
85
|
+
const detail = cause instanceof Error && cause.message.includes("WorkBuddy")
|
|
86
|
+
? Object.assign(new Error(cause.message.replaceAll("WorkBuddy", "ZCode"), { cause: cause.cause }), { code: cause.code }) : cause;
|
|
87
|
+
throw new agent_1.AgentOperationError("ZCODE_TASK_FAILED", error.stage.replaceAll("WorkBuddy", "ZCode"), detail);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async controlSession(request) {
|
|
91
|
+
if (!this.delegate)
|
|
92
|
+
throw new Error("ZCode 插件尚未激活");
|
|
93
|
+
return this.delegate.controlSession(request);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.ZcodePlugin = ZcodePlugin;
|
|
97
|
+
exports.default = ZcodePlugin;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-bridge-zcode",
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"description": "agent-bridge 的 ZCode 桌面端 CDP 插件。",
|
|
5
|
+
"keywords": ["mu-agent-bridge-plugin", "mu-agent-bridge-agent"],
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://codeup.aliyun.com/6808da56fb3da14b899afd54/agent_bridge.git",
|
|
9
|
+
"directory": "packages/zcode"
|
|
10
|
+
},
|
|
11
|
+
"main": "dist/src-ts/plugins/zcode/index.js",
|
|
12
|
+
"files": ["dist/", "plugin.json", "config.schema.json", "README.md"],
|
|
13
|
+
"agentBridge": { "plugin": "./plugin.json", "type": "agent" },
|
|
14
|
+
"publishConfig": { "access": "public", "registry": "https://registry.npmjs.org" },
|
|
15
|
+
"engines": { "node": ">=22" }
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "zcode",
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"type": "agent",
|
|
5
|
+
"displayName": "ZCode",
|
|
6
|
+
"entry": "dist/src-ts/plugins/zcode/index.js",
|
|
7
|
+
"apiVersion": "1",
|
|
8
|
+
"process": "in-process",
|
|
9
|
+
"capabilities": ["chat", "health"],
|
|
10
|
+
"configSchema": "config.schema.json"
|
|
11
|
+
}
|