@openagents-org/agent-launcher 0.2.79 → 0.2.80
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/tui.js +20 -3
package/package.json
CHANGED
package/src/tui.js
CHANGED
|
@@ -104,13 +104,30 @@ function loadAgentRows(connector) {
|
|
|
104
104
|
if (process.env[v]) { isReady = true; break; }
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
// Check creds file (for claude)
|
|
107
|
+
// Check creds file/directory (for claude)
|
|
108
108
|
if (!isReady && cr.creds_file) {
|
|
109
109
|
const credsPath = cr.creds_file.replace('~', process.env.HOME || process.env.USERPROFILE || '');
|
|
110
110
|
try {
|
|
111
111
|
if (fs.existsSync(credsPath)) {
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
112
|
+
const stat = fs.statSync(credsPath);
|
|
113
|
+
if (stat.isDirectory()) {
|
|
114
|
+
// Directory (e.g. ~/.claude/sessions) — check if it has files
|
|
115
|
+
isReady = fs.readdirSync(credsPath).length > 0;
|
|
116
|
+
} else {
|
|
117
|
+
const creds = JSON.parse(fs.readFileSync(credsPath, 'utf-8'));
|
|
118
|
+
if (cr.creds_key) isReady = !!creds[cr.creds_key];
|
|
119
|
+
else isReady = true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
} catch {}
|
|
123
|
+
}
|
|
124
|
+
// Also check OAuth credentials (Claude Code stores tokens in .credentials.json)
|
|
125
|
+
if (!isReady) {
|
|
126
|
+
try {
|
|
127
|
+
const oauthFile = path.join(process.env.HOME || '', '.claude', '.credentials.json');
|
|
128
|
+
if (fs.existsSync(oauthFile)) {
|
|
129
|
+
const creds = JSON.parse(fs.readFileSync(oauthFile, 'utf-8'));
|
|
130
|
+
if (creds.claudeAiOauth && creds.claudeAiOauth.accessToken) isReady = true;
|
|
114
131
|
}
|
|
115
132
|
} catch {}
|
|
116
133
|
}
|