@omnicross/daemon 0.1.8 → 0.1.9
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/cli.cjs +49 -1
- package/dist/cli.js +49 -1
- package/dist/index.cjs +49 -1
- package/dist/index.d.cts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +49 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -520,6 +520,35 @@ function validateApiKeys(raw) {
|
|
|
520
520
|
}
|
|
521
521
|
return out.length > 0 ? out : void 0;
|
|
522
522
|
}
|
|
523
|
+
var THINK_LEVELS = /* @__PURE__ */ new Set([
|
|
524
|
+
"none",
|
|
525
|
+
"minimal",
|
|
526
|
+
"low",
|
|
527
|
+
"medium",
|
|
528
|
+
"high",
|
|
529
|
+
"xhigh",
|
|
530
|
+
"max"
|
|
531
|
+
]);
|
|
532
|
+
function validateThinkingLevels(raw) {
|
|
533
|
+
if (!Array.isArray(raw)) return void 0;
|
|
534
|
+
if (!raw.every((level) => typeof level === "string" && THINK_LEVELS.has(level))) {
|
|
535
|
+
return void 0;
|
|
536
|
+
}
|
|
537
|
+
return [...raw];
|
|
538
|
+
}
|
|
539
|
+
function validateThinkingTokenLimit(raw) {
|
|
540
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return void 0;
|
|
541
|
+
const bounds = raw;
|
|
542
|
+
const min = bounds["min"];
|
|
543
|
+
const max = bounds["max"];
|
|
544
|
+
if (typeof min !== "number" || !Number.isFinite(min) || !Number.isInteger(min) || min < 0) {
|
|
545
|
+
return void 0;
|
|
546
|
+
}
|
|
547
|
+
if (typeof max !== "number" || !Number.isFinite(max) || !Number.isInteger(max) || max < min) {
|
|
548
|
+
return void 0;
|
|
549
|
+
}
|
|
550
|
+
return { min, max };
|
|
551
|
+
}
|
|
523
552
|
function validateModelConfigs(raw) {
|
|
524
553
|
if (!Array.isArray(raw)) return void 0;
|
|
525
554
|
const out = [];
|
|
@@ -534,6 +563,10 @@ function validateModelConfigs(raw) {
|
|
|
534
563
|
if (typeof m["enabled"] === "boolean") entry.enabled = m["enabled"];
|
|
535
564
|
if (typeof m["vision"] === "boolean") entry.vision = m["vision"];
|
|
536
565
|
if (typeof m["reasoning"] === "boolean") entry.reasoning = m["reasoning"];
|
|
566
|
+
const thinkingLevels = validateThinkingLevels(m["thinkingLevels"]);
|
|
567
|
+
if (thinkingLevels) entry.thinkingLevels = thinkingLevels;
|
|
568
|
+
const thinkingTokenLimit = validateThinkingTokenLimit(m["thinkingTokenLimit"]);
|
|
569
|
+
if (thinkingTokenLimit) entry.thinkingTokenLimit = thinkingTokenLimit;
|
|
537
570
|
out.push(entry);
|
|
538
571
|
}
|
|
539
572
|
return out.length > 0 ? out : void 0;
|
|
@@ -5405,6 +5438,12 @@ function parseModelConfigsInput(raw, existing) {
|
|
|
5405
5438
|
else if (typeof prior?.vision === "boolean") entry.vision = prior.vision;
|
|
5406
5439
|
if (typeof m["reasoning"] === "boolean") entry.reasoning = m["reasoning"];
|
|
5407
5440
|
else if (typeof prior?.reasoning === "boolean") entry.reasoning = prior.reasoning;
|
|
5441
|
+
const thinkingLevels = validateThinkingLevels(m["thinkingLevels"]);
|
|
5442
|
+
if (thinkingLevels) entry.thinkingLevels = thinkingLevels;
|
|
5443
|
+
else if (prior?.thinkingLevels) entry.thinkingLevels = prior.thinkingLevels;
|
|
5444
|
+
const thinkingTokenLimit = validateThinkingTokenLimit(m["thinkingTokenLimit"]);
|
|
5445
|
+
if (thinkingTokenLimit) entry.thinkingTokenLimit = thinkingTokenLimit;
|
|
5446
|
+
else if (prior?.thinkingTokenLimit) entry.thinkingTokenLimit = prior.thinkingTokenLimit;
|
|
5408
5447
|
out.push(entry);
|
|
5409
5448
|
}
|
|
5410
5449
|
return out.length > 0 ? out : void 0;
|
|
@@ -6326,7 +6365,7 @@ async function handleUiStatic(req, res, urlPath, uiDist) {
|
|
|
6326
6365
|
}
|
|
6327
6366
|
|
|
6328
6367
|
// src/admin/version.ts
|
|
6329
|
-
var DAEMON_VERSION = true ? "0.1.
|
|
6368
|
+
var DAEMON_VERSION = true ? "0.1.9" : "0.0.0-dev";
|
|
6330
6369
|
|
|
6331
6370
|
// src/admin/AdminServer.ts
|
|
6332
6371
|
var LOOPBACK_ADDR = "127.0.0.1";
|
|
@@ -6867,6 +6906,15 @@ function toLLMProvider(row) {
|
|
|
6867
6906
|
api_base_url: row.baseUrl,
|
|
6868
6907
|
api_key: resolvePreferredApiKey(row),
|
|
6869
6908
|
models,
|
|
6909
|
+
modelConfigs: row.modelConfigs?.map((config) => ({
|
|
6910
|
+
id: config.id,
|
|
6911
|
+
name: config.name ?? config.id,
|
|
6912
|
+
enabled: config.enabled ?? true,
|
|
6913
|
+
vision: config.vision,
|
|
6914
|
+
reasoning: config.reasoning,
|
|
6915
|
+
thinkingLevels: config.thinkingLevels,
|
|
6916
|
+
thinkingTokenLimit: config.thinkingTokenLimit
|
|
6917
|
+
})),
|
|
6870
6918
|
enabled: true,
|
|
6871
6919
|
transformer,
|
|
6872
6920
|
// app-parity-2 child 3: POPULATE the coding-plan endpoint onto the core
|
package/dist/cli.js
CHANGED
|
@@ -497,6 +497,35 @@ function validateApiKeys(raw) {
|
|
|
497
497
|
}
|
|
498
498
|
return out.length > 0 ? out : void 0;
|
|
499
499
|
}
|
|
500
|
+
var THINK_LEVELS = /* @__PURE__ */ new Set([
|
|
501
|
+
"none",
|
|
502
|
+
"minimal",
|
|
503
|
+
"low",
|
|
504
|
+
"medium",
|
|
505
|
+
"high",
|
|
506
|
+
"xhigh",
|
|
507
|
+
"max"
|
|
508
|
+
]);
|
|
509
|
+
function validateThinkingLevels(raw) {
|
|
510
|
+
if (!Array.isArray(raw)) return void 0;
|
|
511
|
+
if (!raw.every((level) => typeof level === "string" && THINK_LEVELS.has(level))) {
|
|
512
|
+
return void 0;
|
|
513
|
+
}
|
|
514
|
+
return [...raw];
|
|
515
|
+
}
|
|
516
|
+
function validateThinkingTokenLimit(raw) {
|
|
517
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return void 0;
|
|
518
|
+
const bounds = raw;
|
|
519
|
+
const min = bounds["min"];
|
|
520
|
+
const max = bounds["max"];
|
|
521
|
+
if (typeof min !== "number" || !Number.isFinite(min) || !Number.isInteger(min) || min < 0) {
|
|
522
|
+
return void 0;
|
|
523
|
+
}
|
|
524
|
+
if (typeof max !== "number" || !Number.isFinite(max) || !Number.isInteger(max) || max < min) {
|
|
525
|
+
return void 0;
|
|
526
|
+
}
|
|
527
|
+
return { min, max };
|
|
528
|
+
}
|
|
500
529
|
function validateModelConfigs(raw) {
|
|
501
530
|
if (!Array.isArray(raw)) return void 0;
|
|
502
531
|
const out = [];
|
|
@@ -511,6 +540,10 @@ function validateModelConfigs(raw) {
|
|
|
511
540
|
if (typeof m["enabled"] === "boolean") entry.enabled = m["enabled"];
|
|
512
541
|
if (typeof m["vision"] === "boolean") entry.vision = m["vision"];
|
|
513
542
|
if (typeof m["reasoning"] === "boolean") entry.reasoning = m["reasoning"];
|
|
543
|
+
const thinkingLevels = validateThinkingLevels(m["thinkingLevels"]);
|
|
544
|
+
if (thinkingLevels) entry.thinkingLevels = thinkingLevels;
|
|
545
|
+
const thinkingTokenLimit = validateThinkingTokenLimit(m["thinkingTokenLimit"]);
|
|
546
|
+
if (thinkingTokenLimit) entry.thinkingTokenLimit = thinkingTokenLimit;
|
|
514
547
|
out.push(entry);
|
|
515
548
|
}
|
|
516
549
|
return out.length > 0 ? out : void 0;
|
|
@@ -5470,6 +5503,12 @@ function parseModelConfigsInput(raw, existing) {
|
|
|
5470
5503
|
else if (typeof prior?.vision === "boolean") entry.vision = prior.vision;
|
|
5471
5504
|
if (typeof m["reasoning"] === "boolean") entry.reasoning = m["reasoning"];
|
|
5472
5505
|
else if (typeof prior?.reasoning === "boolean") entry.reasoning = prior.reasoning;
|
|
5506
|
+
const thinkingLevels = validateThinkingLevels(m["thinkingLevels"]);
|
|
5507
|
+
if (thinkingLevels) entry.thinkingLevels = thinkingLevels;
|
|
5508
|
+
else if (prior?.thinkingLevels) entry.thinkingLevels = prior.thinkingLevels;
|
|
5509
|
+
const thinkingTokenLimit = validateThinkingTokenLimit(m["thinkingTokenLimit"]);
|
|
5510
|
+
if (thinkingTokenLimit) entry.thinkingTokenLimit = thinkingTokenLimit;
|
|
5511
|
+
else if (prior?.thinkingTokenLimit) entry.thinkingTokenLimit = prior.thinkingTokenLimit;
|
|
5473
5512
|
out.push(entry);
|
|
5474
5513
|
}
|
|
5475
5514
|
return out.length > 0 ? out : void 0;
|
|
@@ -6390,7 +6429,7 @@ async function handleUiStatic(req, res, urlPath, uiDist) {
|
|
|
6390
6429
|
}
|
|
6391
6430
|
|
|
6392
6431
|
// src/admin/version.ts
|
|
6393
|
-
var DAEMON_VERSION = true ? "0.1.
|
|
6432
|
+
var DAEMON_VERSION = true ? "0.1.9" : "0.0.0-dev";
|
|
6394
6433
|
|
|
6395
6434
|
// src/admin/AdminServer.ts
|
|
6396
6435
|
var LOOPBACK_ADDR = "127.0.0.1";
|
|
@@ -6934,6 +6973,15 @@ function toLLMProvider(row) {
|
|
|
6934
6973
|
api_base_url: row.baseUrl,
|
|
6935
6974
|
api_key: resolvePreferredApiKey(row),
|
|
6936
6975
|
models,
|
|
6976
|
+
modelConfigs: row.modelConfigs?.map((config) => ({
|
|
6977
|
+
id: config.id,
|
|
6978
|
+
name: config.name ?? config.id,
|
|
6979
|
+
enabled: config.enabled ?? true,
|
|
6980
|
+
vision: config.vision,
|
|
6981
|
+
reasoning: config.reasoning,
|
|
6982
|
+
thinkingLevels: config.thinkingLevels,
|
|
6983
|
+
thinkingTokenLimit: config.thinkingTokenLimit
|
|
6984
|
+
})),
|
|
6937
6985
|
enabled: true,
|
|
6938
6986
|
transformer,
|
|
6939
6987
|
// app-parity-2 child 3: POPULATE the coding-plan endpoint onto the core
|
package/dist/index.cjs
CHANGED
|
@@ -1264,6 +1264,35 @@ function validateApiKeys(raw) {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
return out.length > 0 ? out : void 0;
|
|
1266
1266
|
}
|
|
1267
|
+
var THINK_LEVELS = /* @__PURE__ */ new Set([
|
|
1268
|
+
"none",
|
|
1269
|
+
"minimal",
|
|
1270
|
+
"low",
|
|
1271
|
+
"medium",
|
|
1272
|
+
"high",
|
|
1273
|
+
"xhigh",
|
|
1274
|
+
"max"
|
|
1275
|
+
]);
|
|
1276
|
+
function validateThinkingLevels(raw) {
|
|
1277
|
+
if (!Array.isArray(raw)) return void 0;
|
|
1278
|
+
if (!raw.every((level) => typeof level === "string" && THINK_LEVELS.has(level))) {
|
|
1279
|
+
return void 0;
|
|
1280
|
+
}
|
|
1281
|
+
return [...raw];
|
|
1282
|
+
}
|
|
1283
|
+
function validateThinkingTokenLimit(raw) {
|
|
1284
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return void 0;
|
|
1285
|
+
const bounds = raw;
|
|
1286
|
+
const min = bounds["min"];
|
|
1287
|
+
const max = bounds["max"];
|
|
1288
|
+
if (typeof min !== "number" || !Number.isFinite(min) || !Number.isInteger(min) || min < 0) {
|
|
1289
|
+
return void 0;
|
|
1290
|
+
}
|
|
1291
|
+
if (typeof max !== "number" || !Number.isFinite(max) || !Number.isInteger(max) || max < min) {
|
|
1292
|
+
return void 0;
|
|
1293
|
+
}
|
|
1294
|
+
return { min, max };
|
|
1295
|
+
}
|
|
1267
1296
|
function validateModelConfigs(raw) {
|
|
1268
1297
|
if (!Array.isArray(raw)) return void 0;
|
|
1269
1298
|
const out = [];
|
|
@@ -1278,6 +1307,10 @@ function validateModelConfigs(raw) {
|
|
|
1278
1307
|
if (typeof m["enabled"] === "boolean") entry.enabled = m["enabled"];
|
|
1279
1308
|
if (typeof m["vision"] === "boolean") entry.vision = m["vision"];
|
|
1280
1309
|
if (typeof m["reasoning"] === "boolean") entry.reasoning = m["reasoning"];
|
|
1310
|
+
const thinkingLevels = validateThinkingLevels(m["thinkingLevels"]);
|
|
1311
|
+
if (thinkingLevels) entry.thinkingLevels = thinkingLevels;
|
|
1312
|
+
const thinkingTokenLimit = validateThinkingTokenLimit(m["thinkingTokenLimit"]);
|
|
1313
|
+
if (thinkingTokenLimit) entry.thinkingTokenLimit = thinkingTokenLimit;
|
|
1281
1314
|
out.push(entry);
|
|
1282
1315
|
}
|
|
1283
1316
|
return out.length > 0 ? out : void 0;
|
|
@@ -5013,6 +5046,12 @@ function parseModelConfigsInput(raw, existing) {
|
|
|
5013
5046
|
else if (typeof prior?.vision === "boolean") entry.vision = prior.vision;
|
|
5014
5047
|
if (typeof m["reasoning"] === "boolean") entry.reasoning = m["reasoning"];
|
|
5015
5048
|
else if (typeof prior?.reasoning === "boolean") entry.reasoning = prior.reasoning;
|
|
5049
|
+
const thinkingLevels = validateThinkingLevels(m["thinkingLevels"]);
|
|
5050
|
+
if (thinkingLevels) entry.thinkingLevels = thinkingLevels;
|
|
5051
|
+
else if (prior?.thinkingLevels) entry.thinkingLevels = prior.thinkingLevels;
|
|
5052
|
+
const thinkingTokenLimit = validateThinkingTokenLimit(m["thinkingTokenLimit"]);
|
|
5053
|
+
if (thinkingTokenLimit) entry.thinkingTokenLimit = thinkingTokenLimit;
|
|
5054
|
+
else if (prior?.thinkingTokenLimit) entry.thinkingTokenLimit = prior.thinkingTokenLimit;
|
|
5016
5055
|
out.push(entry);
|
|
5017
5056
|
}
|
|
5018
5057
|
return out.length > 0 ? out : void 0;
|
|
@@ -5934,7 +5973,7 @@ async function handleUiStatic(req, res, urlPath, uiDist) {
|
|
|
5934
5973
|
}
|
|
5935
5974
|
|
|
5936
5975
|
// src/admin/version.ts
|
|
5937
|
-
var DAEMON_VERSION = true ? "0.1.
|
|
5976
|
+
var DAEMON_VERSION = true ? "0.1.9" : "0.0.0-dev";
|
|
5938
5977
|
|
|
5939
5978
|
// src/admin/AdminServer.ts
|
|
5940
5979
|
var LOOPBACK_ADDR = "127.0.0.1";
|
|
@@ -6502,6 +6541,15 @@ function toLLMProvider(row) {
|
|
|
6502
6541
|
api_base_url: row.baseUrl,
|
|
6503
6542
|
api_key: resolvePreferredApiKey(row),
|
|
6504
6543
|
models,
|
|
6544
|
+
modelConfigs: row.modelConfigs?.map((config) => ({
|
|
6545
|
+
id: config.id,
|
|
6546
|
+
name: config.name ?? config.id,
|
|
6547
|
+
enabled: config.enabled ?? true,
|
|
6548
|
+
vision: config.vision,
|
|
6549
|
+
reasoning: config.reasoning,
|
|
6550
|
+
thinkingLevels: config.thinkingLevels,
|
|
6551
|
+
thinkingTokenLimit: config.thinkingTokenLimit
|
|
6552
|
+
})),
|
|
6505
6553
|
enabled: true,
|
|
6506
6554
|
transformer,
|
|
6507
6555
|
// app-parity-2 child 3: POPULATE the coding-plan endpoint onto the core
|
package/dist/index.d.cts
CHANGED
|
@@ -15,6 +15,7 @@ import { SubscriptionIdentityStore } from '@omnicross/core/provider-proxy/identi
|
|
|
15
15
|
import { LoggingConfig, HealthReport } from '@omnicross/contracts/health-logging-types';
|
|
16
16
|
import { SubscriptionAccountHealth } from '@omnicross/core/pipeline/SubscriptionAccountHealth';
|
|
17
17
|
import { fetchUpstream } from '@omnicross/core/pipeline/upstreamFetch';
|
|
18
|
+
import { ThinkLevel } from '@omnicross/contracts/completion-types';
|
|
18
19
|
import { AuditRecord, AuditStats, AuditConfig } from '@omnicross/contracts/audit-types';
|
|
19
20
|
import { BillingDeliveryStatus, BillingConfig, BillingEvent } from '@omnicross/contracts/billing-types';
|
|
20
21
|
import http from 'node:http';
|
|
@@ -145,11 +146,11 @@ interface DaemonApiKeyEntry {
|
|
|
145
146
|
/**
|
|
146
147
|
* Per-model metadata subset (app-parity child 2). A hand-authored SUBSET of the
|
|
147
148
|
* app's `ModelConfig` (`app/src/shared-types/llm-config.ts`), carrying ONLY the
|
|
148
|
-
*
|
|
149
|
-
*
|
|
149
|
+
* allowlisted fields the daemon stores + round-trips, keyed by the model `id`:
|
|
150
|
+
* display metadata plus target thinking capabilities. The wider
|
|
150
151
|
* `ModelConfig` fields the discovery flow may send (`category`/`contextLength`/
|
|
151
152
|
* `maxTokens`/`functionCall`/`webSearch`/`completionSettings`/`openRouterProvider`/
|
|
152
|
-
*
|
|
153
|
+
* fields are NOT in this allowlist — they are DROPPED by
|
|
153
154
|
* deny-by-default (`validateModelConfigs`/`parseModelConfigsInput`).
|
|
154
155
|
*
|
|
155
156
|
* ENFORCEMENT (app-parity-2 child 2): `enabled` is now a DISCOVERY/advertisement
|
|
@@ -158,8 +159,8 @@ interface DaemonApiKeyEntry {
|
|
|
158
159
|
* advertisement, NOT a hard per-request block (core does not validate a requested
|
|
159
160
|
* model against `models[]`, so a hardcoded disabled model id still reaches the
|
|
160
161
|
* upstream, which rejects it). The admin management view (`toProviderView`) still
|
|
161
|
-
* lists ALL models.
|
|
162
|
-
*
|
|
162
|
+
* lists ALL models. `name`/`group`/`vision`/`reasoning` remain display metadata;
|
|
163
|
+
* thinking capabilities are projected into core for request negotiation.
|
|
163
164
|
*/
|
|
164
165
|
interface DaemonModelConfig {
|
|
165
166
|
/** Model id — the metadata key (parallels an entry in the flat `models[]`). */
|
|
@@ -175,6 +176,13 @@ interface DaemonModelConfig {
|
|
|
175
176
|
vision?: boolean;
|
|
176
177
|
/** Reasoning-capable hint (display only; not consumed by routing). */
|
|
177
178
|
reasoning?: boolean;
|
|
179
|
+
/** Discrete reasoning efforts accepted by this target model. */
|
|
180
|
+
thinkingLevels?: ThinkLevel[];
|
|
181
|
+
/** Valid legacy thinking-budget bounds for this target model. */
|
|
182
|
+
thinkingTokenLimit?: {
|
|
183
|
+
min: number;
|
|
184
|
+
max: number;
|
|
185
|
+
};
|
|
178
186
|
}
|
|
179
187
|
/**
|
|
180
188
|
* One transformer chain entry (app-parity child 5). Mirrors the app's
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { SubscriptionIdentityStore } from '@omnicross/core/provider-proxy/identi
|
|
|
15
15
|
import { LoggingConfig, HealthReport } from '@omnicross/contracts/health-logging-types';
|
|
16
16
|
import { SubscriptionAccountHealth } from '@omnicross/core/pipeline/SubscriptionAccountHealth';
|
|
17
17
|
import { fetchUpstream } from '@omnicross/core/pipeline/upstreamFetch';
|
|
18
|
+
import { ThinkLevel } from '@omnicross/contracts/completion-types';
|
|
18
19
|
import { AuditRecord, AuditStats, AuditConfig } from '@omnicross/contracts/audit-types';
|
|
19
20
|
import { BillingDeliveryStatus, BillingConfig, BillingEvent } from '@omnicross/contracts/billing-types';
|
|
20
21
|
import http from 'node:http';
|
|
@@ -145,11 +146,11 @@ interface DaemonApiKeyEntry {
|
|
|
145
146
|
/**
|
|
146
147
|
* Per-model metadata subset (app-parity child 2). A hand-authored SUBSET of the
|
|
147
148
|
* app's `ModelConfig` (`app/src/shared-types/llm-config.ts`), carrying ONLY the
|
|
148
|
-
*
|
|
149
|
-
*
|
|
149
|
+
* allowlisted fields the daemon stores + round-trips, keyed by the model `id`:
|
|
150
|
+
* display metadata plus target thinking capabilities. The wider
|
|
150
151
|
* `ModelConfig` fields the discovery flow may send (`category`/`contextLength`/
|
|
151
152
|
* `maxTokens`/`functionCall`/`webSearch`/`completionSettings`/`openRouterProvider`/
|
|
152
|
-
*
|
|
153
|
+
* fields are NOT in this allowlist — they are DROPPED by
|
|
153
154
|
* deny-by-default (`validateModelConfigs`/`parseModelConfigsInput`).
|
|
154
155
|
*
|
|
155
156
|
* ENFORCEMENT (app-parity-2 child 2): `enabled` is now a DISCOVERY/advertisement
|
|
@@ -158,8 +159,8 @@ interface DaemonApiKeyEntry {
|
|
|
158
159
|
* advertisement, NOT a hard per-request block (core does not validate a requested
|
|
159
160
|
* model against `models[]`, so a hardcoded disabled model id still reaches the
|
|
160
161
|
* upstream, which rejects it). The admin management view (`toProviderView`) still
|
|
161
|
-
* lists ALL models.
|
|
162
|
-
*
|
|
162
|
+
* lists ALL models. `name`/`group`/`vision`/`reasoning` remain display metadata;
|
|
163
|
+
* thinking capabilities are projected into core for request negotiation.
|
|
163
164
|
*/
|
|
164
165
|
interface DaemonModelConfig {
|
|
165
166
|
/** Model id — the metadata key (parallels an entry in the flat `models[]`). */
|
|
@@ -175,6 +176,13 @@ interface DaemonModelConfig {
|
|
|
175
176
|
vision?: boolean;
|
|
176
177
|
/** Reasoning-capable hint (display only; not consumed by routing). */
|
|
177
178
|
reasoning?: boolean;
|
|
179
|
+
/** Discrete reasoning efforts accepted by this target model. */
|
|
180
|
+
thinkingLevels?: ThinkLevel[];
|
|
181
|
+
/** Valid legacy thinking-budget bounds for this target model. */
|
|
182
|
+
thinkingTokenLimit?: {
|
|
183
|
+
min: number;
|
|
184
|
+
max: number;
|
|
185
|
+
};
|
|
178
186
|
}
|
|
179
187
|
/**
|
|
180
188
|
* One transformer chain entry (app-parity child 5). Mirrors the app's
|
package/dist/index.js
CHANGED
|
@@ -1264,6 +1264,35 @@ function validateApiKeys(raw) {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
return out.length > 0 ? out : void 0;
|
|
1266
1266
|
}
|
|
1267
|
+
var THINK_LEVELS = /* @__PURE__ */ new Set([
|
|
1268
|
+
"none",
|
|
1269
|
+
"minimal",
|
|
1270
|
+
"low",
|
|
1271
|
+
"medium",
|
|
1272
|
+
"high",
|
|
1273
|
+
"xhigh",
|
|
1274
|
+
"max"
|
|
1275
|
+
]);
|
|
1276
|
+
function validateThinkingLevels(raw) {
|
|
1277
|
+
if (!Array.isArray(raw)) return void 0;
|
|
1278
|
+
if (!raw.every((level) => typeof level === "string" && THINK_LEVELS.has(level))) {
|
|
1279
|
+
return void 0;
|
|
1280
|
+
}
|
|
1281
|
+
return [...raw];
|
|
1282
|
+
}
|
|
1283
|
+
function validateThinkingTokenLimit(raw) {
|
|
1284
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return void 0;
|
|
1285
|
+
const bounds = raw;
|
|
1286
|
+
const min = bounds["min"];
|
|
1287
|
+
const max = bounds["max"];
|
|
1288
|
+
if (typeof min !== "number" || !Number.isFinite(min) || !Number.isInteger(min) || min < 0) {
|
|
1289
|
+
return void 0;
|
|
1290
|
+
}
|
|
1291
|
+
if (typeof max !== "number" || !Number.isFinite(max) || !Number.isInteger(max) || max < min) {
|
|
1292
|
+
return void 0;
|
|
1293
|
+
}
|
|
1294
|
+
return { min, max };
|
|
1295
|
+
}
|
|
1267
1296
|
function validateModelConfigs(raw) {
|
|
1268
1297
|
if (!Array.isArray(raw)) return void 0;
|
|
1269
1298
|
const out = [];
|
|
@@ -1278,6 +1307,10 @@ function validateModelConfigs(raw) {
|
|
|
1278
1307
|
if (typeof m["enabled"] === "boolean") entry.enabled = m["enabled"];
|
|
1279
1308
|
if (typeof m["vision"] === "boolean") entry.vision = m["vision"];
|
|
1280
1309
|
if (typeof m["reasoning"] === "boolean") entry.reasoning = m["reasoning"];
|
|
1310
|
+
const thinkingLevels = validateThinkingLevels(m["thinkingLevels"]);
|
|
1311
|
+
if (thinkingLevels) entry.thinkingLevels = thinkingLevels;
|
|
1312
|
+
const thinkingTokenLimit = validateThinkingTokenLimit(m["thinkingTokenLimit"]);
|
|
1313
|
+
if (thinkingTokenLimit) entry.thinkingTokenLimit = thinkingTokenLimit;
|
|
1281
1314
|
out.push(entry);
|
|
1282
1315
|
}
|
|
1283
1316
|
return out.length > 0 ? out : void 0;
|
|
@@ -5044,6 +5077,12 @@ function parseModelConfigsInput(raw, existing) {
|
|
|
5044
5077
|
else if (typeof prior?.vision === "boolean") entry.vision = prior.vision;
|
|
5045
5078
|
if (typeof m["reasoning"] === "boolean") entry.reasoning = m["reasoning"];
|
|
5046
5079
|
else if (typeof prior?.reasoning === "boolean") entry.reasoning = prior.reasoning;
|
|
5080
|
+
const thinkingLevels = validateThinkingLevels(m["thinkingLevels"]);
|
|
5081
|
+
if (thinkingLevels) entry.thinkingLevels = thinkingLevels;
|
|
5082
|
+
else if (prior?.thinkingLevels) entry.thinkingLevels = prior.thinkingLevels;
|
|
5083
|
+
const thinkingTokenLimit = validateThinkingTokenLimit(m["thinkingTokenLimit"]);
|
|
5084
|
+
if (thinkingTokenLimit) entry.thinkingTokenLimit = thinkingTokenLimit;
|
|
5085
|
+
else if (prior?.thinkingTokenLimit) entry.thinkingTokenLimit = prior.thinkingTokenLimit;
|
|
5047
5086
|
out.push(entry);
|
|
5048
5087
|
}
|
|
5049
5088
|
return out.length > 0 ? out : void 0;
|
|
@@ -5964,7 +6003,7 @@ async function handleUiStatic(req, res, urlPath, uiDist) {
|
|
|
5964
6003
|
}
|
|
5965
6004
|
|
|
5966
6005
|
// src/admin/version.ts
|
|
5967
|
-
var DAEMON_VERSION = true ? "0.1.
|
|
6006
|
+
var DAEMON_VERSION = true ? "0.1.9" : "0.0.0-dev";
|
|
5968
6007
|
|
|
5969
6008
|
// src/admin/AdminServer.ts
|
|
5970
6009
|
var LOOPBACK_ADDR = "127.0.0.1";
|
|
@@ -6535,6 +6574,15 @@ function toLLMProvider(row) {
|
|
|
6535
6574
|
api_base_url: row.baseUrl,
|
|
6536
6575
|
api_key: resolvePreferredApiKey(row),
|
|
6537
6576
|
models,
|
|
6577
|
+
modelConfigs: row.modelConfigs?.map((config) => ({
|
|
6578
|
+
id: config.id,
|
|
6579
|
+
name: config.name ?? config.id,
|
|
6580
|
+
enabled: config.enabled ?? true,
|
|
6581
|
+
vision: config.vision,
|
|
6582
|
+
reasoning: config.reasoning,
|
|
6583
|
+
thinkingLevels: config.thinkingLevels,
|
|
6584
|
+
thinkingTokenLimit: config.thinkingTokenLimit
|
|
6585
|
+
})),
|
|
6538
6586
|
enabled: true,
|
|
6539
6587
|
transformer,
|
|
6540
6588
|
// app-parity-2 child 3: POPULATE the coding-plan endpoint onto the core
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnicross/daemon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Omnicross standalone daemon 鈥?the bare-Node embedder of @omnicross/core with an admin HTTP API + dashboard.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sayo (https://github.com/Dumoedss)",
|