responses-proxy 0.1.2 → 0.1.4
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 -1
- package/dist/package.json +1 -1
- package/dist/server.js +34 -0
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -109,7 +109,7 @@ const server = spawn(process.execPath, [serverPath], {
|
|
|
109
109
|
SESSION_LOG_DIR: path.join(dataDir, "sessions"),
|
|
110
110
|
CUSTOMER_KEY_DB_PATH: path.join(dataDir, "telegram-bot.sqlite"),
|
|
111
111
|
KIRO_DB_PATH: path.join(dataDir, "kiro.sqlite"),
|
|
112
|
-
KIRO_ENABLED: process.env.KIRO_ENABLED || "
|
|
112
|
+
KIRO_ENABLED: process.env.KIRO_ENABLED || "true",
|
|
113
113
|
QUICK_APPLY_HERMES_CONFIG_PATH: path.join(os.homedir(), ".hermes", "config.yaml"),
|
|
114
114
|
QUICK_APPLY_CODEX_CONFIG_PATH: path.join(os.homedir(), ".codex", "config.toml"),
|
|
115
115
|
QUICK_APPLY_CODEX_AUTH_PATH: path.join(os.homedir(), ".codex", "auth.json"),
|
package/dist/package.json
CHANGED
package/dist/server.js
CHANGED
|
@@ -95,6 +95,20 @@ const deviceLoginService = new DeviceLoginService({
|
|
|
95
95
|
kiroDbPath: config.KIRO_DB_PATH,
|
|
96
96
|
});
|
|
97
97
|
setInterval(() => deviceLoginService.pruneExpiredSessions(), 60_000).unref();
|
|
98
|
+
// Auto-disable Kiro provider if it has no accounts
|
|
99
|
+
if (kiroTokenStore) {
|
|
100
|
+
const kiroAccounts = kiroTokenStore.listAccounts();
|
|
101
|
+
if (kiroAccounts.length === 0) {
|
|
102
|
+
try {
|
|
103
|
+
const kiroProvider = providerRepository.getProvider("account-kiro");
|
|
104
|
+
if (kiroProvider && kiroProvider.enabled !== false) {
|
|
105
|
+
providerRepository.updateProvider("account-kiro", { ...kiroProvider, enabled: false });
|
|
106
|
+
console.log("[kiro] No accounts found — provider auto-disabled. Add accounts via dashboard to enable.");
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch { /* provider might not exist yet */ }
|
|
110
|
+
}
|
|
111
|
+
}
|
|
98
112
|
// Initialize routing services after all stores are available
|
|
99
113
|
const routingComboRepository = new RoutingComboRepository(providerRepository.getDatabase());
|
|
100
114
|
const modelComboRepository = new ModelComboRepository(providerRepository.getDatabase());
|
|
@@ -1551,6 +1565,16 @@ app.post("/api/kiro/import", async (request, reply) => {
|
|
|
1551
1565
|
destDbPath: destPath,
|
|
1552
1566
|
provider: 'kiro',
|
|
1553
1567
|
});
|
|
1568
|
+
// Auto-enable the Kiro provider after importing accounts
|
|
1569
|
+
if (result.imported > 0) {
|
|
1570
|
+
try {
|
|
1571
|
+
const kiroProvider = providerRepository.getProvider("account-kiro");
|
|
1572
|
+
if (kiroProvider && !kiroProvider.enabled) {
|
|
1573
|
+
providerRepository.updateProvider("account-kiro", { ...kiroProvider, enabled: true });
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
catch { /* ignore */ }
|
|
1577
|
+
}
|
|
1554
1578
|
return reply.send({
|
|
1555
1579
|
ok: true,
|
|
1556
1580
|
imported: result.imported,
|
|
@@ -1636,6 +1660,16 @@ app.post("/api/kiro/device/poll", async (request, reply) => {
|
|
|
1636
1660
|
}
|
|
1637
1661
|
try {
|
|
1638
1662
|
const result = await deviceLoginService.pollDeviceLogin(sessionId);
|
|
1663
|
+
// Auto-enable Kiro provider when a new account is added
|
|
1664
|
+
if (result.status === "completed") {
|
|
1665
|
+
try {
|
|
1666
|
+
const kiroProvider = providerRepository.getProvider("account-kiro");
|
|
1667
|
+
if (kiroProvider && !kiroProvider.enabled) {
|
|
1668
|
+
providerRepository.updateProvider("account-kiro", { ...kiroProvider, enabled: true });
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
catch { /* ignore */ }
|
|
1672
|
+
}
|
|
1639
1673
|
return reply.send({ ok: true, ...result });
|
|
1640
1674
|
}
|
|
1641
1675
|
catch (error) {
|