agent-bridge-workbuddy 1.1.1 → 1.1.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.
|
@@ -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,10 +6,11 @@ const node_child_process_1 = require("node:child_process");
|
|
|
6
6
|
const node_fs_1 = require("node:fs");
|
|
7
7
|
const node_os_1 = require("node:os");
|
|
8
8
|
const node_path_1 = require("node:path");
|
|
9
|
+
const plugin_1 = require("../../plugin");
|
|
9
10
|
const cdp_client_1 = require("./cdp-client");
|
|
10
11
|
const cli_client_1 = require("./cli-client");
|
|
11
12
|
exports.workbuddyManifest = {
|
|
12
|
-
id: "workbuddy", version: "1.1.
|
|
13
|
+
id: "workbuddy", version: "1.1.2", displayName: "WorkBuddy", type: "agent",
|
|
13
14
|
entry: "dist/index.js", apiVersion: "1", process: "in-process",
|
|
14
15
|
capabilities: ["chat", "health"], configSchema: "config.schema.json",
|
|
15
16
|
};
|
|
@@ -54,7 +55,7 @@ class WorkbuddyPlugin {
|
|
|
54
55
|
throw new Error("未找到 CodeBuddy CLI,请配置 cliPath");
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
|
-
const port =
|
|
58
|
+
const port = (0, plugin_1.resolveRuntimePort)(config, context.runtime, "workbuddy", "WORKBUDDY_CDP_PORT", this.options.cdpPort ?? 9229);
|
|
58
59
|
this.client = this.options.client ?? new cdp_client_1.WorkbuddyCdpClient({ port });
|
|
59
60
|
try {
|
|
60
61
|
await this.connectOrStart(config, context.logger, port);
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "workbuddy",
|
|
3
|
-
"version": "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",
|
|
@@ -10,5 +10,6 @@
|
|
|
10
10
|
"chat",
|
|
11
11
|
"health"
|
|
12
12
|
],
|
|
13
|
-
"configSchema": "config.schema.json"
|
|
13
|
+
"configSchema": "config.schema.json",
|
|
14
|
+
"clientDownloadUrl": "https://copilot.tencent.com/"
|
|
14
15
|
}
|