omnius 1.0.23 โ 1.0.25
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 +375 -53
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -74631,12 +74631,12 @@ var require_x509_cjs = __commonJS({
|
|
|
74631
74631
|
var require_crypto = __commonJS({
|
|
74632
74632
|
"../node_modules/acme-client/src/crypto/index.js"(exports) {
|
|
74633
74633
|
var net5 = __require("net");
|
|
74634
|
-
var { promisify:
|
|
74634
|
+
var { promisify: promisify7 } = __require("util");
|
|
74635
74635
|
var crypto14 = __require("crypto");
|
|
74636
74636
|
var asn1js4 = require_build2();
|
|
74637
74637
|
var x5093 = require_x509_cjs();
|
|
74638
|
-
var randomInt2 =
|
|
74639
|
-
var generateKeyPair2 =
|
|
74638
|
+
var randomInt2 = promisify7(crypto14.randomInt);
|
|
74639
|
+
var generateKeyPair2 = promisify7(crypto14.generateKeyPair);
|
|
74640
74640
|
x5093.cryptoProvider.set(crypto14.webcrypto);
|
|
74641
74641
|
var subjectAltNameOID = "2.5.29.17";
|
|
74642
74642
|
var alpnAcmeIdentifierOID = "1.3.6.1.5.5.7.1.31";
|
|
@@ -109481,9 +109481,9 @@ var require_lib = __commonJS({
|
|
|
109481
109481
|
var require_forge2 = __commonJS({
|
|
109482
109482
|
"../node_modules/acme-client/src/crypto/forge.js"(exports) {
|
|
109483
109483
|
var net5 = __require("net");
|
|
109484
|
-
var { promisify:
|
|
109484
|
+
var { promisify: promisify7 } = __require("util");
|
|
109485
109485
|
var forge = require_lib();
|
|
109486
|
-
var generateKeyPair2 =
|
|
109486
|
+
var generateKeyPair2 = promisify7(forge.pki.rsa.generateKeyPair);
|
|
109487
109487
|
function forgeObjectFromPem(input) {
|
|
109488
109488
|
const msg = forge.pem.decode(input)[0];
|
|
109489
109489
|
let result;
|
|
@@ -126709,7 +126709,7 @@ var require_mock_interceptor = __commonJS({
|
|
|
126709
126709
|
var require_mock_client = __commonJS({
|
|
126710
126710
|
"../node_modules/undici/lib/mock/mock-client.js"(exports, module) {
|
|
126711
126711
|
"use strict";
|
|
126712
|
-
var { promisify:
|
|
126712
|
+
var { promisify: promisify7 } = __require("node:util");
|
|
126713
126713
|
var Client2 = require_client2();
|
|
126714
126714
|
var { buildMockDispatch } = require_mock_utils();
|
|
126715
126715
|
var {
|
|
@@ -126757,7 +126757,7 @@ var require_mock_client = __commonJS({
|
|
|
126757
126757
|
this[kDispatches] = [];
|
|
126758
126758
|
}
|
|
126759
126759
|
async [kClose]() {
|
|
126760
|
-
await
|
|
126760
|
+
await promisify7(this[kOriginalClose])();
|
|
126761
126761
|
this[kConnected] = 0;
|
|
126762
126762
|
this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
|
|
126763
126763
|
}
|
|
@@ -126970,7 +126970,7 @@ var require_mock_call_history = __commonJS({
|
|
|
126970
126970
|
var require_mock_pool = __commonJS({
|
|
126971
126971
|
"../node_modules/undici/lib/mock/mock-pool.js"(exports, module) {
|
|
126972
126972
|
"use strict";
|
|
126973
|
-
var { promisify:
|
|
126973
|
+
var { promisify: promisify7 } = __require("node:util");
|
|
126974
126974
|
var Pool = require_pool();
|
|
126975
126975
|
var { buildMockDispatch } = require_mock_utils();
|
|
126976
126976
|
var {
|
|
@@ -127018,7 +127018,7 @@ var require_mock_pool = __commonJS({
|
|
|
127018
127018
|
this[kDispatches] = [];
|
|
127019
127019
|
}
|
|
127020
127020
|
async [kClose]() {
|
|
127021
|
-
await
|
|
127021
|
+
await promisify7(this[kOriginalClose])();
|
|
127022
127022
|
this[kConnected] = 0;
|
|
127023
127023
|
this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
|
|
127024
127024
|
}
|
|
@@ -515039,14 +515039,17 @@ function collectSnapshot(workingDir) {
|
|
|
515039
515039
|
}
|
|
515040
515040
|
} catch {
|
|
515041
515041
|
}
|
|
515042
|
-
let disk = { availableGB: 0, totalGB: 0, usedPercent: 0 };
|
|
515042
|
+
let disk = { path: workingDir || "/", availableGB: 0, usedGB: 0, totalGB: 0, usedPercent: 0 };
|
|
515043
515043
|
try {
|
|
515044
515044
|
const stats = statfsSync(workingDir || "/");
|
|
515045
515045
|
const totalBytes = stats.blocks * stats.bsize;
|
|
515046
515046
|
const availBytes = stats.bavail * stats.bsize;
|
|
515047
|
+
const usedBytes = totalBytes - availBytes;
|
|
515047
515048
|
disk = {
|
|
515049
|
+
path: workingDir || "/",
|
|
515048
515050
|
totalGB: Math.round(totalBytes / 1024 ** 3),
|
|
515049
515051
|
availableGB: Math.round(availBytes / 1024 ** 3),
|
|
515052
|
+
usedGB: Math.round(usedBytes / 1024 ** 3),
|
|
515050
515053
|
usedPercent: Math.round((1 - availBytes / totalBytes) * 100)
|
|
515051
515054
|
};
|
|
515052
515055
|
} catch {
|
|
@@ -515119,7 +515122,7 @@ function formatSnapshotForContext(snap) {
|
|
|
515119
515122
|
const icon = snap.battery.charging ? "โก" : snap.battery.percent < 20 ? "๐ชซ" : "๐";
|
|
515120
515123
|
lines.push(`Battery: ${icon} ${snap.battery.percent}% ${snap.battery.charging ? "(charging)" : "(discharging)"}`);
|
|
515121
515124
|
}
|
|
515122
|
-
lines.push(`Disk:
|
|
515125
|
+
lines.push(`Disk: disk_available_gb=${snap.disk.availableGB} disk_used_gb=${snap.disk.usedGB} disk_total_gb=${snap.disk.totalGB} disk_used_pct=${snap.disk.usedPercent} path=${snap.disk.path}`);
|
|
515123
515126
|
lines.push(`Processes: ${snap.processes.total} total | ${snap.processes.nodeCount} node | ${snap.processes.omniusSpawned} Omnius-spawned`);
|
|
515124
515127
|
lines.push(`Uptime: ${snap.uptime}`);
|
|
515125
515128
|
if (snap.processes.topCpu.length > 0) {
|
|
@@ -516403,6 +516406,7 @@ __export(dist_exports, {
|
|
|
516403
516406
|
addProjectConstraint: () => addProjectConstraint,
|
|
516404
516407
|
addSessionConstraint: () => addSessionConstraint,
|
|
516405
516408
|
applyPatch: () => applyPatch,
|
|
516409
|
+
audioGenerationDir: () => audioGenerationDir,
|
|
516406
516410
|
audioGenerationSetupPlan: () => audioGenerationSetupPlan,
|
|
516407
516411
|
audioGenerationVenvDir: () => audioGenerationVenvDir,
|
|
516408
516412
|
audioOutputDir: () => audioOutputDir,
|
|
@@ -518048,9 +518052,9 @@ var init_verifierRunner = __esm({
|
|
|
518048
518052
|
async executeTests(patch, repoRoot) {
|
|
518049
518053
|
if (patch.testsToRun.length === 0)
|
|
518050
518054
|
return "(no tests specified)";
|
|
518051
|
-
const { execFile:
|
|
518052
|
-
const { promisify:
|
|
518053
|
-
const
|
|
518055
|
+
const { execFile: execFile7 } = await import("node:child_process");
|
|
518056
|
+
const { promisify: promisify7 } = await import("node:util");
|
|
518057
|
+
const execFileAsync5 = promisify7(execFile7);
|
|
518054
518058
|
const outputs = [];
|
|
518055
518059
|
const workDir = this.options.workingDir || repoRoot;
|
|
518056
518060
|
for (const cmd of patch.testsToRun.slice(0, 3)) {
|
|
@@ -518059,7 +518063,7 @@ var init_verifierRunner = __esm({
|
|
|
518059
518063
|
const [bin, ...args] = parts;
|
|
518060
518064
|
if (!bin)
|
|
518061
518065
|
continue;
|
|
518062
|
-
const { stdout, stderr } = await
|
|
518066
|
+
const { stdout, stderr } = await execFileAsync5(bin, args, {
|
|
518063
518067
|
cwd: workDir,
|
|
518064
518068
|
timeout: 6e4,
|
|
518065
518069
|
maxBuffer: 1024 * 1024
|
|
@@ -556517,7 +556521,7 @@ import { EventEmitter as EventEmitter6 } from "node:events";
|
|
|
556517
556521
|
import { randomBytes as randomBytes18 } from "node:crypto";
|
|
556518
556522
|
import { URL as URL2 } from "node:url";
|
|
556519
556523
|
import { loadavg, cpus as cpus2, totalmem as totalmem3, freemem as freemem3 } from "node:os";
|
|
556520
|
-
import { existsSync as existsSync80, readFileSync as readFileSync63, writeFileSync as writeFileSync42, unlinkSync as unlinkSync13, mkdirSync as mkdirSync45, readdirSync as readdirSync25, statSync as statSync28 } from "node:fs";
|
|
556524
|
+
import { existsSync as existsSync80, readFileSync as readFileSync63, writeFileSync as writeFileSync42, unlinkSync as unlinkSync13, mkdirSync as mkdirSync45, readdirSync as readdirSync25, statSync as statSync28, statfsSync as statfsSync2 } from "node:fs";
|
|
556521
556525
|
import { join as join96 } from "node:path";
|
|
556522
556526
|
function cleanForwardHeaders(raw, targetHost) {
|
|
556523
556527
|
const out = {};
|
|
@@ -556607,6 +556611,27 @@ async function collectSystemMetricsAsync() {
|
|
|
556607
556611
|
const totalMem = totalmem3();
|
|
556608
556612
|
const freeMem = freemem3();
|
|
556609
556613
|
const usedMem = totalMem - freeMem;
|
|
556614
|
+
let disk = {
|
|
556615
|
+
path: process.cwd(),
|
|
556616
|
+
totalGB: 0,
|
|
556617
|
+
freeGB: 0,
|
|
556618
|
+
usedGB: 0,
|
|
556619
|
+
utilization: -1
|
|
556620
|
+
};
|
|
556621
|
+
try {
|
|
556622
|
+
const fs10 = statfsSync2(process.cwd());
|
|
556623
|
+
const totalBytes = fs10.blocks * fs10.bsize;
|
|
556624
|
+
const freeBytes = fs10.bavail * fs10.bsize;
|
|
556625
|
+
const usedBytes = totalBytes - freeBytes;
|
|
556626
|
+
disk = {
|
|
556627
|
+
path: process.cwd(),
|
|
556628
|
+
totalGB: Math.round(totalBytes / 1024 ** 3 * 10) / 10,
|
|
556629
|
+
freeGB: Math.round(freeBytes / 1024 ** 3 * 10) / 10,
|
|
556630
|
+
usedGB: Math.round(usedBytes / 1024 ** 3 * 10) / 10,
|
|
556631
|
+
utilization: totalBytes > 0 ? Math.round(usedBytes / totalBytes * 100) : -1
|
|
556632
|
+
};
|
|
556633
|
+
} catch {
|
|
556634
|
+
}
|
|
556610
556635
|
const gpu = {
|
|
556611
556636
|
available: false,
|
|
556612
556637
|
name: "",
|
|
@@ -556649,6 +556674,7 @@ async function collectSystemMetricsAsync() {
|
|
|
556649
556674
|
usedGB: Math.round(usedMem / 1024 ** 3 * 10) / 10,
|
|
556650
556675
|
utilization: Math.round(usedMem / totalMem * 100)
|
|
556651
556676
|
},
|
|
556677
|
+
disk,
|
|
556652
556678
|
gpu,
|
|
556653
556679
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
556654
556680
|
};
|
|
@@ -561457,6 +561483,60 @@ var init_braille_spinner = __esm({
|
|
|
561457
561483
|
}
|
|
561458
561484
|
});
|
|
561459
561485
|
|
|
561486
|
+
// packages/cli/src/tui/disk-monitor.ts
|
|
561487
|
+
import { execFile as execFile5 } from "node:child_process";
|
|
561488
|
+
import { promisify as promisify5 } from "node:util";
|
|
561489
|
+
function unavailableDiskMetrics(path11 = process.cwd()) {
|
|
561490
|
+
return {
|
|
561491
|
+
path: path11,
|
|
561492
|
+
mount: "",
|
|
561493
|
+
totalGB: 0,
|
|
561494
|
+
usedGB: 0,
|
|
561495
|
+
freeGB: 0,
|
|
561496
|
+
util: -1
|
|
561497
|
+
};
|
|
561498
|
+
}
|
|
561499
|
+
async function collectDiskMetrics(path11 = process.cwd()) {
|
|
561500
|
+
if (process.platform === "win32") return unavailableDiskMetrics(path11);
|
|
561501
|
+
try {
|
|
561502
|
+
const { stdout } = await execFileAsync4("df", ["-Pk", path11], {
|
|
561503
|
+
encoding: "utf8",
|
|
561504
|
+
timeout: 3e3,
|
|
561505
|
+
maxBuffer: 128 * 1024
|
|
561506
|
+
});
|
|
561507
|
+
const lines = stdout.trim().split("\n").filter(Boolean);
|
|
561508
|
+
const line = lines[lines.length - 1];
|
|
561509
|
+
if (!line) return unavailableDiskMetrics(path11);
|
|
561510
|
+
const parts = line.trim().split(/\s+/);
|
|
561511
|
+
if (parts.length < 6) return unavailableDiskMetrics(path11);
|
|
561512
|
+
const totalKB = Number(parts[1] ?? 0);
|
|
561513
|
+
const usedKB = Number(parts[2] ?? 0);
|
|
561514
|
+
const freeKB = Number(parts[3] ?? 0);
|
|
561515
|
+
if (!Number.isFinite(totalKB) || totalKB <= 0) return unavailableDiskMetrics(path11);
|
|
561516
|
+
const totalGB = totalKB / (1024 * 1024);
|
|
561517
|
+
const usedGB = usedKB / (1024 * 1024);
|
|
561518
|
+
const freeGB = freeKB / (1024 * 1024);
|
|
561519
|
+
const util2 = Math.max(0, Math.min(100, Math.round(usedKB / totalKB * 100)));
|
|
561520
|
+
return {
|
|
561521
|
+
path: path11,
|
|
561522
|
+
mount: parts.slice(5).join(" "),
|
|
561523
|
+
totalGB: Math.round(totalGB * 10) / 10,
|
|
561524
|
+
usedGB: Math.round(usedGB * 10) / 10,
|
|
561525
|
+
freeGB: Math.round(freeGB * 10) / 10,
|
|
561526
|
+
util: util2
|
|
561527
|
+
};
|
|
561528
|
+
} catch {
|
|
561529
|
+
return unavailableDiskMetrics(path11);
|
|
561530
|
+
}
|
|
561531
|
+
}
|
|
561532
|
+
var execFileAsync4;
|
|
561533
|
+
var init_disk_monitor = __esm({
|
|
561534
|
+
"packages/cli/src/tui/disk-monitor.ts"() {
|
|
561535
|
+
"use strict";
|
|
561536
|
+
execFileAsync4 = promisify5(execFile5);
|
|
561537
|
+
}
|
|
561538
|
+
});
|
|
561539
|
+
|
|
561460
561540
|
// packages/cli/src/tui/system-metrics.ts
|
|
561461
561541
|
var system_metrics_exports = {};
|
|
561462
561542
|
__export(system_metrics_exports, {
|
|
@@ -561574,6 +561654,7 @@ async function collectGpuMetrics() {
|
|
|
561574
561654
|
}
|
|
561575
561655
|
function getInstantSnapshot() {
|
|
561576
561656
|
const cr = collectCpuRam();
|
|
561657
|
+
const disk = unavailableDiskMetrics();
|
|
561577
561658
|
return {
|
|
561578
561659
|
source: "local",
|
|
561579
561660
|
hardware: {
|
|
@@ -561587,7 +561668,12 @@ function getInstantSnapshot() {
|
|
|
561587
561668
|
vramTotalMB: 0,
|
|
561588
561669
|
memUtil: cr.memUtil,
|
|
561589
561670
|
memUsedGB: cr.memUsedGB,
|
|
561590
|
-
memTotalGB: cr.memTotalGB
|
|
561671
|
+
memTotalGB: cr.memTotalGB,
|
|
561672
|
+
diskUtil: disk.util,
|
|
561673
|
+
diskUsedGB: disk.usedGB,
|
|
561674
|
+
diskTotalGB: disk.totalGB,
|
|
561675
|
+
diskFreeGB: disk.freeGB,
|
|
561676
|
+
diskPath: disk.path
|
|
561591
561677
|
},
|
|
561592
561678
|
network: { rxBytesPerSec: 0, txBytesPerSec: 0 }
|
|
561593
561679
|
};
|
|
@@ -561634,8 +561720,9 @@ function collectCpuRam() {
|
|
|
561634
561720
|
}
|
|
561635
561721
|
async function collectLocalMetrics() {
|
|
561636
561722
|
const cpuRam = collectCpuRam();
|
|
561637
|
-
const [gpu, network] = await Promise.all([
|
|
561723
|
+
const [gpu, disk, network] = await Promise.all([
|
|
561638
561724
|
collectGpuMetrics(),
|
|
561725
|
+
collectDiskMetrics(),
|
|
561639
561726
|
collectNetworkMetrics()
|
|
561640
561727
|
]);
|
|
561641
561728
|
return {
|
|
@@ -561651,7 +561738,12 @@ async function collectLocalMetrics() {
|
|
|
561651
561738
|
vramTotalMB: gpu.vramTotalMB,
|
|
561652
561739
|
memUtil: cpuRam.memUtil,
|
|
561653
561740
|
memUsedGB: cpuRam.memUsedGB,
|
|
561654
|
-
memTotalGB: cpuRam.memTotalGB
|
|
561741
|
+
memTotalGB: cpuRam.memTotalGB,
|
|
561742
|
+
diskUtil: disk.util,
|
|
561743
|
+
diskUsedGB: disk.usedGB,
|
|
561744
|
+
diskTotalGB: disk.totalGB,
|
|
561745
|
+
diskFreeGB: disk.freeGB,
|
|
561746
|
+
diskPath: disk.path
|
|
561655
561747
|
},
|
|
561656
561748
|
network
|
|
561657
561749
|
};
|
|
@@ -561660,6 +561752,7 @@ var _lastNetSnapshot, _nvidiaSmiAvailable, _cpuPrevSnapshot, SystemMetricsCollec
|
|
|
561660
561752
|
var init_system_metrics = __esm({
|
|
561661
561753
|
"packages/cli/src/tui/system-metrics.ts"() {
|
|
561662
561754
|
"use strict";
|
|
561755
|
+
init_disk_monitor();
|
|
561663
561756
|
_lastNetSnapshot = null;
|
|
561664
561757
|
_nvidiaSmiAvailable = null;
|
|
561665
561758
|
_cpuPrevSnapshot = null;
|
|
@@ -561720,7 +561813,12 @@ var init_system_metrics = __esm({
|
|
|
561720
561813
|
vramTotalMB: hw.vramTotalMB ?? 0,
|
|
561721
561814
|
memUtil: hw.memUtil ?? -1,
|
|
561722
561815
|
memUsedGB: hw.memUsedGB ?? 0,
|
|
561723
|
-
memTotalGB: hw.memTotalGB ?? 0
|
|
561816
|
+
memTotalGB: hw.memTotalGB ?? 0,
|
|
561817
|
+
diskUtil: hw.diskUtil ?? -1,
|
|
561818
|
+
diskUsedGB: hw.diskUsedGB ?? 0,
|
|
561819
|
+
diskTotalGB: hw.diskTotalGB ?? 0,
|
|
561820
|
+
diskFreeGB: hw.diskFreeGB ?? 0,
|
|
561821
|
+
diskPath: hw.diskPath ?? ""
|
|
561724
561822
|
};
|
|
561725
561823
|
this._latest = {
|
|
561726
561824
|
source: "remote",
|
|
@@ -563780,7 +563878,12 @@ var init_status_bar = __esm({
|
|
|
563780
563878
|
vramTotalMB: metrics2.vramTotalMB ?? 0,
|
|
563781
563879
|
memUtil: metrics2.memUtil,
|
|
563782
563880
|
memTotalGB: metrics2.memTotalGB ?? 0,
|
|
563783
|
-
memUsedGB: metrics2.memUsedGB ?? 0
|
|
563881
|
+
memUsedGB: metrics2.memUsedGB ?? 0,
|
|
563882
|
+
diskUtil: metrics2.diskUtil ?? -1,
|
|
563883
|
+
diskUsedGB: metrics2.diskUsedGB ?? 0,
|
|
563884
|
+
diskTotalGB: metrics2.diskTotalGB ?? 0,
|
|
563885
|
+
diskFreeGB: metrics2.diskFreeGB ?? 0,
|
|
563886
|
+
diskPath: metrics2.diskPath ?? ""
|
|
563784
563887
|
});
|
|
563785
563888
|
}
|
|
563786
563889
|
/** Clear remote metrics and switch back to local collection */
|
|
@@ -563838,7 +563941,12 @@ var init_status_bar = __esm({
|
|
|
563838
563941
|
gpuUtil: data.gpu?.available ? data.gpu.utilization ?? 0 : -1,
|
|
563839
563942
|
gpuName: data.gpu?.name ?? "",
|
|
563840
563943
|
vramUtil: data.gpu?.available ? data.gpu.vramUtilization ?? 0 : -1,
|
|
563841
|
-
memUtil: data.memory?.utilization ?? 0
|
|
563944
|
+
memUtil: data.memory?.utilization ?? 0,
|
|
563945
|
+
diskUtil: data.disk?.utilization ?? -1,
|
|
563946
|
+
diskUsedGB: data.disk?.usedGB ?? 0,
|
|
563947
|
+
diskTotalGB: data.disk?.totalGB ?? 0,
|
|
563948
|
+
diskFreeGB: data.disk?.freeGB ?? 0,
|
|
563949
|
+
diskPath: data.disk?.path ?? ""
|
|
563842
563950
|
});
|
|
563843
563951
|
}
|
|
563844
563952
|
} catch {
|
|
@@ -563937,7 +564045,12 @@ var init_status_bar = __esm({
|
|
|
563937
564045
|
vramTotalMB: m2.gpu?.vramTotalMB ?? 0,
|
|
563938
564046
|
memUtil: m2.memory?.utilization ?? 0,
|
|
563939
564047
|
memTotalGB: m2.memory?.totalGB ?? 0,
|
|
563940
|
-
memUsedGB: m2.memory?.usedGB ?? 0
|
|
564048
|
+
memUsedGB: m2.memory?.usedGB ?? 0,
|
|
564049
|
+
diskUtil: m2.disk?.utilization ?? -1,
|
|
564050
|
+
diskTotalGB: m2.disk?.totalGB ?? 0,
|
|
564051
|
+
diskUsedGB: m2.disk?.usedGB ?? 0,
|
|
564052
|
+
diskFreeGB: m2.disk?.freeGB ?? 0,
|
|
564053
|
+
diskPath: m2.disk?.path ?? ""
|
|
563941
564054
|
});
|
|
563942
564055
|
return;
|
|
563943
564056
|
}
|
|
@@ -565406,6 +565519,14 @@ ${CONTENT_BG_SEQ}`);
|
|
|
565406
565519
|
hwExpW += 5 + `${rm3.memUtil}%`.length + memDetail.length;
|
|
565407
565520
|
hwCompW += 5 + `${rm3.memUtil}%`.length;
|
|
565408
565521
|
}
|
|
565522
|
+
if (rm3.diskUtil >= 0) {
|
|
565523
|
+
const diskColor = rm3.diskUtil > 90 ? c3.red : rm3.diskUtil > 75 ? c3.yellow : c3.green;
|
|
565524
|
+
const diskDetail = rm3.diskTotalGB > 0 ? ` (${rm3.diskFreeGB.toFixed(rm3.diskFreeGB < 10 ? 1 : 0)}GB free)` : "";
|
|
565525
|
+
hwExpStr += ` Disk ${diskColor(rm3.diskUtil + "%")}${c3.dim(diskDetail)}`;
|
|
565526
|
+
hwCompStr += ` Disk ${diskColor(rm3.diskUtil + "%")}`;
|
|
565527
|
+
hwExpW += 6 + `${rm3.diskUtil}%`.length + diskDetail.length;
|
|
565528
|
+
hwCompW += 6 + `${rm3.diskUtil}%`.length;
|
|
565529
|
+
}
|
|
565409
565530
|
if (rm3.gpuUtil >= 0) {
|
|
565410
565531
|
const gpuColor = rm3.gpuUtil > 80 ? c3.red : rm3.gpuUtil > 50 ? c3.yellow : c3.green;
|
|
565411
565532
|
const gpuNameShort = rm3.gpuName ? ` (${rm3.gpuName.slice(0, 20)})` : "";
|
|
@@ -566615,7 +566736,7 @@ ${tuiBgSeq()}`);
|
|
|
566615
566736
|
render2();
|
|
566616
566737
|
}
|
|
566617
566738
|
} else if (seq === "\x1B[3~" && opts.onDelete) {
|
|
566618
|
-
if (!isSkippable(cursor) && matchSet.has(cursor) && items[cursor].key !== activeKey) {
|
|
566739
|
+
if (!isSkippable(cursor) && matchSet.has(cursor) && (opts.allowDeleteActive || items[cursor].key !== activeKey)) {
|
|
566619
566740
|
deleteConfirmIdx = cursor;
|
|
566620
566741
|
deleteConfirmSel = false;
|
|
566621
566742
|
render2();
|
|
@@ -566678,6 +566799,10 @@ ${tuiBgSeq()}`);
|
|
|
566678
566799
|
}
|
|
566679
566800
|
scrollOffset = 0;
|
|
566680
566801
|
render2();
|
|
566802
|
+
} else if (opts.backspaceDeletes && opts.onDelete && !isSkippable(cursor) && matchSet.has(cursor) && (opts.allowDeleteActive || items[cursor].key !== activeKey)) {
|
|
566803
|
+
deleteConfirmIdx = cursor;
|
|
566804
|
+
deleteConfirmSel = false;
|
|
566805
|
+
render2();
|
|
566681
566806
|
} else if (hasBreadcrumbs) {
|
|
566682
566807
|
cleanup();
|
|
566683
566808
|
resolve48({ confirmed: false, key: "__back__", index: cursor });
|
|
@@ -567844,7 +567969,7 @@ __export(setup_exports, {
|
|
|
567844
567969
|
});
|
|
567845
567970
|
import * as readline from "node:readline";
|
|
567846
567971
|
import { execSync as execSync50, spawn as spawn25, exec as exec4 } from "node:child_process";
|
|
567847
|
-
import { promisify as
|
|
567972
|
+
import { promisify as promisify6 } from "node:util";
|
|
567848
567973
|
import { existsSync as existsSync86, writeFileSync as writeFileSync46, readFileSync as readFileSync70, appendFileSync as appendFileSync4, mkdirSync as mkdirSync49 } from "node:fs";
|
|
567849
567974
|
import { join as join103 } from "node:path";
|
|
567850
567975
|
import { homedir as homedir30, platform as platform4 } from "node:os";
|
|
@@ -570226,7 +570351,7 @@ var init_setup = __esm({
|
|
|
570226
570351
|
init_config();
|
|
570227
570352
|
init_dist();
|
|
570228
570353
|
init_tui_select();
|
|
570229
|
-
execAsync2 =
|
|
570354
|
+
execAsync2 = promisify6(exec4);
|
|
570230
570355
|
OMNIUS_FIRST_RUN_BANNER = [
|
|
570231
570356
|
" โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ",
|
|
570232
570357
|
"โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ",
|
|
@@ -579751,6 +579876,7 @@ import {
|
|
|
579751
579876
|
writeFileSync as writeFileSync50,
|
|
579752
579877
|
mkdirSync as mkdirSync53,
|
|
579753
579878
|
readdirSync as readdirSync30,
|
|
579879
|
+
lstatSync,
|
|
579754
579880
|
statSync as statSync34,
|
|
579755
579881
|
rmSync as rmSync3,
|
|
579756
579882
|
appendFileSync as appendFileSync5
|
|
@@ -586365,8 +586491,9 @@ function renderImagePresetDetail(prefix, text) {
|
|
|
586365
586491
|
renderInfo(`${prefix}${first2}`);
|
|
586366
586492
|
for (const line of rest) renderInfo(`${" ".repeat(prefix.length)}${line}`);
|
|
586367
586493
|
}
|
|
586368
|
-
function renderImageModelList() {
|
|
586494
|
+
async function renderImageModelList(ctx3) {
|
|
586369
586495
|
const specs = detectSystemSpecs();
|
|
586496
|
+
const ollamaSizes = ctx3 ? await fetchOllamaModelSizes(ctx3).catch(() => /* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
|
|
586370
586497
|
const hardware = `${specs.totalRamGB.toFixed(0)}GB RAM` + (specs.gpuVramGB > 0 ? ` + ${specs.gpuVramGB.toFixed(0)}GB VRAM (${specs.gpuName || "NVIDIA GPU"})` : " + no NVIDIA VRAM detected");
|
|
586371
586498
|
renderInfo(`Image models for this hardware: ${hardware}`);
|
|
586372
586499
|
renderInfo("Fit legend: 85+ excellent, 60+ comfortable, 40+ offload/quantized, below 40 heavy/cloud.");
|
|
@@ -586384,7 +586511,9 @@ function renderImageModelList() {
|
|
|
586384
586511
|
for (const preset of presets) {
|
|
586385
586512
|
const fit2 = rateImagePresetForHardware(preset, specs);
|
|
586386
586513
|
const primary = category === "Primary hyper-realistic baseline" ? c3.cyan(" โ
") : "";
|
|
586387
|
-
|
|
586514
|
+
const disk = ctx3 ? imageModelDiskStats(ctx3, preset, ollamaSizes) : { downloaded: false, bytes: 0, paths: [] };
|
|
586515
|
+
const diskInfo = disk.downloaded ? ` ${c3.green("โ")} ${formatFileSize(disk.bytes)}` : "";
|
|
586516
|
+
renderInfo(`${imageFitIcon(fit2.score)} ${String(fit2.score).padStart(3)}/100 ${c3.bold(preset.label)}${primary}${diskInfo}`);
|
|
586388
586517
|
renderInfo(` id: ${preset.id}`);
|
|
586389
586518
|
renderInfo(` type: ${preset.backend} ยท ${preset.sizeClass ?? "unknown size"} ยท ${fit2.label}`);
|
|
586390
586519
|
renderImagePresetDetail(" quality: ", preset.quality ?? preset.note);
|
|
@@ -586393,22 +586522,135 @@ function renderImageModelList() {
|
|
|
586393
586522
|
}
|
|
586394
586523
|
}
|
|
586395
586524
|
}
|
|
586525
|
+
function modelCacheSlug(model) {
|
|
586526
|
+
if (!model || !model.includes("/")) return null;
|
|
586527
|
+
return `models--${model.replace(/\//g, "--")}`;
|
|
586528
|
+
}
|
|
586529
|
+
function cacheCandidatePaths(root, model) {
|
|
586530
|
+
const slug = modelCacheSlug(model);
|
|
586531
|
+
if (!slug) return [];
|
|
586532
|
+
return [
|
|
586533
|
+
join110(root, "huggingface", "hub", slug),
|
|
586534
|
+
join110(root, "huggingface", "transformers", slug),
|
|
586535
|
+
join110(root, "huggingface", "diffusers", slug),
|
|
586536
|
+
join110(root, "cache", "huggingface", "hub", slug)
|
|
586537
|
+
];
|
|
586538
|
+
}
|
|
586539
|
+
function directorySizeBytes2(path11, seen = /* @__PURE__ */ new Set()) {
|
|
586540
|
+
try {
|
|
586541
|
+
const stat5 = lstatSync(path11);
|
|
586542
|
+
if (stat5.isSymbolicLink()) return 0;
|
|
586543
|
+
if (stat5.isFile()) return stat5.size;
|
|
586544
|
+
if (!stat5.isDirectory()) return 0;
|
|
586545
|
+
const realKey = `${stat5.dev}:${stat5.ino}`;
|
|
586546
|
+
if (seen.has(realKey)) return 0;
|
|
586547
|
+
seen.add(realKey);
|
|
586548
|
+
let total = 0;
|
|
586549
|
+
for (const entry of readdirSync30(path11)) {
|
|
586550
|
+
total += directorySizeBytes2(join110(path11, entry), seen);
|
|
586551
|
+
}
|
|
586552
|
+
return total;
|
|
586553
|
+
} catch {
|
|
586554
|
+
return 0;
|
|
586555
|
+
}
|
|
586556
|
+
}
|
|
586557
|
+
function cachedModelDiskStats(root, model) {
|
|
586558
|
+
const paths = cacheCandidatePaths(root, model).filter((path11) => existsSync96(path11));
|
|
586559
|
+
const bytes = paths.reduce((sum, path11) => sum + directorySizeBytes2(path11), 0);
|
|
586560
|
+
return { downloaded: paths.length > 0, bytes, paths };
|
|
586561
|
+
}
|
|
586562
|
+
function downloadedModelSuffix(stats) {
|
|
586563
|
+
return stats.downloaded ? ` ยท downloaded ${formatFileSize(stats.bytes)}` : "";
|
|
586564
|
+
}
|
|
586565
|
+
function removeCachedModelPaths(root, model) {
|
|
586566
|
+
const removed = [];
|
|
586567
|
+
for (const path11 of cacheCandidatePaths(root, model)) {
|
|
586568
|
+
if (!existsSync96(path11)) continue;
|
|
586569
|
+
rmSync3(path11, { recursive: true, force: true });
|
|
586570
|
+
removed.push(path11);
|
|
586571
|
+
}
|
|
586572
|
+
return removed;
|
|
586573
|
+
}
|
|
586574
|
+
function ollamaApiBase(ctx3) {
|
|
586575
|
+
return String(ctx3.config.backendUrl || "http://localhost:11434").replace(/\/v1\/?$/, "").replace(/\/$/, "");
|
|
586576
|
+
}
|
|
586577
|
+
async function fetchOllamaModelSizes(ctx3) {
|
|
586578
|
+
const sizes = /* @__PURE__ */ new Map();
|
|
586579
|
+
const resp = await fetch(`${ollamaApiBase(ctx3)}/api/tags`, {
|
|
586580
|
+
signal: AbortSignal.timeout(5e3)
|
|
586581
|
+
});
|
|
586582
|
+
if (!resp.ok) return sizes;
|
|
586583
|
+
const data = await resp.json().catch(() => null);
|
|
586584
|
+
for (const entry of data?.models ?? []) {
|
|
586585
|
+
const size = Number(entry.size ?? 0);
|
|
586586
|
+
if (!Number.isFinite(size) || size <= 0) continue;
|
|
586587
|
+
for (const raw of [entry.name, entry.model]) {
|
|
586588
|
+
if (!raw) continue;
|
|
586589
|
+
sizes.set(raw, size);
|
|
586590
|
+
sizes.set(raw.replace(/:latest$/, ""), size);
|
|
586591
|
+
}
|
|
586592
|
+
}
|
|
586593
|
+
return sizes;
|
|
586594
|
+
}
|
|
586595
|
+
function ollamaModelDiskStats(model, sizes) {
|
|
586596
|
+
const bytes = sizes.get(model) ?? sizes.get(`${model}:latest`) ?? sizes.get(model.replace(/:latest$/, "")) ?? 0;
|
|
586597
|
+
return { downloaded: bytes > 0, bytes, paths: [] };
|
|
586598
|
+
}
|
|
586599
|
+
function imageModelDiskStats(ctx3, preset, ollamaSizes) {
|
|
586600
|
+
if (preset.backend === "ollama") return ollamaModelDiskStats(preset.id, ollamaSizes);
|
|
586601
|
+
if (preset.backend === "diffusers") return cachedModelDiskStats(imageGenerationDir(ctx3.repoRoot), preset.id);
|
|
586602
|
+
return { downloaded: false, bytes: 0, paths: [] };
|
|
586603
|
+
}
|
|
586604
|
+
function audioModelDiskStats(ctx3, preset) {
|
|
586605
|
+
if (preset.backend === "project") return { downloaded: false, bytes: 0, paths: [] };
|
|
586606
|
+
return cachedModelDiskStats(audioGenerationDir(ctx3.repoRoot), preset.id);
|
|
586607
|
+
}
|
|
586608
|
+
async function deleteOllamaWeights(ctx3, model) {
|
|
586609
|
+
const resp = await fetch(`${ollamaApiBase(ctx3)}/api/delete`, {
|
|
586610
|
+
method: "DELETE",
|
|
586611
|
+
headers: { "Content-Type": "application/json" },
|
|
586612
|
+
body: JSON.stringify({ name: model }),
|
|
586613
|
+
signal: AbortSignal.timeout(3e4)
|
|
586614
|
+
});
|
|
586615
|
+
if (resp.status === 404) return `Ollama model not present: ${model}`;
|
|
586616
|
+
if (!resp.ok) {
|
|
586617
|
+
const text = await resp.text().catch(() => "");
|
|
586618
|
+
throw new Error(`Ollama delete failed: HTTP ${resp.status}${text ? ` - ${text.slice(0, 300)}` : ""}`);
|
|
586619
|
+
}
|
|
586620
|
+
return `Deleted Ollama model weights: ${model}`;
|
|
586621
|
+
}
|
|
586622
|
+
async function deleteImageModelWeights(ctx3, preset) {
|
|
586623
|
+
const messages2 = [];
|
|
586624
|
+
if (preset.backend === "ollama") {
|
|
586625
|
+
messages2.push(await deleteOllamaWeights(ctx3, preset.id));
|
|
586626
|
+
} else if (preset.backend === "diffusers") {
|
|
586627
|
+
const removed = removeCachedModelPaths(imageGenerationDir(ctx3.repoRoot), preset.id);
|
|
586628
|
+
messages2.push(removed.length > 0 ? `Deleted ${removed.length} cached image model path(s) for ${preset.id}.` : `No cached image weights found for ${preset.id}.`);
|
|
586629
|
+
} else {
|
|
586630
|
+
messages2.push("stable-diffusion.cpp uses explicit local checkpoint paths; remove the chosen checkpoint file directly if needed.");
|
|
586631
|
+
}
|
|
586632
|
+
return messages2;
|
|
586633
|
+
}
|
|
586396
586634
|
async function showImageModelsMenu(ctx3, hasLocal) {
|
|
586397
586635
|
const settings = resolveSettings(ctx3.repoRoot);
|
|
586398
586636
|
const specs = detectSystemSpecs();
|
|
586637
|
+
const ollamaSizes = await fetchOllamaModelSizes(ctx3).catch(() => /* @__PURE__ */ new Map());
|
|
586638
|
+
const buildModelItem = (preset) => {
|
|
586639
|
+
const fit2 = rateImagePresetForHardware(preset, specs);
|
|
586640
|
+
const disk = imageModelDiskStats(ctx3, preset, ollamaSizes);
|
|
586641
|
+
const downloaded = disk.downloaded ? `${c3.green("โ")} ` : "";
|
|
586642
|
+
return {
|
|
586643
|
+
key: `model:${preset.id}`,
|
|
586644
|
+
label: `${downloaded}${imageFitIcon(fit2.score)} ${String(fit2.score).padStart(3)}/100 ${preset.label}`,
|
|
586645
|
+
detail: `${fit2.score}/100 ${fit2.label} ยท ${preset.category ?? preset.backend} ยท ${preset.sizeClass ?? preset.id}${downloadedModelSuffix(disk)}`
|
|
586646
|
+
};
|
|
586647
|
+
};
|
|
586399
586648
|
const items = [
|
|
586400
586649
|
{ key: "setup:ollama", label: "Setup Ollama", detail: "Pull x/z-image-turbo or x/flux2-klein" },
|
|
586401
586650
|
{ key: "setup:diffusers", label: "Setup Diffusers", detail: "Auto-installs SDXL Turbo under .omnius/image-gen/.venv" },
|
|
586402
586651
|
{ key: "setup:sdcpp", label: "Setup stable-diffusion.cpp", detail: "CPU/GGUF/checkpoint route" },
|
|
586403
586652
|
{ key: "hdr:models", label: selectColors.dim("โโโ Models โโโ") },
|
|
586404
|
-
...IMAGE_GENERATION_MODEL_PRESETS.map(
|
|
586405
|
-
const fit2 = rateImagePresetForHardware(preset, specs);
|
|
586406
|
-
return {
|
|
586407
|
-
key: `model:${preset.id}`,
|
|
586408
|
-
label: `${imageFitIcon(fit2.score)} ${String(fit2.score).padStart(3)}/100 ${preset.label}`,
|
|
586409
|
-
detail: `${fit2.score}/100 ${fit2.label} ยท ${preset.category ?? preset.backend} ยท ${preset.sizeClass ?? preset.id}`
|
|
586410
|
-
};
|
|
586411
|
-
})
|
|
586653
|
+
...IMAGE_GENERATION_MODEL_PRESETS.map(buildModelItem)
|
|
586412
586654
|
];
|
|
586413
586655
|
const result = await tuiSelect({
|
|
586414
586656
|
items,
|
|
@@ -586417,7 +586659,34 @@ async function showImageModelsMenu(ctx3, hasLocal) {
|
|
|
586417
586659
|
skipKeys: ["hdr:models"],
|
|
586418
586660
|
rl: ctx3.rl,
|
|
586419
586661
|
availableRows: ctx3.availableContentRows?.(),
|
|
586420
|
-
customKeyHint: " Enter
|
|
586662
|
+
customKeyHint: " Enter select Del/Backspace delete weights",
|
|
586663
|
+
backspaceDeletes: true,
|
|
586664
|
+
allowDeleteActive: true,
|
|
586665
|
+
onDelete: (item, done) => {
|
|
586666
|
+
if (!item.key.startsWith("model:")) {
|
|
586667
|
+
done(false);
|
|
586668
|
+
return;
|
|
586669
|
+
}
|
|
586670
|
+
const model = item.key.slice("model:".length);
|
|
586671
|
+
const preset = IMAGE_GENERATION_MODEL_PRESETS.find((candidate) => candidate.id === model);
|
|
586672
|
+
if (!preset) {
|
|
586673
|
+
renderWarning(`No image preset found for ${model}`);
|
|
586674
|
+
done(false);
|
|
586675
|
+
return;
|
|
586676
|
+
}
|
|
586677
|
+
deleteImageModelWeights(ctx3, preset).then((messages2) => {
|
|
586678
|
+
for (const message2 of messages2) renderInfo(message2);
|
|
586679
|
+
if (preset.backend === "ollama") {
|
|
586680
|
+
ollamaSizes.delete(preset.id);
|
|
586681
|
+
ollamaSizes.delete(`${preset.id}:latest`);
|
|
586682
|
+
}
|
|
586683
|
+
Object.assign(item, buildModelItem(preset));
|
|
586684
|
+
done(false);
|
|
586685
|
+
}).catch((err) => {
|
|
586686
|
+
renderError(`Image weight delete failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
586687
|
+
done(false);
|
|
586688
|
+
});
|
|
586689
|
+
}
|
|
586421
586690
|
});
|
|
586422
586691
|
if (!result.confirmed || !result.key) return;
|
|
586423
586692
|
if (result.key.startsWith("setup:")) {
|
|
@@ -586469,7 +586738,7 @@ async function handleImageCommand(ctx3, arg, hasLocal) {
|
|
|
586469
586738
|
return "handled";
|
|
586470
586739
|
}
|
|
586471
586740
|
if (parsed.subcommand === "models" || parsed.subcommand === "list") {
|
|
586472
|
-
renderImageModelList();
|
|
586741
|
+
await renderImageModelList(ctx3);
|
|
586473
586742
|
return "handled";
|
|
586474
586743
|
}
|
|
586475
586744
|
if (parsed.subcommand === "setup") {
|
|
@@ -586604,7 +586873,7 @@ function rateAudioPresetForHardware(preset, specs) {
|
|
|
586604
586873
|
function audioFitIcon(score) {
|
|
586605
586874
|
return imageFitIcon(score);
|
|
586606
586875
|
}
|
|
586607
|
-
function renderAudioModelList(kind) {
|
|
586876
|
+
async function renderAudioModelList(ctx3, kind) {
|
|
586608
586877
|
const specs = detectSystemSpecs();
|
|
586609
586878
|
const title = kind === "music" ? "Music" : "Sound";
|
|
586610
586879
|
const hardware = `${specs.totalRamGB.toFixed(0)}GB RAM` + (specs.gpuVramGB > 0 ? ` + ${specs.gpuVramGB.toFixed(0)}GB VRAM (${specs.gpuName || "NVIDIA GPU"})` : " + no NVIDIA VRAM detected");
|
|
@@ -586627,7 +586896,9 @@ function renderAudioModelList(kind) {
|
|
|
586627
586896
|
renderInfo(c3.bold(category));
|
|
586628
586897
|
for (const preset of presets) {
|
|
586629
586898
|
const fit2 = rateAudioPresetForHardware(preset, specs);
|
|
586630
|
-
|
|
586899
|
+
const disk = audioModelDiskStats(ctx3, preset);
|
|
586900
|
+
const diskInfo = disk.downloaded ? ` ${c3.green("โ")} ${formatFileSize(disk.bytes)}` : "";
|
|
586901
|
+
renderInfo(`${audioFitIcon(fit2.score)} ${String(fit2.score).padStart(3)}/100 ${c3.bold(preset.label)}${diskInfo}`);
|
|
586631
586902
|
renderInfo(` id: ${preset.id}`);
|
|
586632
586903
|
renderInfo(` type: ${preset.backend} ยท ${preset.sizeClass} ยท ${fit2.label}`);
|
|
586633
586904
|
renderImagePresetDetail(" quality: ", preset.quality);
|
|
@@ -586637,11 +586908,28 @@ function renderAudioModelList(kind) {
|
|
|
586637
586908
|
}
|
|
586638
586909
|
}
|
|
586639
586910
|
}
|
|
586911
|
+
async function deleteAudioModelWeights(ctx3, preset) {
|
|
586912
|
+
if (preset.backend === "project") {
|
|
586913
|
+
return ["Project audio generation profiles do not own a managed model-weight cache."];
|
|
586914
|
+
}
|
|
586915
|
+
const removed = removeCachedModelPaths(audioGenerationDir(ctx3.repoRoot), preset.id);
|
|
586916
|
+
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}.`];
|
|
586917
|
+
}
|
|
586640
586918
|
async function showAudioGenerationMenu(ctx3, hasLocal, kind) {
|
|
586641
586919
|
const settings = resolveSettings(ctx3.repoRoot);
|
|
586642
586920
|
const specs = detectSystemSpecs();
|
|
586643
586921
|
const activeModel = activeAudioModel(settings, kind);
|
|
586644
586922
|
const title = kind === "music" ? "Music Generation" : "Sound Generation";
|
|
586923
|
+
const buildModelItem = (preset) => {
|
|
586924
|
+
const fit2 = rateAudioPresetForHardware(preset, specs);
|
|
586925
|
+
const disk = audioModelDiskStats(ctx3, preset);
|
|
586926
|
+
const downloaded = disk.downloaded ? `${c3.green("โ")} ` : "";
|
|
586927
|
+
return {
|
|
586928
|
+
key: `model:${preset.id}`,
|
|
586929
|
+
label: `${downloaded}${audioFitIcon(fit2.score)} ${String(fit2.score).padStart(3)}/100 ${preset.label}`,
|
|
586930
|
+
detail: `${fit2.label} ยท ${preset.category} ยท ${preset.sizeClass}${downloadedModelSuffix(disk)}`
|
|
586931
|
+
};
|
|
586932
|
+
};
|
|
586645
586933
|
const setupItems = kind === "music" ? [
|
|
586646
586934
|
{ key: "setup:transformers", label: "Setup Transformers", detail: "Default MusicGen path; avoids AudioCraft/PyAV headers" },
|
|
586647
586935
|
{ key: "setup:audiocraft", label: "Setup AudioCraft", detail: "Optional MusicGen/AudioGen upstream runtime" },
|
|
@@ -586656,14 +586944,7 @@ async function showAudioGenerationMenu(ctx3, hasLocal, kind) {
|
|
|
586656
586944
|
const items = [
|
|
586657
586945
|
...setupItems,
|
|
586658
586946
|
{ key: "hdr:models", label: selectColors.dim("โโโ Models โโโ") },
|
|
586659
|
-
...AUDIO_GENERATION_MODEL_PRESETS.filter((preset) => preset.kind === kind).map(
|
|
586660
|
-
const fit2 = rateAudioPresetForHardware(preset, specs);
|
|
586661
|
-
return {
|
|
586662
|
-
key: `model:${preset.id}`,
|
|
586663
|
-
label: `${audioFitIcon(fit2.score)} ${String(fit2.score).padStart(3)}/100 ${preset.label}`,
|
|
586664
|
-
detail: `${fit2.label} ยท ${preset.category} ยท ${preset.sizeClass}`
|
|
586665
|
-
};
|
|
586666
|
-
})
|
|
586947
|
+
...AUDIO_GENERATION_MODEL_PRESETS.filter((preset) => preset.kind === kind).map(buildModelItem)
|
|
586667
586948
|
];
|
|
586668
586949
|
const result = await tuiSelect({
|
|
586669
586950
|
items,
|
|
@@ -586672,7 +586953,30 @@ async function showAudioGenerationMenu(ctx3, hasLocal, kind) {
|
|
|
586672
586953
|
skipKeys: ["hdr:models"],
|
|
586673
586954
|
rl: ctx3.rl,
|
|
586674
586955
|
availableRows: ctx3.availableContentRows?.(),
|
|
586675
|
-
customKeyHint: " Enter
|
|
586956
|
+
customKeyHint: " Enter select Del/Backspace delete weights",
|
|
586957
|
+
backspaceDeletes: true,
|
|
586958
|
+
allowDeleteActive: true,
|
|
586959
|
+
onDelete: (item, done) => {
|
|
586960
|
+
if (!item.key.startsWith("model:")) {
|
|
586961
|
+
done(false);
|
|
586962
|
+
return;
|
|
586963
|
+
}
|
|
586964
|
+
const model = item.key.slice("model:".length);
|
|
586965
|
+
const preset = AUDIO_GENERATION_MODEL_PRESETS.find((candidate) => candidate.kind === kind && candidate.id === model);
|
|
586966
|
+
if (!preset) {
|
|
586967
|
+
renderWarning(`No ${kind} preset found for ${model}`);
|
|
586968
|
+
done(false);
|
|
586969
|
+
return;
|
|
586970
|
+
}
|
|
586971
|
+
deleteAudioModelWeights(ctx3, preset).then((messages2) => {
|
|
586972
|
+
for (const message2 of messages2) renderInfo(message2);
|
|
586973
|
+
Object.assign(item, buildModelItem(preset));
|
|
586974
|
+
done(false);
|
|
586975
|
+
}).catch((err) => {
|
|
586976
|
+
renderError(`${kind} weight delete failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
586977
|
+
done(false);
|
|
586978
|
+
});
|
|
586979
|
+
}
|
|
586676
586980
|
});
|
|
586677
586981
|
if (!result.confirmed || !result.key) return;
|
|
586678
586982
|
if (result.key.startsWith("setup:")) {
|
|
@@ -586727,7 +587031,7 @@ async function handleAudioGenerationCommand(ctx3, arg, hasLocal, kind) {
|
|
|
586727
587031
|
return "handled";
|
|
586728
587032
|
}
|
|
586729
587033
|
if (parsed.subcommand === "models" || parsed.subcommand === "list") {
|
|
586730
|
-
renderAudioModelList(kind);
|
|
587034
|
+
await renderAudioModelList(ctx3, kind);
|
|
586731
587035
|
return "handled";
|
|
586732
587036
|
}
|
|
586733
587037
|
if (parsed.subcommand === "setup") {
|
|
@@ -587247,7 +587551,9 @@ async function showModelPicker(ctx3, local = false) {
|
|
|
587247
587551
|
function formatFileSize(bytes) {
|
|
587248
587552
|
if (bytes < 1024) return `${bytes}B`;
|
|
587249
587553
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)}KB`;
|
|
587250
|
-
return `${(bytes /
|
|
587554
|
+
if (bytes < 1024 ** 3) return `${(bytes / 1024 ** 2).toFixed(1)}MB`;
|
|
587555
|
+
if (bytes < 1024 ** 4) return `${(bytes / 1024 ** 3).toFixed(1)}GB`;
|
|
587556
|
+
return `${(bytes / 1024 ** 4).toFixed(1)}TB`;
|
|
587251
587557
|
}
|
|
587252
587558
|
async function handleVoiceMenu(ctx3, save2, hasLocal) {
|
|
587253
587559
|
const modeLabels = {
|
|
@@ -597818,7 +598124,7 @@ var init_vision_ingress = __esm({
|
|
|
597818
598124
|
});
|
|
597819
598125
|
|
|
597820
598126
|
// packages/cli/src/tui/telegram-bridge.ts
|
|
597821
|
-
import { mkdirSync as mkdirSync60, existsSync as existsSync106, unlinkSync as unlinkSync21, readdirSync as readdirSync36, statSync as statSync36, readFileSync as readFileSync87, writeFileSync as writeFileSync57 } from "node:fs";
|
|
598127
|
+
import { mkdirSync as mkdirSync60, existsSync as existsSync106, unlinkSync as unlinkSync21, readdirSync as readdirSync36, statSync as statSync36, statfsSync as statfsSync3, readFileSync as readFileSync87, writeFileSync as writeFileSync57 } from "node:fs";
|
|
597822
598128
|
import { join as join121, resolve as resolve39, basename as basename23, relative as relative13, isAbsolute as isAbsolute7, extname as extname15 } from "node:path";
|
|
597823
598129
|
import { writeFile as writeFileAsync } from "node:fs/promises";
|
|
597824
598130
|
import { createHash as createHash19, randomInt } from "node:crypto";
|
|
@@ -598086,12 +598392,28 @@ function buildTelegramRuntimeContext(now = /* @__PURE__ */ new Date(), repoRoot)
|
|
|
598086
598392
|
timeZoneName: "short"
|
|
598087
598393
|
}).format(now);
|
|
598088
598394
|
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone || process.env["TZ"] || "system";
|
|
598395
|
+
let diskLine = "";
|
|
598396
|
+
if (repoRoot) {
|
|
598397
|
+
try {
|
|
598398
|
+
const stats = statfsSync3(repoRoot);
|
|
598399
|
+
const totalBytes = stats.blocks * stats.bsize;
|
|
598400
|
+
const freeBytes = stats.bavail * stats.bsize;
|
|
598401
|
+
const usedBytes = totalBytes - freeBytes;
|
|
598402
|
+
const totalGB = Math.round(totalBytes / 1024 ** 3);
|
|
598403
|
+
const freeGB = Math.round(freeBytes / 1024 ** 3);
|
|
598404
|
+
const usedGB = Math.round(usedBytes / 1024 ** 3);
|
|
598405
|
+
const usedPct = totalBytes > 0 ? Math.round(usedBytes / totalBytes * 100) : 0;
|
|
598406
|
+
diskLine = `Disk: disk_available_gb=${freeGB} disk_used_gb=${usedGB} disk_total_gb=${totalGB} disk_used_pct=${usedPct} path=${repoRoot}`;
|
|
598407
|
+
} catch {
|
|
598408
|
+
}
|
|
598409
|
+
}
|
|
598089
598410
|
return [
|
|
598090
598411
|
`Current date: ${date}`,
|
|
598091
598412
|
`Current time: ${time}`,
|
|
598092
598413
|
`Current ISO timestamp: ${now.toISOString()}`,
|
|
598093
598414
|
`Timezone: ${timezone}`,
|
|
598094
|
-
repoRoot ? `Working directory: ${repoRoot}` : ""
|
|
598415
|
+
repoRoot ? `Working directory: ${repoRoot}` : "",
|
|
598416
|
+
diskLine
|
|
598095
598417
|
].filter(Boolean).join("\n");
|
|
598096
598418
|
}
|
|
598097
598419
|
function telegramSessionIdFromKey(sessionKey) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
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.25",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED