@codemem/server 0.28.0 → 0.28.1
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/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/routes/config.d.ts.map +1 -1
- package/package.json +7 -7
- package/static/app.js +14 -28
- package/static/index.html +15 -9
package/dist/index.js
CHANGED
|
@@ -188,6 +188,7 @@ var SECRET_CONFIG_KEYS = new Set([
|
|
|
188
188
|
"observer_headers",
|
|
189
189
|
"sync_coordinator_admin_secret"
|
|
190
190
|
]);
|
|
191
|
+
var REMOVED_CONFIG_KEYS = new Set(["observer_rich_openai_use_responses"]);
|
|
191
192
|
var ALLOWED_KEYS = [
|
|
192
193
|
"claude_command",
|
|
193
194
|
"observer_base_url",
|
|
@@ -198,7 +199,6 @@ var ALLOWED_KEYS = [
|
|
|
198
199
|
"observer_simple_temperature",
|
|
199
200
|
"observer_rich_model",
|
|
200
201
|
"observer_rich_temperature",
|
|
201
|
-
"observer_rich_openai_use_responses",
|
|
202
202
|
"observer_rich_reasoning_effort",
|
|
203
203
|
"observer_rich_reasoning_summary",
|
|
204
204
|
"observer_rich_max_output_tokens",
|
|
@@ -231,7 +231,6 @@ var DEFAULTS = {
|
|
|
231
231
|
observer_runtime: "api_http",
|
|
232
232
|
observer_auth_source: "auto",
|
|
233
233
|
observer_tier_routing_enabled: false,
|
|
234
|
-
observer_rich_openai_use_responses: false,
|
|
235
234
|
observer_auth_command: [],
|
|
236
235
|
observer_auth_timeout_ms: 1500,
|
|
237
236
|
observer_auth_cache_ttl_s: 300,
|
|
@@ -275,6 +274,11 @@ function readConfigFile(configPath) {
|
|
|
275
274
|
return {};
|
|
276
275
|
}
|
|
277
276
|
}
|
|
277
|
+
function withoutRemovedConfigKeys(configData) {
|
|
278
|
+
const next = { ...configData };
|
|
279
|
+
for (const key of REMOVED_CONFIG_KEYS) delete next[key];
|
|
280
|
+
return next;
|
|
281
|
+
}
|
|
278
282
|
function getEffectiveConfig(configData) {
|
|
279
283
|
const effective = {
|
|
280
284
|
...DEFAULTS,
|
|
@@ -406,7 +410,7 @@ function validateAndApplyUpdate(configData, key, value, providers) {
|
|
|
406
410
|
configData[key] = value;
|
|
407
411
|
return null;
|
|
408
412
|
}
|
|
409
|
-
if (key === "observer_tier_routing_enabled"
|
|
413
|
+
if (key === "observer_tier_routing_enabled") {
|
|
410
414
|
if (typeof value !== "boolean") return `${key} must be boolean`;
|
|
411
415
|
configData[key] = value;
|
|
412
416
|
return null;
|
|
@@ -446,7 +450,7 @@ function configRoutes(opts = {}) {
|
|
|
446
450
|
const app = new Hono();
|
|
447
451
|
app.get("/api/config", (c) => {
|
|
448
452
|
const configPath = getConfigPath();
|
|
449
|
-
const configData = readConfigFile(configPath);
|
|
453
|
+
const configData = withoutRemovedConfigKeys(readConfigFile(configPath));
|
|
450
454
|
const effective = getEffectiveConfig(configData);
|
|
451
455
|
return c.json({
|
|
452
456
|
path: configPath,
|
|
@@ -469,7 +473,7 @@ function configRoutes(opts = {}) {
|
|
|
469
473
|
if ("config" in payload && payload.config != null && (typeof payload.config !== "object" || Array.isArray(payload.config))) return c.json({ error: "config must be an object" }, 400);
|
|
470
474
|
const updates = "config" in payload && payload.config != null && typeof payload.config === "object" && !Array.isArray(payload.config) ? payload.config : payload;
|
|
471
475
|
const configPath = getCodememConfigPath();
|
|
472
|
-
const beforeConfig = readCodememConfigFile();
|
|
476
|
+
const beforeConfig = withoutRemovedConfigKeys(readCodememConfigFile());
|
|
473
477
|
const { allowedUpdates, error: protectedKeyError } = partitionViewerUpdates(updates, beforeConfig);
|
|
474
478
|
if (protectedKeyError) return c.json({ error: protectedKeyError }, 403);
|
|
475
479
|
const beforeEffective = getEffectiveConfig(beforeConfig);
|