mu-agent-bridge 1.0.71 → 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 +17 -10
- package/dist/src-ts/agent.js +35 -0
- package/dist/src-ts/channel-sessions.js +3 -2
- package/dist/src-ts/cli.js +67 -37
- package/dist/src-ts/control-server.js +12 -30
- 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 +31 -13
- package/dist/src-ts/http-agent.js +36 -0
- package/dist/src-ts/plugin-catalog.js +11 -2
- package/dist/src-ts/plugin-manager.js +351 -50
- package/dist/src-ts/plugins/abweb/index.js +1 -1
- package/dist/src-ts/plugins/abweb/public/app.js +73 -5
- package/dist/src-ts/plugins/abweb/public/index.html +15 -0
- package/dist/src-ts/plugins/abweb/public/style.css +4 -0
- package/dist/src-ts/plugins/aun/attachments.js +3 -21
- package/dist/src-ts/plugins/aun/index.js +155 -21
- package/dist/src-ts/plugins/aun/messages.js +4 -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/cdp-client.js +26 -12
- package/dist/src-ts/plugins/chatgpt/index.js +80 -19
- package/dist/src-ts/plugins/claude-cli/index.js +19 -2
- package/dist/src-ts/plugins/codex-cli/index.js +19 -2
- package/dist/src-ts/plugins/desktop-launch.js +44 -3
- package/dist/src-ts/plugins/doubao/cdp-client.js +234 -45
- package/dist/src-ts/plugins/doubao/index.js +152 -8
- 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 +172 -21
- 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/local-cli/agent.js +74 -9
- package/dist/src-ts/plugins/personal-assistant/claude-cli-model.js +30 -0
- package/dist/src-ts/plugins/personal-assistant/coordination.js +57 -0
- package/dist/src-ts/plugins/personal-assistant/index.js +263 -0
- package/dist/src-ts/plugins/personal-assistant/model-client.js +181 -0
- package/dist/src-ts/plugins/personal-assistant/owner-context.js +56 -0
- package/dist/src-ts/plugins/personal-assistant/remote-ability.js +176 -0
- package/dist/src-ts/plugins/personal-assistant/session-memory.js +124 -0
- package/dist/src-ts/plugins/personal-assistant/tools.js +167 -0
- package/dist/src-ts/plugins/qwenwork/cdp-client.js +90 -18
- package/dist/src-ts/plugins/qwenwork/index.js +139 -24
- package/dist/src-ts/plugins/workbuddy/cdp-client.js +353 -82
- package/dist/src-ts/plugins/workbuddy/index.js +124 -41
- 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 +132 -14
- package/dist/src-ts/version-manager.js +6 -3
- package/dist/tests-ts/abweb-cli.test.js +10 -2
- package/dist/tests-ts/abweb-model-config.test.js +73 -0
- package/dist/tests-ts/agent.test.js +27 -0
- 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 +20 -0
- package/dist/tests-ts/aun-plugin.test.js +292 -19
- package/dist/tests-ts/bundled-package.test.js +12 -2
- package/dist/tests-ts/cdp-draft-recovery.test.js +182 -3
- package/dist/tests-ts/channel-sessions.test.js +27 -0
- package/dist/tests-ts/chatgpt-plugin.test.js +118 -0
- package/dist/tests-ts/control-server.test.js +56 -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 +773 -12
- package/dist/tests-ts/dsh-agent.test.js +157 -8
- 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/installer-assets.test.js +1 -1
- package/dist/tests-ts/local-cli.test.js +146 -1
- package/dist/tests-ts/model-provider-cancellation.test.js +152 -0
- package/dist/tests-ts/native-session-management.test.js +8 -7
- package/dist/tests-ts/personal-assistant-coordination.test.js +92 -0
- package/dist/tests-ts/personal-assistant-extensions.test.js +35 -0
- package/dist/tests-ts/personal-assistant-memory.test.js +117 -0
- package/dist/tests-ts/personal-assistant-owner-context.test.js +107 -0
- package/dist/tests-ts/personal-assistant-remote-ability.test.js +123 -0
- package/dist/tests-ts/personal-assistant.test.js +663 -0
- package/dist/tests-ts/platform-integration.test.js +183 -1
- package/dist/tests-ts/plugin-catalog.test.js +12 -2
- package/dist/tests-ts/plugin-manager.test.js +356 -4
- package/dist/tests-ts/plugin-upgrade-deadline.test.js +354 -0
- package/dist/tests-ts/publish-packages.test.js +42 -0
- package/dist/tests-ts/qwenwork-plugin.test.js +135 -1
- 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 +159 -4
- 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 +499 -4
- 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/agent.js +35 -0
- package/plugins/abweb/dist/src-ts/plugins/abweb/index.js +1 -1
- package/plugins/abweb/dist/src-ts/plugins/abweb/public/app.js +73 -5
- package/plugins/abweb/dist/src-ts/plugins/abweb/public/app.ts +57 -5
- package/plugins/abweb/dist/src-ts/plugins/abweb/public/index.html +15 -0
- package/plugins/abweb/dist/src-ts/plugins/abweb/public/style.css +4 -0
- 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/agent.js +35 -0
- package/plugins/aun/dist/src-ts/plugins/aun/attachments.js +3 -21
- package/plugins/aun/dist/src-ts/plugins/aun/index.js +155 -21
- package/plugins/aun/dist/src-ts/plugins/aun/messages.js +4 -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/agent.js +35 -0
- package/plugins/chatgpt/dist/src-ts/plugins/cdp-draft.js +5 -2
- package/plugins/chatgpt/dist/src-ts/plugins/chatgpt/cdp-client.js +26 -12
- package/plugins/chatgpt/dist/src-ts/plugins/chatgpt/index.js +80 -19
- package/plugins/chatgpt/dist/src-ts/plugins/desktop-launch.js +44 -3
- package/plugins/chatgpt/package.json +1 -1
- package/plugins/chatgpt/plugin.json +1 -1
- package/plugins/claude-cli/dist/src-ts/agent.js +35 -0
- package/plugins/claude-cli/dist/src-ts/plugins/claude-cli/index.js +19 -2
- package/plugins/claude-cli/dist/src-ts/plugins/local-cli/agent.js +74 -9
- package/plugins/claude-cli/package.json +1 -1
- package/plugins/claude-cli/plugin.json +3 -2
- package/plugins/codex-cli/dist/src-ts/agent.js +35 -0
- package/plugins/codex-cli/dist/src-ts/plugins/codex-cli/index.js +19 -2
- package/plugins/codex-cli/dist/src-ts/plugins/local-cli/agent.js +74 -9
- package/plugins/codex-cli/package.json +1 -1
- package/plugins/codex-cli/plugin.json +3 -2
- package/plugins/doubao/config.schema.json +2 -1
- package/plugins/doubao/dist/src-ts/agent.js +35 -0
- package/plugins/doubao/dist/src-ts/plugins/desktop-launch.js +44 -3
- package/plugins/doubao/dist/src-ts/plugins/doubao/cdp-client.js +234 -45
- package/plugins/doubao/dist/src-ts/plugins/doubao/index.js +152 -8
- 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 +3 -2
- package/plugins/dsh/config.schema.json +5 -2
- package/plugins/dsh/dist/src-ts/agent.js +35 -0
- package/plugins/dsh/dist/src-ts/dsh-agent.js +31 -13
- 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 +172 -21
- 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 +3 -2
- package/plugins/feishu/dist/src-ts/agent.js +35 -0
- 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 +23 -0
- package/plugins/personal-assistant/dist/src-ts/agent.js +69 -0
- package/plugins/personal-assistant/dist/src-ts/attachments.js +62 -0
- package/plugins/personal-assistant/dist/src-ts/plugin.js +13 -0
- package/plugins/personal-assistant/dist/src-ts/plugins/personal-assistant/claude-cli-model.js +30 -0
- package/plugins/personal-assistant/dist/src-ts/plugins/personal-assistant/coordination.js +57 -0
- package/plugins/personal-assistant/dist/src-ts/plugins/personal-assistant/index.js +263 -0
- package/plugins/personal-assistant/dist/src-ts/plugins/personal-assistant/model-client.js +181 -0
- package/plugins/personal-assistant/dist/src-ts/plugins/personal-assistant/owner-context.js +56 -0
- package/plugins/personal-assistant/dist/src-ts/plugins/personal-assistant/remote-ability.js +176 -0
- 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 +167 -0
- package/plugins/personal-assistant/package.json +39 -0
- package/plugins/personal-assistant/plugin.json +15 -0
- package/plugins/qwenwork/dist/src-ts/agent.js +35 -0
- 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 +90 -18
- package/plugins/qwenwork/dist/src-ts/plugins/qwenwork/index.js +139 -24
- package/plugins/qwenwork/package.json +1 -1
- package/plugins/qwenwork/plugin.json +3 -2
- package/plugins/workbuddy/config.schema.json +1 -1
- package/plugins/workbuddy/dist/src-ts/agent.js +35 -0
- package/plugins/workbuddy/dist/src-ts/plugins/desktop-launch.js +44 -3
- package/plugins/workbuddy/dist/src-ts/plugins/workbuddy/cdp-client.js +353 -82
- package/plugins/workbuddy/dist/src-ts/plugins/workbuddy/index.js +124 -41
- package/plugins/workbuddy/package.json +1 -1
- package/plugins/workbuddy/plugin.json +3 -2
- 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
package/dist/src-ts/dsh-agent.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DshAgent = void 0;
|
|
4
|
+
exports.readPresentedFiles = readPresentedFiles;
|
|
4
5
|
const node_child_process_1 = require("node:child_process");
|
|
5
6
|
const node_crypto_1 = require("node:crypto");
|
|
6
7
|
const node_fs_1 = require("node:fs");
|
|
@@ -19,7 +20,7 @@ function digest(data) { return (0, node_crypto_1.createHash)("sha256").update(da
|
|
|
19
20
|
function outputContentType(filename, data) {
|
|
20
21
|
return (0, attachments_1.detectImageContentType)(data) ?? outputMimeTypes[(0, node_path_1.extname)(filename).toLowerCase()] ?? "application/octet-stream";
|
|
21
22
|
}
|
|
22
|
-
async function readPresentedFiles(directory, paths, cwd, inputs, returnPaths) {
|
|
23
|
+
async function readPresentedFiles(directory, paths, cwd, inputs = [], returnPaths = []) {
|
|
23
24
|
if (paths.length > attachments_1.MAX_ATTACHMENTS)
|
|
24
25
|
throw new Error("单条消息最多包含 8 个附件");
|
|
25
26
|
const result = [];
|
|
@@ -72,9 +73,10 @@ class DshAgent {
|
|
|
72
73
|
this.spawnProcess = options.spawn ?? node_child_process_1.spawn;
|
|
73
74
|
this.defaultTimeoutMs = options.defaultTimeoutMs ?? 300_000;
|
|
74
75
|
}
|
|
75
|
-
async send(request) {
|
|
76
|
+
async send(request, modelRequest = false) {
|
|
76
77
|
if (!request.task.trim())
|
|
77
78
|
throw new agent_1.AgentError("DSH task must not be empty");
|
|
79
|
+
request.signal?.throwIfAborted();
|
|
78
80
|
(0, attachments_1.validateAttachments)(request.attachments);
|
|
79
81
|
const paths = this.paths ?? await (0, dsh_paths_1.resolveDshPaths)(this.options.patchPath);
|
|
80
82
|
const workDirectory = await (0, promises_1.mkdtemp)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "agent-bridge-dsh-"));
|
|
@@ -87,7 +89,11 @@ class DshAgent {
|
|
|
87
89
|
const inputPaths = (request.attachments ?? []).map((item, index) => ({ path: (0, node_path_1.join)(workDirectory, `${index}-${(0, attachments_1.attachmentFilename)(item.filename)}`), returnPath: (0, node_path_1.join)(outputDirectory, `${index}-${(0, attachments_1.attachmentFilename)(item.filename)}`), filename: item.filename, contentType: item.contentType }));
|
|
88
90
|
for (const [index, item] of (request.attachments ?? []).entries())
|
|
89
91
|
await (0, promises_1.writeFile)(inputPaths[index].returnPath, item.data, { mode: 0o600 });
|
|
90
|
-
const task =
|
|
92
|
+
const task = modelRequest ? request.task : inputPaths.length
|
|
93
|
+
? `${request.task}\n\n请读取输入附件;如需回传文件,将文件写入 outputDirectory 的直接子文件并调用 present。原附件可直接使用 returnPath。\n附件传输:\n${JSON.stringify({ inputs: inputPaths, outputDirectory })}`
|
|
94
|
+
: request.attachmentOutput
|
|
95
|
+
? `${request.task}\n\n如需回传文件,将文件写入 outputDirectory 的直接子文件并调用 present。\n附件传输:\n${JSON.stringify({ outputDirectory })}`
|
|
96
|
+
: request.task;
|
|
91
97
|
const args = ["--expose-internals", paths.cli, "--profile", "headless", "--patch", paths.patch, "--json"];
|
|
92
98
|
if (request.sessionId && !request.newSession)
|
|
93
99
|
args.push("--session-id", request.sessionId);
|
|
@@ -129,18 +135,30 @@ class DshAgent {
|
|
|
129
135
|
});
|
|
130
136
|
child.stderr.on("data", (chunk) => { errors += chunk; });
|
|
131
137
|
await new Promise((resolve, reject) => {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
reject(new agent_1.AgentError(`DSH task timed out after ${request.timeoutMs ?? this.defaultTimeoutMs}ms`));
|
|
135
|
-
}, request.timeoutMs ?? this.defaultTimeoutMs);
|
|
136
|
-
child.once("error", (error) => { clearTimeout(timer); reject(new agent_1.AgentError("failed to start DSH", { cause: error })); });
|
|
137
|
-
child.once("close", (code) => {
|
|
138
|
+
let timedOut = false;
|
|
139
|
+
const finish = (action) => {
|
|
138
140
|
clearTimeout(timer);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
request.signal?.removeEventListener("abort", abort);
|
|
142
|
+
action();
|
|
143
|
+
};
|
|
144
|
+
const abort = () => { child.kill(); };
|
|
145
|
+
const timer = setTimeout(() => { timedOut = true; child.kill(); }, request.timeoutMs ?? this.defaultTimeoutMs);
|
|
146
|
+
child.once("error", (error) => finish(() => reject(new agent_1.AgentError("failed to start DSH", { cause: error }))));
|
|
147
|
+
child.once("close", (code) => {
|
|
148
|
+
finish(() => {
|
|
149
|
+
if (request.signal?.aborted)
|
|
150
|
+
reject(request.signal.reason instanceof Error ? request.signal.reason : new agent_1.AgentError("DSH task canceled"));
|
|
151
|
+
else if (timedOut)
|
|
152
|
+
reject(new agent_1.AgentError(`DSH task timed out after ${request.timeoutMs ?? this.defaultTimeoutMs}ms`));
|
|
153
|
+
else if (code !== 0 && !finalText)
|
|
154
|
+
reject(new agent_1.AgentError(errors.trim() || `DSH exited with code ${code}`));
|
|
155
|
+
else
|
|
156
|
+
resolve();
|
|
157
|
+
});
|
|
143
158
|
});
|
|
159
|
+
request.signal?.addEventListener("abort", abort, { once: true });
|
|
160
|
+
if (request.signal?.aborted)
|
|
161
|
+
abort();
|
|
144
162
|
child.stdin.end(task, "utf8");
|
|
145
163
|
});
|
|
146
164
|
if (request.newSession && !sessionId)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpAgent = void 0;
|
|
4
|
+
const agent_1 = require("./agent");
|
|
5
|
+
// 仅供独立 HTTP 通信验收使用,不接入桌面插件的生产调用链。
|
|
6
|
+
class HttpAgent {
|
|
7
|
+
endpoint;
|
|
8
|
+
model;
|
|
9
|
+
name = "dsh-http";
|
|
10
|
+
constructor(endpoint, model = "qwenwork") {
|
|
11
|
+
this.endpoint = endpoint;
|
|
12
|
+
this.model = model;
|
|
13
|
+
}
|
|
14
|
+
async send(request) {
|
|
15
|
+
const response = await fetch(`${this.endpoint.replace(/\/$/, "")}/chat/completions`, {
|
|
16
|
+
method: "POST",
|
|
17
|
+
headers: { "content-type": "application/json" },
|
|
18
|
+
body: JSON.stringify({ model: this.model, messages: [{ role: "user", content: request.task }], stream: false }),
|
|
19
|
+
signal: AbortSignal.timeout(request.timeoutMs ?? 300_000),
|
|
20
|
+
});
|
|
21
|
+
const body = await response.text();
|
|
22
|
+
if (!response.ok)
|
|
23
|
+
throw new agent_1.AgentError(`HTTP Agent 请求失败 (${response.status}): ${body.slice(0, 500)}`);
|
|
24
|
+
try {
|
|
25
|
+
const value = JSON.parse(body);
|
|
26
|
+
const text = value.choices?.[0]?.message?.content?.trim();
|
|
27
|
+
if (!text)
|
|
28
|
+
throw new Error("响应 choices[0].message.content 为空");
|
|
29
|
+
return { text };
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
throw new agent_1.AgentError("HTTP Agent 返回了无效响应", { cause: error });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.HttpAgent = HttpAgent;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvePluginId = resolvePluginId;
|
|
3
4
|
exports.searchPluginCatalog = searchPluginCatalog;
|
|
4
5
|
const registry = "https://registry.npmjs.org";
|
|
5
6
|
const pluginName = /^agent-bridge-[a-z0-9-]+$/;
|
|
7
|
+
const pluginId = /^[a-z][a-z0-9-]{1,63}$/;
|
|
8
|
+
function resolvePluginId(packageName, declaredId) {
|
|
9
|
+
if (!pluginName.test(packageName))
|
|
10
|
+
return;
|
|
11
|
+
const id = declaredId === undefined ? packageName.slice("agent-bridge-".length) : declaredId;
|
|
12
|
+
return typeof id === "string" && pluginId.test(id) ? id : undefined;
|
|
13
|
+
}
|
|
6
14
|
async function getJson(url) {
|
|
7
15
|
const response = await fetch(url, { signal: AbortSignal.timeout(10_000) });
|
|
8
16
|
if (!response.ok)
|
|
@@ -24,9 +32,10 @@ async function searchPluginCatalog(query = "", get = getJson) {
|
|
|
24
32
|
const version = metadata?.["dist-tags"]?.latest;
|
|
25
33
|
const pkg = metadata?.versions?.[version];
|
|
26
34
|
const type = pkg?.agentBridge?.type;
|
|
27
|
-
|
|
35
|
+
const id = resolvePluginId(name, pkg?.agentBridge?.id);
|
|
36
|
+
if (!id || !pkg?.agentBridge?.plugin || !["agent", "channel", "management"].includes(type))
|
|
28
37
|
return;
|
|
29
|
-
return { name, version, description: typeof entry.package.description === "string" ? entry.package.description : "", type };
|
|
38
|
+
return { name, id, version, description: typeof entry.package.description === "string" ? entry.package.description : "", type };
|
|
30
39
|
}
|
|
31
40
|
catch {
|
|
32
41
|
return;
|