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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-window",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "A window to interact with AI agents through chat interfaces. Simplified interaction, powerful backend capabilities.",
5
5
  "type": "module",
6
6
  "main": "src/bot.js",
@@ -249,10 +249,24 @@ export async function discoverInstances() {
249
249
  let configPath = null;
250
250
  let pluginPath = null;
251
251
 
252
- // Priority 1: Use CONFIG_PATH from environment variables
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
- projectPath = path.dirname(configPath);
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) {