mirror of
https://github.com/Routstr/routstrd.git
synced 2026-10-05 12:28:23 +00:00
Merge remote-tracking branch 'origin/main' into fix/mint-rate-limit-and-fallback
This commit is contained in:
@@ -27,7 +27,8 @@ export async function installClaudeCodeIntegration(
|
||||
settings = JSON.parse(content);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error reading ${configPath}, creating new one.`);
|
||||
console.error(`Failed to read or parse ${configPath}; leaving it unchanged:`, error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!settings.env) {
|
||||
|
||||
@@ -99,7 +99,8 @@ export async function installHermesIntegration(
|
||||
content = await readFile(configPath, "utf-8");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error reading ${configPath}, creating new one.`);
|
||||
console.error(`Failed to read ${configPath}; leaving it unchanged:`, error);
|
||||
return;
|
||||
}
|
||||
|
||||
let newContent: string;
|
||||
|
||||
@@ -67,8 +67,9 @@ export async function installOpenClawIntegration(
|
||||
const content = await readFile(configPath, "utf-8");
|
||||
openclawConfig = JSON.parse(content) as OpenClawConfig;
|
||||
}
|
||||
} catch {
|
||||
openclawConfig = {};
|
||||
} catch (error) {
|
||||
console.error(`Failed to read or parse ${configPath}; leaving it unchanged:`, error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!openclawConfig.models) {
|
||||
|
||||
@@ -40,8 +40,9 @@ export async function installOpencodeIntegration(
|
||||
} else {
|
||||
opencodeConfig = { provider: {} };
|
||||
}
|
||||
} catch {
|
||||
opencodeConfig = { provider: {} };
|
||||
} catch (error) {
|
||||
console.error(`Failed to read or parse ${configPath}; leaving it unchanged:`, error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!opencodeConfig.provider) {
|
||||
|
||||
@@ -40,8 +40,9 @@ export async function installPiIntegration(
|
||||
const content = await readFile(configPath, "utf-8");
|
||||
piConfig = JSON.parse(content) as PiConfig;
|
||||
}
|
||||
} catch {
|
||||
piConfig = {};
|
||||
} catch (error) {
|
||||
console.error(`Failed to read or parse ${configPath}; leaving it unchanged:`, error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!piConfig.providers) {
|
||||
|
||||
@@ -6,6 +6,8 @@ import { installOpenClawIntegration } from "./openclaw";
|
||||
import { installClaudeCodeIntegration } from "./claudecode";
|
||||
import { installHermesIntegration } from "./hermes";
|
||||
|
||||
const HOME = process.env.HOME || process.env.USERPROFILE || "";
|
||||
|
||||
export interface IntegrationConfig {
|
||||
clientId: string;
|
||||
name: string;
|
||||
@@ -28,27 +30,27 @@ export const CLIENT_CONFIGS: Record<string, IntegrationConfig> = {
|
||||
opencode: {
|
||||
clientId: "opencode",
|
||||
name: "OpenCode",
|
||||
configPath: join(process.env.HOME || "", ".config/opencode/opencode.json"),
|
||||
configPath: join(HOME, ".config/opencode/opencode.json"),
|
||||
},
|
||||
"pi-agent": {
|
||||
clientId: "pi-agent",
|
||||
name: "Pi Agent",
|
||||
configPath: join(process.env.HOME || "", ".pi/agent/models.json"),
|
||||
configPath: join(HOME, ".pi/agent/models.json"),
|
||||
},
|
||||
openclaw: {
|
||||
clientId: "openclaw",
|
||||
name: "OpenClaw",
|
||||
configPath: join(process.env.HOME || "", ".openclaw/openclaw.json"),
|
||||
configPath: join(HOME, ".openclaw/openclaw.json"),
|
||||
},
|
||||
"claude-code": {
|
||||
clientId: "claude-code",
|
||||
name: "Claude Code",
|
||||
configPath: join(process.env.HOME || "", ".claude/settings.json"),
|
||||
configPath: join(HOME, ".claude/settings.json"),
|
||||
},
|
||||
hermes: {
|
||||
clientId: "hermes",
|
||||
name: "Hermes",
|
||||
configPath: join(process.env.HOME || "", ".hermes/config.yaml"),
|
||||
configPath: join(HOME, ".hermes/config.yaml"),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user