omnius 1.0.389 → 1.0.390
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 +307 -265
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9900,9 +9900,9 @@ var init_vision = __esm({
|
|
|
9900
9900
|
if (ollamaResult)
|
|
9901
9901
|
return ollamaResult;
|
|
9902
9902
|
try {
|
|
9903
|
-
const { execSync:
|
|
9903
|
+
const { execSync: execSync62 } = await import("node:child_process");
|
|
9904
9904
|
try {
|
|
9905
|
-
|
|
9905
|
+
execSync62("pip3 install --user moondream 2>/dev/null || pip install --user moondream 2>/dev/null", {
|
|
9906
9906
|
timeout: 12e4,
|
|
9907
9907
|
stdio: "pipe"
|
|
9908
9908
|
});
|
|
@@ -9915,7 +9915,7 @@ var init_vision = __esm({
|
|
|
9915
9915
|
} catch {
|
|
9916
9916
|
}
|
|
9917
9917
|
try {
|
|
9918
|
-
|
|
9918
|
+
execSync62("ollama pull moondream", { timeout: 3e5, stdio: "pipe" });
|
|
9919
9919
|
const retryOllama = await this.tryOllamaVision(buffer2, filename, action, prompt, length4, start2, preferredModel);
|
|
9920
9920
|
if (retryOllama)
|
|
9921
9921
|
return retryOllama;
|
|
@@ -547162,7 +547162,7 @@ def _omnius_normalized_features(features):
|
|
|
547162
547162
|
});
|
|
547163
547163
|
|
|
547164
547164
|
// packages/execution/dist/tools/visual-memory.js
|
|
547165
|
-
import {
|
|
547165
|
+
import { execFile as execFile6 } from "node:child_process";
|
|
547166
547166
|
import { existsSync as existsSync66, mkdirSync as mkdirSync39, writeFileSync as writeFileSync31, readFileSync as readFileSync47 } from "node:fs";
|
|
547167
547167
|
import { join as join80 } from "node:path";
|
|
547168
547168
|
import { homedir as homedir20, tmpdir as tmpdir16 } from "node:os";
|
|
@@ -547179,6 +547179,26 @@ function stringArg2(args, ...keys) {
|
|
|
547179
547179
|
}
|
|
547180
547180
|
return "";
|
|
547181
547181
|
}
|
|
547182
|
+
function execFileText(file, args, opts) {
|
|
547183
|
+
return new Promise((resolve74, reject) => {
|
|
547184
|
+
execFile6(file, args, {
|
|
547185
|
+
timeout: opts.timeout,
|
|
547186
|
+
env: opts.env,
|
|
547187
|
+
cwd: opts.cwd,
|
|
547188
|
+
maxBuffer: 16 * 1024 * 1024
|
|
547189
|
+
}, (error, stdout, stderr) => {
|
|
547190
|
+
if (error) {
|
|
547191
|
+
Object.assign(error, { stdout, stderr });
|
|
547192
|
+
reject(error);
|
|
547193
|
+
return;
|
|
547194
|
+
}
|
|
547195
|
+
resolve74({
|
|
547196
|
+
stdout: String(stdout ?? ""),
|
|
547197
|
+
stderr: String(stderr ?? "")
|
|
547198
|
+
});
|
|
547199
|
+
});
|
|
547200
|
+
});
|
|
547201
|
+
}
|
|
547182
547202
|
function stringListArg(value2) {
|
|
547183
547203
|
if (Array.isArray(value2)) {
|
|
547184
547204
|
return value2.filter((item) => typeof item === "string" && item.trim().length > 0).map((item) => item.trim());
|
|
@@ -547856,9 +547876,8 @@ ${objects.join("\n") || " (none taught)"}`,
|
|
|
547856
547876
|
async ensureVenv() {
|
|
547857
547877
|
if (existsSync66(VENV_PY)) {
|
|
547858
547878
|
try {
|
|
547859
|
-
|
|
547879
|
+
await execFileText(VENV_PY, ["-c", "import insightface, transformers, torch"], {
|
|
547860
547880
|
timeout: 15e3,
|
|
547861
|
-
stdio: "pipe",
|
|
547862
547881
|
env: visualMemoryPythonEnv()
|
|
547863
547882
|
});
|
|
547864
547883
|
return true;
|
|
@@ -547867,12 +547886,27 @@ ${objects.join("\n") || " (none taught)"}`,
|
|
|
547867
547886
|
}
|
|
547868
547887
|
try {
|
|
547869
547888
|
if (!existsSync66(VENV_PY)) {
|
|
547870
|
-
|
|
547889
|
+
await execFileText("python3", ["-m", "venv", VENV_DIR2], {
|
|
547890
|
+
timeout: 3e4,
|
|
547891
|
+
env: visualMemoryPythonEnv()
|
|
547892
|
+
});
|
|
547871
547893
|
}
|
|
547872
|
-
|
|
547873
|
-
|
|
547874
|
-
|
|
547875
|
-
|
|
547894
|
+
await execFileText(VENV_PIP2, ["install", "setuptools<81", "wheel"], {
|
|
547895
|
+
timeout: 6e4,
|
|
547896
|
+
env: visualMemoryPythonEnv()
|
|
547897
|
+
});
|
|
547898
|
+
await execFileText(VENV_PIP2, ["install", "torch", "torchvision"], {
|
|
547899
|
+
timeout: 6e5,
|
|
547900
|
+
env: visualMemoryPythonEnv()
|
|
547901
|
+
});
|
|
547902
|
+
await execFileText(VENV_PIP2, ["install", "insightface", "onnxruntime", "opencv-python-headless"], {
|
|
547903
|
+
timeout: 3e5,
|
|
547904
|
+
env: visualMemoryPythonEnv()
|
|
547905
|
+
});
|
|
547906
|
+
await execFileText(VENV_PIP2, ["install", "transformers", "pillow"], {
|
|
547907
|
+
timeout: 3e5,
|
|
547908
|
+
env: visualMemoryPythonEnv()
|
|
547909
|
+
});
|
|
547876
547910
|
return true;
|
|
547877
547911
|
} catch {
|
|
547878
547912
|
return false;
|
|
@@ -547882,8 +547916,7 @@ ${objects.join("\n") || " (none taught)"}`,
|
|
|
547882
547916
|
const scriptFile = join80(tmpdir16(), `omnius-vmem-${Date.now()}.py`);
|
|
547883
547917
|
writeFileSync31(scriptFile, script);
|
|
547884
547918
|
try {
|
|
547885
|
-
const output =
|
|
547886
|
-
encoding: "utf8",
|
|
547919
|
+
const { stdout: output } = await execFileText(VENV_PY, [scriptFile], {
|
|
547887
547920
|
timeout: timeoutMs,
|
|
547888
547921
|
env: visualMemoryPythonEnv({ PYTHONUNBUFFERED: "1" })
|
|
547889
547922
|
});
|
|
@@ -547910,7 +547943,7 @@ ${objects.join("\n") || " (none taught)"}`,
|
|
|
547910
547943
|
});
|
|
547911
547944
|
|
|
547912
547945
|
// packages/execution/dist/tools/multimodal-memory.js
|
|
547913
|
-
import { execSync as
|
|
547946
|
+
import { execSync as execSync39 } from "node:child_process";
|
|
547914
547947
|
import { existsSync as existsSync67, mkdirSync as mkdirSync40, writeFileSync as writeFileSync32, readFileSync as readFileSync48, readdirSync as readdirSync22 } from "node:fs";
|
|
547915
547948
|
import { join as join81 } from "node:path";
|
|
547916
547949
|
import { homedir as homedir21, tmpdir as tmpdir17 } from "node:os";
|
|
@@ -547997,10 +548030,10 @@ var init_multimodal_memory = __esm({
|
|
|
547997
548030
|
const imagePath = join81(episodeDir2, "photo.jpg");
|
|
547998
548031
|
const cameraArgs = cameraDevice ? `device=${cameraDevice}` : "";
|
|
547999
548032
|
if (cameraDevice === "qoocam") {
|
|
548000
|
-
|
|
548033
|
+
execSync39(`curl -s --connect-timeout 5 "http://192.168.173.1/osc/commands/execute" -H "Content-Type: application/json" -d '{"name":"camera.takePicture"}' -o /dev/null && sleep 1`, { timeout: 15e3, stdio: "pipe" });
|
|
548001
548034
|
}
|
|
548002
548035
|
try {
|
|
548003
|
-
|
|
548036
|
+
execSync39(`ffmpeg -hide_banner -loglevel error -f v4l2 -video_size 1280x720 -i /dev/video0 -frames:v 1 -q:v 2 -y ${imagePath}`, { timeout: 1e4, stdio: "pipe" });
|
|
548004
548037
|
} catch {
|
|
548005
548038
|
}
|
|
548006
548039
|
if (existsSync67(imagePath)) {
|
|
@@ -548024,7 +548057,7 @@ print(json.dumps(features[0].cpu().numpy().tolist()))
|
|
|
548024
548057
|
`;
|
|
548025
548058
|
const scriptFile = join81(tmpdir17(), `mm-clip-${Date.now()}.py`);
|
|
548026
548059
|
writeFileSync32(scriptFile, clipScript);
|
|
548027
|
-
const clipOutput =
|
|
548060
|
+
const clipOutput = execSync39(`${venvPy} ${scriptFile}`, { encoding: "utf8", timeout: 12e4, env: { ...process.env, PYTHONUNBUFFERED: "1" } });
|
|
548028
548061
|
const embedding = JSON.parse(clipOutput.trim().split("\n").pop());
|
|
548029
548062
|
episode.visual.clipEmbedding = embedding;
|
|
548030
548063
|
results.push(`CLIP embedding computed (${embedding.length}d)`);
|
|
@@ -548046,7 +548079,7 @@ print(json.dumps(result))
|
|
|
548046
548079
|
`;
|
|
548047
548080
|
const scriptFile = join81(tmpdir17(), `mm-face-${Date.now()}.py`);
|
|
548048
548081
|
writeFileSync32(scriptFile, faceScript);
|
|
548049
|
-
const faceOutput =
|
|
548082
|
+
const faceOutput = execSync39(`${venvPy} ${scriptFile}`, { encoding: "utf8", timeout: 6e4, env: { ...process.env, PYTHONUNBUFFERED: "1" } });
|
|
548050
548083
|
const faces = JSON.parse(faceOutput.trim().split("\n").pop());
|
|
548051
548084
|
episode.visual.faceIds = faces.map((_, i2) => `face_${i2}`);
|
|
548052
548085
|
if (faces.length > 0)
|
|
@@ -548062,7 +548095,7 @@ print(json.dumps(result))
|
|
|
548062
548095
|
}
|
|
548063
548096
|
try {
|
|
548064
548097
|
const audioPath = join81(episodeDir2, "audio.wav");
|
|
548065
|
-
|
|
548098
|
+
execSync39(`arecord -D default -f S16_LE -r 16000 -c 1 -d ${duration} -q ${audioPath}`, { timeout: (duration + 5) * 1e3, stdio: "pipe" });
|
|
548066
548099
|
if (existsSync67(audioPath)) {
|
|
548067
548100
|
episode.audio = { transcript: null, soundClass: null, recordingPath: audioPath, rmsDb: null };
|
|
548068
548101
|
results.push(`${duration}s audio recorded`);
|
|
@@ -548098,14 +548131,14 @@ print(classes[top])
|
|
|
548098
548131
|
`;
|
|
548099
548132
|
const scriptFile = join81(tmpdir17(), `mm-yamnet-${Date.now()}.py`);
|
|
548100
548133
|
writeFileSync32(scriptFile, classifyScript);
|
|
548101
|
-
const soundClass =
|
|
548134
|
+
const soundClass = execSync39(`${mlVenvPy} ${scriptFile}`, { encoding: "utf8", timeout: 12e4 }).trim().split("\n").pop();
|
|
548102
548135
|
episode.audio.soundClass = soundClass;
|
|
548103
548136
|
results.push(`Sound: ${soundClass}`);
|
|
548104
548137
|
}
|
|
548105
548138
|
} catch {
|
|
548106
548139
|
}
|
|
548107
548140
|
try {
|
|
548108
|
-
const transcribeResult =
|
|
548141
|
+
const transcribeResult = execSync39(`which transcribe-cli 2>/dev/null && transcribe-cli ${audioPath} 2>/dev/null || echo ""`, { encoding: "utf8", timeout: 6e4 }).trim();
|
|
548109
548142
|
if (transcribeResult && transcribeResult.length > 5) {
|
|
548110
548143
|
episode.audio.transcript = transcribeResult;
|
|
548111
548144
|
results.push(`Transcript: "${transcribeResult.slice(0, 80)}"`);
|
|
@@ -548194,7 +548227,7 @@ else:
|
|
|
548194
548227
|
`;
|
|
548195
548228
|
const scriptFile = join81(tmpdir17(), `mm-enroll-${Date.now()}.py`);
|
|
548196
548229
|
writeFileSync32(scriptFile, enrollScript);
|
|
548197
|
-
const enrollOutput =
|
|
548230
|
+
const enrollOutput = execSync39(`${venvPy} ${scriptFile}`, { encoding: "utf8", timeout: 6e4, env: { ...process.env, PYTHONUNBUFFERED: "1" } });
|
|
548198
548231
|
const enrollResult = JSON.parse(enrollOutput.trim().split("\n").pop());
|
|
548199
548232
|
if (enrollResult.enrolled) {
|
|
548200
548233
|
episode.text.content += `. Face enrolled for recognition (${enrollResult.samples} samples).`;
|
|
@@ -548249,7 +548282,7 @@ print(json.dumps(features[0].cpu().numpy().tolist()))
|
|
|
548249
548282
|
`;
|
|
548250
548283
|
const scriptFile = join81(tmpdir17(), `mm-clipq-${Date.now()}.py`);
|
|
548251
548284
|
writeFileSync32(scriptFile, clipTextScript);
|
|
548252
|
-
const output =
|
|
548285
|
+
const output = execSync39(`${venvPy} ${scriptFile}`, { encoding: "utf8", timeout: 6e4, env: { ...process.env, PYTHONUNBUFFERED: "1" } });
|
|
548253
548286
|
queryClipEmbedding = JSON.parse(output.trim().split("\n").pop());
|
|
548254
548287
|
}
|
|
548255
548288
|
} catch {
|
|
@@ -548497,7 +548530,7 @@ ${lines.join("\n")}`,
|
|
|
548497
548530
|
});
|
|
548498
548531
|
|
|
548499
548532
|
// packages/execution/dist/tools/asr-listen.js
|
|
548500
|
-
import { execSync as
|
|
548533
|
+
import { execSync as execSync40, spawnSync as spawnSync9 } from "node:child_process";
|
|
548501
548534
|
import { existsSync as existsSync68, mkdirSync as mkdirSync41, writeFileSync as writeFileSync33, readFileSync as readFileSync49, unlinkSync as unlinkSync14 } from "node:fs";
|
|
548502
548535
|
import { dirname as dirname21, join as join82, resolve as resolve41 } from "node:path";
|
|
548503
548536
|
import { tmpdir as tmpdir18, homedir as homedir22 } from "node:os";
|
|
@@ -548621,10 +548654,10 @@ var init_asr_listen = __esm({
|
|
|
548621
548654
|
const audioFile = join82(captureDir, `listen-${Date.now()}.wav`);
|
|
548622
548655
|
try {
|
|
548623
548656
|
try {
|
|
548624
|
-
|
|
548625
|
-
|
|
548657
|
+
execSync40(`which pw-record`, { stdio: "pipe", timeout: 2e3 });
|
|
548658
|
+
execSync40(`pw-record --channels 1 --rate 16000 --format s16 ${audioFile} & PID=$!; sleep ${duration}; kill $PID 2>/dev/null; wait $PID 2>/dev/null`, { timeout: (duration + 5) * 1e3, stdio: "pipe", shell: "/bin/bash" });
|
|
548626
548659
|
} catch {
|
|
548627
|
-
|
|
548660
|
+
execSync40(`arecord -D ${device} -f S16_LE -r 16000 -c 1 -d ${duration} -q ${audioFile}`, {
|
|
548628
548661
|
timeout: (duration + 5) * 1e3,
|
|
548629
548662
|
stdio: "pipe"
|
|
548630
548663
|
});
|
|
@@ -548774,7 +548807,7 @@ print(json.dumps({"ok": False, "error": "No whisper backend available"}))
|
|
|
548774
548807
|
if (pyPath.includes("/") && !existsSync68(pyPath))
|
|
548775
548808
|
continue;
|
|
548776
548809
|
try {
|
|
548777
|
-
const output =
|
|
548810
|
+
const output = execSync40(`"${pyPath}" "${scriptFile}"`, {
|
|
548778
548811
|
encoding: "utf8",
|
|
548779
548812
|
timeout: 12e4,
|
|
548780
548813
|
env: asrPythonEnv({ PYTHONUNBUFFERED: "1" })
|
|
@@ -549562,7 +549595,7 @@ var init_agent_tool = __esm({
|
|
|
549562
549595
|
});
|
|
549563
549596
|
|
|
549564
549597
|
// packages/execution/dist/tools/worktree.js
|
|
549565
|
-
import { execSync as
|
|
549598
|
+
import { execSync as execSync41 } from "node:child_process";
|
|
549566
549599
|
import { existsSync as existsSync69, mkdirSync as mkdirSync42, rmSync as rmSync8 } from "node:fs";
|
|
549567
549600
|
import { join as join83, resolve as resolve42 } from "node:path";
|
|
549568
549601
|
function validateSlug(slug) {
|
|
@@ -549581,7 +549614,7 @@ function flattenSlug(slug) {
|
|
|
549581
549614
|
}
|
|
549582
549615
|
function isGitRepo(cwd4) {
|
|
549583
549616
|
try {
|
|
549584
|
-
|
|
549617
|
+
execSync41("git rev-parse --is-inside-work-tree", { cwd: cwd4, stdio: "pipe" });
|
|
549585
549618
|
return true;
|
|
549586
549619
|
} catch {
|
|
549587
549620
|
return false;
|
|
@@ -549589,14 +549622,14 @@ function isGitRepo(cwd4) {
|
|
|
549589
549622
|
}
|
|
549590
549623
|
function getCurrentBranch(cwd4) {
|
|
549591
549624
|
try {
|
|
549592
|
-
return
|
|
549625
|
+
return execSync41("git rev-parse --abbrev-ref HEAD", { cwd: cwd4, stdio: "pipe" }).toString().trim();
|
|
549593
549626
|
} catch {
|
|
549594
549627
|
return void 0;
|
|
549595
549628
|
}
|
|
549596
549629
|
}
|
|
549597
549630
|
function getCurrentCommit(cwd4) {
|
|
549598
549631
|
try {
|
|
549599
|
-
return
|
|
549632
|
+
return execSync41("git rev-parse --short HEAD", { cwd: cwd4, stdio: "pipe" }).toString().trim();
|
|
549600
549633
|
} catch {
|
|
549601
549634
|
return void 0;
|
|
549602
549635
|
}
|
|
@@ -549627,13 +549660,13 @@ function createWorktree(repoRoot, slug) {
|
|
|
549627
549660
|
}
|
|
549628
549661
|
mkdirSync42(worktreeBase, { recursive: true });
|
|
549629
549662
|
try {
|
|
549630
|
-
|
|
549663
|
+
execSync41(`git worktree add "${worktreePath}" -b "${branchName}"`, {
|
|
549631
549664
|
cwd: repoRoot,
|
|
549632
549665
|
stdio: "pipe"
|
|
549633
549666
|
});
|
|
549634
549667
|
} catch (err) {
|
|
549635
549668
|
try {
|
|
549636
|
-
|
|
549669
|
+
execSync41(`git worktree add "${worktreePath}" "${branchName}"`, {
|
|
549637
549670
|
cwd: repoRoot,
|
|
549638
549671
|
stdio: "pipe"
|
|
549639
549672
|
});
|
|
@@ -549655,7 +549688,7 @@ function createWorktree(repoRoot, slug) {
|
|
|
549655
549688
|
}
|
|
549656
549689
|
function worktreeHasChanges(worktreePath) {
|
|
549657
549690
|
try {
|
|
549658
|
-
const status =
|
|
549691
|
+
const status = execSync41("git status --porcelain", {
|
|
549659
549692
|
cwd: worktreePath,
|
|
549660
549693
|
stdio: "pipe"
|
|
549661
549694
|
}).toString().trim();
|
|
@@ -549676,20 +549709,20 @@ function removeWorktree(repoRoot, slug, force = false) {
|
|
|
549676
549709
|
return "Worktree has uncommitted changes. Use force=true to discard, or commit/stash first.";
|
|
549677
549710
|
}
|
|
549678
549711
|
try {
|
|
549679
|
-
|
|
549712
|
+
execSync41(`git worktree remove "${worktreePath}" ${force ? "--force" : ""}`, {
|
|
549680
549713
|
cwd: repoRoot,
|
|
549681
549714
|
stdio: "pipe"
|
|
549682
549715
|
});
|
|
549683
549716
|
} catch (err) {
|
|
549684
549717
|
try {
|
|
549685
549718
|
rmSync8(worktreePath, { recursive: true, force: true });
|
|
549686
|
-
|
|
549719
|
+
execSync41("git worktree prune", { cwd: repoRoot, stdio: "pipe" });
|
|
549687
549720
|
} catch {
|
|
549688
549721
|
return `Failed to remove worktree: ${err}`;
|
|
549689
549722
|
}
|
|
549690
549723
|
}
|
|
549691
549724
|
try {
|
|
549692
|
-
|
|
549725
|
+
execSync41(`git branch -D "${branchName}"`, { cwd: repoRoot, stdio: "pipe" });
|
|
549693
549726
|
} catch {
|
|
549694
549727
|
}
|
|
549695
549728
|
_sessions.delete(slug);
|
|
@@ -552211,7 +552244,7 @@ List cells or retry with exact current source.`,
|
|
|
552211
552244
|
});
|
|
552212
552245
|
|
|
552213
552246
|
// packages/execution/dist/tools/environment-snapshot.js
|
|
552214
|
-
import { execSync as
|
|
552247
|
+
import { execSync as execSync42 } from "node:child_process";
|
|
552215
552248
|
import { cpus as cpus2, totalmem as totalmem3, freemem as freemem2, hostname as hostname2, platform as platform2, arch, uptime } from "node:os";
|
|
552216
552249
|
import { statfsSync as statfsSync4 } from "node:fs";
|
|
552217
552250
|
function collectSnapshot(workingDir) {
|
|
@@ -552229,7 +552262,7 @@ function collectSnapshot(workingDir) {
|
|
|
552229
552262
|
}
|
|
552230
552263
|
let gpu = void 0;
|
|
552231
552264
|
try {
|
|
552232
|
-
const nvOut =
|
|
552265
|
+
const nvOut = execSync42("nvidia-smi --query-gpu=name,memory.total,memory.used,temperature.gpu --format=csv,noheader,nounits", { encoding: "utf-8", timeout: 3e3, stdio: ["pipe", "pipe", "pipe"] }).trim().split(",").map((s2) => s2.trim());
|
|
552233
552266
|
if (nvOut.length >= 3) {
|
|
552234
552267
|
gpu = {
|
|
552235
552268
|
name: nvOut[0],
|
|
@@ -552244,12 +552277,12 @@ function collectSnapshot(workingDir) {
|
|
|
552244
552277
|
let battery = void 0;
|
|
552245
552278
|
try {
|
|
552246
552279
|
if (platform2() === "linux") {
|
|
552247
|
-
const cap =
|
|
552248
|
-
const status =
|
|
552280
|
+
const cap = execSync42("cat /sys/class/power_supply/BAT0/capacity 2>/dev/null", { encoding: "utf-8", timeout: 1e3 }).trim();
|
|
552281
|
+
const status = execSync42("cat /sys/class/power_supply/BAT0/status 2>/dev/null", { encoding: "utf-8", timeout: 1e3 }).trim();
|
|
552249
552282
|
if (cap)
|
|
552250
552283
|
battery = { percent: parseInt(cap, 10), charging: status === "Charging" || status === "Full" };
|
|
552251
552284
|
} else if (platform2() === "darwin") {
|
|
552252
|
-
const pmOut =
|
|
552285
|
+
const pmOut = execSync42("pmset -g batt", { encoding: "utf-8", timeout: 2e3 });
|
|
552253
552286
|
const match = pmOut.match(/(\d+)%;\s*(charging|discharging|charged)/i);
|
|
552254
552287
|
if (match)
|
|
552255
552288
|
battery = { percent: parseInt(match[1], 10), charging: match[2].toLowerCase() !== "discharging" };
|
|
@@ -552273,8 +552306,8 @@ function collectSnapshot(workingDir) {
|
|
|
552273
552306
|
}
|
|
552274
552307
|
let processInfo = { total: 0, nodeCount: 0, omniusSpawned: 0, topCpu: [] };
|
|
552275
552308
|
try {
|
|
552276
|
-
const psLines =
|
|
552277
|
-
const total = parseInt(
|
|
552309
|
+
const psLines = execSync42("ps -eo pid,%cpu,args --sort=-%cpu --no-headers 2>/dev/null | head -50", { encoding: "utf-8", timeout: 3e3, stdio: ["pipe", "pipe", "pipe"] }).trim().split("\n");
|
|
552310
|
+
const total = parseInt(execSync42("ps aux | wc -l", { encoding: "utf-8", timeout: 2e3 }).trim(), 10);
|
|
552278
552311
|
let nodeCount = 0;
|
|
552279
552312
|
let omniusSpawned = 0;
|
|
552280
552313
|
const topCpu = [];
|
|
@@ -552355,7 +552388,7 @@ var init_environment_snapshot = __esm({
|
|
|
552355
552388
|
});
|
|
552356
552389
|
|
|
552357
552390
|
// packages/execution/dist/tools/video-understand.js
|
|
552358
|
-
import { execSync as
|
|
552391
|
+
import { execSync as execSync43 } from "node:child_process";
|
|
552359
552392
|
import { existsSync as existsSync74, mkdirSync as mkdirSync45, writeFileSync as writeFileSync37, readFileSync as readFileSync54, readdirSync as readdirSync24, unlinkSync as unlinkSync16 } from "node:fs";
|
|
552360
552393
|
import { join as join87, basename as basename17, isAbsolute as isAbsolute6, resolve as resolve44 } from "node:path";
|
|
552361
552394
|
import { createHash as createHash24 } from "node:crypto";
|
|
@@ -552364,11 +552397,11 @@ function isYouTubeUrl2(url) {
|
|
|
552364
552397
|
}
|
|
552365
552398
|
function ensureYtDlp2() {
|
|
552366
552399
|
try {
|
|
552367
|
-
|
|
552400
|
+
execSync43("yt-dlp --version", { timeout: 5e3, stdio: "pipe" });
|
|
552368
552401
|
return true;
|
|
552369
552402
|
} catch {
|
|
552370
552403
|
try {
|
|
552371
|
-
|
|
552404
|
+
execSync43("pip3 install --break-system-packages yt-dlp 2>/dev/null || pip3 install --user yt-dlp 2>/dev/null", { timeout: 6e4, stdio: "pipe" });
|
|
552372
552405
|
return true;
|
|
552373
552406
|
} catch {
|
|
552374
552407
|
return false;
|
|
@@ -552377,7 +552410,7 @@ function ensureYtDlp2() {
|
|
|
552377
552410
|
}
|
|
552378
552411
|
function ensureFfmpeg() {
|
|
552379
552412
|
try {
|
|
552380
|
-
|
|
552413
|
+
execSync43("ffmpeg -version", { timeout: 3e3, stdio: "pipe" });
|
|
552381
552414
|
return true;
|
|
552382
552415
|
} catch {
|
|
552383
552416
|
return false;
|
|
@@ -552388,7 +552421,7 @@ function shellQuote(value2) {
|
|
|
552388
552421
|
}
|
|
552389
552422
|
function probeVideo(videoPath) {
|
|
552390
552423
|
try {
|
|
552391
|
-
const raw =
|
|
552424
|
+
const raw = execSync43(`ffprobe -v quiet -print_format json -show_format -show_streams ${shellQuote(videoPath)}`, { encoding: "utf-8", timeout: 15e3, stdio: ["pipe", "pipe", "pipe"] });
|
|
552392
552425
|
return JSON.parse(raw);
|
|
552393
552426
|
} catch {
|
|
552394
552427
|
return null;
|
|
@@ -552408,7 +552441,7 @@ function probeDurationSeconds(videoPath, probe) {
|
|
|
552408
552441
|
if (candidates.length > 0)
|
|
552409
552442
|
return Math.max(...candidates);
|
|
552410
552443
|
try {
|
|
552411
|
-
const raw =
|
|
552444
|
+
const raw = execSync43(`ffprobe -v error -show_entries format=duration -of default=nk=1:nw=1 ${shellQuote(videoPath)}`, { encoding: "utf-8", timeout: 1e4, stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
552412
552445
|
const parsed = Number(raw);
|
|
552413
552446
|
return Number.isFinite(parsed) && parsed > 0 ? parsed : 0;
|
|
552414
552447
|
} catch {
|
|
@@ -552427,7 +552460,7 @@ function extractAudioIfPresent(videoPath, audioPath, probe) {
|
|
|
552427
552460
|
return { available: false, status: "no audio track detected; transcription skipped" };
|
|
552428
552461
|
}
|
|
552429
552462
|
try {
|
|
552430
|
-
|
|
552463
|
+
execSync43(`ffmpeg -y -i ${shellQuote(videoPath)} -map 0:a:0 -vn -acodec libmp3lame -q:a 5 ${shellQuote(audioPath)}`, { timeout: 12e4, stdio: "pipe" });
|
|
552431
552464
|
if (existsSync74(audioPath))
|
|
552432
552465
|
return { available: true, status: "audio extracted" };
|
|
552433
552466
|
return { available: false, status: "audio stream detected but extraction produced no file" };
|
|
@@ -552588,22 +552621,22 @@ var init_video_understand = __esm({
|
|
|
552588
552621
|
return { success: false, output: "", error: "yt-dlp required but not available. Install: pip3 install yt-dlp", durationMs: performance.now() - start2 };
|
|
552589
552622
|
}
|
|
552590
552623
|
try {
|
|
552591
|
-
|
|
552624
|
+
execSync43(`yt-dlp -f "worst[ext=mp4]" -o "${join87(tmpDir, "video.%(ext)s")}" "${url}"`, { timeout: 3e5, stdio: "pipe" });
|
|
552592
552625
|
} catch {
|
|
552593
|
-
|
|
552626
|
+
execSync43(`yt-dlp -f worst -o "${join87(tmpDir, "video.%(ext)s")}" "${url}"`, { timeout: 3e5, stdio: "pipe" });
|
|
552594
552627
|
}
|
|
552595
552628
|
try {
|
|
552596
|
-
|
|
552629
|
+
execSync43(`yt-dlp -x --audio-format mp3 --audio-quality 5 -o ${shellQuote(join87(tmpDir, "audio.%(ext)s"))} ${shellQuote(url)}`, { timeout: 3e5, stdio: "pipe" });
|
|
552597
552630
|
} catch (err) {
|
|
552598
552631
|
const message2 = err instanceof Error ? err.message : String(err);
|
|
552599
552632
|
audioStatus = `audio download failed; transcription skipped: ${message2.slice(0, 160)}`;
|
|
552600
552633
|
}
|
|
552601
552634
|
try {
|
|
552602
|
-
title =
|
|
552635
|
+
title = execSync43(`yt-dlp --get-title ${shellQuote(url)}`, { encoding: "utf-8", timeout: 15e3, stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
552603
552636
|
} catch {
|
|
552604
552637
|
}
|
|
552605
552638
|
} else {
|
|
552606
|
-
|
|
552639
|
+
execSync43(`curl -sL -o ${shellQuote(join87(tmpDir, "video.mp4"))} ${shellQuote(url)}`, { timeout: 3e5, stdio: "pipe" });
|
|
552607
552640
|
}
|
|
552608
552641
|
videoPath = readdirSync24(tmpDir).find((f2) => f2.startsWith("video")) ? join87(tmpDir, readdirSync24(tmpDir).find((f2) => f2.startsWith("video"))) : join87(tmpDir, "video.mp4");
|
|
552609
552642
|
audioPath = readdirSync24(tmpDir).find((f2) => f2.startsWith("audio")) ? join87(tmpDir, readdirSync24(tmpDir).find((f2) => f2.startsWith("audio"))) : join87(tmpDir, "audio.mp3");
|
|
@@ -552635,7 +552668,7 @@ var init_video_understand = __esm({
|
|
|
552635
552668
|
let duration = probedDuration;
|
|
552636
552669
|
if (audioAvailable) {
|
|
552637
552670
|
try {
|
|
552638
|
-
|
|
552671
|
+
execSync43(`transcribe-cli transcribe ${shellQuote(audioPath)} --model ${whisperModel} --format json -o ${shellQuote(tmpDir)}`, { timeout: 6e5, stdio: "pipe" });
|
|
552639
552672
|
const jsonFile = readdirSync24(tmpDir).find((f2) => f2.endsWith(".json") && f2 !== "result.json");
|
|
552640
552673
|
if (jsonFile) {
|
|
552641
552674
|
const data = JSON.parse(readFileSync54(join87(tmpDir, jsonFile), "utf-8"));
|
|
@@ -552682,7 +552715,7 @@ var init_video_understand = __esm({
|
|
|
552682
552715
|
const fps = 25;
|
|
552683
552716
|
const intervalFrames = Math.max(1, frameInterval * fps);
|
|
552684
552717
|
try {
|
|
552685
|
-
|
|
552718
|
+
execSync43(`ffmpeg -y -i ${shellQuote(videoPath)} -vf ${shellQuote(`select='gt(scene\\,${sceneThreshold})+not(mod(n\\,${intervalFrames}))',showinfo`)} -vsync vfr ${shellQuote(join87(framesDir, "frame_%04d.jpg"))}`, { timeout: 3e5, stdio: "pipe" });
|
|
552686
552719
|
} catch {
|
|
552687
552720
|
}
|
|
552688
552721
|
const extractedCount = (() => {
|
|
@@ -552695,7 +552728,7 @@ var init_video_understand = __esm({
|
|
|
552695
552728
|
if (extractedCount < minFrames) {
|
|
552696
552729
|
try {
|
|
552697
552730
|
const fallbackFilter = duration > 20 ? `fps=1/${Math.max(1, Math.floor(frameInterval))}` : "fps=1";
|
|
552698
|
-
|
|
552731
|
+
execSync43(`ffmpeg -y -i ${shellQuote(videoPath)} -vf ${shellQuote(fallbackFilter)} -q:v 2 ${shellQuote(join87(framesDir, "interval_%04d.jpg"))}`, { timeout: 3e5, stdio: "pipe" });
|
|
552699
552732
|
} catch {
|
|
552700
552733
|
}
|
|
552701
552734
|
}
|
|
@@ -552842,7 +552875,7 @@ Topic: ${(segments.slice(0, 5).map((s2) => s2.text).join(" ") || audioComprehens
|
|
|
552842
552875
|
}
|
|
552843
552876
|
}
|
|
552844
552877
|
try {
|
|
552845
|
-
|
|
552878
|
+
execSync43(`rm -rf ${shellQuote(tmpDir)}`, { timeout: 1e4, stdio: "pipe" });
|
|
552846
552879
|
} catch {
|
|
552847
552880
|
}
|
|
552848
552881
|
return {
|
|
@@ -558146,9 +558179,9 @@ var init_verifierRunner = __esm({
|
|
|
558146
558179
|
async executeTests(patch, repoRoot) {
|
|
558147
558180
|
if (patch.testsToRun.length === 0)
|
|
558148
558181
|
return "(no tests specified)";
|
|
558149
|
-
const { execFile:
|
|
558182
|
+
const { execFile: execFile10 } = await import("node:child_process");
|
|
558150
558183
|
const { promisify: promisify9 } = await import("node:util");
|
|
558151
|
-
const execFileAsync6 = promisify9(
|
|
558184
|
+
const execFileAsync6 = promisify9(execFile10);
|
|
558152
558185
|
const outputs = [];
|
|
558153
558186
|
const workDir = this.options.workingDir || repoRoot;
|
|
558154
558187
|
for (const cmd of patch.testsToRun.slice(0, 3)) {
|
|
@@ -560013,7 +560046,7 @@ __export(ollama_pool_cleanup_exports, {
|
|
|
560013
560046
|
cleanupStaleOllamaProcesses: () => cleanupStaleOllamaProcesses,
|
|
560014
560047
|
scanOllamaProcesses: () => scanOllamaProcesses
|
|
560015
560048
|
});
|
|
560016
|
-
import { execFile as
|
|
560049
|
+
import { execFile as execFile7 } from "node:child_process";
|
|
560017
560050
|
import { readdir as readdir6, readFile as fsReadFile, readlink } from "node:fs/promises";
|
|
560018
560051
|
import { basename as basename20 } from "node:path";
|
|
560019
560052
|
async function scanOllamaProcesses(options2 = {}) {
|
|
@@ -560334,7 +560367,7 @@ async function maybeApplyInference(scan, options2, system) {
|
|
|
560334
560367
|
function makeSystem(overrides) {
|
|
560335
560368
|
const base3 = {
|
|
560336
560369
|
runCommand: (command, args, timeoutMs) => new Promise((resolve74, reject) => {
|
|
560337
|
-
|
|
560370
|
+
execFile7(command, args, { encoding: "utf8", timeout: timeoutMs }, (err, stdout) => {
|
|
560338
560371
|
if (err)
|
|
560339
560372
|
reject(err);
|
|
560340
560373
|
else
|
|
@@ -563960,7 +563993,7 @@ var init_backward_pass_critic = __esm({
|
|
|
563960
563993
|
|
|
563961
563994
|
// packages/orchestrator/dist/backward-pass-runner.js
|
|
563962
563995
|
import { existsSync as existsSync92, readFileSync as readFileSync69, statSync as statSync35 } from "node:fs";
|
|
563963
|
-
import { execSync as
|
|
563996
|
+
import { execSync as execSync44 } from "node:child_process";
|
|
563964
563997
|
import { isAbsolute as isAbsolute11, join as join102, relative as relative9 } from "node:path";
|
|
563965
563998
|
function collectDiff(opts) {
|
|
563966
563999
|
const cap = Math.max(1, opts.maxFiles);
|
|
@@ -563981,7 +564014,7 @@ function collectDiff(opts) {
|
|
|
563981
564014
|
}
|
|
563982
564015
|
if (existsSync92(join102(opts.workingDir, ".git"))) {
|
|
563983
564016
|
try {
|
|
563984
|
-
const out =
|
|
564017
|
+
const out = execSync44("git diff --name-status HEAD 2>/dev/null; git ls-files --others --exclude-standard 2>/dev/null", { cwd: opts.workingDir, encoding: "utf-8", maxBuffer: 4 * 1024 * 1024, stdio: ["ignore", "pipe", "ignore"] });
|
|
563985
564018
|
const files = [];
|
|
563986
564019
|
for (const line of out.split(/\r?\n/)) {
|
|
563987
564020
|
if (!line.trim())
|
|
@@ -567042,12 +567075,12 @@ var init_tool_batching = __esm({
|
|
|
567042
567075
|
});
|
|
567043
567076
|
|
|
567044
567077
|
// packages/orchestrator/dist/hooks.js
|
|
567045
|
-
import { execSync as
|
|
567078
|
+
import { execSync as execSync45 } from "node:child_process";
|
|
567046
567079
|
function executeHook(hook, env2 = {}) {
|
|
567047
567080
|
const start2 = performance.now();
|
|
567048
567081
|
const timeout2 = hook.timeoutMs ?? DEFAULT_HOOK_TIMEOUT;
|
|
567049
567082
|
try {
|
|
567050
|
-
const output =
|
|
567083
|
+
const output = execSync45(hook.command, {
|
|
567051
567084
|
timeout: timeout2,
|
|
567052
567085
|
env: { ...process.env, ...env2 },
|
|
567053
567086
|
encoding: "utf8",
|
|
@@ -568932,10 +568965,11 @@ function recordContextWindowDump(input) {
|
|
|
568932
568965
|
try {
|
|
568933
568966
|
mkdirSync56(dir, { recursive: true });
|
|
568934
568967
|
const filePath = join107(dir, `${record.id}.json`);
|
|
568935
|
-
|
|
568936
|
-
writeFileSync46(
|
|
568968
|
+
const payload = JSON.stringify(record, null, 2);
|
|
568969
|
+
writeFileSync46(filePath, payload, "utf-8");
|
|
568970
|
+
writeFileSync46(join107(dir, "latest.json"), payload, "utf-8");
|
|
568937
568971
|
appendFileSync8(join107(dir, "index.jsonl"), JSON.stringify(toSummary(record, filePath)) + "\n", "utf-8");
|
|
568938
|
-
|
|
568972
|
+
maybePruneOldDumpFiles(dir);
|
|
568939
568973
|
} catch {
|
|
568940
568974
|
return null;
|
|
568941
568975
|
}
|
|
@@ -569082,6 +569116,13 @@ function toSummary(record, path12) {
|
|
|
569082
569116
|
const { request: _request, ...summary } = record;
|
|
569083
569117
|
return { ...summary, path: path12 };
|
|
569084
569118
|
}
|
|
569119
|
+
function maybePruneOldDumpFiles(dir) {
|
|
569120
|
+
const now2 = Date.now();
|
|
569121
|
+
if (now2 - lastPruneAtMs < 3e4)
|
|
569122
|
+
return;
|
|
569123
|
+
lastPruneAtMs = now2;
|
|
569124
|
+
pruneOldDumpFiles(dir);
|
|
569125
|
+
}
|
|
569085
569126
|
function compactFocusSupervisor(input) {
|
|
569086
569127
|
const directive = input.directive ? {
|
|
569087
569128
|
id: input.directive.id,
|
|
@@ -569133,12 +569174,13 @@ function defaultContextWindowDumpLocations(cwd4 = process.cwd()) {
|
|
|
569133
569174
|
locations.unshift(resolve50(envDir));
|
|
569134
569175
|
return [...new Set(locations)];
|
|
569135
569176
|
}
|
|
569136
|
-
var IMAGE_BASE64_RE, DEFAULT_MAX_FILES;
|
|
569177
|
+
var IMAGE_BASE64_RE, DEFAULT_MAX_FILES, lastPruneAtMs;
|
|
569137
569178
|
var init_contextWindowDump = __esm({
|
|
569138
569179
|
"packages/orchestrator/dist/contextWindowDump.js"() {
|
|
569139
569180
|
"use strict";
|
|
569140
569181
|
IMAGE_BASE64_RE = /\[IMAGE_BASE64:[^\]]+\]/g;
|
|
569141
569182
|
DEFAULT_MAX_FILES = 200;
|
|
569183
|
+
lastPruneAtMs = 0;
|
|
569142
569184
|
}
|
|
569143
569185
|
});
|
|
569144
569186
|
|
|
@@ -570952,7 +570994,7 @@ __export(preflightSnapshot_exports, {
|
|
|
570952
570994
|
freeDiskBytes: () => freeDiskBytes
|
|
570953
570995
|
});
|
|
570954
570996
|
import { existsSync as existsSync98, readFileSync as readFileSync75, statSync as statSync37 } from "node:fs";
|
|
570955
|
-
import { execSync as
|
|
570997
|
+
import { execSync as execSync46 } from "node:child_process";
|
|
570956
570998
|
import { homedir as homedir33, platform as platform3, arch as arch2, totalmem as totalmem4, freemem as freemem3, hostname as hostname3 } from "node:os";
|
|
570957
570999
|
import { join as join108 } from "node:path";
|
|
570958
571000
|
import { createHash as createHash28 } from "node:crypto";
|
|
@@ -571108,7 +571150,7 @@ function captureToolchainVersions() {
|
|
|
571108
571150
|
const out = {};
|
|
571109
571151
|
for (const probe of TOOLCHAIN_PROBES) {
|
|
571110
571152
|
try {
|
|
571111
|
-
const v =
|
|
571153
|
+
const v = execSync46(probe.cmd, {
|
|
571112
571154
|
encoding: "utf8",
|
|
571113
571155
|
stdio: ["ignore", "pipe", "ignore"],
|
|
571114
571156
|
timeout: 500
|
|
@@ -571133,7 +571175,7 @@ function freeDiskBytes(path12 = "/tmp") {
|
|
|
571133
571175
|
const st = statSync37(path12);
|
|
571134
571176
|
if (!st.isDirectory())
|
|
571135
571177
|
return -1;
|
|
571136
|
-
const out =
|
|
571178
|
+
const out = execSync46(`df -P -k ${JSON.stringify(path12)} | tail -1`, {
|
|
571137
571179
|
encoding: "utf8",
|
|
571138
571180
|
timeout: 500
|
|
571139
571181
|
});
|
|
@@ -579157,8 +579199,8 @@ Respond with your assessment, then take action.`;
|
|
|
579157
579199
|
const memMod = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
|
579158
579200
|
let commitSha = "no-commit";
|
|
579159
579201
|
try {
|
|
579160
|
-
const { execSync:
|
|
579161
|
-
commitSha =
|
|
579202
|
+
const { execSync: execSync62 } = await import("node:child_process");
|
|
579203
|
+
commitSha = execSync62("git rev-parse HEAD", {
|
|
579162
579204
|
cwd: this._workingDirectory,
|
|
579163
579205
|
stdio: ["ignore", "pipe", "ignore"]
|
|
579164
579206
|
}).toString().trim().slice(0, 12) || "no-commit";
|
|
@@ -589926,7 +589968,7 @@ ${result}`
|
|
|
589926
589968
|
const buffer2 = Buffer.from(rawBase64, "base64");
|
|
589927
589969
|
let resizedBase64 = null;
|
|
589928
589970
|
try {
|
|
589929
|
-
const { execSync:
|
|
589971
|
+
const { execSync: execSync62 } = await import("node:child_process");
|
|
589930
589972
|
const { writeFileSync: writeFileSync91, readFileSync: readFileSync133, unlinkSync: unlinkSync37 } = await import("node:fs");
|
|
589931
589973
|
const { join: join180 } = await import("node:path");
|
|
589932
589974
|
const { tmpdir: tmpdir24 } = await import("node:os");
|
|
@@ -589936,7 +589978,7 @@ ${result}`
|
|
|
589936
589978
|
const pyBin = process.platform === "win32" ? "python" : "python3";
|
|
589937
589979
|
const escapedIn = tmpIn.replace(/\\/g, "\\\\");
|
|
589938
589980
|
const escapedOut = tmpOut.replace(/\\/g, "\\\\");
|
|
589939
|
-
|
|
589981
|
+
execSync62(`${pyBin} -c "from PIL import Image; img = Image.open('${escapedIn}'); img.thumbnail((512, 512), Image.LANCZOS); img = img.convert('RGB'); img.save('${escapedOut}', 'JPEG', quality=75)"`, { timeout: 1e4, stdio: "pipe" });
|
|
589940
589982
|
const resizedBuf = readFileSync133(tmpOut);
|
|
589941
589983
|
resizedBase64 = `data:image/jpeg;base64,${resizedBuf.toString("base64")}`;
|
|
589942
589984
|
try {
|
|
@@ -590035,8 +590077,8 @@ ${result}`
|
|
|
590035
590077
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
590036
590078
|
});
|
|
590037
590079
|
try {
|
|
590038
|
-
const { execSync:
|
|
590039
|
-
|
|
590080
|
+
const { execSync: execSync62 } = await import("node:child_process");
|
|
590081
|
+
execSync62("ollama pull moondream", {
|
|
590040
590082
|
timeout: 3e5,
|
|
590041
590083
|
stdio: "pipe"
|
|
590042
590084
|
});
|
|
@@ -596724,7 +596766,7 @@ var init_missionSystem = __esm({
|
|
|
596724
596766
|
});
|
|
596725
596767
|
|
|
596726
596768
|
// packages/orchestrator/dist/context-references.js
|
|
596727
|
-
import { execSync as
|
|
596769
|
+
import { execSync as execSync47 } from "node:child_process";
|
|
596728
596770
|
import { readFileSync as readFileSync83, readdirSync as readdirSync33, statSync as statSync40 } from "node:fs";
|
|
596729
596771
|
import { homedir as homedir35 } from "node:os";
|
|
596730
596772
|
import { join as join118, resolve as resolve51, relative as relative10, sep as sep3, extname as extname13 } from "node:path";
|
|
@@ -596978,7 +597020,7 @@ ${listing}`];
|
|
|
596978
597020
|
}
|
|
596979
597021
|
function expandGitReference(ref, cwd4, args, label) {
|
|
596980
597022
|
try {
|
|
596981
|
-
const result =
|
|
597023
|
+
const result = execSync47(["git", ...args].join(" "), {
|
|
596982
597024
|
cwd: cwd4,
|
|
596983
597025
|
encoding: "utf-8",
|
|
596984
597026
|
stdio: "pipe",
|
|
@@ -598530,7 +598572,7 @@ __export(listen_exports, {
|
|
|
598530
598572
|
transcribeFileViaWhisper: () => transcribeFileViaWhisper,
|
|
598531
598573
|
waitForTranscribeCli: () => waitForTranscribeCli
|
|
598532
598574
|
});
|
|
598533
|
-
import { spawn as spawn25, execSync as
|
|
598575
|
+
import { spawn as spawn25, execSync as execSync48 } from "node:child_process";
|
|
598534
598576
|
import {
|
|
598535
598577
|
accessSync,
|
|
598536
598578
|
constants,
|
|
@@ -598559,7 +598601,7 @@ function findMicCaptureCommand() {
|
|
|
598559
598601
|
const platform7 = process.platform;
|
|
598560
598602
|
if (platform7 === "linux") {
|
|
598561
598603
|
try {
|
|
598562
|
-
|
|
598604
|
+
execSync48("which arecord", { stdio: "pipe" });
|
|
598563
598605
|
return {
|
|
598564
598606
|
cmd: "arecord",
|
|
598565
598607
|
args: [
|
|
@@ -598580,7 +598622,7 @@ function findMicCaptureCommand() {
|
|
|
598580
598622
|
}
|
|
598581
598623
|
if (platform7 === "darwin") {
|
|
598582
598624
|
try {
|
|
598583
|
-
|
|
598625
|
+
execSync48("which sox", { stdio: "pipe" });
|
|
598584
598626
|
return {
|
|
598585
598627
|
cmd: "sox",
|
|
598586
598628
|
args: [
|
|
@@ -598602,7 +598644,7 @@ function findMicCaptureCommand() {
|
|
|
598602
598644
|
}
|
|
598603
598645
|
}
|
|
598604
598646
|
try {
|
|
598605
|
-
|
|
598647
|
+
execSync48("which ffmpeg", { stdio: "pipe" });
|
|
598606
598648
|
if (platform7 === "linux") {
|
|
598607
598649
|
return {
|
|
598608
598650
|
cmd: "ffmpeg",
|
|
@@ -598659,7 +598701,7 @@ function findTranscribeFileScript() {
|
|
|
598659
598701
|
if (existsSync107(p2)) return p2;
|
|
598660
598702
|
}
|
|
598661
598703
|
try {
|
|
598662
|
-
const globalRoot =
|
|
598704
|
+
const globalRoot = execSync48("npm root -g", {
|
|
598663
598705
|
encoding: "utf-8",
|
|
598664
598706
|
timeout: 5e3,
|
|
598665
598707
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -598750,7 +598792,7 @@ function findLiveWhisperScript() {
|
|
|
598750
598792
|
if (existsSync107(p2)) return p2;
|
|
598751
598793
|
}
|
|
598752
598794
|
try {
|
|
598753
|
-
const globalRoot =
|
|
598795
|
+
const globalRoot = execSync48("npm root -g", {
|
|
598754
598796
|
encoding: "utf-8",
|
|
598755
598797
|
timeout: 5e3,
|
|
598756
598798
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -598798,7 +598840,7 @@ function ensureVenvForTranscribeCli() {
|
|
|
598798
598840
|
process.env.PATH = `${venvBin}${pathSep2}${currentPath}`;
|
|
598799
598841
|
}
|
|
598800
598842
|
try {
|
|
598801
|
-
|
|
598843
|
+
execSync48(`"${venvPython2}" -c "import numpy"`, {
|
|
598802
598844
|
stdio: "pipe",
|
|
598803
598845
|
timeout: 1e4
|
|
598804
598846
|
});
|
|
@@ -598811,7 +598853,7 @@ function ensureTranscribeCliBackground() {
|
|
|
598811
598853
|
if (_bgInstallPromise) return _bgInstallPromise;
|
|
598812
598854
|
_bgInstallPromise = (async () => {
|
|
598813
598855
|
try {
|
|
598814
|
-
const globalRoot =
|
|
598856
|
+
const globalRoot = execSync48("npm root -g", {
|
|
598815
598857
|
encoding: "utf-8",
|
|
598816
598858
|
timeout: 5e3,
|
|
598817
598859
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -598824,7 +598866,7 @@ function ensureTranscribeCliBackground() {
|
|
|
598824
598866
|
try {
|
|
598825
598867
|
let needsSudo = false;
|
|
598826
598868
|
try {
|
|
598827
|
-
const prefix =
|
|
598869
|
+
const prefix = execSync48("npm prefix -g", {
|
|
598828
598870
|
encoding: "utf-8",
|
|
598829
598871
|
timeout: 5e3,
|
|
598830
598872
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -599080,7 +599122,7 @@ var init_listen = __esm({
|
|
|
599080
599122
|
}
|
|
599081
599123
|
if (!this.transcribeCliAvailable) {
|
|
599082
599124
|
try {
|
|
599083
|
-
|
|
599125
|
+
execSync48("which transcribe-cli", { stdio: "pipe" });
|
|
599084
599126
|
this.transcribeCliAvailable = true;
|
|
599085
599127
|
} catch {
|
|
599086
599128
|
this.transcribeCliAvailable = false;
|
|
@@ -599097,7 +599139,7 @@ var init_listen = __esm({
|
|
|
599097
599139
|
} catch {
|
|
599098
599140
|
}
|
|
599099
599141
|
try {
|
|
599100
|
-
const globalRoot =
|
|
599142
|
+
const globalRoot = execSync48("npm root -g", {
|
|
599101
599143
|
encoding: "utf-8",
|
|
599102
599144
|
timeout: 5e3,
|
|
599103
599145
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -599152,7 +599194,7 @@ var init_listen = __esm({
|
|
|
599152
599194
|
}
|
|
599153
599195
|
if (!tc) {
|
|
599154
599196
|
try {
|
|
599155
|
-
|
|
599197
|
+
execSync48("npm i -g transcribe-cli", {
|
|
599156
599198
|
stdio: "pipe",
|
|
599157
599199
|
timeout: 18e4
|
|
599158
599200
|
});
|
|
@@ -599181,7 +599223,7 @@ var init_listen = __esm({
|
|
|
599181
599223
|
}
|
|
599182
599224
|
} catch {
|
|
599183
599225
|
try {
|
|
599184
|
-
const out =
|
|
599226
|
+
const out = execSync48(
|
|
599185
599227
|
"npm list -g transcribe-cli --depth=0 --json",
|
|
599186
599228
|
{
|
|
599187
599229
|
encoding: "utf-8",
|
|
@@ -599197,7 +599239,7 @@ var init_listen = __esm({
|
|
|
599197
599239
|
}
|
|
599198
599240
|
if (!tcUpToDate) {
|
|
599199
599241
|
try {
|
|
599200
|
-
|
|
599242
|
+
execSync48("npm i -g transcribe-cli@latest", {
|
|
599201
599243
|
stdio: "pipe",
|
|
599202
599244
|
timeout: 12e4
|
|
599203
599245
|
});
|
|
@@ -599465,7 +599507,7 @@ transcribe-cli error: ${transcribeCliError}` : "";
|
|
|
599465
599507
|
}
|
|
599466
599508
|
if (!tc) {
|
|
599467
599509
|
try {
|
|
599468
|
-
|
|
599510
|
+
execSync48("npm i -g transcribe-cli", {
|
|
599469
599511
|
stdio: "pipe",
|
|
599470
599512
|
timeout: 18e4
|
|
599471
599513
|
});
|
|
@@ -599527,7 +599569,7 @@ transcribe-cli error: ${transcribeCliError}` : "";
|
|
|
599527
599569
|
}
|
|
599528
599570
|
if (!tc) {
|
|
599529
599571
|
try {
|
|
599530
|
-
|
|
599572
|
+
execSync48("npm i -g transcribe-cli", {
|
|
599531
599573
|
stdio: "pipe",
|
|
599532
599574
|
timeout: 18e4
|
|
599533
599575
|
});
|
|
@@ -604783,7 +604825,7 @@ __export(text_selection_exports, {
|
|
|
604783
604825
|
stripAnsi: () => stripAnsi,
|
|
604784
604826
|
visibleLength: () => visibleLength
|
|
604785
604827
|
});
|
|
604786
|
-
import { execSync as
|
|
604828
|
+
import { execSync as execSync49 } from "node:child_process";
|
|
604787
604829
|
function stripAnsi(s2) {
|
|
604788
604830
|
return s2.replace(/\x1B\[[0-9;]*[A-Za-z]|\x1B\].*?(?:\x07|\x1B\\)/g, "");
|
|
604789
604831
|
}
|
|
@@ -604805,11 +604847,11 @@ function copyText(text2) {
|
|
|
604805
604847
|
try {
|
|
604806
604848
|
const platform7 = process.platform;
|
|
604807
604849
|
if (platform7 === "darwin") {
|
|
604808
|
-
|
|
604850
|
+
execSync49("pbcopy", { input: text2, timeout: 3e3 });
|
|
604809
604851
|
return true;
|
|
604810
604852
|
}
|
|
604811
604853
|
if (platform7 === "win32") {
|
|
604812
|
-
|
|
604854
|
+
execSync49("clip", { input: text2, timeout: 3e3 });
|
|
604813
604855
|
return true;
|
|
604814
604856
|
}
|
|
604815
604857
|
for (const tool of [
|
|
@@ -604818,7 +604860,7 @@ function copyText(text2) {
|
|
|
604818
604860
|
"wl-copy"
|
|
604819
604861
|
]) {
|
|
604820
604862
|
try {
|
|
604821
|
-
|
|
604863
|
+
execSync49(tool, { input: text2, timeout: 3e3 });
|
|
604822
604864
|
return true;
|
|
604823
604865
|
} catch {
|
|
604824
604866
|
continue;
|
|
@@ -604827,13 +604869,13 @@ function copyText(text2) {
|
|
|
604827
604869
|
if (!_clipboardAutoInstallAttempted) {
|
|
604828
604870
|
_clipboardAutoInstallAttempted = true;
|
|
604829
604871
|
try {
|
|
604830
|
-
|
|
604872
|
+
execSync49("which apt-get", { timeout: 2e3, stdio: "pipe" });
|
|
604831
604873
|
try {
|
|
604832
|
-
|
|
604874
|
+
execSync49("sudo -n apt-get install -y xclip 2>/dev/null", {
|
|
604833
604875
|
timeout: 15e3,
|
|
604834
604876
|
stdio: "pipe"
|
|
604835
604877
|
});
|
|
604836
|
-
|
|
604878
|
+
execSync49("xclip -selection clipboard", {
|
|
604837
604879
|
input: text2,
|
|
604838
604880
|
timeout: 3e3
|
|
604839
604881
|
});
|
|
@@ -604857,10 +604899,10 @@ function pasteText() {
|
|
|
604857
604899
|
try {
|
|
604858
604900
|
const platform7 = process.platform;
|
|
604859
604901
|
if (platform7 === "darwin") {
|
|
604860
|
-
return
|
|
604902
|
+
return execSync49("pbpaste", { timeout: 3e3, encoding: "utf8" }).trimEnd();
|
|
604861
604903
|
}
|
|
604862
604904
|
if (platform7 === "win32") {
|
|
604863
|
-
return
|
|
604905
|
+
return execSync49("powershell -command Get-Clipboard", {
|
|
604864
604906
|
timeout: 3e3,
|
|
604865
604907
|
encoding: "utf8"
|
|
604866
604908
|
}).trimEnd();
|
|
@@ -604871,7 +604913,7 @@ function pasteText() {
|
|
|
604871
604913
|
{ cmd: "wl-paste", args: [] }
|
|
604872
604914
|
]) {
|
|
604873
604915
|
try {
|
|
604874
|
-
const result =
|
|
604916
|
+
const result = execSync49(`${tool.cmd} ${tool.args.join(" ")}`, {
|
|
604875
604917
|
timeout: 3e3,
|
|
604876
604918
|
encoding: "utf8"
|
|
604877
604919
|
});
|
|
@@ -608433,7 +608475,7 @@ var init_render = __esm({
|
|
|
608433
608475
|
|
|
608434
608476
|
// packages/cli/src/tui/voice-session.ts
|
|
608435
608477
|
import { createServer as createServer4 } from "node:http";
|
|
608436
|
-
import { spawn as spawn26, execSync as
|
|
608478
|
+
import { spawn as spawn26, execSync as execSync50 } from "node:child_process";
|
|
608437
608479
|
import { EventEmitter as EventEmitter7 } from "node:events";
|
|
608438
608480
|
function generateFrontendHTML() {
|
|
608439
608481
|
return `<!DOCTYPE html>
|
|
@@ -616729,7 +616771,7 @@ var init_braille_spinner = __esm({
|
|
|
616729
616771
|
});
|
|
616730
616772
|
|
|
616731
616773
|
// packages/cli/src/tui/disk-monitor.ts
|
|
616732
|
-
import { execFile as
|
|
616774
|
+
import { execFile as execFile8 } from "node:child_process";
|
|
616733
616775
|
import { promisify as promisify6 } from "node:util";
|
|
616734
616776
|
function unavailableDiskMetrics(path12 = process.cwd()) {
|
|
616735
616777
|
return {
|
|
@@ -616778,7 +616820,7 @@ var execFileAsync5;
|
|
|
616778
616820
|
var init_disk_monitor = __esm({
|
|
616779
616821
|
"packages/cli/src/tui/disk-monitor.ts"() {
|
|
616780
616822
|
"use strict";
|
|
616781
|
-
execFileAsync5 = promisify6(
|
|
616823
|
+
execFileAsync5 = promisify6(execFile8);
|
|
616782
616824
|
}
|
|
616783
616825
|
});
|
|
616784
616826
|
|
|
@@ -623204,7 +623246,7 @@ __export(personaplex_exports, {
|
|
|
623204
623246
|
import { existsSync as existsSync118, writeFileSync as writeFileSync61, readFileSync as readFileSync95, mkdirSync as mkdirSync71, copyFileSync as copyFileSync5, readdirSync as readdirSync40, statSync as statSync44 } from "node:fs";
|
|
623205
623247
|
import { join as join132, dirname as dirname42 } from "node:path";
|
|
623206
623248
|
import { homedir as homedir42 } from "node:os";
|
|
623207
|
-
import { execSync as
|
|
623249
|
+
import { execSync as execSync51, spawn as spawn28 } from "node:child_process";
|
|
623208
623250
|
import { fileURLToPath as fileURLToPath18 } from "node:url";
|
|
623209
623251
|
function personaplexPythonEnv(extra = {}) {
|
|
623210
623252
|
const env2 = { ...process.env, ...extra };
|
|
@@ -623242,7 +623284,7 @@ function detectJetson() {
|
|
|
623242
623284
|
try {
|
|
623243
623285
|
const model = readFileSync95("/proc/device-tree/model", "utf8").replace(/\0/g, "").trim();
|
|
623244
623286
|
if (/jetson|orin|tegra/i.test(model)) {
|
|
623245
|
-
const memInfo =
|
|
623287
|
+
const memInfo = execSync51("grep MemTotal /proc/meminfo", { encoding: "utf8", timeout: 3e3, stdio: "pipe" });
|
|
623246
623288
|
const memKB = parseInt(memInfo.match(/(\d+)/)?.[1] ?? "0", 10);
|
|
623247
623289
|
return { isJetson: true, model, totalMemGB: memKB / 1024 / 1024 };
|
|
623248
623290
|
}
|
|
@@ -623276,7 +623318,7 @@ function detectPersonaPlexCapability() {
|
|
|
623276
623318
|
};
|
|
623277
623319
|
}
|
|
623278
623320
|
try {
|
|
623279
|
-
const nvsmi =
|
|
623321
|
+
const nvsmi = execSync51("nvidia-smi --query-gpu=name,memory.total --format=csv,noheader,nounits", {
|
|
623280
623322
|
encoding: "utf8",
|
|
623281
623323
|
timeout: 5e3,
|
|
623282
623324
|
stdio: "pipe"
|
|
@@ -623288,7 +623330,7 @@ function detectPersonaPlexCapability() {
|
|
|
623288
623330
|
return { ...fail3(`GPU has ${vramGB.toFixed(1)}GB VRAM (need ≥8GB)`), gpuName: gpuName ?? "", vramGB };
|
|
623289
623331
|
}
|
|
623290
623332
|
try {
|
|
623291
|
-
|
|
623333
|
+
execSync51('python3 -c "import torch; assert torch.cuda.is_available()"', {
|
|
623292
623334
|
timeout: 1e4,
|
|
623293
623335
|
stdio: "pipe",
|
|
623294
623336
|
env: personaplexPythonEnv()
|
|
@@ -623362,7 +623404,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
623362
623404
|
mkdirSync71(PERSONAPLEX_DIR, { recursive: true });
|
|
623363
623405
|
let arch3 = "";
|
|
623364
623406
|
try {
|
|
623365
|
-
arch3 =
|
|
623407
|
+
arch3 = execSync51("uname -m", { encoding: "utf8", timeout: 3e3, stdio: "pipe" }).trim();
|
|
623366
623408
|
} catch {
|
|
623367
623409
|
}
|
|
623368
623410
|
const isAarch64 = arch3 === "aarch64" || arch3 === "arm64";
|
|
@@ -623383,16 +623425,16 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
623383
623425
|
log22("Checking system dependencies (libopus)...");
|
|
623384
623426
|
try {
|
|
623385
623427
|
if (process.platform === "linux") {
|
|
623386
|
-
|
|
623428
|
+
execSync51("dpkg -l libopus-dev 2>/dev/null || sudo apt-get install -y libopus-dev", { timeout: 3e4, stdio: "pipe" });
|
|
623387
623429
|
} else if (process.platform === "darwin") {
|
|
623388
|
-
|
|
623430
|
+
execSync51("brew list opus 2>/dev/null || brew install opus", { timeout: 6e4, stdio: "pipe" });
|
|
623389
623431
|
}
|
|
623390
623432
|
} catch {
|
|
623391
623433
|
}
|
|
623392
623434
|
if (isAarch64) {
|
|
623393
623435
|
log22("ARM64: Checking Rust toolchain for sphn build...");
|
|
623394
623436
|
try {
|
|
623395
|
-
|
|
623437
|
+
execSync51("rustc --version", { timeout: 5e3, stdio: "pipe" });
|
|
623396
623438
|
} catch {
|
|
623397
623439
|
log22("ARM64: Installing Rust toolchain (needed for sphn audio codec)...");
|
|
623398
623440
|
try {
|
|
@@ -623465,7 +623507,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
623465
623507
|
}
|
|
623466
623508
|
const serverPy = join132(venvDir, "lib", `python3.${process.versions.node ? "12" : "10"}`, "site-packages", "moshi", "server.py");
|
|
623467
623509
|
try {
|
|
623468
|
-
const sitePackages =
|
|
623510
|
+
const sitePackages = execSync51(`"${python}" -c "import moshi, os; print(os.path.dirname(moshi.__file__))"`, {
|
|
623469
623511
|
encoding: "utf8",
|
|
623470
623512
|
timeout: 5e3,
|
|
623471
623513
|
stdio: "pipe",
|
|
@@ -623483,7 +623525,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
623483
623525
|
} catch {
|
|
623484
623526
|
}
|
|
623485
623527
|
try {
|
|
623486
|
-
const sitePackages =
|
|
623528
|
+
const sitePackages = execSync51(`"${python}" -c "import moshi, os; print(os.path.dirname(moshi.__file__))"`, {
|
|
623487
623529
|
encoding: "utf8",
|
|
623488
623530
|
timeout: 5e3,
|
|
623489
623531
|
stdio: "pipe",
|
|
@@ -623588,7 +623630,7 @@ $2if filename.endswith(".safetensors"):`
|
|
|
623588
623630
|
} catch {
|
|
623589
623631
|
}
|
|
623590
623632
|
try {
|
|
623591
|
-
const sitePackages2 =
|
|
623633
|
+
const sitePackages2 = execSync51(`"${python}" -c "import moshi, os; print(os.path.dirname(moshi.__file__))"`, {
|
|
623592
623634
|
encoding: "utf8",
|
|
623593
623635
|
timeout: 5e3,
|
|
623594
623636
|
stdio: "pipe",
|
|
@@ -623724,14 +623766,14 @@ async function startPersonaPlexDaemon(onInfo) {
|
|
|
623724
623766
|
if (tier === "nf4-distilled") {
|
|
623725
623767
|
log22(`Weight tier: ${tier} — distilled NF4 (90% token match, ${repoInfo.sizeGB}GB)...`);
|
|
623726
623768
|
try {
|
|
623727
|
-
const weightPath =
|
|
623769
|
+
const weightPath = execSync51(
|
|
623728
623770
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', '${repoInfo.file}', token=False))"`,
|
|
623729
623771
|
{ encoding: "utf8", timeout: 6e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
623730
623772
|
).trim();
|
|
623731
623773
|
if (existsSync118(weightPath)) {
|
|
623732
623774
|
if (!existsSync118(cachedBf16)) {
|
|
623733
623775
|
log22("Converting .pt checkpoint to safetensors (one-time)...");
|
|
623734
|
-
|
|
623776
|
+
execSync51(
|
|
623735
623777
|
`"${venvPython2}" -c "
|
|
623736
623778
|
import torch; from safetensors.torch import save_file
|
|
623737
623779
|
state = torch.load('${weightPath}', map_location='cpu', weights_only=True)
|
|
@@ -623763,13 +623805,13 @@ print('Converted')
|
|
|
623763
623805
|
}
|
|
623764
623806
|
}
|
|
623765
623807
|
try {
|
|
623766
|
-
const weightPath =
|
|
623808
|
+
const weightPath = execSync51(
|
|
623767
623809
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', '${repoInfo.file}'${repoInfo.needsToken ? "" : ", token=False"}))"`,
|
|
623768
623810
|
{ encoding: "utf8", timeout: 3e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
623769
623811
|
).trim();
|
|
623770
623812
|
if (existsSync118(dequantScript) && existsSync118(weightPath)) {
|
|
623771
623813
|
try {
|
|
623772
|
-
|
|
623814
|
+
execSync51(
|
|
623773
623815
|
`"${venvPython2}" "${dequantScript}" --input "${weightPath}" --output "${cachedBf16}"`,
|
|
623774
623816
|
{ timeout: 3e5, stdio: "pipe", env: personaplexPythonEnv() }
|
|
623775
623817
|
);
|
|
@@ -623782,7 +623824,7 @@ print('Converted')
|
|
|
623782
623824
|
}
|
|
623783
623825
|
}
|
|
623784
623826
|
try {
|
|
623785
|
-
const mimiPath =
|
|
623827
|
+
const mimiPath = execSync51(
|
|
623786
623828
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', 'tokenizer-e351c8d8-checkpoint125.safetensors', token=False))"`,
|
|
623787
623829
|
{ encoding: "utf8", timeout: 3e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
623788
623830
|
).trim();
|
|
@@ -623790,7 +623832,7 @@ print('Converted')
|
|
|
623790
623832
|
} catch {
|
|
623791
623833
|
}
|
|
623792
623834
|
try {
|
|
623793
|
-
const tokPath =
|
|
623835
|
+
const tokPath = execSync51(
|
|
623794
623836
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', 'tokenizer_spm_32k_3.model', token=False))"`,
|
|
623795
623837
|
{ encoding: "utf8", timeout: 3e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
623796
623838
|
).trim();
|
|
@@ -623814,7 +623856,7 @@ print('Converted')
|
|
|
623814
623856
|
}
|
|
623815
623857
|
if (!ollamaModel) ollamaModel = "qwen3.5:4b";
|
|
623816
623858
|
try {
|
|
623817
|
-
const ollamaCheck =
|
|
623859
|
+
const ollamaCheck = execSync51("curl -s http://localhost:11434/api/tags", {
|
|
623818
623860
|
timeout: 3e3,
|
|
623819
623861
|
stdio: "pipe",
|
|
623820
623862
|
encoding: "utf8"
|
|
@@ -623888,7 +623930,7 @@ print('Converted')
|
|
|
623888
623930
|
return null;
|
|
623889
623931
|
}
|
|
623890
623932
|
try {
|
|
623891
|
-
|
|
623933
|
+
execSync51(`curl -sk -o /dev/null -w "%{http_code}" https://127.0.0.1:${PORT}/`, {
|
|
623892
623934
|
timeout: 3e3,
|
|
623893
623935
|
stdio: "pipe",
|
|
623894
623936
|
encoding: "utf8"
|
|
@@ -623911,7 +623953,7 @@ function stopPersonaPlex() {
|
|
|
623911
623953
|
if (isNaN(pid) || pid <= 0) return;
|
|
623912
623954
|
try {
|
|
623913
623955
|
if (process.platform === "win32") {
|
|
623914
|
-
|
|
623956
|
+
execSync51(`taskkill /F /PID ${pid}`, { timeout: 5e3, stdio: "ignore" });
|
|
623915
623957
|
} else {
|
|
623916
623958
|
process.kill(pid, "SIGTERM");
|
|
623917
623959
|
}
|
|
@@ -624222,7 +624264,7 @@ __export(setup_exports, {
|
|
|
624222
624264
|
updateOllama: () => updateOllama
|
|
624223
624265
|
});
|
|
624224
624266
|
import * as readline from "node:readline";
|
|
624225
|
-
import { execSync as
|
|
624267
|
+
import { execSync as execSync52, spawn as spawn29, exec as exec5 } from "node:child_process";
|
|
624226
624268
|
import { promisify as promisify7 } from "node:util";
|
|
624227
624269
|
import { existsSync as existsSync119, writeFileSync as writeFileSync62, readFileSync as readFileSync96, appendFileSync as appendFileSync12, mkdirSync as mkdirSync72 } from "node:fs";
|
|
624228
624270
|
import { join as join133 } from "node:path";
|
|
@@ -624345,7 +624387,7 @@ function detectSystemSpecs() {
|
|
|
624345
624387
|
let availableVramGB = 0;
|
|
624346
624388
|
let gpuName = "";
|
|
624347
624389
|
try {
|
|
624348
|
-
const memInfo =
|
|
624390
|
+
const memInfo = execSync52("free -b 2>/dev/null || sysctl -n hw.memsize 2>/dev/null", {
|
|
624349
624391
|
encoding: "utf8",
|
|
624350
624392
|
timeout: 5e3
|
|
624351
624393
|
});
|
|
@@ -624365,7 +624407,7 @@ function detectSystemSpecs() {
|
|
|
624365
624407
|
} catch {
|
|
624366
624408
|
}
|
|
624367
624409
|
try {
|
|
624368
|
-
const nvidiaSmi =
|
|
624410
|
+
const nvidiaSmi = execSync52(
|
|
624369
624411
|
"nvidia-smi --query-gpu=memory.total,memory.free,name --format=csv,noheader,nounits 2>/dev/null",
|
|
624370
624412
|
{ encoding: "utf8", timeout: 5e3 }
|
|
624371
624413
|
);
|
|
@@ -624377,7 +624419,7 @@ function detectSystemSpecs() {
|
|
|
624377
624419
|
}
|
|
624378
624420
|
if (gpuVramGB === 0) {
|
|
624379
624421
|
try {
|
|
624380
|
-
const rocmSmi =
|
|
624422
|
+
const rocmSmi = execSync52(
|
|
624381
624423
|
"rocm-smi --showmeminfo vram --csv 2>/dev/null",
|
|
624382
624424
|
{ encoding: "utf8", timeout: 5e3 }
|
|
624383
624425
|
);
|
|
@@ -624633,7 +624675,7 @@ function ensureCurl() {
|
|
|
624633
624675
|
for (const s2 of strategies) {
|
|
624634
624676
|
if (hasCmd(s2.check)) {
|
|
624635
624677
|
try {
|
|
624636
|
-
|
|
624678
|
+
execSync52(s2.install, { stdio: "inherit", timeout: 12e4 });
|
|
624637
624679
|
if (hasCmd("curl")) {
|
|
624638
624680
|
process.stdout.write(` ${c3.green("✔")} curl installed via ${s2.label}.
|
|
624639
624681
|
`);
|
|
@@ -624647,7 +624689,7 @@ function ensureCurl() {
|
|
|
624647
624689
|
}
|
|
624648
624690
|
if (plat === "darwin") {
|
|
624649
624691
|
try {
|
|
624650
|
-
|
|
624692
|
+
execSync52("xcode-select --install", { stdio: "inherit", timeout: 3e5 });
|
|
624651
624693
|
if (hasCmd("curl")) return true;
|
|
624652
624694
|
} catch {
|
|
624653
624695
|
}
|
|
@@ -624661,7 +624703,7 @@ function ensureZstd() {
|
|
|
624661
624703
|
if (process.platform === "darwin") {
|
|
624662
624704
|
if (!hasCmd("brew")) return false;
|
|
624663
624705
|
try {
|
|
624664
|
-
|
|
624706
|
+
execSync52("brew install zstd", { stdio: "inherit", timeout: 12e4 });
|
|
624665
624707
|
return hasCmd("zstd");
|
|
624666
624708
|
} catch {
|
|
624667
624709
|
return false;
|
|
@@ -624703,7 +624745,7 @@ function ensureZstd() {
|
|
|
624703
624745
|
candidates.push({ cmd: installCmd, env: process.env });
|
|
624704
624746
|
for (const cand of candidates) {
|
|
624705
624747
|
try {
|
|
624706
|
-
|
|
624748
|
+
execSync52(cand.cmd, {
|
|
624707
624749
|
stdio: cand.stdio ?? ["ignore", "inherit", "pipe"],
|
|
624708
624750
|
env: cand.env,
|
|
624709
624751
|
timeout: 18e4
|
|
@@ -624740,7 +624782,7 @@ function detectAskpassHelper() {
|
|
|
624740
624782
|
for (const name10 of ["ssh-askpass", "ksshaskpass", "x11-ssh-askpass"]) {
|
|
624741
624783
|
if (hasCmd(name10)) {
|
|
624742
624784
|
try {
|
|
624743
|
-
const p2 =
|
|
624785
|
+
const p2 = execSync52(`command -v ${name10}`, { encoding: "utf8" }).trim();
|
|
624744
624786
|
if (p2) return p2;
|
|
624745
624787
|
} catch {
|
|
624746
624788
|
}
|
|
@@ -624783,7 +624825,7 @@ osascript -e 'Tell application "System Events" to display dialog "Omnius needs a
|
|
|
624783
624825
|
}
|
|
624784
624826
|
try {
|
|
624785
624827
|
writeFileSync62(helperPath, body, { mode: 448 });
|
|
624786
|
-
|
|
624828
|
+
execSync52(`chmod 700 "${helperPath}"`, { stdio: "ignore" });
|
|
624787
624829
|
return helperPath;
|
|
624788
624830
|
} catch {
|
|
624789
624831
|
return null;
|
|
@@ -624852,7 +624894,7 @@ function runElevatedCommand(command, opts = {}) {
|
|
|
624852
624894
|
let lastErr = null;
|
|
624853
624895
|
for (const cand of candidates) {
|
|
624854
624896
|
try {
|
|
624855
|
-
|
|
624897
|
+
execSync52(cand.cmd, {
|
|
624856
624898
|
stdio: cand.stdio ?? ["ignore", "pipe", "pipe"],
|
|
624857
624899
|
env: cand.env,
|
|
624858
624900
|
timeout: timeout2
|
|
@@ -624889,7 +624931,7 @@ function runOllamaInstallScript() {
|
|
|
624889
624931
|
`);
|
|
624890
624932
|
}
|
|
624891
624933
|
const runOnce = () => {
|
|
624892
|
-
|
|
624934
|
+
execSync52(elevated.cmd, {
|
|
624893
624935
|
stdio: elevated.mode === "terminal" ? "inherit" : ["ignore", "inherit", "pipe"],
|
|
624894
624936
|
env: elevated.env,
|
|
624895
624937
|
timeout: 6e5
|
|
@@ -624968,7 +625010,7 @@ async function installOllamaMac(_rl) {
|
|
|
624968
625010
|
|
|
624969
625011
|
`);
|
|
624970
625012
|
try {
|
|
624971
|
-
|
|
625013
|
+
execSync52(
|
|
624972
625014
|
'/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',
|
|
624973
625015
|
{ stdio: "inherit", timeout: 6e5 }
|
|
624974
625016
|
);
|
|
@@ -625004,7 +625046,7 @@ async function installOllamaMac(_rl) {
|
|
|
625004
625046
|
|
|
625005
625047
|
`);
|
|
625006
625048
|
try {
|
|
625007
|
-
|
|
625049
|
+
execSync52("brew install ollama", {
|
|
625008
625050
|
stdio: "inherit",
|
|
625009
625051
|
timeout: 3e5
|
|
625010
625052
|
});
|
|
@@ -625031,7 +625073,7 @@ function installOllamaWindows() {
|
|
|
625031
625073
|
|
|
625032
625074
|
`);
|
|
625033
625075
|
try {
|
|
625034
|
-
|
|
625076
|
+
execSync52('powershell -Command "irm https://ollama.com/install.ps1 | iex"', {
|
|
625035
625077
|
stdio: "inherit",
|
|
625036
625078
|
timeout: 3e5
|
|
625037
625079
|
});
|
|
@@ -625111,7 +625153,7 @@ async function ensureOllamaRunning(backendUrl2, rl) {
|
|
|
625111
625153
|
}
|
|
625112
625154
|
function getOllamaVersion() {
|
|
625113
625155
|
try {
|
|
625114
|
-
const out =
|
|
625156
|
+
const out = execSync52("ollama --version", { encoding: "utf8", timeout: 5e3 });
|
|
625115
625157
|
const match = out.match(/(\d+\.\d+\.\d+)/);
|
|
625116
625158
|
return match ? match[1] : null;
|
|
625117
625159
|
} catch {
|
|
@@ -625168,7 +625210,7 @@ function updateOllama() {
|
|
|
625168
625210
|
}
|
|
625169
625211
|
function pullModelWithAutoUpdate(tag) {
|
|
625170
625212
|
try {
|
|
625171
|
-
|
|
625213
|
+
execSync52(`ollama pull ${tag}`, {
|
|
625172
625214
|
stdio: "inherit",
|
|
625173
625215
|
timeout: 36e5
|
|
625174
625216
|
// 1 hour max
|
|
@@ -625195,7 +625237,7 @@ function pullModelWithAutoUpdate(tag) {
|
|
|
625195
625237
|
process.stdout.write(` ${c3.cyan("●")} Retrying pull of ${c3.bold(tag)}...
|
|
625196
625238
|
|
|
625197
625239
|
`);
|
|
625198
|
-
|
|
625240
|
+
execSync52(`ollama pull ${tag}`, {
|
|
625199
625241
|
stdio: "inherit",
|
|
625200
625242
|
timeout: 36e5
|
|
625201
625243
|
});
|
|
@@ -625284,7 +625326,7 @@ function ensurePython3() {
|
|
|
625284
625326
|
if (plat === "darwin") {
|
|
625285
625327
|
if (hasCmd("brew")) {
|
|
625286
625328
|
try {
|
|
625287
|
-
|
|
625329
|
+
execSync52("brew install python3", { stdio: "inherit", timeout: 3e5 });
|
|
625288
625330
|
if (hasCmd("python3")) {
|
|
625289
625331
|
process.stdout.write(` ${c3.green("✔")} Python3 installed via Homebrew.
|
|
625290
625332
|
`);
|
|
@@ -625297,7 +625339,7 @@ function ensurePython3() {
|
|
|
625297
625339
|
for (const s2 of strategies) {
|
|
625298
625340
|
if (hasCmd(s2.check)) {
|
|
625299
625341
|
try {
|
|
625300
|
-
|
|
625342
|
+
execSync52(s2.install, { stdio: "inherit", timeout: 12e4 });
|
|
625301
625343
|
if (hasCmd("python3") || hasCmd("python")) {
|
|
625302
625344
|
process.stdout.write(` ${c3.green("✔")} Python3 installed via ${s2.label}.
|
|
625303
625345
|
`);
|
|
@@ -625313,11 +625355,11 @@ function ensurePython3() {
|
|
|
625313
625355
|
}
|
|
625314
625356
|
function checkPythonVenv() {
|
|
625315
625357
|
try {
|
|
625316
|
-
|
|
625358
|
+
execSync52("python3 -m venv --help", { stdio: "pipe", timeout: 5e3 });
|
|
625317
625359
|
return true;
|
|
625318
625360
|
} catch {
|
|
625319
625361
|
try {
|
|
625320
|
-
|
|
625362
|
+
execSync52("python -m venv --help", { stdio: "pipe", timeout: 5e3 });
|
|
625321
625363
|
return true;
|
|
625322
625364
|
} catch {
|
|
625323
625365
|
return false;
|
|
@@ -625336,7 +625378,7 @@ function ensurePythonVenv() {
|
|
|
625336
625378
|
for (const s2 of strategies) {
|
|
625337
625379
|
if (hasCmd(s2.check)) {
|
|
625338
625380
|
try {
|
|
625339
|
-
|
|
625381
|
+
execSync52(s2.install, { stdio: "inherit", timeout: 12e4 });
|
|
625340
625382
|
if (checkPythonVenv()) {
|
|
625341
625383
|
process.stdout.write(` ${c3.green("✔")} python3-venv installed via ${s2.label}.
|
|
625342
625384
|
`);
|
|
@@ -625943,7 +625985,7 @@ ${c3.cyan(OMNIUS_FIRST_RUN_BANNER)}
|
|
|
625943
625985
|
for (let i2 = 0; i2 < modelfileCandidates.length; i2++) {
|
|
625944
625986
|
writeFileSync62(modelfilePath, modelfileCandidates[i2] + "\n", "utf8");
|
|
625945
625987
|
try {
|
|
625946
|
-
|
|
625988
|
+
execSync52(`ollama create ${customName} -f ${modelfilePath}`, {
|
|
625947
625989
|
stdio: "pipe",
|
|
625948
625990
|
timeout: 12e4
|
|
625949
625991
|
});
|
|
@@ -626005,7 +626047,7 @@ function isFirstRun() {
|
|
|
626005
626047
|
function hasCmd(cmd) {
|
|
626006
626048
|
try {
|
|
626007
626049
|
const whichCmd = process.platform === "win32" ? `where ${cmd}` : `which ${cmd}`;
|
|
626008
|
-
|
|
626050
|
+
execSync52(whichCmd, { stdio: "pipe", timeout: 3e3 });
|
|
626009
626051
|
return true;
|
|
626010
626052
|
} catch {
|
|
626011
626053
|
return false;
|
|
@@ -626017,7 +626059,7 @@ function detectPkgManager() {
|
|
|
626017
626059
|
if (hasCmd("choco")) return "choco";
|
|
626018
626060
|
if (hasCmd("winget")) return "winget";
|
|
626019
626061
|
try {
|
|
626020
|
-
|
|
626062
|
+
execSync52(
|
|
626021
626063
|
`powershell -NoProfile -Command "Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"`,
|
|
626022
626064
|
{ stdio: "pipe", timeout: 12e4 }
|
|
626023
626065
|
);
|
|
@@ -626029,7 +626071,7 @@ function detectPkgManager() {
|
|
|
626029
626071
|
if (plat === "darwin") {
|
|
626030
626072
|
if (hasCmd("brew")) return "brew";
|
|
626031
626073
|
try {
|
|
626032
|
-
|
|
626074
|
+
execSync52(
|
|
626033
626075
|
'/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',
|
|
626034
626076
|
{ stdio: "pipe", timeout: 3e5, env: { ...process.env, NONINTERACTIVE: "1" } }
|
|
626035
626077
|
);
|
|
@@ -626049,7 +626091,7 @@ function getVenvDir2() {
|
|
|
626049
626091
|
}
|
|
626050
626092
|
function hasVenvModule() {
|
|
626051
626093
|
try {
|
|
626052
|
-
|
|
626094
|
+
execSync52('python3 -c "import ensurepip, venv"', {
|
|
626053
626095
|
stdio: "pipe",
|
|
626054
626096
|
timeout: 5e3
|
|
626055
626097
|
});
|
|
@@ -626066,17 +626108,17 @@ function ensureVenv2(log22) {
|
|
|
626066
626108
|
const pythonCmd = isWin2 ? "python" : "python3";
|
|
626067
626109
|
if (existsSync119(pipPath)) {
|
|
626068
626110
|
try {
|
|
626069
|
-
|
|
626111
|
+
execSync52(`"${venvPyPath}" -m pip --version`, { stdio: "pipe", timeout: 1e4 });
|
|
626070
626112
|
return venvDir;
|
|
626071
626113
|
} catch {
|
|
626072
626114
|
log22("Python venv pip is broken — repairing...");
|
|
626073
626115
|
try {
|
|
626074
|
-
|
|
626116
|
+
execSync52(`"${venvPyPath}" -m ensurepip --upgrade`, { stdio: "pipe", timeout: 3e4 });
|
|
626075
626117
|
log22("pip repaired via ensurepip.");
|
|
626076
626118
|
return venvDir;
|
|
626077
626119
|
} catch {
|
|
626078
626120
|
try {
|
|
626079
|
-
|
|
626121
|
+
execSync52(`curl -sS https://bootstrap.pypa.io/get-pip.py | "${venvPyPath}"`, { stdio: "pipe", timeout: 6e4 });
|
|
626080
626122
|
log22("pip repaired via get-pip.py.");
|
|
626081
626123
|
return venvDir;
|
|
626082
626124
|
} catch {
|
|
@@ -626097,17 +626139,17 @@ function ensureVenv2(log22) {
|
|
|
626097
626139
|
try {
|
|
626098
626140
|
mkdirSync72(join133(homedir43(), ".omnius"), { recursive: true });
|
|
626099
626141
|
const pyCmd = hasCmd(pythonCmd) ? pythonCmd : "python3";
|
|
626100
|
-
|
|
626142
|
+
execSync52(`${pyCmd} -m venv --clear "${venvDir}"`, { stdio: "pipe", timeout: 3e4 });
|
|
626101
626143
|
try {
|
|
626102
|
-
|
|
626144
|
+
execSync52(`"${venvPyPath}" -m pip --version`, { stdio: "pipe", timeout: 1e4 });
|
|
626103
626145
|
} catch {
|
|
626104
626146
|
try {
|
|
626105
|
-
|
|
626147
|
+
execSync52(`"${venvPyPath}" -m ensurepip --upgrade`, { stdio: "pipe", timeout: 3e4 });
|
|
626106
626148
|
} catch {
|
|
626107
|
-
|
|
626149
|
+
execSync52(`curl -sS https://bootstrap.pypa.io/get-pip.py | "${venvPyPath}"`, { stdio: "pipe", timeout: 6e4 });
|
|
626108
626150
|
}
|
|
626109
626151
|
}
|
|
626110
|
-
|
|
626152
|
+
execSync52(`"${venvPyPath}" -m pip install --upgrade pip`, {
|
|
626111
626153
|
stdio: "pipe",
|
|
626112
626154
|
timeout: 6e4
|
|
626113
626155
|
});
|
|
@@ -626120,7 +626162,7 @@ function ensureVenv2(log22) {
|
|
|
626120
626162
|
}
|
|
626121
626163
|
function trySudoPasswordless(cmd, timeoutMs = 12e4) {
|
|
626122
626164
|
try {
|
|
626123
|
-
|
|
626165
|
+
execSync52(`sudo -n ${cmd}`, {
|
|
626124
626166
|
stdio: "pipe",
|
|
626125
626167
|
timeout: timeoutMs,
|
|
626126
626168
|
env: { ...process.env, DEBIAN_FRONTEND: "noninteractive" }
|
|
@@ -626133,7 +626175,7 @@ function trySudoPasswordless(cmd, timeoutMs = 12e4) {
|
|
|
626133
626175
|
function runWithSudo(cmd, password, timeoutMs = 12e4) {
|
|
626134
626176
|
try {
|
|
626135
626177
|
const escaped = cmd.replace(/'/g, "'\\''");
|
|
626136
|
-
|
|
626178
|
+
execSync52(`sudo -S bash -c '${escaped}'`, {
|
|
626137
626179
|
input: password + "\n",
|
|
626138
626180
|
stdio: ["pipe", "pipe", "pipe"],
|
|
626139
626181
|
timeout: timeoutMs,
|
|
@@ -626175,7 +626217,7 @@ async function sudoInstall(cmd, getSudoPassword, log22, cachedPasswordRef, timeo
|
|
|
626175
626217
|
try {
|
|
626176
626218
|
const isRoot = typeof process.getuid === "function" && process.getuid() === 0;
|
|
626177
626219
|
const escaped = cmd.replace(/'/g, "'\\''");
|
|
626178
|
-
|
|
626220
|
+
execSync52(isRoot ? `bash -c '${escaped}'` : `sudo bash -c '${escaped}'`, {
|
|
626179
626221
|
stdio: "inherit",
|
|
626180
626222
|
timeout: timeoutMs,
|
|
626181
626223
|
env: { ...process.env, DEBIAN_FRONTEND: "noninteractive" }
|
|
@@ -626241,7 +626283,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
626241
626283
|
let winNeedsElevation = false;
|
|
626242
626284
|
if (process.platform === "win32") {
|
|
626243
626285
|
try {
|
|
626244
|
-
|
|
626286
|
+
execSync52("net session", { stdio: "pipe", timeout: 3e3 });
|
|
626245
626287
|
} catch {
|
|
626246
626288
|
winNeedsElevation = true;
|
|
626247
626289
|
log22(`Installing ${labels} via ${pm2} (requires admin — UAC prompt will appear)...`);
|
|
@@ -626288,12 +626330,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
626288
626330
|
if (needsSudo) {
|
|
626289
626331
|
await sudoInstall(installCmd, getPassword, log22, cachedPasswordRef, 18e4);
|
|
626290
626332
|
} else if (winNeedsElevation) {
|
|
626291
|
-
|
|
626333
|
+
execSync52(
|
|
626292
626334
|
`powershell -NoProfile -Command "Start-Process -FilePath 'cmd.exe' -ArgumentList '/c ${installCmd.replace(/'/g, "''")}' -Verb RunAs -Wait"`,
|
|
626293
626335
|
{ stdio: "pipe", timeout: 18e4 }
|
|
626294
626336
|
);
|
|
626295
626337
|
} else {
|
|
626296
|
-
|
|
626338
|
+
execSync52(installCmd, { stdio: "pipe", timeout: 18e4 });
|
|
626297
626339
|
}
|
|
626298
626340
|
} catch (e2) {
|
|
626299
626341
|
const stderr = e2.stderr?.toString?.()?.trim?.() ?? "";
|
|
@@ -626306,7 +626348,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
626306
626348
|
if (!hasCmd(d2.binary) && pipPkg) {
|
|
626307
626349
|
try {
|
|
626308
626350
|
const pipCmd = process.platform === "win32" ? `pip install ${pipPkg}` : `pip3 install ${pipPkg}`;
|
|
626309
|
-
|
|
626351
|
+
execSync52(pipCmd, { stdio: "pipe", timeout: 12e4 });
|
|
626310
626352
|
lastError = "";
|
|
626311
626353
|
} catch (e2) {
|
|
626312
626354
|
const stderr = e2.stderr?.toString?.()?.trim?.() ?? "";
|
|
@@ -626318,7 +626360,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
626318
626360
|
}
|
|
626319
626361
|
if (process.platform === "win32" && !hasCmd(d2.binary)) {
|
|
626320
626362
|
try {
|
|
626321
|
-
const freshPath =
|
|
626363
|
+
const freshPath = execSync52(
|
|
626322
626364
|
`powershell -NoProfile -Command "[System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User')"`,
|
|
626323
626365
|
{ encoding: "utf8", timeout: 5e3, stdio: "pipe" }
|
|
626324
626366
|
).trim();
|
|
@@ -626364,7 +626406,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
626364
626406
|
const venvCmds = {
|
|
626365
626407
|
apt: () => {
|
|
626366
626408
|
try {
|
|
626367
|
-
const pyVer =
|
|
626409
|
+
const pyVer = execSync52(
|
|
626368
626410
|
`python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"`,
|
|
626369
626411
|
{ encoding: "utf8", stdio: "pipe", timeout: 5e3 }
|
|
626370
626412
|
).trim();
|
|
@@ -626396,12 +626438,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
626396
626438
|
const venvPip2 = join133(venvBin, "pip");
|
|
626397
626439
|
log22("Installing moondream-station in ~/.omnius/venv...");
|
|
626398
626440
|
try {
|
|
626399
|
-
|
|
626441
|
+
execSync52(`"${venvPip2}" install moondream-station`, { stdio: "pipe", timeout: 3e5 });
|
|
626400
626442
|
if (existsSync119(venvMoondream)) {
|
|
626401
626443
|
log22("moondream-station installed successfully.");
|
|
626402
626444
|
} else {
|
|
626403
626445
|
try {
|
|
626404
|
-
const check =
|
|
626446
|
+
const check = execSync52(`"${venvPip2}" show moondream-station`, { encoding: "utf8", stdio: "pipe", timeout: 5e3 });
|
|
626405
626447
|
if (check.includes("moondream")) {
|
|
626406
626448
|
log22("moondream-station package installed.");
|
|
626407
626449
|
}
|
|
@@ -626418,7 +626460,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
626418
626460
|
const venvPip2 = join133(venvBin, isWin2 ? "pip.exe" : "pip");
|
|
626419
626461
|
let ocrStackInstalled = false;
|
|
626420
626462
|
try {
|
|
626421
|
-
|
|
626463
|
+
execSync52(
|
|
626422
626464
|
`"${venvPython2}" -c "import cv2, pytesseract, numpy, PIL"`,
|
|
626423
626465
|
{ stdio: "pipe", timeout: 1e4 }
|
|
626424
626466
|
);
|
|
@@ -626429,12 +626471,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
626429
626471
|
const ocrPackages = "pytesseract Pillow opencv-python-headless numpy";
|
|
626430
626472
|
log22("Installing OCR Python stack (pytesseract, OpenCV, Pillow, numpy)...");
|
|
626431
626473
|
try {
|
|
626432
|
-
|
|
626474
|
+
execSync52(
|
|
626433
626475
|
`"${venvPip2}" install ${ocrPackages}`,
|
|
626434
626476
|
{ stdio: "pipe", timeout: 3e5 }
|
|
626435
626477
|
);
|
|
626436
626478
|
try {
|
|
626437
|
-
|
|
626479
|
+
execSync52(
|
|
626438
626480
|
`"${venvPython2}" -c "import cv2, pytesseract, numpy, PIL"`,
|
|
626439
626481
|
{ stdio: "pipe", timeout: 1e4 }
|
|
626440
626482
|
);
|
|
@@ -626470,7 +626512,7 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
626470
626512
|
const archMap = { x64: "amd64", arm64: "arm64", arm: "arm" };
|
|
626471
626513
|
const cfArch = archMap[arch3] ?? "amd64";
|
|
626472
626514
|
try {
|
|
626473
|
-
|
|
626515
|
+
execSync52(
|
|
626474
626516
|
`curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && mkdir -p "${homedir43()}/.local/bin" && mv /tmp/cloudflared "${homedir43()}/.local/bin/cloudflared"`,
|
|
626475
626517
|
{ stdio: "pipe", timeout: 6e4 }
|
|
626476
626518
|
);
|
|
@@ -626486,7 +626528,7 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
626486
626528
|
try {
|
|
626487
626529
|
const terminalElevation = process.env["OMNIUS_ELEVATION_MODE"] === "terminal" && process.stdin.isTTY && process.stdout.isTTY;
|
|
626488
626530
|
const sudoMove = terminalElevation ? `sudo mv /tmp/cloudflared /usr/local/bin/cloudflared` : `sudo mv /tmp/cloudflared /usr/local/bin/cloudflared 2>/dev/null`;
|
|
626489
|
-
|
|
626531
|
+
execSync52(
|
|
626490
626532
|
`curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && ` + sudoMove,
|
|
626491
626533
|
{ stdio: terminalElevation ? "inherit" : "pipe", timeout: 6e4 }
|
|
626492
626534
|
);
|
|
@@ -626498,7 +626540,7 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
626498
626540
|
}
|
|
626499
626541
|
} else if (os9 === "darwin") {
|
|
626500
626542
|
try {
|
|
626501
|
-
|
|
626543
|
+
execSync52("brew install cloudflared", { stdio: "pipe", timeout: 12e4 });
|
|
626502
626544
|
if (hasCmd("cloudflared")) {
|
|
626503
626545
|
log22("cloudflared installed via Homebrew.");
|
|
626504
626546
|
return true;
|
|
@@ -626695,7 +626737,7 @@ function createExpandedVariantNamed(targetModel, baseModel, specs, sizeGB, kvByt
|
|
|
626695
626737
|
for (let i2 = 0; i2 < modelfileCandidates.length; i2++) {
|
|
626696
626738
|
writeFileSync62(modelfilePath, modelfileCandidates[i2] + "\n", "utf8");
|
|
626697
626739
|
try {
|
|
626698
|
-
|
|
626740
|
+
execSync52(`ollama create ${targetModel} -f ${modelfilePath}`, {
|
|
626699
626741
|
stdio: "pipe",
|
|
626700
626742
|
timeout: 12e4
|
|
626701
626743
|
});
|
|
@@ -626981,7 +627023,7 @@ async function repairAllExpandedVariants(backendUrl2) {
|
|
|
626981
627023
|
}
|
|
626982
627024
|
async function ensureNeovim() {
|
|
626983
627025
|
try {
|
|
626984
|
-
const nvimPath =
|
|
627026
|
+
const nvimPath = execSync52("which nvim 2>/dev/null || where nvim 2>nul", {
|
|
626985
627027
|
encoding: "utf8",
|
|
626986
627028
|
stdio: "pipe",
|
|
626987
627029
|
timeout: 5e3
|
|
@@ -627002,14 +627044,14 @@ async function ensureNeovim() {
|
|
|
627002
627044
|
const url = `https://github.com/neovim/neovim/releases/latest/download/${appImageName}`;
|
|
627003
627045
|
console.log(` Downloading Neovim (${appImageName})...`);
|
|
627004
627046
|
try {
|
|
627005
|
-
|
|
627006
|
-
|
|
627047
|
+
execSync52(`curl -fsSL "${url}" -o "${nvimDest}"`, { stdio: "pipe", timeout: 6e4 });
|
|
627048
|
+
execSync52(`chmod +x "${nvimDest}"`, { stdio: "pipe", timeout: 3e3 });
|
|
627007
627049
|
} catch (err) {
|
|
627008
627050
|
console.log(` Failed to download Neovim: ${err instanceof Error ? err.message : String(err)}`);
|
|
627009
627051
|
return null;
|
|
627010
627052
|
}
|
|
627011
627053
|
try {
|
|
627012
|
-
const ver =
|
|
627054
|
+
const ver = execSync52(`"${nvimDest}" --version`, { encoding: "utf8", stdio: "pipe", timeout: 5e3 }).split("\n")[0];
|
|
627013
627055
|
console.log(` Installed: ${ver}`);
|
|
627014
627056
|
} catch {
|
|
627015
627057
|
console.log(" Warning: nvim binary downloaded but may not work (missing FUSE? Try: nvim --appimage-extract)");
|
|
@@ -627024,8 +627066,8 @@ async function ensureNeovim() {
|
|
|
627024
627066
|
if (hasCmd("brew")) {
|
|
627025
627067
|
console.log(" Installing Neovim via Homebrew...");
|
|
627026
627068
|
try {
|
|
627027
|
-
|
|
627028
|
-
const nvimPath =
|
|
627069
|
+
execSync52("brew install neovim", { stdio: "inherit", timeout: 12e4 });
|
|
627070
|
+
const nvimPath = execSync52("which nvim", { encoding: "utf8", stdio: "pipe", timeout: 3e3 }).trim();
|
|
627029
627071
|
return nvimPath || null;
|
|
627030
627072
|
} catch {
|
|
627031
627073
|
console.log(" brew install neovim failed.");
|
|
@@ -627039,7 +627081,7 @@ async function ensureNeovim() {
|
|
|
627039
627081
|
if (hasCmd("choco")) {
|
|
627040
627082
|
console.log(" Installing Neovim via Chocolatey...");
|
|
627041
627083
|
try {
|
|
627042
|
-
|
|
627084
|
+
execSync52("choco install neovim -y", { stdio: "inherit", timeout: 12e4 });
|
|
627043
627085
|
return "nvim";
|
|
627044
627086
|
} catch {
|
|
627045
627087
|
console.log(" choco install neovim failed.");
|
|
@@ -627048,7 +627090,7 @@ async function ensureNeovim() {
|
|
|
627048
627090
|
if (hasCmd("winget")) {
|
|
627049
627091
|
console.log(" Installing Neovim via winget...");
|
|
627050
627092
|
try {
|
|
627051
|
-
|
|
627093
|
+
execSync52("winget install Neovim.Neovim --accept-source-agreements --accept-package-agreements", {
|
|
627052
627094
|
stdio: "inherit",
|
|
627053
627095
|
timeout: 12e4
|
|
627054
627096
|
});
|
|
@@ -631117,7 +631159,7 @@ var init_audio_waveform = __esm({
|
|
|
631117
631159
|
import { existsSync as existsSync125, unlinkSync as unlinkSync24 } from "node:fs";
|
|
631118
631160
|
import { tmpdir as tmpdir20 } from "node:os";
|
|
631119
631161
|
import { join as join137 } from "node:path";
|
|
631120
|
-
import { execSync as
|
|
631162
|
+
import { execSync as execSync53 } from "node:child_process";
|
|
631121
631163
|
function isNeovimActive() {
|
|
631122
631164
|
return _state2 !== null && !_state2.cleanedUp;
|
|
631123
631165
|
}
|
|
@@ -631134,7 +631176,7 @@ async function startNeovimMode(opts) {
|
|
|
631134
631176
|
}
|
|
631135
631177
|
let nvimPath;
|
|
631136
631178
|
try {
|
|
631137
|
-
nvimPath =
|
|
631179
|
+
nvimPath = execSync53("which nvim 2>/dev/null", { encoding: "utf8" }).trim();
|
|
631138
631180
|
if (!nvimPath) throw new Error();
|
|
631139
631181
|
} catch {
|
|
631140
631182
|
const installed = await ensureNeovim();
|
|
@@ -631861,8 +631903,8 @@ async function forceKillDaemon(port) {
|
|
|
631861
631903
|
}
|
|
631862
631904
|
}
|
|
631863
631905
|
try {
|
|
631864
|
-
const { execSync:
|
|
631865
|
-
const out =
|
|
631906
|
+
const { execSync: execSync62 } = await import("node:child_process");
|
|
631907
|
+
const out = execSync62(
|
|
631866
631908
|
`lsof -ti :${p2} 2>/dev/null || fuser ${p2}/tcp 2>/dev/null || true`,
|
|
631867
631909
|
{ encoding: "utf8", timeout: 3e3 }
|
|
631868
631910
|
).trim();
|
|
@@ -634753,7 +634795,7 @@ import {
|
|
|
634753
634795
|
import { join as join143, dirname as dirname44, resolve as resolve60 } from "node:path";
|
|
634754
634796
|
import { homedir as homedir48, tmpdir as tmpdir21, platform as platform6 } from "node:os";
|
|
634755
634797
|
import {
|
|
634756
|
-
execSync as
|
|
634798
|
+
execSync as execSync54,
|
|
634757
634799
|
spawn as nodeSpawn
|
|
634758
634800
|
} from "node:child_process";
|
|
634759
634801
|
import { createRequire as createRequire7 } from "node:module";
|
|
@@ -637100,7 +637142,7 @@ except Exception as exc:
|
|
|
637100
637142
|
}
|
|
637101
637143
|
for (const player of ["paplay", "pw-play", "aplay"]) {
|
|
637102
637144
|
try {
|
|
637103
|
-
|
|
637145
|
+
execSync54(`which ${player}`, { stdio: "pipe" });
|
|
637104
637146
|
return [player, path12];
|
|
637105
637147
|
} catch {
|
|
637106
637148
|
}
|
|
@@ -637278,7 +637320,7 @@ except Exception as exc:
|
|
|
637278
637320
|
return false;
|
|
637279
637321
|
}
|
|
637280
637322
|
try {
|
|
637281
|
-
|
|
637323
|
+
execSync54(`${JSON.stringify(venvPy)} -c "import supertonic"`, {
|
|
637282
637324
|
stdio: "pipe",
|
|
637283
637325
|
timeout: 1e4
|
|
637284
637326
|
});
|
|
@@ -637410,7 +637452,7 @@ except Exception as exc:
|
|
|
637410
637452
|
if (this.python3Path) return this.python3Path;
|
|
637411
637453
|
for (const bin of ["python3", "python"]) {
|
|
637412
637454
|
try {
|
|
637413
|
-
const path12 =
|
|
637455
|
+
const path12 = execSync54(`which ${bin}`, { stdio: "pipe", timeout: 5e3 }).toString().trim();
|
|
637414
637456
|
if (path12) {
|
|
637415
637457
|
this.python3Path = path12;
|
|
637416
637458
|
return path12;
|
|
@@ -637474,7 +637516,7 @@ except Exception as exc:
|
|
|
637474
637516
|
return false;
|
|
637475
637517
|
}
|
|
637476
637518
|
try {
|
|
637477
|
-
|
|
637519
|
+
execSync54(`${py} -c "import mlx_audio"`, {
|
|
637478
637520
|
stdio: "pipe",
|
|
637479
637521
|
timeout: 1e4
|
|
637480
637522
|
});
|
|
@@ -637543,14 +637585,14 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
637543
637585
|
`tts_gen.main(["--model", ${JSON.stringify(mlxModelId)}, "--text", text, "--voice", ${JSON.stringify(mlxVoice)}, "--lang_code", ${JSON.stringify(mlxLangCode)}, "--audio_path", ${JSON.stringify(wavPath)}])`
|
|
637544
637586
|
].join("; ");
|
|
637545
637587
|
try {
|
|
637546
|
-
|
|
637588
|
+
execSync54(
|
|
637547
637589
|
`${py} -c ${JSON.stringify(pyScript)} ${JSON.stringify(JSON.stringify(cleaned))}`,
|
|
637548
637590
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
637549
637591
|
);
|
|
637550
637592
|
} catch (err) {
|
|
637551
637593
|
try {
|
|
637552
637594
|
const safeText = cleaned.replace(/'/g, "'\\''");
|
|
637553
|
-
|
|
637595
|
+
execSync54(
|
|
637554
637596
|
`${py} -m mlx_audio.tts.generate --model ${mlxModelId} --text '${safeText}' --voice ${mlxVoice} --lang_code ${mlxLangCode} --audio_path ${JSON.stringify(wavPath)}`,
|
|
637555
637597
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
637556
637598
|
);
|
|
@@ -637624,14 +637666,14 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
637624
637666
|
`tts_gen.main(["--model", ${JSON.stringify(mlxModelId)}, "--text", text, "--voice", ${JSON.stringify(mlxVoice)}, "--lang_code", ${JSON.stringify(mlxLangCode)}, "--audio_path", ${JSON.stringify(wavPath)}])`
|
|
637625
637667
|
].join("; ");
|
|
637626
637668
|
try {
|
|
637627
|
-
|
|
637669
|
+
execSync54(
|
|
637628
637670
|
`${py} -c ${JSON.stringify(pyScript)} ${JSON.stringify(JSON.stringify(cleaned))}`,
|
|
637629
637671
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
637630
637672
|
);
|
|
637631
637673
|
} catch {
|
|
637632
637674
|
try {
|
|
637633
637675
|
const safeText = cleaned.replace(/'/g, "'\\''");
|
|
637634
|
-
|
|
637676
|
+
execSync54(
|
|
637635
637677
|
`${py} -m mlx_audio.tts.generate --model ${mlxModelId} --text '${safeText}' --voice ${mlxVoice} --lang_code ${mlxLangCode} --audio_path ${JSON.stringify(wavPath)}`,
|
|
637636
637678
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
637637
637679
|
);
|
|
@@ -637927,11 +637969,11 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
637927
637969
|
...isJetson ? (() => {
|
|
637928
637970
|
let jpVer = "v60";
|
|
637929
637971
|
try {
|
|
637930
|
-
const tegra = existsSync132("/etc/nv_tegra_release") ?
|
|
637972
|
+
const tegra = existsSync132("/etc/nv_tegra_release") ? execSync54("cat /etc/nv_tegra_release 2>/dev/null", {
|
|
637931
637973
|
encoding: "utf8",
|
|
637932
637974
|
timeout: 3e3
|
|
637933
637975
|
}).trim() : "";
|
|
637934
|
-
const dpkg =
|
|
637976
|
+
const dpkg = execSync54(
|
|
637935
637977
|
"dpkg -l nvidia-jetpack 2>/dev/null | grep nvidia-jetpack | awk '{print $3}'",
|
|
637936
637978
|
{ encoding: "utf8", timeout: 5e3 }
|
|
637937
637979
|
).trim();
|
|
@@ -643565,10 +643607,10 @@ ${result.output}`);
|
|
|
643565
643607
|
"Requesting sudo to migrate daemon to current user and restart..."
|
|
643566
643608
|
);
|
|
643567
643609
|
const nodeBin = process.execPath;
|
|
643568
|
-
const { execSync:
|
|
643610
|
+
const { execSync: execSync62 } = await import("node:child_process");
|
|
643569
643611
|
let npmRoot = "";
|
|
643570
643612
|
try {
|
|
643571
|
-
npmRoot =
|
|
643613
|
+
npmRoot = execSync62("npm root -g", { encoding: "utf8" }).trim();
|
|
643572
643614
|
} catch {
|
|
643573
643615
|
}
|
|
643574
643616
|
const launcher = npmRoot ? `${npmRoot}/omnius/dist/launcher.cjs` : "";
|
|
@@ -652276,7 +652318,7 @@ async function handleBroker(arg, _ctx) {
|
|
|
652276
652318
|
);
|
|
652277
652319
|
}
|
|
652278
652320
|
async function handleParallel(arg, ctx3) {
|
|
652279
|
-
const { execSync:
|
|
652321
|
+
const { execSync: execSync62 } = await import("node:child_process");
|
|
652280
652322
|
const baseUrl2 = ctx3.config.backendUrl || "http://localhost:11434";
|
|
652281
652323
|
const isRemote = ctx3.config.backendType === "nexus";
|
|
652282
652324
|
if (isRemote) {
|
|
@@ -652308,7 +652350,7 @@ async function handleParallel(arg, ctx3) {
|
|
|
652308
652350
|
}
|
|
652309
652351
|
let systemdVal = "";
|
|
652310
652352
|
try {
|
|
652311
|
-
const out =
|
|
652353
|
+
const out = execSync62(
|
|
652312
652354
|
"systemctl show ollama.service -p Environment 2>/dev/null || true",
|
|
652313
652355
|
{ encoding: "utf8" }
|
|
652314
652356
|
);
|
|
@@ -652343,7 +652385,7 @@ async function handleParallel(arg, ctx3) {
|
|
|
652343
652385
|
}
|
|
652344
652386
|
const isSystemd = (() => {
|
|
652345
652387
|
try {
|
|
652346
|
-
const out =
|
|
652388
|
+
const out = execSync62("systemctl is-active ollama.service 2>/dev/null", {
|
|
652347
652389
|
encoding: "utf8"
|
|
652348
652390
|
}).trim();
|
|
652349
652391
|
return out === "active" || out === "inactive";
|
|
@@ -654645,13 +654687,13 @@ async function showExposeDashboard(gateway, rl, ctx3) {
|
|
|
654645
654687
|
const cmd = `/endpoint ${id} --auth ${gateway.authKey ?? ""}`;
|
|
654646
654688
|
let copied = false;
|
|
654647
654689
|
try {
|
|
654648
|
-
const { execSync:
|
|
654690
|
+
const { execSync: execSync62 } = __require("node:child_process");
|
|
654649
654691
|
const platform7 = process.platform;
|
|
654650
654692
|
if (platform7 === "darwin") {
|
|
654651
|
-
|
|
654693
|
+
execSync62("pbcopy", { input: cmd, timeout: 3e3 });
|
|
654652
654694
|
copied = true;
|
|
654653
654695
|
} else if (platform7 === "win32") {
|
|
654654
|
-
|
|
654696
|
+
execSync62("clip", { input: cmd, timeout: 3e3 });
|
|
654655
654697
|
copied = true;
|
|
654656
654698
|
} else {
|
|
654657
654699
|
for (const tool of [
|
|
@@ -654660,7 +654702,7 @@ async function showExposeDashboard(gateway, rl, ctx3) {
|
|
|
654660
654702
|
"wl-copy"
|
|
654661
654703
|
]) {
|
|
654662
654704
|
try {
|
|
654663
|
-
|
|
654705
|
+
execSync62(tool, {
|
|
654664
654706
|
input: cmd,
|
|
654665
654707
|
timeout: 3e3,
|
|
654666
654708
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -655051,7 +655093,7 @@ var init_commands = __esm({
|
|
|
655051
655093
|
// packages/cli/src/tui/project-context.ts
|
|
655052
655094
|
import { existsSync as existsSync134, readFileSync as readFileSync107, readdirSync as readdirSync46, mkdirSync as mkdirSync79, writeFileSync as writeFileSync69 } from "node:fs";
|
|
655053
655095
|
import { join as join145, basename as basename27 } from "node:path";
|
|
655054
|
-
import { execSync as
|
|
655096
|
+
import { execSync as execSync55 } from "node:child_process";
|
|
655055
655097
|
import { homedir as homedir50 } from "node:os";
|
|
655056
655098
|
function projectContextUrlSpanAt(text2, index) {
|
|
655057
655099
|
PROJECT_CONTEXT_URL_RE.lastIndex = 0;
|
|
@@ -655110,18 +655152,18 @@ function loadProjectMap(repoRoot) {
|
|
|
655110
655152
|
}
|
|
655111
655153
|
function getGitInfo(repoRoot) {
|
|
655112
655154
|
try {
|
|
655113
|
-
|
|
655155
|
+
execSync55("git rev-parse --is-inside-work-tree", { cwd: repoRoot, stdio: "pipe" });
|
|
655114
655156
|
} catch {
|
|
655115
655157
|
return "";
|
|
655116
655158
|
}
|
|
655117
655159
|
const lines = [];
|
|
655118
655160
|
try {
|
|
655119
|
-
const branch =
|
|
655161
|
+
const branch = execSync55("git branch --show-current", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
655120
655162
|
if (branch) lines.push(`Branch: ${branch}`);
|
|
655121
655163
|
} catch {
|
|
655122
655164
|
}
|
|
655123
655165
|
try {
|
|
655124
|
-
const status =
|
|
655166
|
+
const status = execSync55("git status --porcelain", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
655125
655167
|
if (status) {
|
|
655126
655168
|
const changed = status.split("\n").length;
|
|
655127
655169
|
lines.push(`Working tree: ${changed} changed file(s)`);
|
|
@@ -655131,7 +655173,7 @@ function getGitInfo(repoRoot) {
|
|
|
655131
655173
|
} catch {
|
|
655132
655174
|
}
|
|
655133
655175
|
try {
|
|
655134
|
-
const log22 =
|
|
655176
|
+
const log22 = execSync55("git log --oneline -5 --no-decorate", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
655135
655177
|
if (log22) lines.push(`Recent commits:
|
|
655136
655178
|
${log22}`);
|
|
655137
655179
|
} catch {
|
|
@@ -660069,7 +660111,7 @@ var init_promptLoader3 = __esm({
|
|
|
660069
660111
|
// packages/cli/src/tui/dream-engine.ts
|
|
660070
660112
|
import { mkdirSync as mkdirSync86, writeFileSync as writeFileSync74, readFileSync as readFileSync114, existsSync as existsSync142, readdirSync as readdirSync51 } from "node:fs";
|
|
660071
660113
|
import { join as join154, basename as basename33 } from "node:path";
|
|
660072
|
-
import { execSync as
|
|
660114
|
+
import { execSync as execSync56 } from "node:child_process";
|
|
660073
660115
|
function setDreamWriteContent(fn) {
|
|
660074
660116
|
_dreamWriteContent = fn;
|
|
660075
660117
|
}
|
|
@@ -660442,7 +660484,7 @@ var init_dream_engine = __esm({
|
|
|
660442
660484
|
}
|
|
660443
660485
|
}
|
|
660444
660486
|
try {
|
|
660445
|
-
const output =
|
|
660487
|
+
const output = execSync56(cmd, {
|
|
660446
660488
|
cwd: this.repoRoot,
|
|
660447
660489
|
timeout: 3e4,
|
|
660448
660490
|
encoding: "utf-8",
|
|
@@ -661419,17 +661461,17 @@ ${summary}` };
|
|
|
661419
661461
|
try {
|
|
661420
661462
|
mkdirSync86(checkpointDir3, { recursive: true });
|
|
661421
661463
|
try {
|
|
661422
|
-
const gitStatus =
|
|
661464
|
+
const gitStatus = execSync56("git status --porcelain", {
|
|
661423
661465
|
cwd: this.repoRoot,
|
|
661424
661466
|
encoding: "utf-8",
|
|
661425
661467
|
timeout: 1e4
|
|
661426
661468
|
});
|
|
661427
|
-
const gitDiff =
|
|
661469
|
+
const gitDiff = execSync56("git diff", {
|
|
661428
661470
|
cwd: this.repoRoot,
|
|
661429
661471
|
encoding: "utf-8",
|
|
661430
661472
|
timeout: 1e4
|
|
661431
661473
|
});
|
|
661432
|
-
const gitHash =
|
|
661474
|
+
const gitHash = execSync56("git rev-parse HEAD 2>/dev/null || echo 'no-git'", {
|
|
661433
661475
|
cwd: this.repoRoot,
|
|
661434
661476
|
encoding: "utf-8",
|
|
661435
661477
|
timeout: 5e3
|
|
@@ -690955,7 +690997,7 @@ __export(aiwg_exports, {
|
|
|
690955
690997
|
import { existsSync as existsSync154, readFileSync as readFileSync124, readdirSync as readdirSync55, statSync as statSync55 } from "node:fs";
|
|
690956
690998
|
import { join as join165 } from "node:path";
|
|
690957
690999
|
import { homedir as homedir55 } from "node:os";
|
|
690958
|
-
import { execSync as
|
|
691000
|
+
import { execSync as execSync57 } from "node:child_process";
|
|
690959
691001
|
function resolveAiwgRoot() {
|
|
690960
691002
|
if (_cachedAiwgRoot !== void 0) return _cachedAiwgRoot;
|
|
690961
691003
|
const envRoot = process.env["OMNIUS_AIWG_ROOT"];
|
|
@@ -690969,7 +691011,7 @@ function resolveAiwgRoot() {
|
|
|
690969
691011
|
return shareDir;
|
|
690970
691012
|
}
|
|
690971
691013
|
try {
|
|
690972
|
-
const globalRoot =
|
|
691014
|
+
const globalRoot = execSync57("npm root -g", {
|
|
690973
691015
|
encoding: "utf-8",
|
|
690974
691016
|
timeout: 5e3,
|
|
690975
691017
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -691011,7 +691053,7 @@ function resolveAiwgRoot() {
|
|
|
691011
691053
|
}
|
|
691012
691054
|
}
|
|
691013
691055
|
try {
|
|
691014
|
-
const whichAiwg =
|
|
691056
|
+
const whichAiwg = execSync57("which aiwg 2>/dev/null || where aiwg 2>nul", {
|
|
691015
691057
|
encoding: "utf-8",
|
|
691016
691058
|
timeout: 3e3,
|
|
691017
691059
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -693977,9 +694019,9 @@ function resolveLocalPeerId() {
|
|
|
693977
694019
|
}
|
|
693978
694020
|
let scanResult = null;
|
|
693979
694021
|
try {
|
|
693980
|
-
const { execSync:
|
|
694022
|
+
const { execSync: execSync62 } = __require("node:child_process");
|
|
693981
694023
|
const cmd = `find "${homedir58()}" -maxdepth 4 -path '*/.omnius/nexus/status.json' -type f 2>/dev/null | head -50`;
|
|
693982
|
-
const out =
|
|
694024
|
+
const out = execSync62(cmd, { encoding: "utf-8", timeout: 2e3 }).trim();
|
|
693983
694025
|
for (const line of out.split("\n")) {
|
|
693984
694026
|
const f2 = line.trim();
|
|
693985
694027
|
if (!f2) continue;
|
|
@@ -694009,8 +694051,8 @@ function locateTorScript(filename) {
|
|
|
694009
694051
|
if (existsSync158(p2)) return p2;
|
|
694010
694052
|
}
|
|
694011
694053
|
try {
|
|
694012
|
-
const { execSync:
|
|
694013
|
-
const root =
|
|
694054
|
+
const { execSync: execSync62 } = __require("node:child_process");
|
|
694055
|
+
const root = execSync62("npm root -g", { encoding: "utf-8", timeout: 5e3 }).trim();
|
|
694014
694056
|
const p2 = join169(root, "omnius", "dist", "scripts", "tor", filename);
|
|
694015
694057
|
if (existsSync158(p2)) return p2;
|
|
694016
694058
|
} catch {
|
|
@@ -707380,7 +707422,7 @@ var init_chat_followup = __esm({
|
|
|
707380
707422
|
});
|
|
707381
707423
|
|
|
707382
707424
|
// packages/cli/src/docker.ts
|
|
707383
|
-
import { execSync as
|
|
707425
|
+
import { execSync as execSync58, spawn as spawn32 } from "node:child_process";
|
|
707384
707426
|
import { existsSync as existsSync160, mkdirSync as mkdirSync101, writeFileSync as writeFileSync85 } from "node:fs";
|
|
707385
707427
|
import { join as join171, resolve as resolve68, dirname as dirname50 } from "node:path";
|
|
707386
707428
|
import { homedir as homedir59 } from "node:os";
|
|
@@ -707401,7 +707443,7 @@ function getDockerDir() {
|
|
|
707401
707443
|
}
|
|
707402
707444
|
function isDockerAvailable() {
|
|
707403
707445
|
try {
|
|
707404
|
-
|
|
707446
|
+
execSync58("docker info", { stdio: "pipe", timeout: 1e4 });
|
|
707405
707447
|
return true;
|
|
707406
707448
|
} catch {
|
|
707407
707449
|
return false;
|
|
@@ -707409,7 +707451,7 @@ function isDockerAvailable() {
|
|
|
707409
707451
|
}
|
|
707410
707452
|
function isDockerInstalled() {
|
|
707411
707453
|
try {
|
|
707412
|
-
|
|
707454
|
+
execSync58("docker --version", { stdio: "pipe", timeout: 5e3 });
|
|
707413
707455
|
return true;
|
|
707414
707456
|
} catch {
|
|
707415
707457
|
return false;
|
|
@@ -707434,31 +707476,31 @@ async function ensureDocker() {
|
|
|
707434
707476
|
}
|
|
707435
707477
|
try {
|
|
707436
707478
|
console.log("[omnius-docker] Docker not found. Installing via get.docker.com...");
|
|
707437
|
-
|
|
707479
|
+
execSync58("curl -fsSL https://get.docker.com | sh", {
|
|
707438
707480
|
stdio: "inherit",
|
|
707439
707481
|
timeout: 3e5
|
|
707440
707482
|
});
|
|
707441
707483
|
const user = process.env["USER"] || process.env["LOGNAME"];
|
|
707442
707484
|
if (user) {
|
|
707443
707485
|
try {
|
|
707444
|
-
|
|
707486
|
+
execSync58(`sudo usermod -aG docker ${user}`, { stdio: "pipe" });
|
|
707445
707487
|
} catch {
|
|
707446
707488
|
}
|
|
707447
707489
|
}
|
|
707448
707490
|
try {
|
|
707449
|
-
|
|
707491
|
+
execSync58("sudo systemctl start docker", { stdio: "pipe", timeout: 15e3 });
|
|
707450
707492
|
} catch {
|
|
707451
707493
|
}
|
|
707452
707494
|
try {
|
|
707453
|
-
|
|
707454
|
-
const runtimes =
|
|
707495
|
+
execSync58("nvidia-smi", { stdio: "pipe", timeout: 5e3 });
|
|
707496
|
+
const runtimes = execSync58("docker info --format '{{json .Runtimes}}'", {
|
|
707455
707497
|
stdio: "pipe",
|
|
707456
707498
|
timeout: 5e3
|
|
707457
707499
|
}).toString();
|
|
707458
707500
|
if (!runtimes.includes("nvidia")) {
|
|
707459
707501
|
console.log("[omnius-docker] NVIDIA GPU detected. Installing nvidia-container-toolkit...");
|
|
707460
707502
|
try {
|
|
707461
|
-
|
|
707503
|
+
execSync58(`
|
|
707462
707504
|
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg 2>/dev/null
|
|
707463
707505
|
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list > /dev/null 2>&1
|
|
707464
707506
|
sudo apt-get update -qq 2>/dev/null && sudo apt-get install -y -qq nvidia-container-toolkit 2>/dev/null || ( sudo dnf install -y nvidia-container-toolkit 2>/dev/null || sudo yum install -y nvidia-container-toolkit 2>/dev/null || true )
|
|
@@ -707488,7 +707530,7 @@ async function ensureDocker() {
|
|
|
707488
707530
|
}
|
|
707489
707531
|
async function ensureNvidiaToolkit() {
|
|
707490
707532
|
try {
|
|
707491
|
-
|
|
707533
|
+
execSync58("nvidia-smi --query-gpu=name --format=csv,noheader", { stdio: "pipe", timeout: 5e3 });
|
|
707492
707534
|
} catch {
|
|
707493
707535
|
return { ok: false, message: "No NVIDIA GPU detected (nvidia-smi not found)" };
|
|
707494
707536
|
}
|
|
@@ -707499,7 +707541,7 @@ async function ensureNvidiaToolkit() {
|
|
|
707499
707541
|
return { ok: false, message: "Auto-install only supported on Linux. Install manually: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html" };
|
|
707500
707542
|
}
|
|
707501
707543
|
try {
|
|
707502
|
-
|
|
707544
|
+
execSync58(`
|
|
707503
707545
|
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg 2>/dev/null
|
|
707504
707546
|
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list > /dev/null 2>&1
|
|
707505
707547
|
sudo apt-get update -qq 2>/dev/null && sudo apt-get install -y -qq nvidia-container-toolkit 2>/dev/null || ( sudo dnf install -y nvidia-container-toolkit 2>/dev/null || sudo yum install -y nvidia-container-toolkit 2>/dev/null || true )
|
|
@@ -707513,7 +707555,7 @@ async function ensureNvidiaToolkit() {
|
|
|
707513
707555
|
}
|
|
707514
707556
|
function isOmniusImageBuilt() {
|
|
707515
707557
|
try {
|
|
707516
|
-
const out =
|
|
707558
|
+
const out = execSync58(`docker images -q ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG}`, {
|
|
707517
707559
|
stdio: "pipe",
|
|
707518
707560
|
timeout: 5e3
|
|
707519
707561
|
}).toString().trim();
|
|
@@ -707537,7 +707579,7 @@ async function ensureOmniusImage(force = false) {
|
|
|
707537
707579
|
}
|
|
707538
707580
|
try {
|
|
707539
707581
|
console.log(`[omnius-docker] Building image ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG}...`);
|
|
707540
|
-
|
|
707582
|
+
execSync58(`docker build -t ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG} ${buildContext}`, {
|
|
707541
707583
|
stdio: "inherit",
|
|
707542
707584
|
timeout: 6e5
|
|
707543
707585
|
// 10 min
|
|
@@ -707611,11 +707653,11 @@ exec "$@"
|
|
|
707611
707653
|
}
|
|
707612
707654
|
function hasNvidiaGpu() {
|
|
707613
707655
|
try {
|
|
707614
|
-
|
|
707656
|
+
execSync58("nvidia-smi --query-gpu=name --format=csv,noheader", {
|
|
707615
707657
|
stdio: "pipe",
|
|
707616
707658
|
timeout: 5e3
|
|
707617
707659
|
});
|
|
707618
|
-
const runtimes =
|
|
707660
|
+
const runtimes = execSync58("docker info --format '{{json .Runtimes}}'", {
|
|
707619
707661
|
stdio: "pipe",
|
|
707620
707662
|
timeout: 5e3
|
|
707621
707663
|
}).toString();
|
|
@@ -707864,7 +707906,7 @@ import { createRequire as createRequire8 } from "node:module";
|
|
|
707864
707906
|
import { fileURLToPath as fileURLToPath22 } from "node:url";
|
|
707865
707907
|
import { dirname as dirname51, join as join173, resolve as resolve69 } from "node:path";
|
|
707866
707908
|
import { homedir as homedir60 } from "node:os";
|
|
707867
|
-
import { spawn as spawn33, execSync as
|
|
707909
|
+
import { spawn as spawn33, execSync as execSync59 } from "node:child_process";
|
|
707868
707910
|
import {
|
|
707869
707911
|
createReadStream as createReadStream2,
|
|
707870
707912
|
mkdirSync as mkdirSync102,
|
|
@@ -712323,7 +712365,7 @@ function handleV1RunsDelete(res, id) {
|
|
|
712323
712365
|
const containerName = `omnius-${id}`;
|
|
712324
712366
|
if (job.sandbox === "container") {
|
|
712325
712367
|
try {
|
|
712326
|
-
|
|
712368
|
+
execSync59(`docker stop ${containerName}`, {
|
|
712327
712369
|
timeout: 5e3,
|
|
712328
712370
|
stdio: "ignore"
|
|
712329
712371
|
});
|
|
@@ -714673,8 +714715,8 @@ data: ${JSON.stringify(data)}
|
|
|
714673
714715
|
}
|
|
714674
714716
|
setImmediate(() => {
|
|
714675
714717
|
try {
|
|
714676
|
-
const { execSync:
|
|
714677
|
-
|
|
714718
|
+
const { execSync: execSync62 } = require4("node:child_process");
|
|
714719
|
+
execSync62("npm update -g omnius 2>/dev/null || true", {
|
|
714678
714720
|
stdio: "pipe"
|
|
714679
714721
|
});
|
|
714680
714722
|
} catch {
|
|
@@ -714717,7 +714759,7 @@ data: ${JSON.stringify(data)}
|
|
|
714717
714759
|
return;
|
|
714718
714760
|
}
|
|
714719
714761
|
try {
|
|
714720
|
-
const { execSync:
|
|
714762
|
+
const { execSync: execSync62 } = require4("node:child_process");
|
|
714721
714763
|
let audioPath = null;
|
|
714722
714764
|
const ttsCmds = [
|
|
714723
714765
|
`espeak "${text2}" -w /tmp/tts_${Date.now()}.wav 2>/dev/null`,
|
|
@@ -714726,7 +714768,7 @@ data: ${JSON.stringify(data)}
|
|
|
714726
714768
|
];
|
|
714727
714769
|
for (const cmd of ttsCmds) {
|
|
714728
714770
|
try {
|
|
714729
|
-
|
|
714771
|
+
execSync62(cmd, { stdio: "pipe" });
|
|
714730
714772
|
audioPath = "/tmp/tts_" + Date.now() + ".wav";
|
|
714731
714773
|
break;
|
|
714732
714774
|
} catch {
|
|
@@ -718456,7 +718498,7 @@ var clipboard_media_exports = {};
|
|
|
718456
718498
|
__export(clipboard_media_exports, {
|
|
718457
718499
|
pasteClipboardImageToFile: () => pasteClipboardImageToFile
|
|
718458
718500
|
});
|
|
718459
|
-
import { execFileSync as execFileSync11, execSync as
|
|
718501
|
+
import { execFileSync as execFileSync11, execSync as execSync60 } from "node:child_process";
|
|
718460
718502
|
import { mkdirSync as mkdirSync103, readFileSync as readFileSync130, rmSync as rmSync13, writeFileSync as writeFileSync87 } from "node:fs";
|
|
718461
718503
|
import { join as join174 } from "node:path";
|
|
718462
718504
|
function pasteClipboardImageToFile(repoRoot) {
|
|
@@ -718471,7 +718513,7 @@ function pasteClipboardImageToFile(repoRoot) {
|
|
|
718471
718513
|
function readClipboardImage() {
|
|
718472
718514
|
if (process.platform === "darwin") {
|
|
718473
718515
|
try {
|
|
718474
|
-
|
|
718516
|
+
execSync60("command -v pngpaste", { stdio: "ignore", timeout: 1e3 });
|
|
718475
718517
|
const tmp = `/tmp/omnius-clipboard-${Date.now()}.png`;
|
|
718476
718518
|
execFileSync11("pngpaste", [tmp], { timeout: 3e3 });
|
|
718477
718519
|
const buffer2 = readFileSync130(tmp);
|
|
@@ -718547,7 +718589,7 @@ import {
|
|
|
718547
718589
|
writeFile as writeFileAsync2,
|
|
718548
718590
|
mkdir as mkdirAsync
|
|
718549
718591
|
} from "node:fs/promises";
|
|
718550
|
-
import { execSync as
|
|
718592
|
+
import { execSync as execSync61 } from "node:child_process";
|
|
718551
718593
|
import { homedir as homedir61 } from "node:os";
|
|
718552
718594
|
function formatTimeAgo2(date) {
|
|
718553
718595
|
const seconds = Math.floor((Date.now() - date.getTime()) / 1e3);
|
|
@@ -726832,7 +726874,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
726832
726874
|
try {
|
|
726833
726875
|
if (process.platform === "win32") {
|
|
726834
726876
|
try {
|
|
726835
|
-
|
|
726877
|
+
execSync61(`taskkill /F /PID ${pid}`, {
|
|
726836
726878
|
timeout: 5e3,
|
|
726837
726879
|
stdio: "ignore"
|
|
726838
726880
|
});
|
|
@@ -726864,7 +726906,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
726864
726906
|
if (pid > 0) {
|
|
726865
726907
|
if (process.platform === "win32") {
|
|
726866
726908
|
try {
|
|
726867
|
-
|
|
726909
|
+
execSync61(`taskkill /F /PID ${pid}`, {
|
|
726868
726910
|
timeout: 5e3,
|
|
726869
726911
|
stdio: "ignore"
|
|
726870
726912
|
});
|
|
@@ -726884,7 +726926,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
726884
726926
|
} catch {
|
|
726885
726927
|
}
|
|
726886
726928
|
try {
|
|
726887
|
-
|
|
726929
|
+
execSync61(
|
|
726888
726930
|
process.platform === "win32" ? "timeout /t 1 /nobreak >nul" : "sleep 0.5",
|
|
726889
726931
|
{ timeout: 3e3, stdio: "ignore" }
|
|
726890
726932
|
);
|
|
@@ -726901,7 +726943,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
726901
726943
|
} catch (err) {
|
|
726902
726944
|
if (attempt < 2) {
|
|
726903
726945
|
try {
|
|
726904
|
-
|
|
726946
|
+
execSync61(
|
|
726905
726947
|
process.platform === "win32" ? "timeout /t 1 /nobreak >nul" : "sleep 0.3",
|
|
726906
726948
|
{ timeout: 3e3, stdio: "ignore" }
|
|
726907
726949
|
);
|
|
@@ -726915,7 +726957,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
726915
726957
|
);
|
|
726916
726958
|
if (process.platform === "win32") {
|
|
726917
726959
|
try {
|
|
726918
|
-
|
|
726960
|
+
execSync61(`rd /s /q "${omniusPath}"`, {
|
|
726919
726961
|
timeout: 1e4,
|
|
726920
726962
|
stdio: "ignore"
|
|
726921
726963
|
});
|