aicodeswitch 3.9.1 → 3.9.3
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/dist/server/database.js
CHANGED
|
@@ -386,7 +386,7 @@ class DatabaseManager {
|
|
|
386
386
|
CREATE TABLE IF NOT EXISTS rules (
|
|
387
387
|
id TEXT PRIMARY KEY,
|
|
388
388
|
route_id TEXT NOT NULL,
|
|
389
|
-
content_type TEXT NOT NULL CHECK(content_type IN ('default', 'background', 'thinking', 'long-context', 'image-understanding', 'model-mapping')),
|
|
389
|
+
content_type TEXT NOT NULL CHECK(content_type IN ('default', 'background', 'thinking', 'long-context', 'image-understanding', 'model-mapping', 'high-iq')),
|
|
390
390
|
target_service_id TEXT NOT NULL,
|
|
391
391
|
target_model TEXT,
|
|
392
392
|
replaced_model TEXT,
|
|
@@ -1707,7 +1707,7 @@ class FileSystemDatabaseManager {
|
|
|
1707
1707
|
if (!rule.routeId || typeof rule.routeId !== 'string') {
|
|
1708
1708
|
return { valid: false, error: `规则[${index}](${rule.id}) 缺少有效的 routeId 字段` };
|
|
1709
1709
|
}
|
|
1710
|
-
const validContentTypes = ['default', 'background', 'thinking', 'long-context', 'image-understanding', 'model-mapping'];
|
|
1710
|
+
const validContentTypes = ['default', 'background', 'thinking', 'long-context', 'image-understanding', 'model-mapping', 'high-iq'];
|
|
1711
1711
|
if (!rule.contentType || !validContentTypes.includes(rule.contentType)) {
|
|
1712
1712
|
return { valid: false, error: `规则[${index}](${rule.id}) 的 contentType 无效` };
|
|
1713
1713
|
}
|
|
@@ -2264,11 +2264,22 @@ class FileSystemDatabaseManager {
|
|
|
2264
2264
|
existing.lastRequestAt = now;
|
|
2265
2265
|
existing.requestCount++;
|
|
2266
2266
|
existing.totalTokens += session.totalTokens || 0;
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2267
|
+
if (session.vendorId !== undefined)
|
|
2268
|
+
existing.vendorId = session.vendorId;
|
|
2269
|
+
if (session.vendorName !== undefined)
|
|
2270
|
+
existing.vendorName = session.vendorName;
|
|
2271
|
+
if (session.serviceId !== undefined)
|
|
2272
|
+
existing.serviceId = session.serviceId;
|
|
2273
|
+
if (session.serviceName !== undefined)
|
|
2274
|
+
existing.serviceName = session.serviceName;
|
|
2275
|
+
if (session.model !== undefined)
|
|
2276
|
+
existing.model = session.model;
|
|
2277
|
+
if (session.highIqMode !== undefined)
|
|
2278
|
+
existing.highIqMode = session.highIqMode;
|
|
2279
|
+
if (Object.prototype.hasOwnProperty.call(session, 'highIqRuleId'))
|
|
2280
|
+
existing.highIqRuleId = session.highIqRuleId;
|
|
2281
|
+
if (Object.prototype.hasOwnProperty.call(session, 'highIqEnabledAt'))
|
|
2282
|
+
existing.highIqEnabledAt = session.highIqEnabledAt;
|
|
2272
2283
|
}
|
|
2273
2284
|
else {
|
|
2274
2285
|
// 创建新 session
|
|
@@ -2285,6 +2296,9 @@ class FileSystemDatabaseManager {
|
|
|
2285
2296
|
serviceId: session.serviceId,
|
|
2286
2297
|
serviceName: session.serviceName,
|
|
2287
2298
|
model: session.model,
|
|
2299
|
+
highIqMode: session.highIqMode,
|
|
2300
|
+
highIqRuleId: session.highIqRuleId,
|
|
2301
|
+
highIqEnabledAt: session.highIqEnabledAt,
|
|
2288
2302
|
});
|
|
2289
2303
|
}
|
|
2290
2304
|
// 异步保存(不阻塞)
|