agent-window 1.0.5 → 1.0.6
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
|
@@ -244,15 +244,22 @@ export async function discoverInstances() {
|
|
|
244
244
|
// Extract instance name from bot-name
|
|
245
245
|
const instanceName = proc.name.replace(/^bot-/, '');
|
|
246
246
|
|
|
247
|
-
//
|
|
247
|
+
// Determine project path and config path
|
|
248
248
|
let projectPath = null;
|
|
249
|
+
let configPath = null;
|
|
249
250
|
let pluginPath = null;
|
|
250
251
|
|
|
251
|
-
|
|
252
|
-
|
|
252
|
+
// Priority 1: Use CONFIG_PATH from environment variables
|
|
253
|
+
if (proc.configPath) {
|
|
254
|
+
configPath = proc.configPath;
|
|
255
|
+
projectPath = path.dirname(configPath);
|
|
256
|
+
}
|
|
257
|
+
// Priority 2: Use cwd
|
|
258
|
+
else if (proc.cwd) {
|
|
259
|
+
projectPath = proc.cwd;
|
|
253
260
|
}
|
|
254
261
|
|
|
255
|
-
// Check if it's a BMAD project
|
|
262
|
+
// Check if it's a BMAD project (has _bmad directory)
|
|
256
263
|
if (projectPath && existsSync(path.join(projectPath, '_bmad'))) {
|
|
257
264
|
pluginPath = path.join(projectPath, '_agent-bridge', 'src');
|
|
258
265
|
} else if (projectPath && existsSync(path.join(projectPath, 'src', 'bot.js'))) {
|
|
@@ -265,6 +272,7 @@ export async function discoverInstances() {
|
|
|
265
272
|
name: instanceName,
|
|
266
273
|
displayName: instanceName.charAt(0).toUpperCase() + instanceName.slice(1),
|
|
267
274
|
projectPath,
|
|
275
|
+
configPath,
|
|
268
276
|
pluginPath,
|
|
269
277
|
status: proc.status || 'unknown',
|
|
270
278
|
pid: proc.pid,
|
|
@@ -314,6 +322,7 @@ export async function importInstance(discovered) {
|
|
|
314
322
|
name: discovered.name,
|
|
315
323
|
displayName: discovered.displayName,
|
|
316
324
|
projectPath: validatedPath,
|
|
325
|
+
configPath: discovered.configPath,
|
|
317
326
|
pluginPath: validatedPluginPath,
|
|
318
327
|
botName: discovered.botName,
|
|
319
328
|
addedAt: new Date().toISOString(),
|
|
@@ -88,7 +88,10 @@ async function list(options = {}) {
|
|
|
88
88
|
cpu: p.monit?.cpu || 0,
|
|
89
89
|
restarts: p.pm2_env?.restart_time || 0,
|
|
90
90
|
cwd: p.pm2_env?.cwd || null,
|
|
91
|
-
script: p.pm2_env?.pm_cwd || null
|
|
91
|
+
script: p.pm2_env?.pm_cwd || null,
|
|
92
|
+
// Environment variables
|
|
93
|
+
env: p.pm2_env?.env || {},
|
|
94
|
+
configPath: p.pm2_env?.env?.CONFIG_PATH || null
|
|
92
95
|
}));
|
|
93
96
|
} catch {
|
|
94
97
|
return [];
|