@starlink-awaken/agentmesh 1.2.1 → 1.2.3
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/cli.js +1 -1
- package/dist/src/core/config.js +15 -2
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -7,7 +7,7 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
7
7
|
import { resolve, dirname, join } from 'node:path';
|
|
8
8
|
import { initLogger } from './core/logger.js';
|
|
9
9
|
const PROJECT_ROOT = resolve(dirname(import.meta.dir), '..');
|
|
10
|
-
const VERSION = '1.2.
|
|
10
|
+
const VERSION = '1.2.3';
|
|
11
11
|
const BANNER = `
|
|
12
12
|
█████╗ ██████╗ ███████╗███╗ ██╗████████╗
|
|
13
13
|
██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝
|
package/dist/src/core/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync, existsSync } from 'fs';
|
|
2
2
|
import { parse } from 'yaml';
|
|
3
|
-
import { join } from 'path';
|
|
3
|
+
import { join, dirname } from 'path';
|
|
4
4
|
const DEFAULT_CONFIG = {
|
|
5
5
|
port: 3000,
|
|
6
6
|
wsPort: 3001,
|
|
@@ -22,13 +22,26 @@ export function loadConfig(configPath) {
|
|
|
22
22
|
if (cachedConfig) {
|
|
23
23
|
return cachedConfig;
|
|
24
24
|
}
|
|
25
|
+
const pkgDir = (() => {
|
|
26
|
+
try {
|
|
27
|
+
let d = import.meta.dir || import.meta.dirname || '';
|
|
28
|
+
for (let i = 0; i < 4; i++)
|
|
29
|
+
d = dirname(d); // 上溯到包根
|
|
30
|
+
return d;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
})();
|
|
25
36
|
const paths = configPath
|
|
26
37
|
? [configPath]
|
|
27
38
|
: [
|
|
28
39
|
'./config/gateway.yaml',
|
|
29
40
|
'./config/gateway.yml',
|
|
30
41
|
join(process.cwd(), 'config/gateway.yaml'),
|
|
31
|
-
join(process.cwd(), 'config/gateway.yml')
|
|
42
|
+
join(process.cwd(), 'config/gateway.yml'),
|
|
43
|
+
join(pkgDir, 'config', 'gateway.yaml'),
|
|
44
|
+
join(pkgDir, 'config', 'gateway.yml'),
|
|
32
45
|
];
|
|
33
46
|
for (const path of paths) {
|
|
34
47
|
try {
|