agent-bridge-doubao 1.0.4 → 1.0.5

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
+ }
@@ -2,9 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DoubaoPlugin = exports.doubaoManifest = void 0;
4
4
  const cdp_client_1 = require("./cdp-client");
5
+ const plugin_1 = require("../../plugin");
5
6
  exports.doubaoManifest = {
6
7
  id: "doubao",
7
- version: "1.0.4",
8
+ version: "1.0.5",
8
9
  displayName: "豆包",
9
10
  entry: "dist/index.js",
10
11
  apiVersion: "1",
@@ -24,7 +25,7 @@ class DoubaoPlugin {
24
25
  disposer;
25
26
  async activate(context) {
26
27
  this.client = this.injectedClient ?? new cdp_client_1.DoubaoCdpClient({
27
- port: typeof context.config.cdpPort === "number" ? context.config.cdpPort : undefined,
28
+ port: (0, plugin_1.resolveRuntimePort)(context.config, context.runtime, "doubao", "DOUBAO_CDP_PORT", 9227),
28
29
  conversationId: typeof context.config.conversationId === "string" ? context.config.conversationId : undefined,
29
30
  botId: typeof context.config.botId === "string" ? context.config.botId : undefined,
30
31
  pluginList: Array.isArray(context.config.pluginList) ? context.config.pluginList.filter((value) => typeof value === "string") : undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-bridge-doubao",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "agent-bridge 的豆包插件。",
5
5
  "keywords": [
6
6
  "mu-agent-bridge-plugin",
package/plugin.json CHANGED
@@ -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",
@@ -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://www.doubao.com/chat/"
14
15
  }