@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/index.js
CHANGED
|
@@ -8007,7 +8007,7 @@ async function handleAdminApi(req, res, path2, deps) {
|
|
|
8007
8007
|
case "server":
|
|
8008
8008
|
return await handleServer(req, res, method, deps);
|
|
8009
8009
|
case "images":
|
|
8010
|
-
return await handleImages(res, method, rest, deps);
|
|
8010
|
+
return await handleImages(req, res, method, rest, deps);
|
|
8011
8011
|
case "search":
|
|
8012
8012
|
return await handleSearchAdmin(req, res, method, rest, deps);
|
|
8013
8013
|
case "accounts":
|
|
@@ -9554,7 +9554,41 @@ function imageEndpointUrls(base) {
|
|
|
9554
9554
|
edits: `${base}/v1/images/edits`
|
|
9555
9555
|
}) : null;
|
|
9556
9556
|
}
|
|
9557
|
-
|
|
9557
|
+
function imageProviderEvidence(images, capabilities) {
|
|
9558
|
+
const evidenceAt = safeStatusTimestamp(capabilities?.oldestEvidenceAt);
|
|
9559
|
+
const resolvedAt = safeStatusTimestamp(capabilities?.resolvedAt);
|
|
9560
|
+
if (evidenceAt === void 0 || resolvedAt === void 0) return null;
|
|
9561
|
+
const expiresAt = evidenceAt <= Number.MAX_SAFE_INTEGER - images.evidenceTtlMs ? evidenceAt + images.evidenceTtlMs : void 0;
|
|
9562
|
+
return Object.freeze({
|
|
9563
|
+
verifiedAt: evidenceAt,
|
|
9564
|
+
ageMs: Math.max(0, resolvedAt - evidenceAt),
|
|
9565
|
+
...expiresAt !== void 0 ? { expiresAt } : {}
|
|
9566
|
+
});
|
|
9567
|
+
}
|
|
9568
|
+
async function handleImagesVerifyLive(req, res, deps) {
|
|
9569
|
+
const verifier = deps.imageLiveVerifier;
|
|
9570
|
+
if (!verifier) {
|
|
9571
|
+
return writeJsonError(res, 501, "Images live verification is not available");
|
|
9572
|
+
}
|
|
9573
|
+
const serverConfig = await loadServerConfig3(deps.settingsStore);
|
|
9574
|
+
const images = serverConfig.images ?? DEFAULT_IMAGES_SERVER_CONFIG;
|
|
9575
|
+
req.resume();
|
|
9576
|
+
const controller = new AbortController();
|
|
9577
|
+
req.on("close", () => controller.abort());
|
|
9578
|
+
const result = await verifier.verifyLive(images, controller.signal);
|
|
9579
|
+
const antigravityRouted = Object.values(images.models).includes("antigravity-subscription");
|
|
9580
|
+
return writeJson4(res, 200, {
|
|
9581
|
+
...result,
|
|
9582
|
+
...antigravityRouted ? { antigravityDeferred: true } : {}
|
|
9583
|
+
});
|
|
9584
|
+
}
|
|
9585
|
+
async function handleImages(req, res, method, rest, deps) {
|
|
9586
|
+
if (rest.length === 1 && rest[0] === "verify-live") {
|
|
9587
|
+
if (method !== "POST") {
|
|
9588
|
+
return writeJsonError(res, 405, `method ${method} not allowed on Images verify-live`);
|
|
9589
|
+
}
|
|
9590
|
+
return handleImagesVerifyLive(req, res, deps);
|
|
9591
|
+
}
|
|
9558
9592
|
if (rest.length !== 1 || rest[0] !== "capabilities") {
|
|
9559
9593
|
return writeJsonError(res, 404, "unknown Images admin resource");
|
|
9560
9594
|
}
|
|
@@ -9569,14 +9603,14 @@ async function handleImages(res, method, rest, deps) {
|
|
|
9569
9603
|
const capability = await reader.inspectCapability(IMAGE_ADMIN_STATUS_TENANT);
|
|
9570
9604
|
const resources = safeRuntimeResources(reader.resourceStatus());
|
|
9571
9605
|
const outbound = deps.outboundApiServer.getStatus();
|
|
9572
|
-
const
|
|
9573
|
-
const
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
})
|
|
9606
|
+
const evidence = imageProviderEvidence(images, capability.capabilities);
|
|
9607
|
+
const providers = (capability.providers ?? []).map((provider) => Object.freeze({
|
|
9608
|
+
providerId: provider.providerId,
|
|
9609
|
+
available: provider.available === true,
|
|
9610
|
+
reason: provider.available ? null : safeImageCapabilityReason(provider.reason),
|
|
9611
|
+
models: Object.freeze([...provider.models]),
|
|
9612
|
+
evidence: imageProviderEvidence(images, provider.capabilities)
|
|
9613
|
+
}));
|
|
9580
9614
|
const draining = lifecycle.draining.map((generation) => Object.freeze({
|
|
9581
9615
|
generationId: safeImageGenerationId(generation.generationId),
|
|
9582
9616
|
enabled: generation.enabled,
|
|
@@ -9597,6 +9631,7 @@ async function handleImages(res, method, rest, deps) {
|
|
|
9597
9631
|
evidence,
|
|
9598
9632
|
features: safeCapabilityValues(capability.capabilities, images.defaultModel)
|
|
9599
9633
|
},
|
|
9634
|
+
providers,
|
|
9600
9635
|
runtime: {
|
|
9601
9636
|
disposed: lifecycle.disposed,
|
|
9602
9637
|
generationId: safeImageGenerationId(lifecycle.current.generationId),
|
|
@@ -9826,7 +9861,7 @@ async function handleUiStatic(req, res, urlPath, uiDist) {
|
|
|
9826
9861
|
}
|
|
9827
9862
|
|
|
9828
9863
|
// src/admin/version.ts
|
|
9829
|
-
var DAEMON_VERSION = true ? "0.4.
|
|
9864
|
+
var DAEMON_VERSION = true ? "0.4.4" : "0.0.0-dev";
|
|
9830
9865
|
|
|
9831
9866
|
// src/admin/AdminServer.ts
|
|
9832
9867
|
var LOOPBACK_ADDR = "127.0.0.1";
|
|
@@ -12171,15 +12206,32 @@ function createImageRuntimeGeneration(options) {
|
|
|
12171
12206
|
const inspectCapability = async (apiKeyId) => {
|
|
12172
12207
|
const providerCapabilities = /* @__PURE__ */ new Map();
|
|
12173
12208
|
let defaultProviderError;
|
|
12209
|
+
const providerRows = [];
|
|
12174
12210
|
for (const providerId of [...new Set(Object.values(config.models))]) {
|
|
12175
12211
|
try {
|
|
12176
|
-
|
|
12212
|
+
const capabilities2 = await inspectOneProvider(providerId, apiKeyId);
|
|
12213
|
+
providerCapabilities.set(providerId, capabilities2);
|
|
12214
|
+
const affirmed = capabilities2.available === true && capabilities2.generate === true;
|
|
12215
|
+
providerRows.push({
|
|
12216
|
+
providerId,
|
|
12217
|
+
available: affirmed,
|
|
12218
|
+
...!affirmed ? { reason: capabilities2.reason ?? "runtime_unavailable" } : {},
|
|
12219
|
+
models: affirmed ? Object.entries(config.models).filter(([model, modelProvider]) => modelProvider === providerId && capabilities2.models.includes(model)).map(([model]) => model) : [],
|
|
12220
|
+
capabilities: capabilities2
|
|
12221
|
+
});
|
|
12177
12222
|
} catch (error) {
|
|
12178
12223
|
if (providerId === defaultProviderId) defaultProviderError = error;
|
|
12224
|
+
providerRows.push({
|
|
12225
|
+
providerId,
|
|
12226
|
+
available: false,
|
|
12227
|
+
reason: error instanceof ImageGenerationError4 && (error.code === "upstream_auth_required" || error.code === "invalid_api_key") ? "account_unverified" : "runtime_unavailable",
|
|
12228
|
+
models: []
|
|
12229
|
+
});
|
|
12179
12230
|
}
|
|
12180
12231
|
}
|
|
12232
|
+
const providers2 = Object.freeze(providerRows);
|
|
12181
12233
|
const routedModels = Object.freeze(
|
|
12182
|
-
|
|
12234
|
+
providerRows.flatMap((row) => row.available ? row.models : [])
|
|
12183
12235
|
);
|
|
12184
12236
|
const capabilities = providerCapabilities.get(defaultProviderId);
|
|
12185
12237
|
if (!capabilities) {
|
|
@@ -12189,6 +12241,7 @@ function createImageRuntimeGeneration(options) {
|
|
|
12189
12241
|
providerId: defaultProviderId,
|
|
12190
12242
|
model: config.defaultModel,
|
|
12191
12243
|
routedModels,
|
|
12244
|
+
providers: providers2,
|
|
12192
12245
|
reason: defaultProviderError instanceof ImageGenerationError4 && (defaultProviderError.code === "upstream_auth_required" || defaultProviderError.code === "invalid_api_key") ? "account_unverified" : "runtime_unavailable"
|
|
12193
12246
|
});
|
|
12194
12247
|
}
|
|
@@ -12199,6 +12252,7 @@ function createImageRuntimeGeneration(options) {
|
|
|
12199
12252
|
providerId: defaultProviderId,
|
|
12200
12253
|
model: config.defaultModel,
|
|
12201
12254
|
routedModels,
|
|
12255
|
+
providers: providers2,
|
|
12202
12256
|
...!available ? { reason: capabilities.reason ?? "runtime_unavailable" } : {},
|
|
12203
12257
|
capabilities
|
|
12204
12258
|
});
|
|
@@ -21307,6 +21361,7 @@ function buildDaemon(config, paths) {
|
|
|
21307
21361
|
outboundApiServer,
|
|
21308
21362
|
imageRuntimeConfig,
|
|
21309
21363
|
imageRuntimeStatus: paths.imageRuntimeStatus ?? imageRuntimeManager,
|
|
21364
|
+
imageLiveVerifier: paths.imageLiveVerifier ?? imageDoctor,
|
|
21310
21365
|
imageConfigAudit: paths.imageConfigAudit ?? ((record) => {
|
|
21311
21366
|
imageObservability.recordConfigurationAudit(record);
|
|
21312
21367
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnicross/daemon",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
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)",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"typecheck": "tsc -p tsconfig.typecheck.json --noEmit"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@omnicross/contracts": "^0.4.
|
|
58
|
-
"@omnicross/core": "^0.4.
|
|
59
|
-
"@omnicross/subscriptions": "^0.4.
|
|
60
|
-
"@omnicross/cli-launcher": "^0.4.
|
|
61
|
-
"@omnicross/ui": "^0.4.
|
|
57
|
+
"@omnicross/contracts": "^0.4.4",
|
|
58
|
+
"@omnicross/core": "^0.4.4",
|
|
59
|
+
"@omnicross/subscriptions": "^0.4.4",
|
|
60
|
+
"@omnicross/cli-launcher": "^0.4.4",
|
|
61
|
+
"@omnicross/ui": "^0.4.4"
|
|
62
62
|
}
|
|
63
63
|
}
|