mu-agent-bridge 1.0.1 → 1.0.2

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.
@@ -32,5 +32,6 @@ async function searchPluginCatalog(query = "", get = getJson) {
32
32
  return;
33
33
  }
34
34
  }));
35
- return items.filter((item) => Boolean(item));
35
+ const needle = query.trim().toLowerCase();
36
+ return items.filter((item) => Boolean(item)).filter((item) => !needle || `${item.name} ${item.description}`.toLowerCase().includes(needle));
36
37
  }
@@ -25,6 +25,19 @@ const plugin_manager_1 = require("../src-ts/plugin-manager");
25
25
  await server.stop();
26
26
  }
27
27
  });
28
+ (0, node_test_1.default)("插件目录 API 返回远程候选包", async () => {
29
+ const manager = { list: () => [], searchPackages: async (query) => query === "workbuddy" ? [{ name: "agent-bridge-workbuddy", version: "1.0.0", type: "agent", description: "办公 Agent" }] : [] };
30
+ const server = new control_server_1.ControlServer({ manager, host: "127.0.0.1", port: 0 });
31
+ const address = await server.start();
32
+ try {
33
+ const response = await fetch(`http://${address.host}:${address.port}/api/plugins/catalog?q=workbuddy`);
34
+ strict_1.default.equal(response.status, 200);
35
+ strict_1.default.equal((await response.json()).plugins[0].type, "agent");
36
+ }
37
+ finally {
38
+ await server.stop();
39
+ }
40
+ });
28
41
  (0, node_test_1.default)("control server dispatches plugin HTTP routes and unregisters them on stop", async () => {
29
42
  const root = await (0, promises_1.mkdtemp)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "agent-bridge-http-plugin-"));
30
43
  try {
@@ -21,6 +21,7 @@ const plugin_manifest_1 = require("../src-ts/plugin-manifest");
21
21
  strict_1.default.deepEqual((await (0, plugin_catalog_1.searchPluginCatalog)("", get)).map(({ name, type }) => [name, type]), [
22
22
  ["agent-bridge-workbuddy", "agent"], ["agent-bridge-aun", "channel"],
23
23
  ]);
24
+ strict_1.default.deepEqual((await (0, plugin_catalog_1.searchPluginCatalog)("aun", get)).map(({ name }) => name), ["agent-bridge-aun"]);
24
25
  });
25
26
  (0, node_test_1.default)("插件清单类型从能力兼容识别,冲突类型拒绝", () => {
26
27
  const base = { id: "sample", version: "1.0.0", entry: "index.js", apiVersion: "1", capabilities: ["chat"] };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mu-agent-bridge",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "将 AUN Agent 连接到本地桌面 AI 客户端的插件平台。",
5
5
  "main": "dist/src-ts/cli.js",
6
6
  "bin": { "mab": "dist/src-ts/cli.js", "agent-bridge": "dist/src-ts/cli.js" },