mu-agent-bridge 1.0.17 → 1.0.19
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/control-server.js +21 -3
- package/dist/src-ts/plugins/doubao/index.js +1 -1
- package/dist/src-ts/plugins/dsh/index.js +1 -1
- package/dist/src-ts/plugins/qwenwork/index.js +1 -1
- package/dist/src-ts/plugins/workbuddy/index.js +1 -1
- package/dist/tests-ts/bundled-package.test.js +11 -0
- package/package.json +1 -1
- package/plugins/abweb/dist/src-ts/plugin.js +13 -0
- package/plugins/aun/dist/src-ts/plugin.js +13 -0
- package/plugins/chatgpt/dist/src-ts/plugin.js +13 -0
- package/plugins/doubao/dist/src-ts/plugin.js +13 -0
- package/plugins/doubao/dist/src-ts/plugins/doubao/index.js +1 -1
- package/plugins/doubao/plugin.json +1 -1
- package/plugins/dsh/dist/src-ts/plugin.js +13 -0
- package/plugins/dsh/dist/src-ts/plugins/dsh/index.js +1 -1
- package/plugins/dsh/plugin.json +1 -1
- package/plugins/feishu/dist/src-ts/plugin.js +13 -0
- package/plugins/qwenwork/dist/src-ts/plugin.js +13 -0
- package/plugins/qwenwork/dist/src-ts/plugins/qwenwork/index.js +1 -1
- package/plugins/qwenwork/plugin.json +1 -1
- package/plugins/workbuddy/dist/src-ts/plugin.js +13 -0
- package/plugins/workbuddy/dist/src-ts/plugins/workbuddy/index.js +1 -1
- package/plugins/workbuddy/plugin.json +1 -1
|
@@ -110,9 +110,27 @@ class ControlServer {
|
|
|
110
110
|
if (method === "POST" && url.pathname === "/api/update") {
|
|
111
111
|
this.options.manager.log("info", "已请求后台升级,准备重启 daemon", undefined, "后台升级");
|
|
112
112
|
if (process.platform === "win32") {
|
|
113
|
-
const
|
|
114
|
-
const
|
|
115
|
-
|
|
113
|
+
const logFile = `${process.env.APPDATA ?? process.cwd()}\\agent-bridge\\state\\core-update.log`;
|
|
114
|
+
const script = [
|
|
115
|
+
"$ErrorActionPreference='Continue'",
|
|
116
|
+
`$log = '${logFile.replace(/'/g, "''")}'`,
|
|
117
|
+
"$dir = Split-Path -Parent $log",
|
|
118
|
+
"New-Item -ItemType Directory -Force $dir | Out-Null",
|
|
119
|
+
"function Write-UpdateLog($text) { \"$(Get-Date -Format o) $text\" | Out-File -FilePath $log -Append -Encoding utf8 }",
|
|
120
|
+
"Start-Sleep -Seconds 3",
|
|
121
|
+
"Write-UpdateLog '停止旧 daemon'",
|
|
122
|
+
"schtasks.exe /End /TN mab 2>&1 | ForEach-Object { Write-UpdateLog $_ }",
|
|
123
|
+
"Start-Sleep -Seconds 2",
|
|
124
|
+
"Write-UpdateLog '开始安装 mu-agent-bridge@latest'",
|
|
125
|
+
"npm.cmd install -g mu-agent-bridge@latest --no-fund --no-audit 2>&1 | ForEach-Object { Write-UpdateLog $_ }",
|
|
126
|
+
"Write-UpdateLog '重新启动 mab 计划任务'",
|
|
127
|
+
"schtasks.exe /Run /TN mab 2>&1 | ForEach-Object { Write-UpdateLog $_ }",
|
|
128
|
+
"Write-UpdateLog '后台升级脚本结束'",
|
|
129
|
+
].join('; ');
|
|
130
|
+
setTimeout(() => {
|
|
131
|
+
const child = (0, node_child_process_1.spawn)("powershell.exe", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", script], { detached: true, stdio: "ignore", windowsHide: true });
|
|
132
|
+
child.unref();
|
|
133
|
+
}, 1500).unref();
|
|
116
134
|
}
|
|
117
135
|
else {
|
|
118
136
|
return this.json(res, 501, { error: "当前平台未配置后台升级器" });
|
|
@@ -6,7 +6,7 @@ const dsh_agent_1 = require("../../dsh-agent");
|
|
|
6
6
|
const openai_adapter_1 = require("../qwenwork/openai-adapter");
|
|
7
7
|
exports.dshManifest = {
|
|
8
8
|
id: "dsh",
|
|
9
|
-
version: "1.0.
|
|
9
|
+
version: "1.0.4",
|
|
10
10
|
displayName: "DeepSeek Harness",
|
|
11
11
|
entry: "dist/index.js",
|
|
12
12
|
apiVersion: "1",
|
|
@@ -10,7 +10,7 @@ const plugin_1 = require("../../plugin");
|
|
|
10
10
|
const cdp_client_1 = require("./cdp-client");
|
|
11
11
|
const cli_client_1 = require("./cli-client");
|
|
12
12
|
exports.workbuddyManifest = {
|
|
13
|
-
id: "workbuddy", version: "1.1.
|
|
13
|
+
id: "workbuddy", version: "1.1.2", displayName: "WorkBuddy", type: "agent",
|
|
14
14
|
entry: "dist/index.js", apiVersion: "1", process: "in-process",
|
|
15
15
|
capabilities: ["chat", "health"], configSchema: "config.schema.json",
|
|
16
16
|
};
|
|
@@ -6,8 +6,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
7
7
|
const promises_1 = require("node:fs/promises");
|
|
8
8
|
const node_path_1 = require("node:path");
|
|
9
|
+
const node_module_1 = require("node:module");
|
|
9
10
|
const node_test_1 = __importDefault(require("node:test"));
|
|
10
11
|
const ids = ["abweb", "aun", "chatgpt", "doubao", "dsh", "feishu", "qwenwork", "workbuddy"];
|
|
12
|
+
(0, node_test_1.default)("独立包和默认插件的运行时依赖可加载", async () => {
|
|
13
|
+
const load = (0, node_module_1.createRequire)(__filename);
|
|
14
|
+
for (const id of ids) {
|
|
15
|
+
for (const root of ["packages", "plugins"]) {
|
|
16
|
+
const directory = (0, node_path_1.join)(process.cwd(), root, id);
|
|
17
|
+
const manifest = JSON.parse(await (0, promises_1.readFile)((0, node_path_1.join)(directory, "plugin.json"), "utf8"));
|
|
18
|
+
strict_1.default.doesNotThrow(() => load((0, node_path_1.join)(directory, manifest.entry)), `${root}/${id} 的运行时依赖必须完整`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
11
22
|
(0, node_test_1.default)("核心插件目录包含全部默认插件及其可加载入口", async () => {
|
|
12
23
|
const packageJson = JSON.parse(await (0, promises_1.readFile)((0, node_path_1.join)(process.cwd(), "package.json"), "utf8"));
|
|
13
24
|
strict_1.default.ok(packageJson.files?.includes("plugins/"));
|
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRuntimePort = resolveRuntimePort;
|
|
4
|
+
function resolveRuntimePort(config, runtime, pluginId, envName, fallback) {
|
|
5
|
+
const injected = runtime?.ports?.[pluginId];
|
|
6
|
+
if (typeof injected === "number" && Number.isInteger(injected) && injected > 0)
|
|
7
|
+
return injected;
|
|
8
|
+
const configured = config.cdpPort;
|
|
9
|
+
if (typeof configured === "number" && Number.isInteger(configured) && configured > 0)
|
|
10
|
+
return configured;
|
|
11
|
+
const environment = Number(process.env[envName] ?? "");
|
|
12
|
+
return Number.isInteger(environment) && environment > 0 ? environment : fallback;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRuntimePort = resolveRuntimePort;
|
|
4
|
+
function resolveRuntimePort(config, runtime, pluginId, envName, fallback) {
|
|
5
|
+
const injected = runtime?.ports?.[pluginId];
|
|
6
|
+
if (typeof injected === "number" && Number.isInteger(injected) && injected > 0)
|
|
7
|
+
return injected;
|
|
8
|
+
const configured = config.cdpPort;
|
|
9
|
+
if (typeof configured === "number" && Number.isInteger(configured) && configured > 0)
|
|
10
|
+
return configured;
|
|
11
|
+
const environment = Number(process.env[envName] ?? "");
|
|
12
|
+
return Number.isInteger(environment) && environment > 0 ? environment : fallback;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRuntimePort = resolveRuntimePort;
|
|
4
|
+
function resolveRuntimePort(config, runtime, pluginId, envName, fallback) {
|
|
5
|
+
const injected = runtime?.ports?.[pluginId];
|
|
6
|
+
if (typeof injected === "number" && Number.isInteger(injected) && injected > 0)
|
|
7
|
+
return injected;
|
|
8
|
+
const configured = config.cdpPort;
|
|
9
|
+
if (typeof configured === "number" && Number.isInteger(configured) && configured > 0)
|
|
10
|
+
return configured;
|
|
11
|
+
const environment = Number(process.env[envName] ?? "");
|
|
12
|
+
return Number.isInteger(environment) && environment > 0 ? environment : fallback;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRuntimePort = resolveRuntimePort;
|
|
4
|
+
function resolveRuntimePort(config, runtime, pluginId, envName, fallback) {
|
|
5
|
+
const injected = runtime?.ports?.[pluginId];
|
|
6
|
+
if (typeof injected === "number" && Number.isInteger(injected) && injected > 0)
|
|
7
|
+
return injected;
|
|
8
|
+
const configured = config.cdpPort;
|
|
9
|
+
if (typeof configured === "number" && Number.isInteger(configured) && configured > 0)
|
|
10
|
+
return configured;
|
|
11
|
+
const environment = Number(process.env[envName] ?? "");
|
|
12
|
+
return Number.isInteger(environment) && environment > 0 ? environment : fallback;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRuntimePort = resolveRuntimePort;
|
|
4
|
+
function resolveRuntimePort(config, runtime, pluginId, envName, fallback) {
|
|
5
|
+
const injected = runtime?.ports?.[pluginId];
|
|
6
|
+
if (typeof injected === "number" && Number.isInteger(injected) && injected > 0)
|
|
7
|
+
return injected;
|
|
8
|
+
const configured = config.cdpPort;
|
|
9
|
+
if (typeof configured === "number" && Number.isInteger(configured) && configured > 0)
|
|
10
|
+
return configured;
|
|
11
|
+
const environment = Number(process.env[envName] ?? "");
|
|
12
|
+
return Number.isInteger(environment) && environment > 0 ? environment : fallback;
|
|
13
|
+
}
|
|
@@ -6,7 +6,7 @@ const dsh_agent_1 = require("../../dsh-agent");
|
|
|
6
6
|
const openai_adapter_1 = require("../qwenwork/openai-adapter");
|
|
7
7
|
exports.dshManifest = {
|
|
8
8
|
id: "dsh",
|
|
9
|
-
version: "1.0.
|
|
9
|
+
version: "1.0.4",
|
|
10
10
|
displayName: "DeepSeek Harness",
|
|
11
11
|
entry: "dist/index.js",
|
|
12
12
|
apiVersion: "1",
|
package/plugins/dsh/plugin.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRuntimePort = resolveRuntimePort;
|
|
4
|
+
function resolveRuntimePort(config, runtime, pluginId, envName, fallback) {
|
|
5
|
+
const injected = runtime?.ports?.[pluginId];
|
|
6
|
+
if (typeof injected === "number" && Number.isInteger(injected) && injected > 0)
|
|
7
|
+
return injected;
|
|
8
|
+
const configured = config.cdpPort;
|
|
9
|
+
if (typeof configured === "number" && Number.isInteger(configured) && configured > 0)
|
|
10
|
+
return configured;
|
|
11
|
+
const environment = Number(process.env[envName] ?? "");
|
|
12
|
+
return Number.isInteger(environment) && environment > 0 ? environment : fallback;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRuntimePort = resolveRuntimePort;
|
|
4
|
+
function resolveRuntimePort(config, runtime, pluginId, envName, fallback) {
|
|
5
|
+
const injected = runtime?.ports?.[pluginId];
|
|
6
|
+
if (typeof injected === "number" && Number.isInteger(injected) && injected > 0)
|
|
7
|
+
return injected;
|
|
8
|
+
const configured = config.cdpPort;
|
|
9
|
+
if (typeof configured === "number" && Number.isInteger(configured) && configured > 0)
|
|
10
|
+
return configured;
|
|
11
|
+
const environment = Number(process.env[envName] ?? "");
|
|
12
|
+
return Number.isInteger(environment) && environment > 0 ? environment : fallback;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRuntimePort = resolveRuntimePort;
|
|
4
|
+
function resolveRuntimePort(config, runtime, pluginId, envName, fallback) {
|
|
5
|
+
const injected = runtime?.ports?.[pluginId];
|
|
6
|
+
if (typeof injected === "number" && Number.isInteger(injected) && injected > 0)
|
|
7
|
+
return injected;
|
|
8
|
+
const configured = config.cdpPort;
|
|
9
|
+
if (typeof configured === "number" && Number.isInteger(configured) && configured > 0)
|
|
10
|
+
return configured;
|
|
11
|
+
const environment = Number(process.env[envName] ?? "");
|
|
12
|
+
return Number.isInteger(environment) && environment > 0 ? environment : fallback;
|
|
13
|
+
}
|
|
@@ -10,7 +10,7 @@ const plugin_1 = require("../../plugin");
|
|
|
10
10
|
const cdp_client_1 = require("./cdp-client");
|
|
11
11
|
const cli_client_1 = require("./cli-client");
|
|
12
12
|
exports.workbuddyManifest = {
|
|
13
|
-
id: "workbuddy", version: "1.1.
|
|
13
|
+
id: "workbuddy", version: "1.1.2", displayName: "WorkBuddy", type: "agent",
|
|
14
14
|
entry: "dist/index.js", apiVersion: "1", process: "in-process",
|
|
15
15
|
capabilities: ["chat", "health"], configSchema: "config.schema.json",
|
|
16
16
|
};
|