agent-bridge-aun 1.0.10 → 1.0.11
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/dist/src-ts/plugins/aun/index.js +14 -3
- package/package.json +1 -1
- package/plugin.json +1 -1
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AunPlugin = void 0;
|
|
4
4
|
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
5
6
|
const node_module_1 = require("node:module");
|
|
6
7
|
const node_path_1 = require("node:path");
|
|
8
|
+
const node_os_1 = require("node:os");
|
|
7
9
|
const node_url_1 = require("node:url");
|
|
8
10
|
const messages_1 = require("./messages");
|
|
9
11
|
const manifest = {
|
|
10
|
-
id: "aun", version: "1.0.
|
|
12
|
+
id: "aun", version: "1.0.11", type: "channel", displayName: "AUN 通道",
|
|
11
13
|
entry: "dist/src-ts/plugins/aun/index.js", apiVersion: "1", process: "in-process",
|
|
12
14
|
capabilities: ["channel", "channel.identity.create", "channel.receive", "channel.send", "health"],
|
|
13
15
|
configSchema: "config.schema.json",
|
|
@@ -207,6 +209,12 @@ class AunPlugin {
|
|
|
207
209
|
this.identities.add(this.aid);
|
|
208
210
|
for (const aid of this.identities)
|
|
209
211
|
await this.connectAid(aid);
|
|
212
|
+
// 密钥库中的其余 AID 也自动连接:不再依赖 ec 或 EvolCore 进程
|
|
213
|
+
for (const aid of this.listStoreAids()) {
|
|
214
|
+
this.identities.add(aid);
|
|
215
|
+
if (!this.clients.has(aid))
|
|
216
|
+
await this.connectAid(aid);
|
|
217
|
+
}
|
|
210
218
|
}
|
|
211
219
|
async connectAid(aid) {
|
|
212
220
|
try {
|
|
@@ -253,10 +261,13 @@ class AunPlugin {
|
|
|
253
261
|
async handle(_request) { throw new Error("AUN 是入站通道插件"); }
|
|
254
262
|
path() {
|
|
255
263
|
const configured = this.config.aun_path;
|
|
256
|
-
|
|
264
|
+
// 默认与 EvolCore 共用同一密钥库目录,保证已注册的 AID 直接可用
|
|
265
|
+
return typeof configured === "string" && configured.trim() ? configured : (0, node_path_1.resolve)(process.env.AUN_HOME ?? process.env.EVOLCORE_HOME ?? (0, node_path_1.join)((0, node_os_1.homedir)(), ".evolcore"));
|
|
257
266
|
}
|
|
258
267
|
newStore() {
|
|
259
|
-
|
|
268
|
+
// 与 EvolCore 共用密钥库时沿用其固定 seed 和 CA 证书路径
|
|
269
|
+
const rootCaPath = typeof this.config.root_ca_path === "string" && this.config.root_ca_path ? this.config.root_ca_path : (0, node_path_1.join)(this.path(), "CA", "root", "root.crt");
|
|
270
|
+
return new this.sdk.AIDStore({ aunPath: this.path(), encryptionSeed: typeof this.config.encryption_seed === "string" && this.config.encryption_seed ? this.config.encryption_seed : "evol", verifySsl: typeof this.config.verify_ssl === "boolean" ? this.config.verify_ssl : true, rootCaPath: (0, node_fs_1.existsSync)(rootCaPath) ? rootCaPath : undefined });
|
|
260
271
|
}
|
|
261
272
|
createAid = async (request, response) => {
|
|
262
273
|
let input;
|
package/package.json
CHANGED