@starlink-awaken/agentmesh 1.2.0 → 1.2.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.
- package/bin/agentmesh +2 -2
- package/dist/src/cli/setup.js +2 -1
- package/dist/src/cli.js +1 -1
- package/dist/src/core/config.js +12 -2
- package/package.json +1 -1
package/bin/agentmesh
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
import('../dist/cli.js');
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import('../dist/src/cli.js');
|
package/dist/src/cli/setup.js
CHANGED
|
@@ -4,7 +4,8 @@ import { existsSync, writeFileSync } from 'node:fs';
|
|
|
4
4
|
import { join, dirname } from 'node:path';
|
|
5
5
|
import { logger } from '../core/logger.js';
|
|
6
6
|
const CONFIG_DIR = join(Bun.env.HOME || '~', '.config', 'agentmesh');
|
|
7
|
-
const
|
|
7
|
+
const _metaDir = import.meta.dir || import.meta.dirname || '.';
|
|
8
|
+
const PROJECT_ROOT = dirname(dirname(_metaDir));
|
|
8
9
|
function prompt(msg, def) {
|
|
9
10
|
const suffix = def ? ` [${def}]` : '';
|
|
10
11
|
process.stdout.write(` ${msg}${suffix}: `);
|
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.1
|
|
10
|
+
const VERSION = '1.2.1';
|
|
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,23 @@ export function loadConfig(configPath) {
|
|
|
22
22
|
if (cachedConfig) {
|
|
23
23
|
return cachedConfig;
|
|
24
24
|
}
|
|
25
|
+
const pkgDir = (() => {
|
|
26
|
+
try {
|
|
27
|
+
return dirname(dirname(import.meta.dir || import.meta.dirname || ''));
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return '';
|
|
31
|
+
}
|
|
32
|
+
})();
|
|
25
33
|
const paths = configPath
|
|
26
34
|
? [configPath]
|
|
27
35
|
: [
|
|
28
36
|
'./config/gateway.yaml',
|
|
29
37
|
'./config/gateway.yml',
|
|
30
38
|
join(process.cwd(), 'config/gateway.yaml'),
|
|
31
|
-
join(process.cwd(), 'config/gateway.yml')
|
|
39
|
+
join(process.cwd(), 'config/gateway.yml'),
|
|
40
|
+
join(pkgDir, 'config', 'gateway.yaml'),
|
|
41
|
+
join(pkgDir, 'config', 'gateway.yml'),
|
|
32
42
|
];
|
|
33
43
|
for (const path of paths) {
|
|
34
44
|
try {
|