apex-dev 3.10.17 → 3.10.18
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/cli.js +1 -0
- package/dist/index.js +12 -2
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -295,6 +295,7 @@ async function ensureApiKeys() {
|
|
|
295
295
|
console.error(`\n\u2713 ${configured.length} provider(s) configured`);
|
|
296
296
|
} else {
|
|
297
297
|
console.error("\n\u26A0 No API keys configured. Launching interactive provider selection.");
|
|
298
|
+
process.env.APEX_DEV_NEEDS_CONFIG = "true";
|
|
298
299
|
}
|
|
299
300
|
}
|
|
300
301
|
|
package/dist/index.js
CHANGED
|
@@ -301,6 +301,8 @@ var require_utils3 = __commonJS((exports, module2) => {
|
|
|
301
301
|
});
|
|
302
302
|
var require_config = __commonJS((exports, module) => {
|
|
303
303
|
const OpenAI = __require("openai");
|
|
304
|
+
const fs = __require("fs");
|
|
305
|
+
const path = __require("path");
|
|
304
306
|
const PROVIDERS = {
|
|
305
307
|
fireworks: {
|
|
306
308
|
label: "Fireworks AI",
|
|
@@ -866,6 +868,15 @@ The user asks you to implement a new feature. You respond in multiple steps:
|
|
|
866
868
|
minimax: { model: "minimax/minimax-01", temperature: 0.1, maxTokens: 8192 }
|
|
867
869
|
};
|
|
868
870
|
const _initialProvider = PROVIDERS[currentProvider];
|
|
871
|
+
try {
|
|
872
|
+
const configPath = path.join(__require("os").homedir(), ".apex-dev", "config.json");
|
|
873
|
+
if (fs.existsSync(configPath)) {
|
|
874
|
+
const savedConfig = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
875
|
+
if (savedConfig[currentProvider] && !process.env[_initialProvider.envKey]) {
|
|
876
|
+
process.env[_initialProvider.envKey] = savedConfig[currentProvider];
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
} catch (e) {}
|
|
869
880
|
const _initialKey = process.env[_initialProvider.envKey] || "no-key";
|
|
870
881
|
let _internalClient = new OpenAI({
|
|
871
882
|
apiKey: _initialKey,
|
|
@@ -947,7 +958,6 @@ The user asks you to implement a new feature. You respond in multiple steps:
|
|
|
947
958
|
}
|
|
948
959
|
return str;
|
|
949
960
|
}
|
|
950
|
-
const path = __require("path");
|
|
951
961
|
function resolvePath(p) {
|
|
952
962
|
if (!p)
|
|
953
963
|
return PROJECT_ROOT;
|
|
@@ -2985,7 +2995,7 @@ var require_agent = __commonJS((exports, module2) => {
|
|
|
2985
2995
|
});
|
|
2986
2996
|
break;
|
|
2987
2997
|
} catch (apiErr) {
|
|
2988
|
-
if (attempt < maxRetries && apiErr.status
|
|
2998
|
+
if (attempt < maxRetries && (!apiErr.status || apiErr.status >= 500)) {
|
|
2989
2999
|
await sleep(1000 * Math.pow(2, attempt));
|
|
2990
3000
|
continue;
|
|
2991
3001
|
}
|