@damn-dev/cli 0.9.17 → 0.9.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/package.json
CHANGED
|
@@ -2279,12 +2279,29 @@ var require_openclaw = __commonJS({
|
|
|
2279
2279
|
}
|
|
2280
2280
|
}
|
|
2281
2281
|
async function migrateProviderPrefixToOpenRouter() {
|
|
2282
|
-
|
|
2282
|
+
let config;
|
|
2283
|
+
try {
|
|
2284
|
+
config = await readOpenClawConfig();
|
|
2285
|
+
} catch {
|
|
2286
|
+
return;
|
|
2287
|
+
}
|
|
2288
|
+
const providers = config?.models?.providers ?? {};
|
|
2289
|
+
const envMap = await (0, envFiles_1.readEnvFile)();
|
|
2290
|
+
const has = (providerName, envName) => {
|
|
2291
|
+
const p = providers[providerName];
|
|
2292
|
+
if (p && typeof p === "object" && typeof p.apiKey === "string" && p.apiKey.length > 0)
|
|
2293
|
+
return true;
|
|
2294
|
+
const fromFile = envMap.get(envName);
|
|
2295
|
+
if (typeof fromFile === "string" && fromFile.length > 0)
|
|
2296
|
+
return true;
|
|
2297
|
+
return !!process.env[envName];
|
|
2298
|
+
};
|
|
2299
|
+
const hasOpenRouter = has("openrouter", "OPENROUTER_API_KEY");
|
|
2283
2300
|
if (!hasOpenRouter)
|
|
2284
2301
|
return;
|
|
2285
|
-
const hasAnthropic =
|
|
2286
|
-
const hasOpenAI =
|
|
2287
|
-
const hasGoogle =
|
|
2302
|
+
const hasAnthropic = has("anthropic", "ANTHROPIC_API_KEY");
|
|
2303
|
+
const hasOpenAI = has("openai", "OPENAI_API_KEY");
|
|
2304
|
+
const hasGoogle = has("google", "GEMINI_API_KEY") || has("google", "GOOGLE_API_KEY") || has("gemini", "GEMINI_API_KEY");
|
|
2288
2305
|
const rewritePrefixes = [
|
|
2289
2306
|
...hasAnthropic ? [] : ["anthropic/"],
|
|
2290
2307
|
...hasOpenAI ? [] : ["openai/"],
|
|
@@ -2292,12 +2309,6 @@ var require_openclaw = __commonJS({
|
|
|
2292
2309
|
];
|
|
2293
2310
|
if (rewritePrefixes.length === 0)
|
|
2294
2311
|
return;
|
|
2295
|
-
let config;
|
|
2296
|
-
try {
|
|
2297
|
-
config = await readOpenClawConfig();
|
|
2298
|
-
} catch {
|
|
2299
|
-
return;
|
|
2300
|
-
}
|
|
2301
2312
|
let changed = 0;
|
|
2302
2313
|
const rewrite = (value) => {
|
|
2303
2314
|
if (typeof value !== "string")
|
|
@@ -2339,19 +2350,25 @@ var require_openclaw = __commonJS({
|
|
|
2339
2350
|
} catch {
|
|
2340
2351
|
return;
|
|
2341
2352
|
}
|
|
2353
|
+
const defaultsMode = config.agents?.defaults?.sandbox?.mode;
|
|
2354
|
+
const defaultIsNonMain = defaultsMode === "non-main";
|
|
2342
2355
|
const agents = Array.isArray(config.agents?.list) ? config.agents.list : [];
|
|
2343
2356
|
if (agents.length === 0)
|
|
2344
2357
|
return;
|
|
2345
2358
|
let changed = 0;
|
|
2346
2359
|
for (const agent of agents) {
|
|
2347
|
-
|
|
2360
|
+
const explicit = agent?.sandbox?.mode;
|
|
2361
|
+
if (explicit === "non-main") {
|
|
2348
2362
|
agent.sandbox.mode = "off";
|
|
2349
2363
|
changed++;
|
|
2364
|
+
} else if (!explicit && defaultIsNonMain) {
|
|
2365
|
+
agent.sandbox = { mode: "off" };
|
|
2366
|
+
changed++;
|
|
2350
2367
|
}
|
|
2351
2368
|
}
|
|
2352
2369
|
if (changed > 0) {
|
|
2353
2370
|
await writeOpenClawConfig(config);
|
|
2354
|
-
console.log(`[migrate-sandbox-mode]
|
|
2371
|
+
console.log(`[migrate-sandbox-mode] set sandbox: off on ${changed} agent(s) (was non-main or inheriting non-main default) \u2014 0.9.17/0.9.18`);
|
|
2355
2372
|
}
|
|
2356
2373
|
}
|
|
2357
2374
|
async function ensureAgentTimeoutDefault() {
|
|
@@ -28397,7 +28414,7 @@ var require_package = __commonJS({
|
|
|
28397
28414
|
module2.exports = {
|
|
28398
28415
|
name: "backend",
|
|
28399
28416
|
private: true,
|
|
28400
|
-
version: "0.9.
|
|
28417
|
+
version: "0.9.18",
|
|
28401
28418
|
scripts: {
|
|
28402
28419
|
dev: "tsx watch src/server.ts",
|
|
28403
28420
|
build: "tsc && cp -r resources dist/resources",
|