@atlisp/agent 0.1.11 → 0.1.12
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/config.js +7 -3
- package/mcp/stdio-client.js +3 -1
- package/package.json +1 -1
package/config.js
CHANGED
|
@@ -71,8 +71,7 @@ function loadConfigFile() {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
return {};
|
|
74
|
+
return null;
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
function deepMerge(target, source) {
|
|
@@ -91,8 +90,13 @@ let config = null;
|
|
|
91
90
|
|
|
92
91
|
function loadConfig() {
|
|
93
92
|
const fileConfig = loadConfigFile();
|
|
94
|
-
let merged = deepMerge(getDefaultConfig(), fileConfig);
|
|
95
93
|
|
|
94
|
+
if (fileConfig === null) {
|
|
95
|
+
const jsonPath = getConfigPath();
|
|
96
|
+
saveDefaultConfig(jsonPath);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let merged = deepMerge(getDefaultConfig(), fileConfig);
|
|
96
100
|
return merged;
|
|
97
101
|
}
|
|
98
102
|
|
package/mcp/stdio-client.js
CHANGED
|
@@ -16,8 +16,10 @@ export class StdioMcpClient {
|
|
|
16
16
|
async connect() {
|
|
17
17
|
return new Promise((resolve, reject) => {
|
|
18
18
|
try {
|
|
19
|
-
|
|
19
|
+
const npxPath = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
20
|
+
this.proc = spawn(npxPath, ['-y', this.command, ...this.args], {
|
|
20
21
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
22
|
+
shell: true,
|
|
21
23
|
});
|
|
22
24
|
|
|
23
25
|
this.proc.stdout.on('data', (data) => {
|