@omnicross/daemon 0.4.3 → 0.4.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/dist/cli.cjs +68 -13
- package/dist/cli.js +68 -13
- package/dist/index.cjs +68 -13
- package/dist/index.d.cts +1466 -1440
- package/dist/index.d.ts +1466 -1440
- package/dist/index.js +68 -13
- package/package.json +6 -6
package/dist/cli.cjs
CHANGED
|
@@ -8684,7 +8684,7 @@ async function handleAdminApi(req, res, path2, deps) {
|
|
|
8684
8684
|
case "server":
|
|
8685
8685
|
return await handleServer(req, res, method, deps);
|
|
8686
8686
|
case "images":
|
|
8687
|
-
return await handleImages(res, method, rest, deps);
|
|
8687
|
+
return await handleImages(req, res, method, rest, deps);
|
|
8688
8688
|
case "search":
|
|
8689
8689
|
return await handleSearchAdmin(req, res, method, rest, deps);
|
|
8690
8690
|
case "accounts":
|
|
@@ -10231,7 +10231,41 @@ function imageEndpointUrls(base) {
|
|
|
10231
10231
|
edits: `${base}/v1/images/edits`
|
|
10232
10232
|
}) : null;
|
|
10233
10233
|
}
|
|
10234
|
-
|
|
10234
|
+
function imageProviderEvidence(images, capabilities) {
|
|
10235
|
+
const evidenceAt = safeStatusTimestamp(capabilities?.oldestEvidenceAt);
|
|
10236
|
+
const resolvedAt = safeStatusTimestamp(capabilities?.resolvedAt);
|
|
10237
|
+
if (evidenceAt === void 0 || resolvedAt === void 0) return null;
|
|
10238
|
+
const expiresAt = evidenceAt <= Number.MAX_SAFE_INTEGER - images.evidenceTtlMs ? evidenceAt + images.evidenceTtlMs : void 0;
|
|
10239
|
+
return Object.freeze({
|
|
10240
|
+
verifiedAt: evidenceAt,
|
|
10241
|
+
ageMs: Math.max(0, resolvedAt - evidenceAt),
|
|
10242
|
+
...expiresAt !== void 0 ? { expiresAt } : {}
|
|
10243
|
+
});
|
|
10244
|
+
}
|
|
10245
|
+
async function handleImagesVerifyLive(req, res, deps) {
|
|
10246
|
+
const verifier = deps.imageLiveVerifier;
|
|
10247
|
+
if (!verifier) {
|
|
10248
|
+
return writeJsonError(res, 501, "Images live verification is not available");
|
|
10249
|
+
}
|
|
10250
|
+
const serverConfig = await (0, import_outbound_api5.loadServerConfig)(deps.settingsStore);
|
|
10251
|
+
const images = serverConfig.images ?? import_outbound_api5.DEFAULT_IMAGES_SERVER_CONFIG;
|
|
10252
|
+
req.resume();
|
|
10253
|
+
const controller = new AbortController();
|
|
10254
|
+
req.on("close", () => controller.abort());
|
|
10255
|
+
const result = await verifier.verifyLive(images, controller.signal);
|
|
10256
|
+
const antigravityRouted = Object.values(images.models).includes("antigravity-subscription");
|
|
10257
|
+
return writeJson4(res, 200, {
|
|
10258
|
+
...result,
|
|
10259
|
+
...antigravityRouted ? { antigravityDeferred: true } : {}
|
|
10260
|
+
});
|
|
10261
|
+
}
|
|
10262
|
+
async function handleImages(req, res, method, rest, deps) {
|
|
10263
|
+
if (rest.length === 1 && rest[0] === "verify-live") {
|
|
10264
|
+
if (method !== "POST") {
|
|
10265
|
+
return writeJsonError(res, 405, `method ${method} not allowed on Images verify-live`);
|
|
10266
|
+
}
|
|
10267
|
+
return handleImagesVerifyLive(req, res, deps);
|
|
10268
|
+
}
|
|
10235
10269
|
if (rest.length !== 1 || rest[0] !== "capabilities") {
|
|
10236
10270
|
return writeJsonError(res, 404, "unknown Images admin resource");
|
|
10237
10271
|
}
|
|
@@ -10246,14 +10280,14 @@ async function handleImages(res, method, rest, deps) {
|
|
|
10246
10280
|
const capability = await reader.inspectCapability(IMAGE_ADMIN_STATUS_TENANT);
|
|
10247
10281
|
const resources = safeRuntimeResources(reader.resourceStatus());
|
|
10248
10282
|
const outbound = deps.outboundApiServer.getStatus();
|
|
10249
|
-
const
|
|
10250
|
-
const
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
})
|
|
10283
|
+
const evidence = imageProviderEvidence(images, capability.capabilities);
|
|
10284
|
+
const providers = (capability.providers ?? []).map((provider) => Object.freeze({
|
|
10285
|
+
providerId: provider.providerId,
|
|
10286
|
+
available: provider.available === true,
|
|
10287
|
+
reason: provider.available ? null : safeImageCapabilityReason(provider.reason),
|
|
10288
|
+
models: Object.freeze([...provider.models]),
|
|
10289
|
+
evidence: imageProviderEvidence(images, provider.capabilities)
|
|
10290
|
+
}));
|
|
10257
10291
|
const draining = lifecycle.draining.map((generation) => Object.freeze({
|
|
10258
10292
|
generationId: safeImageGenerationId(generation.generationId),
|
|
10259
10293
|
enabled: generation.enabled,
|
|
@@ -10274,6 +10308,7 @@ async function handleImages(res, method, rest, deps) {
|
|
|
10274
10308
|
evidence,
|
|
10275
10309
|
features: safeCapabilityValues(capability.capabilities, images.defaultModel)
|
|
10276
10310
|
},
|
|
10311
|
+
providers,
|
|
10277
10312
|
runtime: {
|
|
10278
10313
|
disposed: lifecycle.disposed,
|
|
10279
10314
|
generationId: safeImageGenerationId(lifecycle.current.generationId),
|
|
@@ -10504,7 +10539,7 @@ async function handleUiStatic(req, res, urlPath, uiDist) {
|
|
|
10504
10539
|
}
|
|
10505
10540
|
|
|
10506
10541
|
// src/admin/version.ts
|
|
10507
|
-
var DAEMON_VERSION = true ? "0.4.
|
|
10542
|
+
var DAEMON_VERSION = true ? "0.4.4" : "0.0.0-dev";
|
|
10508
10543
|
|
|
10509
10544
|
// src/admin/AdminServer.ts
|
|
10510
10545
|
var LOOPBACK_ADDR = "127.0.0.1";
|
|
@@ -12771,15 +12806,32 @@ function createImageRuntimeGeneration(options) {
|
|
|
12771
12806
|
const inspectCapability = async (apiKeyId) => {
|
|
12772
12807
|
const providerCapabilities = /* @__PURE__ */ new Map();
|
|
12773
12808
|
let defaultProviderError;
|
|
12809
|
+
const providerRows = [];
|
|
12774
12810
|
for (const providerId of [...new Set(Object.values(config.models))]) {
|
|
12775
12811
|
try {
|
|
12776
|
-
|
|
12812
|
+
const capabilities2 = await inspectOneProvider(providerId, apiKeyId);
|
|
12813
|
+
providerCapabilities.set(providerId, capabilities2);
|
|
12814
|
+
const affirmed = capabilities2.available === true && capabilities2.generate === true;
|
|
12815
|
+
providerRows.push({
|
|
12816
|
+
providerId,
|
|
12817
|
+
available: affirmed,
|
|
12818
|
+
...!affirmed ? { reason: capabilities2.reason ?? "runtime_unavailable" } : {},
|
|
12819
|
+
models: affirmed ? Object.entries(config.models).filter(([model, modelProvider]) => modelProvider === providerId && capabilities2.models.includes(model)).map(([model]) => model) : [],
|
|
12820
|
+
capabilities: capabilities2
|
|
12821
|
+
});
|
|
12777
12822
|
} catch (error) {
|
|
12778
12823
|
if (providerId === defaultProviderId) defaultProviderError = error;
|
|
12824
|
+
providerRows.push({
|
|
12825
|
+
providerId,
|
|
12826
|
+
available: false,
|
|
12827
|
+
reason: error instanceof import_image_generation5.ImageGenerationError && (error.code === "upstream_auth_required" || error.code === "invalid_api_key") ? "account_unverified" : "runtime_unavailable",
|
|
12828
|
+
models: []
|
|
12829
|
+
});
|
|
12779
12830
|
}
|
|
12780
12831
|
}
|
|
12832
|
+
const providers2 = Object.freeze(providerRows);
|
|
12781
12833
|
const routedModels = Object.freeze(
|
|
12782
|
-
|
|
12834
|
+
providerRows.flatMap((row) => row.available ? row.models : [])
|
|
12783
12835
|
);
|
|
12784
12836
|
const capabilities = providerCapabilities.get(defaultProviderId);
|
|
12785
12837
|
if (!capabilities) {
|
|
@@ -12789,6 +12841,7 @@ function createImageRuntimeGeneration(options) {
|
|
|
12789
12841
|
providerId: defaultProviderId,
|
|
12790
12842
|
model: config.defaultModel,
|
|
12791
12843
|
routedModels,
|
|
12844
|
+
providers: providers2,
|
|
12792
12845
|
reason: defaultProviderError instanceof import_image_generation5.ImageGenerationError && (defaultProviderError.code === "upstream_auth_required" || defaultProviderError.code === "invalid_api_key") ? "account_unverified" : "runtime_unavailable"
|
|
12793
12846
|
});
|
|
12794
12847
|
}
|
|
@@ -12799,6 +12852,7 @@ function createImageRuntimeGeneration(options) {
|
|
|
12799
12852
|
providerId: defaultProviderId,
|
|
12800
12853
|
model: config.defaultModel,
|
|
12801
12854
|
routedModels,
|
|
12855
|
+
providers: providers2,
|
|
12802
12856
|
...!available ? { reason: capabilities.reason ?? "runtime_unavailable" } : {},
|
|
12803
12857
|
capabilities
|
|
12804
12858
|
});
|
|
@@ -21259,6 +21313,7 @@ function buildDaemon(config, paths) {
|
|
|
21259
21313
|
outboundApiServer,
|
|
21260
21314
|
imageRuntimeConfig,
|
|
21261
21315
|
imageRuntimeStatus: paths.imageRuntimeStatus ?? imageRuntimeManager,
|
|
21316
|
+
imageLiveVerifier: paths.imageLiveVerifier ?? imageDoctor,
|
|
21262
21317
|
imageConfigAudit: paths.imageConfigAudit ?? ((record) => {
|
|
21263
21318
|
imageObservability.recordConfigurationAudit(record);
|
|
21264
21319
|
}),
|
package/dist/cli.js
CHANGED
|
@@ -8818,7 +8818,7 @@ async function handleAdminApi(req, res, path2, deps) {
|
|
|
8818
8818
|
case "server":
|
|
8819
8819
|
return await handleServer(req, res, method, deps);
|
|
8820
8820
|
case "images":
|
|
8821
|
-
return await handleImages(res, method, rest, deps);
|
|
8821
|
+
return await handleImages(req, res, method, rest, deps);
|
|
8822
8822
|
case "search":
|
|
8823
8823
|
return await handleSearchAdmin(req, res, method, rest, deps);
|
|
8824
8824
|
case "accounts":
|
|
@@ -10365,7 +10365,41 @@ function imageEndpointUrls(base) {
|
|
|
10365
10365
|
edits: `${base}/v1/images/edits`
|
|
10366
10366
|
}) : null;
|
|
10367
10367
|
}
|
|
10368
|
-
|
|
10368
|
+
function imageProviderEvidence(images, capabilities) {
|
|
10369
|
+
const evidenceAt = safeStatusTimestamp(capabilities?.oldestEvidenceAt);
|
|
10370
|
+
const resolvedAt = safeStatusTimestamp(capabilities?.resolvedAt);
|
|
10371
|
+
if (evidenceAt === void 0 || resolvedAt === void 0) return null;
|
|
10372
|
+
const expiresAt = evidenceAt <= Number.MAX_SAFE_INTEGER - images.evidenceTtlMs ? evidenceAt + images.evidenceTtlMs : void 0;
|
|
10373
|
+
return Object.freeze({
|
|
10374
|
+
verifiedAt: evidenceAt,
|
|
10375
|
+
ageMs: Math.max(0, resolvedAt - evidenceAt),
|
|
10376
|
+
...expiresAt !== void 0 ? { expiresAt } : {}
|
|
10377
|
+
});
|
|
10378
|
+
}
|
|
10379
|
+
async function handleImagesVerifyLive(req, res, deps) {
|
|
10380
|
+
const verifier = deps.imageLiveVerifier;
|
|
10381
|
+
if (!verifier) {
|
|
10382
|
+
return writeJsonError(res, 501, "Images live verification is not available");
|
|
10383
|
+
}
|
|
10384
|
+
const serverConfig = await loadServerConfig3(deps.settingsStore);
|
|
10385
|
+
const images = serverConfig.images ?? DEFAULT_IMAGES_SERVER_CONFIG;
|
|
10386
|
+
req.resume();
|
|
10387
|
+
const controller = new AbortController();
|
|
10388
|
+
req.on("close", () => controller.abort());
|
|
10389
|
+
const result = await verifier.verifyLive(images, controller.signal);
|
|
10390
|
+
const antigravityRouted = Object.values(images.models).includes("antigravity-subscription");
|
|
10391
|
+
return writeJson4(res, 200, {
|
|
10392
|
+
...result,
|
|
10393
|
+
...antigravityRouted ? { antigravityDeferred: true } : {}
|
|
10394
|
+
});
|
|
10395
|
+
}
|
|
10396
|
+
async function handleImages(req, res, method, rest, deps) {
|
|
10397
|
+
if (rest.length === 1 && rest[0] === "verify-live") {
|
|
10398
|
+
if (method !== "POST") {
|
|
10399
|
+
return writeJsonError(res, 405, `method ${method} not allowed on Images verify-live`);
|
|
10400
|
+
}
|
|
10401
|
+
return handleImagesVerifyLive(req, res, deps);
|
|
10402
|
+
}
|
|
10369
10403
|
if (rest.length !== 1 || rest[0] !== "capabilities") {
|
|
10370
10404
|
return writeJsonError(res, 404, "unknown Images admin resource");
|
|
10371
10405
|
}
|
|
@@ -10380,14 +10414,14 @@ async function handleImages(res, method, rest, deps) {
|
|
|
10380
10414
|
const capability = await reader.inspectCapability(IMAGE_ADMIN_STATUS_TENANT);
|
|
10381
10415
|
const resources = safeRuntimeResources(reader.resourceStatus());
|
|
10382
10416
|
const outbound = deps.outboundApiServer.getStatus();
|
|
10383
|
-
const
|
|
10384
|
-
const
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
})
|
|
10417
|
+
const evidence = imageProviderEvidence(images, capability.capabilities);
|
|
10418
|
+
const providers = (capability.providers ?? []).map((provider) => Object.freeze({
|
|
10419
|
+
providerId: provider.providerId,
|
|
10420
|
+
available: provider.available === true,
|
|
10421
|
+
reason: provider.available ? null : safeImageCapabilityReason(provider.reason),
|
|
10422
|
+
models: Object.freeze([...provider.models]),
|
|
10423
|
+
evidence: imageProviderEvidence(images, provider.capabilities)
|
|
10424
|
+
}));
|
|
10391
10425
|
const draining = lifecycle.draining.map((generation) => Object.freeze({
|
|
10392
10426
|
generationId: safeImageGenerationId(generation.generationId),
|
|
10393
10427
|
enabled: generation.enabled,
|
|
@@ -10408,6 +10442,7 @@ async function handleImages(res, method, rest, deps) {
|
|
|
10408
10442
|
evidence,
|
|
10409
10443
|
features: safeCapabilityValues(capability.capabilities, images.defaultModel)
|
|
10410
10444
|
},
|
|
10445
|
+
providers,
|
|
10411
10446
|
runtime: {
|
|
10412
10447
|
disposed: lifecycle.disposed,
|
|
10413
10448
|
generationId: safeImageGenerationId(lifecycle.current.generationId),
|
|
@@ -10637,7 +10672,7 @@ async function handleUiStatic(req, res, urlPath, uiDist) {
|
|
|
10637
10672
|
}
|
|
10638
10673
|
|
|
10639
10674
|
// src/admin/version.ts
|
|
10640
|
-
var DAEMON_VERSION = true ? "0.4.
|
|
10675
|
+
var DAEMON_VERSION = true ? "0.4.4" : "0.0.0-dev";
|
|
10641
10676
|
|
|
10642
10677
|
// src/admin/AdminServer.ts
|
|
10643
10678
|
var LOOPBACK_ADDR = "127.0.0.1";
|
|
@@ -12949,15 +12984,32 @@ function createImageRuntimeGeneration(options) {
|
|
|
12949
12984
|
const inspectCapability = async (apiKeyId) => {
|
|
12950
12985
|
const providerCapabilities = /* @__PURE__ */ new Map();
|
|
12951
12986
|
let defaultProviderError;
|
|
12987
|
+
const providerRows = [];
|
|
12952
12988
|
for (const providerId of [...new Set(Object.values(config.models))]) {
|
|
12953
12989
|
try {
|
|
12954
|
-
|
|
12990
|
+
const capabilities2 = await inspectOneProvider(providerId, apiKeyId);
|
|
12991
|
+
providerCapabilities.set(providerId, capabilities2);
|
|
12992
|
+
const affirmed = capabilities2.available === true && capabilities2.generate === true;
|
|
12993
|
+
providerRows.push({
|
|
12994
|
+
providerId,
|
|
12995
|
+
available: affirmed,
|
|
12996
|
+
...!affirmed ? { reason: capabilities2.reason ?? "runtime_unavailable" } : {},
|
|
12997
|
+
models: affirmed ? Object.entries(config.models).filter(([model, modelProvider]) => modelProvider === providerId && capabilities2.models.includes(model)).map(([model]) => model) : [],
|
|
12998
|
+
capabilities: capabilities2
|
|
12999
|
+
});
|
|
12955
13000
|
} catch (error) {
|
|
12956
13001
|
if (providerId === defaultProviderId) defaultProviderError = error;
|
|
13002
|
+
providerRows.push({
|
|
13003
|
+
providerId,
|
|
13004
|
+
available: false,
|
|
13005
|
+
reason: error instanceof ImageGenerationError4 && (error.code === "upstream_auth_required" || error.code === "invalid_api_key") ? "account_unverified" : "runtime_unavailable",
|
|
13006
|
+
models: []
|
|
13007
|
+
});
|
|
12957
13008
|
}
|
|
12958
13009
|
}
|
|
13010
|
+
const providers2 = Object.freeze(providerRows);
|
|
12959
13011
|
const routedModels = Object.freeze(
|
|
12960
|
-
|
|
13012
|
+
providerRows.flatMap((row) => row.available ? row.models : [])
|
|
12961
13013
|
);
|
|
12962
13014
|
const capabilities = providerCapabilities.get(defaultProviderId);
|
|
12963
13015
|
if (!capabilities) {
|
|
@@ -12967,6 +13019,7 @@ function createImageRuntimeGeneration(options) {
|
|
|
12967
13019
|
providerId: defaultProviderId,
|
|
12968
13020
|
model: config.defaultModel,
|
|
12969
13021
|
routedModels,
|
|
13022
|
+
providers: providers2,
|
|
12970
13023
|
reason: defaultProviderError instanceof ImageGenerationError4 && (defaultProviderError.code === "upstream_auth_required" || defaultProviderError.code === "invalid_api_key") ? "account_unverified" : "runtime_unavailable"
|
|
12971
13024
|
});
|
|
12972
13025
|
}
|
|
@@ -12977,6 +13030,7 @@ function createImageRuntimeGeneration(options) {
|
|
|
12977
13030
|
providerId: defaultProviderId,
|
|
12978
13031
|
model: config.defaultModel,
|
|
12979
13032
|
routedModels,
|
|
13033
|
+
providers: providers2,
|
|
12980
13034
|
...!available ? { reason: capabilities.reason ?? "runtime_unavailable" } : {},
|
|
12981
13035
|
capabilities
|
|
12982
13036
|
});
|
|
@@ -21538,6 +21592,7 @@ function buildDaemon(config, paths) {
|
|
|
21538
21592
|
outboundApiServer,
|
|
21539
21593
|
imageRuntimeConfig,
|
|
21540
21594
|
imageRuntimeStatus: paths.imageRuntimeStatus ?? imageRuntimeManager,
|
|
21595
|
+
imageLiveVerifier: paths.imageLiveVerifier ?? imageDoctor,
|
|
21541
21596
|
imageConfigAudit: paths.imageConfigAudit ?? ((record) => {
|
|
21542
21597
|
imageObservability.recordConfigurationAudit(record);
|
|
21543
21598
|
}),
|
package/dist/index.cjs
CHANGED
|
@@ -7917,7 +7917,7 @@ async function handleAdminApi(req, res, path2, deps) {
|
|
|
7917
7917
|
case "server":
|
|
7918
7918
|
return await handleServer(req, res, method, deps);
|
|
7919
7919
|
case "images":
|
|
7920
|
-
return await handleImages(res, method, rest, deps);
|
|
7920
|
+
return await handleImages(req, res, method, rest, deps);
|
|
7921
7921
|
case "search":
|
|
7922
7922
|
return await handleSearchAdmin(req, res, method, rest, deps);
|
|
7923
7923
|
case "accounts":
|
|
@@ -9464,7 +9464,41 @@ function imageEndpointUrls(base) {
|
|
|
9464
9464
|
edits: `${base}/v1/images/edits`
|
|
9465
9465
|
}) : null;
|
|
9466
9466
|
}
|
|
9467
|
-
|
|
9467
|
+
function imageProviderEvidence(images, capabilities) {
|
|
9468
|
+
const evidenceAt = safeStatusTimestamp(capabilities?.oldestEvidenceAt);
|
|
9469
|
+
const resolvedAt = safeStatusTimestamp(capabilities?.resolvedAt);
|
|
9470
|
+
if (evidenceAt === void 0 || resolvedAt === void 0) return null;
|
|
9471
|
+
const expiresAt = evidenceAt <= Number.MAX_SAFE_INTEGER - images.evidenceTtlMs ? evidenceAt + images.evidenceTtlMs : void 0;
|
|
9472
|
+
return Object.freeze({
|
|
9473
|
+
verifiedAt: evidenceAt,
|
|
9474
|
+
ageMs: Math.max(0, resolvedAt - evidenceAt),
|
|
9475
|
+
...expiresAt !== void 0 ? { expiresAt } : {}
|
|
9476
|
+
});
|
|
9477
|
+
}
|
|
9478
|
+
async function handleImagesVerifyLive(req, res, deps) {
|
|
9479
|
+
const verifier = deps.imageLiveVerifier;
|
|
9480
|
+
if (!verifier) {
|
|
9481
|
+
return writeJsonError(res, 501, "Images live verification is not available");
|
|
9482
|
+
}
|
|
9483
|
+
const serverConfig = await (0, import_outbound_api5.loadServerConfig)(deps.settingsStore);
|
|
9484
|
+
const images = serverConfig.images ?? import_outbound_api5.DEFAULT_IMAGES_SERVER_CONFIG;
|
|
9485
|
+
req.resume();
|
|
9486
|
+
const controller = new AbortController();
|
|
9487
|
+
req.on("close", () => controller.abort());
|
|
9488
|
+
const result = await verifier.verifyLive(images, controller.signal);
|
|
9489
|
+
const antigravityRouted = Object.values(images.models).includes("antigravity-subscription");
|
|
9490
|
+
return writeJson4(res, 200, {
|
|
9491
|
+
...result,
|
|
9492
|
+
...antigravityRouted ? { antigravityDeferred: true } : {}
|
|
9493
|
+
});
|
|
9494
|
+
}
|
|
9495
|
+
async function handleImages(req, res, method, rest, deps) {
|
|
9496
|
+
if (rest.length === 1 && rest[0] === "verify-live") {
|
|
9497
|
+
if (method !== "POST") {
|
|
9498
|
+
return writeJsonError(res, 405, `method ${method} not allowed on Images verify-live`);
|
|
9499
|
+
}
|
|
9500
|
+
return handleImagesVerifyLive(req, res, deps);
|
|
9501
|
+
}
|
|
9468
9502
|
if (rest.length !== 1 || rest[0] !== "capabilities") {
|
|
9469
9503
|
return writeJsonError(res, 404, "unknown Images admin resource");
|
|
9470
9504
|
}
|
|
@@ -9479,14 +9513,14 @@ async function handleImages(res, method, rest, deps) {
|
|
|
9479
9513
|
const capability = await reader.inspectCapability(IMAGE_ADMIN_STATUS_TENANT);
|
|
9480
9514
|
const resources = safeRuntimeResources(reader.resourceStatus());
|
|
9481
9515
|
const outbound = deps.outboundApiServer.getStatus();
|
|
9482
|
-
const
|
|
9483
|
-
const
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
})
|
|
9516
|
+
const evidence = imageProviderEvidence(images, capability.capabilities);
|
|
9517
|
+
const providers = (capability.providers ?? []).map((provider) => Object.freeze({
|
|
9518
|
+
providerId: provider.providerId,
|
|
9519
|
+
available: provider.available === true,
|
|
9520
|
+
reason: provider.available ? null : safeImageCapabilityReason(provider.reason),
|
|
9521
|
+
models: Object.freeze([...provider.models]),
|
|
9522
|
+
evidence: imageProviderEvidence(images, provider.capabilities)
|
|
9523
|
+
}));
|
|
9490
9524
|
const draining = lifecycle.draining.map((generation) => Object.freeze({
|
|
9491
9525
|
generationId: safeImageGenerationId(generation.generationId),
|
|
9492
9526
|
enabled: generation.enabled,
|
|
@@ -9507,6 +9541,7 @@ async function handleImages(res, method, rest, deps) {
|
|
|
9507
9541
|
evidence,
|
|
9508
9542
|
features: safeCapabilityValues(capability.capabilities, images.defaultModel)
|
|
9509
9543
|
},
|
|
9544
|
+
providers,
|
|
9510
9545
|
runtime: {
|
|
9511
9546
|
disposed: lifecycle.disposed,
|
|
9512
9547
|
generationId: safeImageGenerationId(lifecycle.current.generationId),
|
|
@@ -9737,7 +9772,7 @@ async function handleUiStatic(req, res, urlPath, uiDist) {
|
|
|
9737
9772
|
}
|
|
9738
9773
|
|
|
9739
9774
|
// src/admin/version.ts
|
|
9740
|
-
var DAEMON_VERSION = true ? "0.4.
|
|
9775
|
+
var DAEMON_VERSION = true ? "0.4.4" : "0.0.0-dev";
|
|
9741
9776
|
|
|
9742
9777
|
// src/admin/AdminServer.ts
|
|
9743
9778
|
var LOOPBACK_ADDR = "127.0.0.1";
|
|
@@ -12037,15 +12072,32 @@ function createImageRuntimeGeneration(options) {
|
|
|
12037
12072
|
const inspectCapability = async (apiKeyId) => {
|
|
12038
12073
|
const providerCapabilities = /* @__PURE__ */ new Map();
|
|
12039
12074
|
let defaultProviderError;
|
|
12075
|
+
const providerRows = [];
|
|
12040
12076
|
for (const providerId of [...new Set(Object.values(config.models))]) {
|
|
12041
12077
|
try {
|
|
12042
|
-
|
|
12078
|
+
const capabilities2 = await inspectOneProvider(providerId, apiKeyId);
|
|
12079
|
+
providerCapabilities.set(providerId, capabilities2);
|
|
12080
|
+
const affirmed = capabilities2.available === true && capabilities2.generate === true;
|
|
12081
|
+
providerRows.push({
|
|
12082
|
+
providerId,
|
|
12083
|
+
available: affirmed,
|
|
12084
|
+
...!affirmed ? { reason: capabilities2.reason ?? "runtime_unavailable" } : {},
|
|
12085
|
+
models: affirmed ? Object.entries(config.models).filter(([model, modelProvider]) => modelProvider === providerId && capabilities2.models.includes(model)).map(([model]) => model) : [],
|
|
12086
|
+
capabilities: capabilities2
|
|
12087
|
+
});
|
|
12043
12088
|
} catch (error) {
|
|
12044
12089
|
if (providerId === defaultProviderId) defaultProviderError = error;
|
|
12090
|
+
providerRows.push({
|
|
12091
|
+
providerId,
|
|
12092
|
+
available: false,
|
|
12093
|
+
reason: error instanceof import_image_generation5.ImageGenerationError && (error.code === "upstream_auth_required" || error.code === "invalid_api_key") ? "account_unverified" : "runtime_unavailable",
|
|
12094
|
+
models: []
|
|
12095
|
+
});
|
|
12045
12096
|
}
|
|
12046
12097
|
}
|
|
12098
|
+
const providers2 = Object.freeze(providerRows);
|
|
12047
12099
|
const routedModels = Object.freeze(
|
|
12048
|
-
|
|
12100
|
+
providerRows.flatMap((row) => row.available ? row.models : [])
|
|
12049
12101
|
);
|
|
12050
12102
|
const capabilities = providerCapabilities.get(defaultProviderId);
|
|
12051
12103
|
if (!capabilities) {
|
|
@@ -12055,6 +12107,7 @@ function createImageRuntimeGeneration(options) {
|
|
|
12055
12107
|
providerId: defaultProviderId,
|
|
12056
12108
|
model: config.defaultModel,
|
|
12057
12109
|
routedModels,
|
|
12110
|
+
providers: providers2,
|
|
12058
12111
|
reason: defaultProviderError instanceof import_image_generation5.ImageGenerationError && (defaultProviderError.code === "upstream_auth_required" || defaultProviderError.code === "invalid_api_key") ? "account_unverified" : "runtime_unavailable"
|
|
12059
12112
|
});
|
|
12060
12113
|
}
|
|
@@ -12065,6 +12118,7 @@ function createImageRuntimeGeneration(options) {
|
|
|
12065
12118
|
providerId: defaultProviderId,
|
|
12066
12119
|
model: config.defaultModel,
|
|
12067
12120
|
routedModels,
|
|
12121
|
+
providers: providers2,
|
|
12068
12122
|
...!available ? { reason: capabilities.reason ?? "runtime_unavailable" } : {},
|
|
12069
12123
|
capabilities
|
|
12070
12124
|
});
|
|
@@ -21072,6 +21126,7 @@ function buildDaemon(config, paths) {
|
|
|
21072
21126
|
outboundApiServer,
|
|
21073
21127
|
imageRuntimeConfig,
|
|
21074
21128
|
imageRuntimeStatus: paths.imageRuntimeStatus ?? imageRuntimeManager,
|
|
21129
|
+
imageLiveVerifier: paths.imageLiveVerifier ?? imageDoctor,
|
|
21075
21130
|
imageConfigAudit: paths.imageConfigAudit ?? ((record) => {
|
|
21076
21131
|
imageObservability.recordConfigurationAudit(record);
|
|
21077
21132
|
}),
|