fluxy-bot 0.2.9 → 0.2.11
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/supervisor/fluxy-agent.ts +5 -3
- package/supervisor/index.ts +2 -5
package/package.json
CHANGED
|
@@ -63,9 +63,11 @@ function readOAuthToken(): string | null {
|
|
|
63
63
|
try {
|
|
64
64
|
if (fs.existsSync(CREDENTIALS_FILE)) {
|
|
65
65
|
const creds = JSON.parse(fs.readFileSync(CREDENTIALS_FILE, 'utf-8'));
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
// Support both flat format ({ accessToken }) and nested ({ claudeAiOauth: { accessToken } })
|
|
67
|
+
const oauth = creds.claudeAiOauth || creds;
|
|
68
|
+
if (oauth.accessToken) {
|
|
69
|
+
if (oauth.expiresAt && Date.now() >= oauth.expiresAt) return null;
|
|
70
|
+
return oauth.accessToken;
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
} catch {}
|
package/supervisor/index.ts
CHANGED
|
@@ -131,7 +131,7 @@ export async function startSupervisor() {
|
|
|
131
131
|
? createProvider(freshConfig.ai.provider, freshConfig.ai.apiKey, freshConfig.ai.baseUrl)
|
|
132
132
|
: null;
|
|
133
133
|
|
|
134
|
-
log.info(`[fluxy] provider=${freshConfig.ai.provider}, model=${freshConfig.ai.model}
|
|
134
|
+
log.info(`[fluxy] provider=${freshConfig.ai.provider}, model=${freshConfig.ai.model}`);
|
|
135
135
|
|
|
136
136
|
// Route Anthropic through Agent SDK (uses OAuth token, not API key)
|
|
137
137
|
if (freshConfig.ai.provider === 'anthropic') {
|
|
@@ -142,10 +142,7 @@ export async function startSupervisor() {
|
|
|
142
142
|
// COMMIT HERE
|
|
143
143
|
ws.send(JSON.stringify({ type: 'app:rebuilding', data: {} }));
|
|
144
144
|
log.info('File tools used — rebuilding app...');
|
|
145
|
-
|
|
146
|
-
const sep = process.platform === 'win32' ? ';' : ':';
|
|
147
|
-
const execEnv = { ...process.env, PATH: `${localBin}${sep}${process.env.PATH}` };
|
|
148
|
-
exec('npm run build', { cwd: PKG_DIR, env: execEnv }, (err, stdout, stderr) => {
|
|
145
|
+
exec('npm run build', { cwd: PKG_DIR }, (err, stdout, stderr) => {
|
|
149
146
|
if (err) {
|
|
150
147
|
const errorMsg = stderr || err.message;
|
|
151
148
|
log.error(`Build failed: ${errorMsg}`);
|