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.
@@ -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 script = "$ErrorActionPreference='Continue'; Start-Sleep -Seconds 2; schtasks.exe /End /TN mab | Out-Null; npm.cmd install -g mu-agent-bridge@latest --no-fund --no-audit; schtasks.exe /Run /TN mab | Out-Null";
114
- const child = (0, node_child_process_1.spawn)("powershell.exe", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", script], { detached: true, stdio: "ignore", windowsHide: true });
115
- child.unref();
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: "当前平台未配置后台升级器" });
@@ -5,7 +5,7 @@ const cdp_client_1 = require("./cdp-client");
5
5
  const plugin_1 = require("../../plugin");
6
6
  exports.doubaoManifest = {
7
7
  id: "doubao",
8
- version: "1.0.4",
8
+ version: "1.0.5",
9
9
  displayName: "豆包",
10
10
  entry: "dist/index.js",
11
11
  apiVersion: "1",
@@ -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.2",
9
+ version: "1.0.4",
10
10
  displayName: "DeepSeek Harness",
11
11
  entry: "dist/index.js",
12
12
  apiVersion: "1",
@@ -7,7 +7,7 @@ const cdp_client_1 = require("./cdp-client");
7
7
  const plugin_1 = require("../../plugin");
8
8
  exports.qwenworkManifest = {
9
9
  id: "qwenwork",
10
- version: "1.0.2",
10
+ version: "1.0.3",
11
11
  displayName: "千问办公",
12
12
  entry: "dist/index.js",
13
13
  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.1", displayName: "WorkBuddy", type: "agent",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mu-agent-bridge",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "将 AUN Agent 连接到本地桌面 AI 客户端的插件平台。",
5
5
  "main": "dist/src-ts/cli.js",
6
6
  "bin": {
@@ -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
+ }
@@ -5,7 +5,7 @@ const cdp_client_1 = require("./cdp-client");
5
5
  const plugin_1 = require("../../plugin");
6
6
  exports.doubaoManifest = {
7
7
  id: "doubao",
8
- version: "1.0.4",
8
+ version: "1.0.5",
9
9
  displayName: "豆包",
10
10
  entry: "dist/index.js",
11
11
  apiVersion: "1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "doubao",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "type": "agent",
5
5
  "displayName": "豆包",
6
6
  "entry": "dist/src-ts/plugins/doubao/index.js",
@@ -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.2",
9
+ version: "1.0.4",
10
10
  displayName: "DeepSeek Harness",
11
11
  entry: "dist/index.js",
12
12
  apiVersion: "1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "type": "agent",
5
5
  "displayName": "DeepSeek Harness",
6
6
  "entry": "dist/src-ts/plugins/dsh/index.js",
@@ -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
+ }
@@ -7,7 +7,7 @@ const cdp_client_1 = require("./cdp-client");
7
7
  const plugin_1 = require("../../plugin");
8
8
  exports.qwenworkManifest = {
9
9
  id: "qwenwork",
10
- version: "1.0.2",
10
+ version: "1.0.3",
11
11
  displayName: "千问办公",
12
12
  entry: "dist/index.js",
13
13
  apiVersion: "1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "qwenwork",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "agent",
5
5
  "displayName": "千问办公",
6
6
  "entry": "dist/src-ts/plugins/qwenwork/index.js",
@@ -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.1", displayName: "WorkBuddy", type: "agent",
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
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "workbuddy",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "type": "agent",
5
5
  "displayName": "WorkBuddy(CodeBuddy CLI)",
6
6
  "entry": "dist/src-ts/plugins/workbuddy/index.js",