agent-window 1.0.6 → 1.0.7
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/package.json +1 -1
- package/src/core/instance/manager.js +17 -3
package/package.json
CHANGED
|
@@ -249,10 +249,24 @@ export async function discoverInstances() {
|
|
|
249
249
|
let configPath = null;
|
|
250
250
|
let pluginPath = null;
|
|
251
251
|
|
|
252
|
-
// Priority 1:
|
|
253
|
-
if (proc.configPath) {
|
|
252
|
+
// Priority 1: Read CONFIG_PATH and extract PROJECT_DIR from config
|
|
253
|
+
if (proc.configPath && existsSync(proc.configPath)) {
|
|
254
254
|
configPath = proc.configPath;
|
|
255
|
-
|
|
255
|
+
try {
|
|
256
|
+
const configContent = await fs.readFile(proc.configPath, 'utf8');
|
|
257
|
+
const config = JSON.parse(configContent);
|
|
258
|
+
|
|
259
|
+
// Use PROJECT_DIR from config if available
|
|
260
|
+
if (config.PROJECT_DIR) {
|
|
261
|
+
projectPath = config.PROJECT_DIR;
|
|
262
|
+
} else {
|
|
263
|
+
// Fallback to config directory
|
|
264
|
+
projectPath = path.dirname(configPath);
|
|
265
|
+
}
|
|
266
|
+
} catch {
|
|
267
|
+
// If config read fails, use directory name
|
|
268
|
+
projectPath = path.dirname(configPath);
|
|
269
|
+
}
|
|
256
270
|
}
|
|
257
271
|
// Priority 2: Use cwd
|
|
258
272
|
else if (proc.cwd) {
|