omnius 1.0.23 → 1.0.24
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 +111 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -516403,6 +516403,7 @@ __export(dist_exports, {
|
|
|
516403
516403
|
addProjectConstraint: () => addProjectConstraint,
|
|
516404
516404
|
addSessionConstraint: () => addSessionConstraint,
|
|
516405
516405
|
applyPatch: () => applyPatch,
|
|
516406
|
+
audioGenerationDir: () => audioGenerationDir,
|
|
516406
516407
|
audioGenerationSetupPlan: () => audioGenerationSetupPlan,
|
|
516407
516408
|
audioGenerationVenvDir: () => audioGenerationVenvDir,
|
|
516408
516409
|
audioOutputDir: () => audioOutputDir,
|
|
@@ -566615,7 +566616,7 @@ ${tuiBgSeq()}`);
|
|
|
566615
566616
|
render2();
|
|
566616
566617
|
}
|
|
566617
566618
|
} else if (seq === "\x1B[3~" && opts.onDelete) {
|
|
566618
|
-
if (!isSkippable(cursor) && matchSet.has(cursor) && items[cursor].key !== activeKey) {
|
|
566619
|
+
if (!isSkippable(cursor) && matchSet.has(cursor) && (opts.allowDeleteActive || items[cursor].key !== activeKey)) {
|
|
566619
566620
|
deleteConfirmIdx = cursor;
|
|
566620
566621
|
deleteConfirmSel = false;
|
|
566621
566622
|
render2();
|
|
@@ -566678,6 +566679,10 @@ ${tuiBgSeq()}`);
|
|
|
566678
566679
|
}
|
|
566679
566680
|
scrollOffset = 0;
|
|
566680
566681
|
render2();
|
|
566682
|
+
} else if (opts.backspaceDeletes && opts.onDelete && !isSkippable(cursor) && matchSet.has(cursor) && (opts.allowDeleteActive || items[cursor].key !== activeKey)) {
|
|
566683
|
+
deleteConfirmIdx = cursor;
|
|
566684
|
+
deleteConfirmSel = false;
|
|
566685
|
+
render2();
|
|
566681
566686
|
} else if (hasBreadcrumbs) {
|
|
566682
566687
|
cleanup();
|
|
566683
566688
|
resolve48({ confirmed: false, key: "__back__", index: cursor });
|
|
@@ -586393,6 +586398,58 @@ function renderImageModelList() {
|
|
|
586393
586398
|
}
|
|
586394
586399
|
}
|
|
586395
586400
|
}
|
|
586401
|
+
function modelCacheSlug(model) {
|
|
586402
|
+
if (!model || !model.includes("/")) return null;
|
|
586403
|
+
return `models--${model.replace(/\//g, "--")}`;
|
|
586404
|
+
}
|
|
586405
|
+
function cacheCandidatePaths(root, model) {
|
|
586406
|
+
const slug = modelCacheSlug(model);
|
|
586407
|
+
if (!slug) return [];
|
|
586408
|
+
return [
|
|
586409
|
+
join110(root, "huggingface", "hub", slug),
|
|
586410
|
+
join110(root, "huggingface", "transformers", slug),
|
|
586411
|
+
join110(root, "huggingface", "diffusers", slug),
|
|
586412
|
+
join110(root, "cache", "huggingface", "hub", slug)
|
|
586413
|
+
];
|
|
586414
|
+
}
|
|
586415
|
+
function removeCachedModelPaths(root, model) {
|
|
586416
|
+
const removed = [];
|
|
586417
|
+
for (const path11 of cacheCandidatePaths(root, model)) {
|
|
586418
|
+
if (!existsSync96(path11)) continue;
|
|
586419
|
+
rmSync3(path11, { recursive: true, force: true });
|
|
586420
|
+
removed.push(path11);
|
|
586421
|
+
}
|
|
586422
|
+
return removed;
|
|
586423
|
+
}
|
|
586424
|
+
function ollamaApiBase(ctx3) {
|
|
586425
|
+
return String(ctx3.config.backendUrl || "http://localhost:11434").replace(/\/v1\/?$/, "").replace(/\/$/, "");
|
|
586426
|
+
}
|
|
586427
|
+
async function deleteOllamaWeights(ctx3, model) {
|
|
586428
|
+
const resp = await fetch(`${ollamaApiBase(ctx3)}/api/delete`, {
|
|
586429
|
+
method: "DELETE",
|
|
586430
|
+
headers: { "Content-Type": "application/json" },
|
|
586431
|
+
body: JSON.stringify({ name: model }),
|
|
586432
|
+
signal: AbortSignal.timeout(3e4)
|
|
586433
|
+
});
|
|
586434
|
+
if (resp.status === 404) return `Ollama model not present: ${model}`;
|
|
586435
|
+
if (!resp.ok) {
|
|
586436
|
+
const text = await resp.text().catch(() => "");
|
|
586437
|
+
throw new Error(`Ollama delete failed: HTTP ${resp.status}${text ? ` - ${text.slice(0, 300)}` : ""}`);
|
|
586438
|
+
}
|
|
586439
|
+
return `Deleted Ollama model weights: ${model}`;
|
|
586440
|
+
}
|
|
586441
|
+
async function deleteImageModelWeights(ctx3, preset) {
|
|
586442
|
+
const messages2 = [];
|
|
586443
|
+
if (preset.backend === "ollama") {
|
|
586444
|
+
messages2.push(await deleteOllamaWeights(ctx3, preset.id));
|
|
586445
|
+
} else if (preset.backend === "diffusers") {
|
|
586446
|
+
const removed = removeCachedModelPaths(imageGenerationDir(ctx3.repoRoot), preset.id);
|
|
586447
|
+
messages2.push(removed.length > 0 ? `Deleted ${removed.length} cached image model path(s) for ${preset.id}.` : `No cached image weights found for ${preset.id}.`);
|
|
586448
|
+
} else {
|
|
586449
|
+
messages2.push("stable-diffusion.cpp uses explicit local checkpoint paths; remove the chosen checkpoint file directly if needed.");
|
|
586450
|
+
}
|
|
586451
|
+
return messages2;
|
|
586452
|
+
}
|
|
586396
586453
|
async function showImageModelsMenu(ctx3, hasLocal) {
|
|
586397
586454
|
const settings = resolveSettings(ctx3.repoRoot);
|
|
586398
586455
|
const specs = detectSystemSpecs();
|
|
@@ -586417,7 +586474,29 @@ async function showImageModelsMenu(ctx3, hasLocal) {
|
|
|
586417
586474
|
skipKeys: ["hdr:models"],
|
|
586418
586475
|
rl: ctx3.rl,
|
|
586419
586476
|
availableRows: ctx3.availableContentRows?.(),
|
|
586420
|
-
customKeyHint: " Enter
|
|
586477
|
+
customKeyHint: " Enter select Del/Backspace delete weights",
|
|
586478
|
+
backspaceDeletes: true,
|
|
586479
|
+
allowDeleteActive: true,
|
|
586480
|
+
onDelete: (item, done) => {
|
|
586481
|
+
if (!item.key.startsWith("model:")) {
|
|
586482
|
+
done(false);
|
|
586483
|
+
return;
|
|
586484
|
+
}
|
|
586485
|
+
const model = item.key.slice("model:".length);
|
|
586486
|
+
const preset = IMAGE_GENERATION_MODEL_PRESETS.find((candidate) => candidate.id === model);
|
|
586487
|
+
if (!preset) {
|
|
586488
|
+
renderWarning(`No image preset found for ${model}`);
|
|
586489
|
+
done(false);
|
|
586490
|
+
return;
|
|
586491
|
+
}
|
|
586492
|
+
deleteImageModelWeights(ctx3, preset).then((messages2) => {
|
|
586493
|
+
for (const message2 of messages2) renderInfo(message2);
|
|
586494
|
+
done(false);
|
|
586495
|
+
}).catch((err) => {
|
|
586496
|
+
renderError(`Image weight delete failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
586497
|
+
done(false);
|
|
586498
|
+
});
|
|
586499
|
+
}
|
|
586421
586500
|
});
|
|
586422
586501
|
if (!result.confirmed || !result.key) return;
|
|
586423
586502
|
if (result.key.startsWith("setup:")) {
|
|
@@ -586637,6 +586716,13 @@ function renderAudioModelList(kind) {
|
|
|
586637
586716
|
}
|
|
586638
586717
|
}
|
|
586639
586718
|
}
|
|
586719
|
+
async function deleteAudioModelWeights(ctx3, preset) {
|
|
586720
|
+
if (preset.backend === "project") {
|
|
586721
|
+
return ["Project audio generation profiles do not own a managed model-weight cache."];
|
|
586722
|
+
}
|
|
586723
|
+
const removed = removeCachedModelPaths(audioGenerationDir(ctx3.repoRoot), preset.id);
|
|
586724
|
+
return [removed.length > 0 ? `Deleted ${removed.length} cached ${preset.kind} model path(s) for ${preset.id}.` : `No cached ${preset.kind} weights found for ${preset.id}.`];
|
|
586725
|
+
}
|
|
586640
586726
|
async function showAudioGenerationMenu(ctx3, hasLocal, kind) {
|
|
586641
586727
|
const settings = resolveSettings(ctx3.repoRoot);
|
|
586642
586728
|
const specs = detectSystemSpecs();
|
|
@@ -586672,7 +586758,29 @@ async function showAudioGenerationMenu(ctx3, hasLocal, kind) {
|
|
|
586672
586758
|
skipKeys: ["hdr:models"],
|
|
586673
586759
|
rl: ctx3.rl,
|
|
586674
586760
|
availableRows: ctx3.availableContentRows?.(),
|
|
586675
|
-
customKeyHint: " Enter
|
|
586761
|
+
customKeyHint: " Enter select Del/Backspace delete weights",
|
|
586762
|
+
backspaceDeletes: true,
|
|
586763
|
+
allowDeleteActive: true,
|
|
586764
|
+
onDelete: (item, done) => {
|
|
586765
|
+
if (!item.key.startsWith("model:")) {
|
|
586766
|
+
done(false);
|
|
586767
|
+
return;
|
|
586768
|
+
}
|
|
586769
|
+
const model = item.key.slice("model:".length);
|
|
586770
|
+
const preset = AUDIO_GENERATION_MODEL_PRESETS.find((candidate) => candidate.kind === kind && candidate.id === model);
|
|
586771
|
+
if (!preset) {
|
|
586772
|
+
renderWarning(`No ${kind} preset found for ${model}`);
|
|
586773
|
+
done(false);
|
|
586774
|
+
return;
|
|
586775
|
+
}
|
|
586776
|
+
deleteAudioModelWeights(ctx3, preset).then((messages2) => {
|
|
586777
|
+
for (const message2 of messages2) renderInfo(message2);
|
|
586778
|
+
done(false);
|
|
586779
|
+
}).catch((err) => {
|
|
586780
|
+
renderError(`${kind} weight delete failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
586781
|
+
done(false);
|
|
586782
|
+
});
|
|
586783
|
+
}
|
|
586676
586784
|
});
|
|
586677
586785
|
if (!result.confirmed || !result.key) return;
|
|
586678
586786
|
if (result.key.startsWith("setup:")) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.24",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED