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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxy-bot",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "Self-hosted AI bot — run your own AI assistant from anywhere",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -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
- if (creds.accessToken) {
67
- if (creds.expiresAt && Date.now() >= creds.expiresAt) return null;
68
- return creds.accessToken;
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 {}
@@ -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}, hasApiKey=${!!freshConfig.ai.apiKey}`);
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
- const localBin = path.join(PKG_DIR, 'node_modules', '.bin');
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}`);