omnius 1.0.306 → 1.0.308
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 +167 -214
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9724,9 +9724,9 @@ var init_vision = __esm({
|
|
|
9724
9724
|
if (ollamaResult)
|
|
9725
9725
|
return ollamaResult;
|
|
9726
9726
|
try {
|
|
9727
|
-
const { execSync:
|
|
9727
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
9728
9728
|
try {
|
|
9729
|
-
|
|
9729
|
+
execSync63("pip3 install --user moondream 2>/dev/null || pip install --user moondream 2>/dev/null", {
|
|
9730
9730
|
timeout: 12e4,
|
|
9731
9731
|
stdio: "pipe"
|
|
9732
9732
|
});
|
|
@@ -9739,7 +9739,7 @@ var init_vision = __esm({
|
|
|
9739
9739
|
} catch {
|
|
9740
9740
|
}
|
|
9741
9741
|
try {
|
|
9742
|
-
|
|
9742
|
+
execSync63("ollama pull moondream", { timeout: 3e5, stdio: "pipe" });
|
|
9743
9743
|
const retryOllama = await this.tryOllamaVision(buffer2, filename, action, prompt, length4, start2, preferredModel);
|
|
9744
9744
|
if (retryOllama)
|
|
9745
9745
|
return retryOllama;
|
|
@@ -571397,8 +571397,8 @@ Respond with your assessment, then take action.`;
|
|
|
571397
571397
|
const memMod = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
|
571398
571398
|
let commitSha = "no-commit";
|
|
571399
571399
|
try {
|
|
571400
|
-
const { execSync:
|
|
571401
|
-
commitSha =
|
|
571400
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
571401
|
+
commitSha = execSync63("git rev-parse HEAD", {
|
|
571402
571402
|
cwd: this._workingDirectory,
|
|
571403
571403
|
stdio: ["ignore", "pipe", "ignore"]
|
|
571404
571404
|
}).toString().trim().slice(0, 12) || "no-commit";
|
|
@@ -580756,7 +580756,7 @@ ${result}`
|
|
|
580756
580756
|
const buffer2 = Buffer.from(rawBase64, "base64");
|
|
580757
580757
|
let resizedBase64 = null;
|
|
580758
580758
|
try {
|
|
580759
|
-
const { execSync:
|
|
580759
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
580760
580760
|
const { writeFileSync: writeFileSync87, readFileSync: readFileSync129, unlinkSync: unlinkSync35 } = await import("node:fs");
|
|
580761
580761
|
const { join: join172 } = await import("node:path");
|
|
580762
580762
|
const { tmpdir: tmpdir24 } = await import("node:os");
|
|
@@ -580766,7 +580766,7 @@ ${result}`
|
|
|
580766
580766
|
const pyBin = process.platform === "win32" ? "python" : "python3";
|
|
580767
580767
|
const escapedIn = tmpIn.replace(/\\/g, "\\\\");
|
|
580768
580768
|
const escapedOut = tmpOut.replace(/\\/g, "\\\\");
|
|
580769
|
-
|
|
580769
|
+
execSync63(`${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" });
|
|
580770
580770
|
const resizedBuf = readFileSync129(tmpOut);
|
|
580771
580771
|
resizedBase64 = `data:image/jpeg;base64,${resizedBuf.toString("base64")}`;
|
|
580772
580772
|
try {
|
|
@@ -580835,8 +580835,8 @@ ${result}`
|
|
|
580835
580835
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
580836
580836
|
});
|
|
580837
580837
|
try {
|
|
580838
|
-
const { execSync:
|
|
580839
|
-
|
|
580838
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
580839
|
+
execSync63("ollama pull moondream", {
|
|
580840
580840
|
timeout: 3e5,
|
|
580841
580841
|
stdio: "pipe"
|
|
580842
580842
|
});
|
|
@@ -607066,7 +607066,6 @@ __export(status_bar_exports, {
|
|
|
607066
607066
|
setTerminalTitle: () => setTerminalTitle,
|
|
607067
607067
|
unlockFooterRedraws: () => unlockFooterRedraws
|
|
607068
607068
|
});
|
|
607069
|
-
import { execSync as execSync52 } from "child_process";
|
|
607070
607069
|
import { readFileSync as readFileSync91 } from "node:fs";
|
|
607071
607070
|
function formatPoolAge(ms) {
|
|
607072
607071
|
if (ms < 6e4) return `${Math.max(0, Math.floor(ms / 1e3))}s`;
|
|
@@ -607087,30 +607086,6 @@ function refreshThemeVars() {
|
|
|
607087
607086
|
TEXT_PRIMARY = tuiTextPrimary() < 0 ? 252 : tuiTextPrimary();
|
|
607088
607087
|
TEXT_DIM = tuiTextDim();
|
|
607089
607088
|
}
|
|
607090
|
-
function digitBarSupported() {
|
|
607091
|
-
if (_digitBarSupported !== null) return _digitBarSupported;
|
|
607092
|
-
if (_isWindows) {
|
|
607093
|
-
_digitBarSupported = false;
|
|
607094
|
-
return false;
|
|
607095
|
-
}
|
|
607096
|
-
const termProgram = process.env.TERM_PROGRAM || "";
|
|
607097
|
-
if (/^(iTerm2|WezTerm|Kitty|Alacritty|Ghostty|Warp|Hyper|Tabby)$/i.test(
|
|
607098
|
-
termProgram
|
|
607099
|
-
)) {
|
|
607100
|
-
_digitBarSupported = true;
|
|
607101
|
-
return true;
|
|
607102
|
-
}
|
|
607103
|
-
try {
|
|
607104
|
-
const result = execSync52(
|
|
607105
|
-
'fc-list ":charset=1fbf0-1fbf9" 2>/dev/null || true',
|
|
607106
|
-
{ encoding: "utf8", timeout: 3e3 }
|
|
607107
|
-
);
|
|
607108
|
-
_digitBarSupported = result.trim().length > 0;
|
|
607109
|
-
} catch {
|
|
607110
|
-
_digitBarSupported = true;
|
|
607111
|
-
}
|
|
607112
|
-
return _digitBarSupported;
|
|
607113
|
-
}
|
|
607114
607089
|
function sanitizeSponsorHeaderText(value2, max = SPONSOR_HEADER_LABEL_MAX) {
|
|
607115
607090
|
const cleaned = stripAnsi(String(value2 ?? "")).replace(/[\x00-\x1F\x7F]/g, " ").replace(/\s+/g, " ").trim();
|
|
607116
607091
|
if (cleaned.length <= max) return cleaned;
|
|
@@ -607144,7 +607119,7 @@ function setTerminalTitle(task, version4) {
|
|
|
607144
607119
|
process.stdout.write(data);
|
|
607145
607120
|
}
|
|
607146
607121
|
}
|
|
607147
|
-
var EXPERT_TOOL_BASELINES, CONTEXT_SWITCH_OVERHEAD, TURN_PLANNING_OVERHEAD, DEFAULT_TOOL_BASELINE, CODE_READ_CHARS_PER_SEC, PROSE_READ_CHARS_PER_SEC, MIN_CONTENT_FOR_READING, CODE_CONTENT_TOOLS, PROSE_CONTENT_TOOLS, HumanSpeedTracker, PANEL_BG_SEQ, CONTENT_BG_SEQ, BOX_FG, TEXT_PRIMARY, TEXT_DIM, NO_SUB_AGENTS_HEADER_LABEL, HEADER_ACCENT_GREEN, HEADER_ACCENT_BOLD_FG, HEADER_BUTTON_BG, HEADER_BUTTON_FG, BOX_TL3, BOX_TR3, BOX_BL3, BOX_BR3, BOX_H3, BOX_V3, _globalFooterLock, RESET4, CURSOR_BLINK_BLOCK, _isWindows,
|
|
607122
|
+
var EXPERT_TOOL_BASELINES, CONTEXT_SWITCH_OVERHEAD, TURN_PLANNING_OVERHEAD, DEFAULT_TOOL_BASELINE, CODE_READ_CHARS_PER_SEC, PROSE_READ_CHARS_PER_SEC, MIN_CONTENT_FOR_READING, CODE_CONTENT_TOOLS, PROSE_CONTENT_TOOLS, HumanSpeedTracker, PANEL_BG_SEQ, CONTENT_BG_SEQ, BOX_FG, TEXT_PRIMARY, TEXT_DIM, NO_SUB_AGENTS_HEADER_LABEL, HEADER_ACCENT_GREEN, HEADER_ACCENT_BOLD_FG, HEADER_BUTTON_BG, HEADER_BUTTON_FG, BOX_TL3, BOX_TR3, BOX_BL3, BOX_BR3, BOX_H3, BOX_V3, _globalFooterLock, RESET4, CURSOR_BLINK_BLOCK, _isWindows, SPONSOR_HEADER_LABEL_MAX, _termTitleWriter, StatusBar;
|
|
607148
607123
|
var init_status_bar = __esm({
|
|
607149
607124
|
"packages/cli/src/tui/status-bar.ts"() {
|
|
607150
607125
|
"use strict";
|
|
@@ -607338,7 +607313,6 @@ var init_status_bar = __esm({
|
|
|
607338
607313
|
RESET4 = "\x1B[0m";
|
|
607339
607314
|
CURSOR_BLINK_BLOCK = "\x1B[1 q";
|
|
607340
607315
|
_isWindows = process.platform === "win32";
|
|
607341
|
-
_digitBarSupported = null;
|
|
607342
607316
|
SPONSOR_HEADER_LABEL_MAX = 48;
|
|
607343
607317
|
_termTitleWriter = null;
|
|
607344
607318
|
StatusBar = class _StatusBar {
|
|
@@ -610220,30 +610194,9 @@ ${CONTENT_BG_SEQ}`);
|
|
|
610220
610194
|
if (n2 < 1e6) return `${Math.round(n2 / 1e3)}K`;
|
|
610221
610195
|
return `${(n2 / 1e6).toFixed(1)}M`;
|
|
610222
610196
|
}
|
|
610223
|
-
/** Map digit 0-9 to
|
|
610224
|
-
static DIGIT_EMOJI =
|
|
610225
|
-
|
|
610226
|
-
// 0
|
|
610227
|
-
"🯱",
|
|
610228
|
-
// 1
|
|
610229
|
-
"🯲",
|
|
610230
|
-
// 2
|
|
610231
|
-
"🯳",
|
|
610232
|
-
// 3
|
|
610233
|
-
"🯴",
|
|
610234
|
-
// 4
|
|
610235
|
-
"🯵",
|
|
610236
|
-
// 5
|
|
610237
|
-
"🯶",
|
|
610238
|
-
// 6
|
|
610239
|
-
"🯷",
|
|
610240
|
-
// 7
|
|
610241
|
-
"🯸",
|
|
610242
|
-
// 8
|
|
610243
|
-
"🯹"
|
|
610244
|
-
// 9
|
|
610245
|
-
] : ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
610246
|
-
/** Convert a number to a digit-bar string: 1234 → "🯱🯲🯳🯴" */
|
|
610197
|
+
/** Map digit 0-9 to plain ASCII digits */
|
|
610198
|
+
static DIGIT_EMOJI = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
610199
|
+
/** Convert a number to a digit-bar string: 1234 → "1234" */
|
|
610247
610200
|
static digitBar(n2) {
|
|
610248
610201
|
if (n2 < 0) return this.DIGIT_EMOJI[0].repeat(4);
|
|
610249
610202
|
const digits = String(n2).split("");
|
|
@@ -612190,7 +612143,7 @@ __export(personaplex_exports, {
|
|
|
612190
612143
|
import { existsSync as existsSync111, writeFileSync as writeFileSync57, readFileSync as readFileSync92, mkdirSync as mkdirSync66, copyFileSync as copyFileSync4, readdirSync as readdirSync37, statSync as statSync42 } from "node:fs";
|
|
612191
612144
|
import { join as join126, dirname as dirname40 } from "node:path";
|
|
612192
612145
|
import { homedir as homedir40 } from "node:os";
|
|
612193
|
-
import { execSync as
|
|
612146
|
+
import { execSync as execSync52, spawn as spawn28 } from "node:child_process";
|
|
612194
612147
|
import { fileURLToPath as fileURLToPath15 } from "node:url";
|
|
612195
612148
|
function personaplexPythonEnv(extra = {}) {
|
|
612196
612149
|
const env2 = { ...process.env, ...extra };
|
|
@@ -612228,7 +612181,7 @@ function detectJetson() {
|
|
|
612228
612181
|
try {
|
|
612229
612182
|
const model = readFileSync92("/proc/device-tree/model", "utf8").replace(/\0/g, "").trim();
|
|
612230
612183
|
if (/jetson|orin|tegra/i.test(model)) {
|
|
612231
|
-
const memInfo =
|
|
612184
|
+
const memInfo = execSync52("grep MemTotal /proc/meminfo", { encoding: "utf8", timeout: 3e3, stdio: "pipe" });
|
|
612232
612185
|
const memKB = parseInt(memInfo.match(/(\d+)/)?.[1] ?? "0", 10);
|
|
612233
612186
|
return { isJetson: true, model, totalMemGB: memKB / 1024 / 1024 };
|
|
612234
612187
|
}
|
|
@@ -612262,7 +612215,7 @@ function detectPersonaPlexCapability() {
|
|
|
612262
612215
|
};
|
|
612263
612216
|
}
|
|
612264
612217
|
try {
|
|
612265
|
-
const nvsmi =
|
|
612218
|
+
const nvsmi = execSync52("nvidia-smi --query-gpu=name,memory.total --format=csv,noheader,nounits", {
|
|
612266
612219
|
encoding: "utf8",
|
|
612267
612220
|
timeout: 5e3,
|
|
612268
612221
|
stdio: "pipe"
|
|
@@ -612274,7 +612227,7 @@ function detectPersonaPlexCapability() {
|
|
|
612274
612227
|
return { ...fail3(`GPU has ${vramGB.toFixed(1)}GB VRAM (need ≥8GB)`), gpuName: gpuName ?? "", vramGB };
|
|
612275
612228
|
}
|
|
612276
612229
|
try {
|
|
612277
|
-
|
|
612230
|
+
execSync52('python3 -c "import torch; assert torch.cuda.is_available()"', {
|
|
612278
612231
|
timeout: 1e4,
|
|
612279
612232
|
stdio: "pipe",
|
|
612280
612233
|
env: personaplexPythonEnv()
|
|
@@ -612348,7 +612301,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
612348
612301
|
mkdirSync66(PERSONAPLEX_DIR, { recursive: true });
|
|
612349
612302
|
let arch3 = "";
|
|
612350
612303
|
try {
|
|
612351
|
-
arch3 =
|
|
612304
|
+
arch3 = execSync52("uname -m", { encoding: "utf8", timeout: 3e3, stdio: "pipe" }).trim();
|
|
612352
612305
|
} catch {
|
|
612353
612306
|
}
|
|
612354
612307
|
const isAarch64 = arch3 === "aarch64" || arch3 === "arm64";
|
|
@@ -612369,16 +612322,16 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
612369
612322
|
log22("Checking system dependencies (libopus)...");
|
|
612370
612323
|
try {
|
|
612371
612324
|
if (process.platform === "linux") {
|
|
612372
|
-
|
|
612325
|
+
execSync52("dpkg -l libopus-dev 2>/dev/null || sudo apt-get install -y libopus-dev", { timeout: 3e4, stdio: "pipe" });
|
|
612373
612326
|
} else if (process.platform === "darwin") {
|
|
612374
|
-
|
|
612327
|
+
execSync52("brew list opus 2>/dev/null || brew install opus", { timeout: 6e4, stdio: "pipe" });
|
|
612375
612328
|
}
|
|
612376
612329
|
} catch {
|
|
612377
612330
|
}
|
|
612378
612331
|
if (isAarch64) {
|
|
612379
612332
|
log22("ARM64: Checking Rust toolchain for sphn build...");
|
|
612380
612333
|
try {
|
|
612381
|
-
|
|
612334
|
+
execSync52("rustc --version", { timeout: 5e3, stdio: "pipe" });
|
|
612382
612335
|
} catch {
|
|
612383
612336
|
log22("ARM64: Installing Rust toolchain (needed for sphn audio codec)...");
|
|
612384
612337
|
try {
|
|
@@ -612451,7 +612404,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
612451
612404
|
}
|
|
612452
612405
|
const serverPy = join126(venvDir, "lib", `python3.${process.versions.node ? "12" : "10"}`, "site-packages", "moshi", "server.py");
|
|
612453
612406
|
try {
|
|
612454
|
-
const sitePackages =
|
|
612407
|
+
const sitePackages = execSync52(`"${python}" -c "import moshi, os; print(os.path.dirname(moshi.__file__))"`, {
|
|
612455
612408
|
encoding: "utf8",
|
|
612456
612409
|
timeout: 5e3,
|
|
612457
612410
|
stdio: "pipe",
|
|
@@ -612469,7 +612422,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
612469
612422
|
} catch {
|
|
612470
612423
|
}
|
|
612471
612424
|
try {
|
|
612472
|
-
const sitePackages =
|
|
612425
|
+
const sitePackages = execSync52(`"${python}" -c "import moshi, os; print(os.path.dirname(moshi.__file__))"`, {
|
|
612473
612426
|
encoding: "utf8",
|
|
612474
612427
|
timeout: 5e3,
|
|
612475
612428
|
stdio: "pipe",
|
|
@@ -612574,7 +612527,7 @@ $2if filename.endswith(".safetensors"):`
|
|
|
612574
612527
|
} catch {
|
|
612575
612528
|
}
|
|
612576
612529
|
try {
|
|
612577
|
-
const sitePackages2 =
|
|
612530
|
+
const sitePackages2 = execSync52(`"${python}" -c "import moshi, os; print(os.path.dirname(moshi.__file__))"`, {
|
|
612578
612531
|
encoding: "utf8",
|
|
612579
612532
|
timeout: 5e3,
|
|
612580
612533
|
stdio: "pipe",
|
|
@@ -612710,14 +612663,14 @@ async function startPersonaPlexDaemon(onInfo) {
|
|
|
612710
612663
|
if (tier === "nf4-distilled") {
|
|
612711
612664
|
log22(`Weight tier: ${tier} — distilled NF4 (90% token match, ${repoInfo.sizeGB}GB)...`);
|
|
612712
612665
|
try {
|
|
612713
|
-
const weightPath =
|
|
612666
|
+
const weightPath = execSync52(
|
|
612714
612667
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', '${repoInfo.file}', token=False))"`,
|
|
612715
612668
|
{ encoding: "utf8", timeout: 6e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612716
612669
|
).trim();
|
|
612717
612670
|
if (existsSync111(weightPath)) {
|
|
612718
612671
|
if (!existsSync111(cachedBf16)) {
|
|
612719
612672
|
log22("Converting .pt checkpoint to safetensors (one-time)...");
|
|
612720
|
-
|
|
612673
|
+
execSync52(
|
|
612721
612674
|
`"${venvPython2}" -c "
|
|
612722
612675
|
import torch; from safetensors.torch import save_file
|
|
612723
612676
|
state = torch.load('${weightPath}', map_location='cpu', weights_only=True)
|
|
@@ -612749,13 +612702,13 @@ print('Converted')
|
|
|
612749
612702
|
}
|
|
612750
612703
|
}
|
|
612751
612704
|
try {
|
|
612752
|
-
const weightPath =
|
|
612705
|
+
const weightPath = execSync52(
|
|
612753
612706
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', '${repoInfo.file}'${repoInfo.needsToken ? "" : ", token=False"}))"`,
|
|
612754
612707
|
{ encoding: "utf8", timeout: 3e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612755
612708
|
).trim();
|
|
612756
612709
|
if (existsSync111(dequantScript) && existsSync111(weightPath)) {
|
|
612757
612710
|
try {
|
|
612758
|
-
|
|
612711
|
+
execSync52(
|
|
612759
612712
|
`"${venvPython2}" "${dequantScript}" --input "${weightPath}" --output "${cachedBf16}"`,
|
|
612760
612713
|
{ timeout: 3e5, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612761
612714
|
);
|
|
@@ -612768,7 +612721,7 @@ print('Converted')
|
|
|
612768
612721
|
}
|
|
612769
612722
|
}
|
|
612770
612723
|
try {
|
|
612771
|
-
const mimiPath =
|
|
612724
|
+
const mimiPath = execSync52(
|
|
612772
612725
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', 'tokenizer-e351c8d8-checkpoint125.safetensors', token=False))"`,
|
|
612773
612726
|
{ encoding: "utf8", timeout: 3e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612774
612727
|
).trim();
|
|
@@ -612776,7 +612729,7 @@ print('Converted')
|
|
|
612776
612729
|
} catch {
|
|
612777
612730
|
}
|
|
612778
612731
|
try {
|
|
612779
|
-
const tokPath =
|
|
612732
|
+
const tokPath = execSync52(
|
|
612780
612733
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', 'tokenizer_spm_32k_3.model', token=False))"`,
|
|
612781
612734
|
{ encoding: "utf8", timeout: 3e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612782
612735
|
).trim();
|
|
@@ -612800,7 +612753,7 @@ print('Converted')
|
|
|
612800
612753
|
}
|
|
612801
612754
|
if (!ollamaModel) ollamaModel = "qwen3.5:4b";
|
|
612802
612755
|
try {
|
|
612803
|
-
const ollamaCheck =
|
|
612756
|
+
const ollamaCheck = execSync52("curl -s http://localhost:11434/api/tags", {
|
|
612804
612757
|
timeout: 3e3,
|
|
612805
612758
|
stdio: "pipe",
|
|
612806
612759
|
encoding: "utf8"
|
|
@@ -612874,7 +612827,7 @@ print('Converted')
|
|
|
612874
612827
|
return null;
|
|
612875
612828
|
}
|
|
612876
612829
|
try {
|
|
612877
|
-
|
|
612830
|
+
execSync52(`curl -sk -o /dev/null -w "%{http_code}" https://127.0.0.1:${PORT}/`, {
|
|
612878
612831
|
timeout: 3e3,
|
|
612879
612832
|
stdio: "pipe",
|
|
612880
612833
|
encoding: "utf8"
|
|
@@ -612897,7 +612850,7 @@ function stopPersonaPlex() {
|
|
|
612897
612850
|
if (isNaN(pid) || pid <= 0) return;
|
|
612898
612851
|
try {
|
|
612899
612852
|
if (process.platform === "win32") {
|
|
612900
|
-
|
|
612853
|
+
execSync52(`taskkill /F /PID ${pid}`, { timeout: 5e3, stdio: "ignore" });
|
|
612901
612854
|
} else {
|
|
612902
612855
|
process.kill(pid, "SIGTERM");
|
|
612903
612856
|
}
|
|
@@ -613208,7 +613161,7 @@ __export(setup_exports, {
|
|
|
613208
613161
|
updateOllama: () => updateOllama
|
|
613209
613162
|
});
|
|
613210
613163
|
import * as readline from "node:readline";
|
|
613211
|
-
import { execSync as
|
|
613164
|
+
import { execSync as execSync53, spawn as spawn29, exec as exec5 } from "node:child_process";
|
|
613212
613165
|
import { promisify as promisify6 } from "node:util";
|
|
613213
613166
|
import { existsSync as existsSync112, writeFileSync as writeFileSync58, readFileSync as readFileSync93, appendFileSync as appendFileSync10, mkdirSync as mkdirSync67 } from "node:fs";
|
|
613214
613167
|
import { join as join127 } from "node:path";
|
|
@@ -613331,7 +613284,7 @@ function detectSystemSpecs() {
|
|
|
613331
613284
|
let availableVramGB = 0;
|
|
613332
613285
|
let gpuName = "";
|
|
613333
613286
|
try {
|
|
613334
|
-
const memInfo =
|
|
613287
|
+
const memInfo = execSync53("free -b 2>/dev/null || sysctl -n hw.memsize 2>/dev/null", {
|
|
613335
613288
|
encoding: "utf8",
|
|
613336
613289
|
timeout: 5e3
|
|
613337
613290
|
});
|
|
@@ -613351,7 +613304,7 @@ function detectSystemSpecs() {
|
|
|
613351
613304
|
} catch {
|
|
613352
613305
|
}
|
|
613353
613306
|
try {
|
|
613354
|
-
const nvidiaSmi =
|
|
613307
|
+
const nvidiaSmi = execSync53(
|
|
613355
613308
|
"nvidia-smi --query-gpu=memory.total,memory.free,name --format=csv,noheader,nounits 2>/dev/null",
|
|
613356
613309
|
{ encoding: "utf8", timeout: 5e3 }
|
|
613357
613310
|
);
|
|
@@ -613363,7 +613316,7 @@ function detectSystemSpecs() {
|
|
|
613363
613316
|
}
|
|
613364
613317
|
if (gpuVramGB === 0) {
|
|
613365
613318
|
try {
|
|
613366
|
-
const rocmSmi =
|
|
613319
|
+
const rocmSmi = execSync53(
|
|
613367
613320
|
"rocm-smi --showmeminfo vram --csv 2>/dev/null",
|
|
613368
613321
|
{ encoding: "utf8", timeout: 5e3 }
|
|
613369
613322
|
);
|
|
@@ -613619,7 +613572,7 @@ function ensureCurl() {
|
|
|
613619
613572
|
for (const s2 of strategies) {
|
|
613620
613573
|
if (hasCmd(s2.check)) {
|
|
613621
613574
|
try {
|
|
613622
|
-
|
|
613575
|
+
execSync53(s2.install, { stdio: "inherit", timeout: 12e4 });
|
|
613623
613576
|
if (hasCmd("curl")) {
|
|
613624
613577
|
process.stdout.write(` ${c3.green("✔")} curl installed via ${s2.label}.
|
|
613625
613578
|
`);
|
|
@@ -613633,7 +613586,7 @@ function ensureCurl() {
|
|
|
613633
613586
|
}
|
|
613634
613587
|
if (plat === "darwin") {
|
|
613635
613588
|
try {
|
|
613636
|
-
|
|
613589
|
+
execSync53("xcode-select --install", { stdio: "inherit", timeout: 3e5 });
|
|
613637
613590
|
if (hasCmd("curl")) return true;
|
|
613638
613591
|
} catch {
|
|
613639
613592
|
}
|
|
@@ -613647,7 +613600,7 @@ function ensureZstd() {
|
|
|
613647
613600
|
if (process.platform === "darwin") {
|
|
613648
613601
|
if (!hasCmd("brew")) return false;
|
|
613649
613602
|
try {
|
|
613650
|
-
|
|
613603
|
+
execSync53("brew install zstd", { stdio: "inherit", timeout: 12e4 });
|
|
613651
613604
|
return hasCmd("zstd");
|
|
613652
613605
|
} catch {
|
|
613653
613606
|
return false;
|
|
@@ -613689,7 +613642,7 @@ function ensureZstd() {
|
|
|
613689
613642
|
candidates.push({ cmd: installCmd, env: process.env });
|
|
613690
613643
|
for (const cand of candidates) {
|
|
613691
613644
|
try {
|
|
613692
|
-
|
|
613645
|
+
execSync53(cand.cmd, {
|
|
613693
613646
|
stdio: cand.stdio ?? ["ignore", "inherit", "pipe"],
|
|
613694
613647
|
env: cand.env,
|
|
613695
613648
|
timeout: 18e4
|
|
@@ -613726,7 +613679,7 @@ function detectAskpassHelper() {
|
|
|
613726
613679
|
for (const name10 of ["ssh-askpass", "ksshaskpass", "x11-ssh-askpass"]) {
|
|
613727
613680
|
if (hasCmd(name10)) {
|
|
613728
613681
|
try {
|
|
613729
|
-
const p2 =
|
|
613682
|
+
const p2 = execSync53(`command -v ${name10}`, { encoding: "utf8" }).trim();
|
|
613730
613683
|
if (p2) return p2;
|
|
613731
613684
|
} catch {
|
|
613732
613685
|
}
|
|
@@ -613769,7 +613722,7 @@ osascript -e 'Tell application "System Events" to display dialog "Omnius needs a
|
|
|
613769
613722
|
}
|
|
613770
613723
|
try {
|
|
613771
613724
|
writeFileSync58(helperPath, body, { mode: 448 });
|
|
613772
|
-
|
|
613725
|
+
execSync53(`chmod 700 "${helperPath}"`, { stdio: "ignore" });
|
|
613773
613726
|
return helperPath;
|
|
613774
613727
|
} catch {
|
|
613775
613728
|
return null;
|
|
@@ -613838,7 +613791,7 @@ function runElevatedCommand(command, opts = {}) {
|
|
|
613838
613791
|
let lastErr = null;
|
|
613839
613792
|
for (const cand of candidates) {
|
|
613840
613793
|
try {
|
|
613841
|
-
|
|
613794
|
+
execSync53(cand.cmd, {
|
|
613842
613795
|
stdio: cand.stdio ?? ["ignore", "pipe", "pipe"],
|
|
613843
613796
|
env: cand.env,
|
|
613844
613797
|
timeout: timeout2
|
|
@@ -613875,7 +613828,7 @@ function runOllamaInstallScript() {
|
|
|
613875
613828
|
`);
|
|
613876
613829
|
}
|
|
613877
613830
|
const runOnce = () => {
|
|
613878
|
-
|
|
613831
|
+
execSync53(elevated.cmd, {
|
|
613879
613832
|
stdio: elevated.mode === "terminal" ? "inherit" : ["ignore", "inherit", "pipe"],
|
|
613880
613833
|
env: elevated.env,
|
|
613881
613834
|
timeout: 6e5
|
|
@@ -613954,7 +613907,7 @@ async function installOllamaMac(_rl) {
|
|
|
613954
613907
|
|
|
613955
613908
|
`);
|
|
613956
613909
|
try {
|
|
613957
|
-
|
|
613910
|
+
execSync53(
|
|
613958
613911
|
'/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',
|
|
613959
613912
|
{ stdio: "inherit", timeout: 6e5 }
|
|
613960
613913
|
);
|
|
@@ -613990,7 +613943,7 @@ async function installOllamaMac(_rl) {
|
|
|
613990
613943
|
|
|
613991
613944
|
`);
|
|
613992
613945
|
try {
|
|
613993
|
-
|
|
613946
|
+
execSync53("brew install ollama", {
|
|
613994
613947
|
stdio: "inherit",
|
|
613995
613948
|
timeout: 3e5
|
|
613996
613949
|
});
|
|
@@ -614017,7 +613970,7 @@ function installOllamaWindows() {
|
|
|
614017
613970
|
|
|
614018
613971
|
`);
|
|
614019
613972
|
try {
|
|
614020
|
-
|
|
613973
|
+
execSync53('powershell -Command "irm https://ollama.com/install.ps1 | iex"', {
|
|
614021
613974
|
stdio: "inherit",
|
|
614022
613975
|
timeout: 3e5
|
|
614023
613976
|
});
|
|
@@ -614097,7 +614050,7 @@ async function ensureOllamaRunning(backendUrl2, rl) {
|
|
|
614097
614050
|
}
|
|
614098
614051
|
function getOllamaVersion() {
|
|
614099
614052
|
try {
|
|
614100
|
-
const out =
|
|
614053
|
+
const out = execSync53("ollama --version", { encoding: "utf8", timeout: 5e3 });
|
|
614101
614054
|
const match = out.match(/(\d+\.\d+\.\d+)/);
|
|
614102
614055
|
return match ? match[1] : null;
|
|
614103
614056
|
} catch {
|
|
@@ -614154,7 +614107,7 @@ function updateOllama() {
|
|
|
614154
614107
|
}
|
|
614155
614108
|
function pullModelWithAutoUpdate(tag) {
|
|
614156
614109
|
try {
|
|
614157
|
-
|
|
614110
|
+
execSync53(`ollama pull ${tag}`, {
|
|
614158
614111
|
stdio: "inherit",
|
|
614159
614112
|
timeout: 36e5
|
|
614160
614113
|
// 1 hour max
|
|
@@ -614181,7 +614134,7 @@ function pullModelWithAutoUpdate(tag) {
|
|
|
614181
614134
|
process.stdout.write(` ${c3.cyan("●")} Retrying pull of ${c3.bold(tag)}...
|
|
614182
614135
|
|
|
614183
614136
|
`);
|
|
614184
|
-
|
|
614137
|
+
execSync53(`ollama pull ${tag}`, {
|
|
614185
614138
|
stdio: "inherit",
|
|
614186
614139
|
timeout: 36e5
|
|
614187
614140
|
});
|
|
@@ -614270,7 +614223,7 @@ function ensurePython3() {
|
|
|
614270
614223
|
if (plat === "darwin") {
|
|
614271
614224
|
if (hasCmd("brew")) {
|
|
614272
614225
|
try {
|
|
614273
|
-
|
|
614226
|
+
execSync53("brew install python3", { stdio: "inherit", timeout: 3e5 });
|
|
614274
614227
|
if (hasCmd("python3")) {
|
|
614275
614228
|
process.stdout.write(` ${c3.green("✔")} Python3 installed via Homebrew.
|
|
614276
614229
|
`);
|
|
@@ -614283,7 +614236,7 @@ function ensurePython3() {
|
|
|
614283
614236
|
for (const s2 of strategies) {
|
|
614284
614237
|
if (hasCmd(s2.check)) {
|
|
614285
614238
|
try {
|
|
614286
|
-
|
|
614239
|
+
execSync53(s2.install, { stdio: "inherit", timeout: 12e4 });
|
|
614287
614240
|
if (hasCmd("python3") || hasCmd("python")) {
|
|
614288
614241
|
process.stdout.write(` ${c3.green("✔")} Python3 installed via ${s2.label}.
|
|
614289
614242
|
`);
|
|
@@ -614299,11 +614252,11 @@ function ensurePython3() {
|
|
|
614299
614252
|
}
|
|
614300
614253
|
function checkPythonVenv() {
|
|
614301
614254
|
try {
|
|
614302
|
-
|
|
614255
|
+
execSync53("python3 -m venv --help", { stdio: "pipe", timeout: 5e3 });
|
|
614303
614256
|
return true;
|
|
614304
614257
|
} catch {
|
|
614305
614258
|
try {
|
|
614306
|
-
|
|
614259
|
+
execSync53("python -m venv --help", { stdio: "pipe", timeout: 5e3 });
|
|
614307
614260
|
return true;
|
|
614308
614261
|
} catch {
|
|
614309
614262
|
return false;
|
|
@@ -614322,7 +614275,7 @@ function ensurePythonVenv() {
|
|
|
614322
614275
|
for (const s2 of strategies) {
|
|
614323
614276
|
if (hasCmd(s2.check)) {
|
|
614324
614277
|
try {
|
|
614325
|
-
|
|
614278
|
+
execSync53(s2.install, { stdio: "inherit", timeout: 12e4 });
|
|
614326
614279
|
if (checkPythonVenv()) {
|
|
614327
614280
|
process.stdout.write(` ${c3.green("✔")} python3-venv installed via ${s2.label}.
|
|
614328
614281
|
`);
|
|
@@ -614929,7 +614882,7 @@ ${c3.cyan(OMNIUS_FIRST_RUN_BANNER)}
|
|
|
614929
614882
|
for (let i2 = 0; i2 < modelfileCandidates.length; i2++) {
|
|
614930
614883
|
writeFileSync58(modelfilePath, modelfileCandidates[i2] + "\n", "utf8");
|
|
614931
614884
|
try {
|
|
614932
|
-
|
|
614885
|
+
execSync53(`ollama create ${customName} -f ${modelfilePath}`, {
|
|
614933
614886
|
stdio: "pipe",
|
|
614934
614887
|
timeout: 12e4
|
|
614935
614888
|
});
|
|
@@ -614991,7 +614944,7 @@ function isFirstRun() {
|
|
|
614991
614944
|
function hasCmd(cmd) {
|
|
614992
614945
|
try {
|
|
614993
614946
|
const whichCmd = process.platform === "win32" ? `where ${cmd}` : `which ${cmd}`;
|
|
614994
|
-
|
|
614947
|
+
execSync53(whichCmd, { stdio: "pipe", timeout: 3e3 });
|
|
614995
614948
|
return true;
|
|
614996
614949
|
} catch {
|
|
614997
614950
|
return false;
|
|
@@ -615003,7 +614956,7 @@ function detectPkgManager() {
|
|
|
615003
614956
|
if (hasCmd("choco")) return "choco";
|
|
615004
614957
|
if (hasCmd("winget")) return "winget";
|
|
615005
614958
|
try {
|
|
615006
|
-
|
|
614959
|
+
execSync53(
|
|
615007
614960
|
`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'))"`,
|
|
615008
614961
|
{ stdio: "pipe", timeout: 12e4 }
|
|
615009
614962
|
);
|
|
@@ -615015,7 +614968,7 @@ function detectPkgManager() {
|
|
|
615015
614968
|
if (plat === "darwin") {
|
|
615016
614969
|
if (hasCmd("brew")) return "brew";
|
|
615017
614970
|
try {
|
|
615018
|
-
|
|
614971
|
+
execSync53(
|
|
615019
614972
|
'/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',
|
|
615020
614973
|
{ stdio: "pipe", timeout: 3e5, env: { ...process.env, NONINTERACTIVE: "1" } }
|
|
615021
614974
|
);
|
|
@@ -615035,7 +614988,7 @@ function getVenvDir2() {
|
|
|
615035
614988
|
}
|
|
615036
614989
|
function hasVenvModule() {
|
|
615037
614990
|
try {
|
|
615038
|
-
|
|
614991
|
+
execSync53('python3 -c "import ensurepip, venv"', {
|
|
615039
614992
|
stdio: "pipe",
|
|
615040
614993
|
timeout: 5e3
|
|
615041
614994
|
});
|
|
@@ -615052,17 +615005,17 @@ function ensureVenv2(log22) {
|
|
|
615052
615005
|
const pythonCmd = isWin2 ? "python" : "python3";
|
|
615053
615006
|
if (existsSync112(pipPath)) {
|
|
615054
615007
|
try {
|
|
615055
|
-
|
|
615008
|
+
execSync53(`"${venvPyPath}" -m pip --version`, { stdio: "pipe", timeout: 1e4 });
|
|
615056
615009
|
return venvDir;
|
|
615057
615010
|
} catch {
|
|
615058
615011
|
log22("Python venv pip is broken — repairing...");
|
|
615059
615012
|
try {
|
|
615060
|
-
|
|
615013
|
+
execSync53(`"${venvPyPath}" -m ensurepip --upgrade`, { stdio: "pipe", timeout: 3e4 });
|
|
615061
615014
|
log22("pip repaired via ensurepip.");
|
|
615062
615015
|
return venvDir;
|
|
615063
615016
|
} catch {
|
|
615064
615017
|
try {
|
|
615065
|
-
|
|
615018
|
+
execSync53(`curl -sS https://bootstrap.pypa.io/get-pip.py | "${venvPyPath}"`, { stdio: "pipe", timeout: 6e4 });
|
|
615066
615019
|
log22("pip repaired via get-pip.py.");
|
|
615067
615020
|
return venvDir;
|
|
615068
615021
|
} catch {
|
|
@@ -615083,17 +615036,17 @@ function ensureVenv2(log22) {
|
|
|
615083
615036
|
try {
|
|
615084
615037
|
mkdirSync67(join127(homedir41(), ".omnius"), { recursive: true });
|
|
615085
615038
|
const pyCmd = hasCmd(pythonCmd) ? pythonCmd : "python3";
|
|
615086
|
-
|
|
615039
|
+
execSync53(`${pyCmd} -m venv --clear "${venvDir}"`, { stdio: "pipe", timeout: 3e4 });
|
|
615087
615040
|
try {
|
|
615088
|
-
|
|
615041
|
+
execSync53(`"${venvPyPath}" -m pip --version`, { stdio: "pipe", timeout: 1e4 });
|
|
615089
615042
|
} catch {
|
|
615090
615043
|
try {
|
|
615091
|
-
|
|
615044
|
+
execSync53(`"${venvPyPath}" -m ensurepip --upgrade`, { stdio: "pipe", timeout: 3e4 });
|
|
615092
615045
|
} catch {
|
|
615093
|
-
|
|
615046
|
+
execSync53(`curl -sS https://bootstrap.pypa.io/get-pip.py | "${venvPyPath}"`, { stdio: "pipe", timeout: 6e4 });
|
|
615094
615047
|
}
|
|
615095
615048
|
}
|
|
615096
|
-
|
|
615049
|
+
execSync53(`"${venvPyPath}" -m pip install --upgrade pip`, {
|
|
615097
615050
|
stdio: "pipe",
|
|
615098
615051
|
timeout: 6e4
|
|
615099
615052
|
});
|
|
@@ -615106,7 +615059,7 @@ function ensureVenv2(log22) {
|
|
|
615106
615059
|
}
|
|
615107
615060
|
function trySudoPasswordless(cmd, timeoutMs = 12e4) {
|
|
615108
615061
|
try {
|
|
615109
|
-
|
|
615062
|
+
execSync53(`sudo -n ${cmd}`, {
|
|
615110
615063
|
stdio: "pipe",
|
|
615111
615064
|
timeout: timeoutMs,
|
|
615112
615065
|
env: { ...process.env, DEBIAN_FRONTEND: "noninteractive" }
|
|
@@ -615119,7 +615072,7 @@ function trySudoPasswordless(cmd, timeoutMs = 12e4) {
|
|
|
615119
615072
|
function runWithSudo(cmd, password, timeoutMs = 12e4) {
|
|
615120
615073
|
try {
|
|
615121
615074
|
const escaped = cmd.replace(/'/g, "'\\''");
|
|
615122
|
-
|
|
615075
|
+
execSync53(`sudo -S bash -c '${escaped}'`, {
|
|
615123
615076
|
input: password + "\n",
|
|
615124
615077
|
stdio: ["pipe", "pipe", "pipe"],
|
|
615125
615078
|
timeout: timeoutMs,
|
|
@@ -615161,7 +615114,7 @@ async function sudoInstall(cmd, getSudoPassword, log22, cachedPasswordRef, timeo
|
|
|
615161
615114
|
try {
|
|
615162
615115
|
const isRoot = typeof process.getuid === "function" && process.getuid() === 0;
|
|
615163
615116
|
const escaped = cmd.replace(/'/g, "'\\''");
|
|
615164
|
-
|
|
615117
|
+
execSync53(isRoot ? `bash -c '${escaped}'` : `sudo bash -c '${escaped}'`, {
|
|
615165
615118
|
stdio: "inherit",
|
|
615166
615119
|
timeout: timeoutMs,
|
|
615167
615120
|
env: { ...process.env, DEBIAN_FRONTEND: "noninteractive" }
|
|
@@ -615227,7 +615180,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615227
615180
|
let winNeedsElevation = false;
|
|
615228
615181
|
if (process.platform === "win32") {
|
|
615229
615182
|
try {
|
|
615230
|
-
|
|
615183
|
+
execSync53("net session", { stdio: "pipe", timeout: 3e3 });
|
|
615231
615184
|
} catch {
|
|
615232
615185
|
winNeedsElevation = true;
|
|
615233
615186
|
log22(`Installing ${labels} via ${pm2} (requires admin — UAC prompt will appear)...`);
|
|
@@ -615274,12 +615227,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615274
615227
|
if (needsSudo) {
|
|
615275
615228
|
await sudoInstall(installCmd, getPassword, log22, cachedPasswordRef, 18e4);
|
|
615276
615229
|
} else if (winNeedsElevation) {
|
|
615277
|
-
|
|
615230
|
+
execSync53(
|
|
615278
615231
|
`powershell -NoProfile -Command "Start-Process -FilePath 'cmd.exe' -ArgumentList '/c ${installCmd.replace(/'/g, "''")}' -Verb RunAs -Wait"`,
|
|
615279
615232
|
{ stdio: "pipe", timeout: 18e4 }
|
|
615280
615233
|
);
|
|
615281
615234
|
} else {
|
|
615282
|
-
|
|
615235
|
+
execSync53(installCmd, { stdio: "pipe", timeout: 18e4 });
|
|
615283
615236
|
}
|
|
615284
615237
|
} catch (e2) {
|
|
615285
615238
|
const stderr = e2.stderr?.toString?.()?.trim?.() ?? "";
|
|
@@ -615292,7 +615245,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615292
615245
|
if (!hasCmd(d2.binary) && pipPkg) {
|
|
615293
615246
|
try {
|
|
615294
615247
|
const pipCmd = process.platform === "win32" ? `pip install ${pipPkg}` : `pip3 install ${pipPkg}`;
|
|
615295
|
-
|
|
615248
|
+
execSync53(pipCmd, { stdio: "pipe", timeout: 12e4 });
|
|
615296
615249
|
lastError = "";
|
|
615297
615250
|
} catch (e2) {
|
|
615298
615251
|
const stderr = e2.stderr?.toString?.()?.trim?.() ?? "";
|
|
@@ -615304,7 +615257,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615304
615257
|
}
|
|
615305
615258
|
if (process.platform === "win32" && !hasCmd(d2.binary)) {
|
|
615306
615259
|
try {
|
|
615307
|
-
const freshPath =
|
|
615260
|
+
const freshPath = execSync53(
|
|
615308
615261
|
`powershell -NoProfile -Command "[System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User')"`,
|
|
615309
615262
|
{ encoding: "utf8", timeout: 5e3, stdio: "pipe" }
|
|
615310
615263
|
).trim();
|
|
@@ -615350,7 +615303,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615350
615303
|
const venvCmds = {
|
|
615351
615304
|
apt: () => {
|
|
615352
615305
|
try {
|
|
615353
|
-
const pyVer =
|
|
615306
|
+
const pyVer = execSync53(
|
|
615354
615307
|
`python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"`,
|
|
615355
615308
|
{ encoding: "utf8", stdio: "pipe", timeout: 5e3 }
|
|
615356
615309
|
).trim();
|
|
@@ -615382,12 +615335,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615382
615335
|
const venvPip2 = join127(venvBin, "pip");
|
|
615383
615336
|
log22("Installing moondream-station in ~/.omnius/venv...");
|
|
615384
615337
|
try {
|
|
615385
|
-
|
|
615338
|
+
execSync53(`"${venvPip2}" install moondream-station`, { stdio: "pipe", timeout: 3e5 });
|
|
615386
615339
|
if (existsSync112(venvMoondream)) {
|
|
615387
615340
|
log22("moondream-station installed successfully.");
|
|
615388
615341
|
} else {
|
|
615389
615342
|
try {
|
|
615390
|
-
const check =
|
|
615343
|
+
const check = execSync53(`"${venvPip2}" show moondream-station`, { encoding: "utf8", stdio: "pipe", timeout: 5e3 });
|
|
615391
615344
|
if (check.includes("moondream")) {
|
|
615392
615345
|
log22("moondream-station package installed.");
|
|
615393
615346
|
}
|
|
@@ -615404,7 +615357,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615404
615357
|
const venvPip2 = join127(venvBin, isWin2 ? "pip.exe" : "pip");
|
|
615405
615358
|
let ocrStackInstalled = false;
|
|
615406
615359
|
try {
|
|
615407
|
-
|
|
615360
|
+
execSync53(
|
|
615408
615361
|
`"${venvPython2}" -c "import cv2, pytesseract, numpy, PIL"`,
|
|
615409
615362
|
{ stdio: "pipe", timeout: 1e4 }
|
|
615410
615363
|
);
|
|
@@ -615415,12 +615368,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615415
615368
|
const ocrPackages = "pytesseract Pillow opencv-python-headless numpy";
|
|
615416
615369
|
log22("Installing OCR Python stack (pytesseract, OpenCV, Pillow, numpy)...");
|
|
615417
615370
|
try {
|
|
615418
|
-
|
|
615371
|
+
execSync53(
|
|
615419
615372
|
`"${venvPip2}" install ${ocrPackages}`,
|
|
615420
615373
|
{ stdio: "pipe", timeout: 3e5 }
|
|
615421
615374
|
);
|
|
615422
615375
|
try {
|
|
615423
|
-
|
|
615376
|
+
execSync53(
|
|
615424
615377
|
`"${venvPython2}" -c "import cv2, pytesseract, numpy, PIL"`,
|
|
615425
615378
|
{ stdio: "pipe", timeout: 1e4 }
|
|
615426
615379
|
);
|
|
@@ -615456,7 +615409,7 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
615456
615409
|
const archMap = { x64: "amd64", arm64: "arm64", arm: "arm" };
|
|
615457
615410
|
const cfArch = archMap[arch3] ?? "amd64";
|
|
615458
615411
|
try {
|
|
615459
|
-
|
|
615412
|
+
execSync53(
|
|
615460
615413
|
`curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && mkdir -p "${homedir41()}/.local/bin" && mv /tmp/cloudflared "${homedir41()}/.local/bin/cloudflared"`,
|
|
615461
615414
|
{ stdio: "pipe", timeout: 6e4 }
|
|
615462
615415
|
);
|
|
@@ -615472,7 +615425,7 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
615472
615425
|
try {
|
|
615473
615426
|
const terminalElevation = process.env["OMNIUS_ELEVATION_MODE"] === "terminal" && process.stdin.isTTY && process.stdout.isTTY;
|
|
615474
615427
|
const sudoMove = terminalElevation ? `sudo mv /tmp/cloudflared /usr/local/bin/cloudflared` : `sudo mv /tmp/cloudflared /usr/local/bin/cloudflared 2>/dev/null`;
|
|
615475
|
-
|
|
615428
|
+
execSync53(
|
|
615476
615429
|
`curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && ` + sudoMove,
|
|
615477
615430
|
{ stdio: terminalElevation ? "inherit" : "pipe", timeout: 6e4 }
|
|
615478
615431
|
);
|
|
@@ -615484,7 +615437,7 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
615484
615437
|
}
|
|
615485
615438
|
} else if (os9 === "darwin") {
|
|
615486
615439
|
try {
|
|
615487
|
-
|
|
615440
|
+
execSync53("brew install cloudflared", { stdio: "pipe", timeout: 12e4 });
|
|
615488
615441
|
if (hasCmd("cloudflared")) {
|
|
615489
615442
|
log22("cloudflared installed via Homebrew.");
|
|
615490
615443
|
return true;
|
|
@@ -615681,7 +615634,7 @@ function createExpandedVariantNamed(targetModel, baseModel, specs, sizeGB, kvByt
|
|
|
615681
615634
|
for (let i2 = 0; i2 < modelfileCandidates.length; i2++) {
|
|
615682
615635
|
writeFileSync58(modelfilePath, modelfileCandidates[i2] + "\n", "utf8");
|
|
615683
615636
|
try {
|
|
615684
|
-
|
|
615637
|
+
execSync53(`ollama create ${targetModel} -f ${modelfilePath}`, {
|
|
615685
615638
|
stdio: "pipe",
|
|
615686
615639
|
timeout: 12e4
|
|
615687
615640
|
});
|
|
@@ -615967,7 +615920,7 @@ async function repairAllExpandedVariants(backendUrl2) {
|
|
|
615967
615920
|
}
|
|
615968
615921
|
async function ensureNeovim() {
|
|
615969
615922
|
try {
|
|
615970
|
-
const nvimPath =
|
|
615923
|
+
const nvimPath = execSync53("which nvim 2>/dev/null || where nvim 2>nul", {
|
|
615971
615924
|
encoding: "utf8",
|
|
615972
615925
|
stdio: "pipe",
|
|
615973
615926
|
timeout: 5e3
|
|
@@ -615988,14 +615941,14 @@ async function ensureNeovim() {
|
|
|
615988
615941
|
const url = `https://github.com/neovim/neovim/releases/latest/download/${appImageName}`;
|
|
615989
615942
|
console.log(` Downloading Neovim (${appImageName})...`);
|
|
615990
615943
|
try {
|
|
615991
|
-
|
|
615992
|
-
|
|
615944
|
+
execSync53(`curl -fsSL "${url}" -o "${nvimDest}"`, { stdio: "pipe", timeout: 6e4 });
|
|
615945
|
+
execSync53(`chmod +x "${nvimDest}"`, { stdio: "pipe", timeout: 3e3 });
|
|
615993
615946
|
} catch (err) {
|
|
615994
615947
|
console.log(` Failed to download Neovim: ${err instanceof Error ? err.message : String(err)}`);
|
|
615995
615948
|
return null;
|
|
615996
615949
|
}
|
|
615997
615950
|
try {
|
|
615998
|
-
const ver =
|
|
615951
|
+
const ver = execSync53(`"${nvimDest}" --version`, { encoding: "utf8", stdio: "pipe", timeout: 5e3 }).split("\n")[0];
|
|
615999
615952
|
console.log(` Installed: ${ver}`);
|
|
616000
615953
|
} catch {
|
|
616001
615954
|
console.log(" Warning: nvim binary downloaded but may not work (missing FUSE? Try: nvim --appimage-extract)");
|
|
@@ -616010,8 +615963,8 @@ async function ensureNeovim() {
|
|
|
616010
615963
|
if (hasCmd("brew")) {
|
|
616011
615964
|
console.log(" Installing Neovim via Homebrew...");
|
|
616012
615965
|
try {
|
|
616013
|
-
|
|
616014
|
-
const nvimPath =
|
|
615966
|
+
execSync53("brew install neovim", { stdio: "inherit", timeout: 12e4 });
|
|
615967
|
+
const nvimPath = execSync53("which nvim", { encoding: "utf8", stdio: "pipe", timeout: 3e3 }).trim();
|
|
616015
615968
|
return nvimPath || null;
|
|
616016
615969
|
} catch {
|
|
616017
615970
|
console.log(" brew install neovim failed.");
|
|
@@ -616025,7 +615978,7 @@ async function ensureNeovim() {
|
|
|
616025
615978
|
if (hasCmd("choco")) {
|
|
616026
615979
|
console.log(" Installing Neovim via Chocolatey...");
|
|
616027
615980
|
try {
|
|
616028
|
-
|
|
615981
|
+
execSync53("choco install neovim -y", { stdio: "inherit", timeout: 12e4 });
|
|
616029
615982
|
return "nvim";
|
|
616030
615983
|
} catch {
|
|
616031
615984
|
console.log(" choco install neovim failed.");
|
|
@@ -616034,7 +615987,7 @@ async function ensureNeovim() {
|
|
|
616034
615987
|
if (hasCmd("winget")) {
|
|
616035
615988
|
console.log(" Installing Neovim via winget...");
|
|
616036
615989
|
try {
|
|
616037
|
-
|
|
615990
|
+
execSync53("winget install Neovim.Neovim --accept-source-agreements --accept-package-agreements", {
|
|
616038
615991
|
stdio: "inherit",
|
|
616039
615992
|
timeout: 12e4
|
|
616040
615993
|
});
|
|
@@ -620103,7 +620056,7 @@ var init_audio_waveform = __esm({
|
|
|
620103
620056
|
import { existsSync as existsSync118, unlinkSync as unlinkSync23 } from "node:fs";
|
|
620104
620057
|
import { tmpdir as tmpdir20 } from "node:os";
|
|
620105
620058
|
import { join as join131 } from "node:path";
|
|
620106
|
-
import { execSync as
|
|
620059
|
+
import { execSync as execSync54 } from "node:child_process";
|
|
620107
620060
|
function isNeovimActive() {
|
|
620108
620061
|
return _state2 !== null && !_state2.cleanedUp;
|
|
620109
620062
|
}
|
|
@@ -620120,7 +620073,7 @@ async function startNeovimMode(opts) {
|
|
|
620120
620073
|
}
|
|
620121
620074
|
let nvimPath;
|
|
620122
620075
|
try {
|
|
620123
|
-
nvimPath =
|
|
620076
|
+
nvimPath = execSync54("which nvim 2>/dev/null", { encoding: "utf8" }).trim();
|
|
620124
620077
|
if (!nvimPath) throw new Error();
|
|
620125
620078
|
} catch {
|
|
620126
620079
|
const installed = await ensureNeovim();
|
|
@@ -620802,8 +620755,8 @@ async function forceKillDaemon(port) {
|
|
|
620802
620755
|
}
|
|
620803
620756
|
}
|
|
620804
620757
|
try {
|
|
620805
|
-
const { execSync:
|
|
620806
|
-
const out =
|
|
620758
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
620759
|
+
const out = execSync63(
|
|
620807
620760
|
`lsof -ti :${p2} 2>/dev/null || fuser ${p2}/tcp 2>/dev/null || true`,
|
|
620808
620761
|
{ encoding: "utf8", timeout: 3e3 }
|
|
620809
620762
|
).trim();
|
|
@@ -623680,7 +623633,7 @@ import {
|
|
|
623680
623633
|
import { join as join137, dirname as dirname42, resolve as resolve57 } from "node:path";
|
|
623681
623634
|
import { homedir as homedir46, tmpdir as tmpdir21, platform as platform6 } from "node:os";
|
|
623682
623635
|
import {
|
|
623683
|
-
execSync as
|
|
623636
|
+
execSync as execSync55,
|
|
623684
623637
|
spawn as nodeSpawn
|
|
623685
623638
|
} from "node:child_process";
|
|
623686
623639
|
import { createRequire as createRequire6 } from "node:module";
|
|
@@ -626027,7 +625980,7 @@ except Exception as exc:
|
|
|
626027
625980
|
}
|
|
626028
625981
|
for (const player of ["paplay", "pw-play", "aplay"]) {
|
|
626029
625982
|
try {
|
|
626030
|
-
|
|
625983
|
+
execSync55(`which ${player}`, { stdio: "pipe" });
|
|
626031
625984
|
return [player, path12];
|
|
626032
625985
|
} catch {
|
|
626033
625986
|
}
|
|
@@ -626205,7 +626158,7 @@ except Exception as exc:
|
|
|
626205
626158
|
return false;
|
|
626206
626159
|
}
|
|
626207
626160
|
try {
|
|
626208
|
-
|
|
626161
|
+
execSync55(`${JSON.stringify(venvPy)} -c "import supertonic"`, {
|
|
626209
626162
|
stdio: "pipe",
|
|
626210
626163
|
timeout: 1e4
|
|
626211
626164
|
});
|
|
@@ -626337,7 +626290,7 @@ except Exception as exc:
|
|
|
626337
626290
|
if (this.python3Path) return this.python3Path;
|
|
626338
626291
|
for (const bin of ["python3", "python"]) {
|
|
626339
626292
|
try {
|
|
626340
|
-
const path12 =
|
|
626293
|
+
const path12 = execSync55(`which ${bin}`, { stdio: "pipe", timeout: 5e3 }).toString().trim();
|
|
626341
626294
|
if (path12) {
|
|
626342
626295
|
this.python3Path = path12;
|
|
626343
626296
|
return path12;
|
|
@@ -626401,7 +626354,7 @@ except Exception as exc:
|
|
|
626401
626354
|
return false;
|
|
626402
626355
|
}
|
|
626403
626356
|
try {
|
|
626404
|
-
|
|
626357
|
+
execSync55(`${py} -c "import mlx_audio"`, {
|
|
626405
626358
|
stdio: "pipe",
|
|
626406
626359
|
timeout: 1e4
|
|
626407
626360
|
});
|
|
@@ -626470,14 +626423,14 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
626470
626423
|
`tts_gen.main(["--model", ${JSON.stringify(mlxModelId)}, "--text", text, "--voice", ${JSON.stringify(mlxVoice)}, "--lang_code", ${JSON.stringify(mlxLangCode)}, "--audio_path", ${JSON.stringify(wavPath)}])`
|
|
626471
626424
|
].join("; ");
|
|
626472
626425
|
try {
|
|
626473
|
-
|
|
626426
|
+
execSync55(
|
|
626474
626427
|
`${py} -c ${JSON.stringify(pyScript)} ${JSON.stringify(JSON.stringify(cleaned))}`,
|
|
626475
626428
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
626476
626429
|
);
|
|
626477
626430
|
} catch (err) {
|
|
626478
626431
|
try {
|
|
626479
626432
|
const safeText = cleaned.replace(/'/g, "'\\''");
|
|
626480
|
-
|
|
626433
|
+
execSync55(
|
|
626481
626434
|
`${py} -m mlx_audio.tts.generate --model ${mlxModelId} --text '${safeText}' --voice ${mlxVoice} --lang_code ${mlxLangCode} --audio_path ${JSON.stringify(wavPath)}`,
|
|
626482
626435
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
626483
626436
|
);
|
|
@@ -626551,14 +626504,14 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
626551
626504
|
`tts_gen.main(["--model", ${JSON.stringify(mlxModelId)}, "--text", text, "--voice", ${JSON.stringify(mlxVoice)}, "--lang_code", ${JSON.stringify(mlxLangCode)}, "--audio_path", ${JSON.stringify(wavPath)}])`
|
|
626552
626505
|
].join("; ");
|
|
626553
626506
|
try {
|
|
626554
|
-
|
|
626507
|
+
execSync55(
|
|
626555
626508
|
`${py} -c ${JSON.stringify(pyScript)} ${JSON.stringify(JSON.stringify(cleaned))}`,
|
|
626556
626509
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
626557
626510
|
);
|
|
626558
626511
|
} catch {
|
|
626559
626512
|
try {
|
|
626560
626513
|
const safeText = cleaned.replace(/'/g, "'\\''");
|
|
626561
|
-
|
|
626514
|
+
execSync55(
|
|
626562
626515
|
`${py} -m mlx_audio.tts.generate --model ${mlxModelId} --text '${safeText}' --voice ${mlxVoice} --lang_code ${mlxLangCode} --audio_path ${JSON.stringify(wavPath)}`,
|
|
626563
626516
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
626564
626517
|
);
|
|
@@ -626854,11 +626807,11 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
626854
626807
|
...isJetson ? (() => {
|
|
626855
626808
|
let jpVer = "v60";
|
|
626856
626809
|
try {
|
|
626857
|
-
const tegra = existsSync125("/etc/nv_tegra_release") ?
|
|
626810
|
+
const tegra = existsSync125("/etc/nv_tegra_release") ? execSync55("cat /etc/nv_tegra_release 2>/dev/null", {
|
|
626858
626811
|
encoding: "utf8",
|
|
626859
626812
|
timeout: 3e3
|
|
626860
626813
|
}).trim() : "";
|
|
626861
|
-
const dpkg =
|
|
626814
|
+
const dpkg = execSync55(
|
|
626862
626815
|
"dpkg -l nvidia-jetpack 2>/dev/null | grep nvidia-jetpack | awk '{print $3}'",
|
|
626863
626816
|
{ encoding: "utf8", timeout: 5e3 }
|
|
626864
626817
|
).trim();
|
|
@@ -632394,10 +632347,10 @@ The session corrections MUST become hard rules in the SKILL.md Rules section.`;
|
|
|
632394
632347
|
"Requesting sudo to migrate daemon to current user and restart..."
|
|
632395
632348
|
);
|
|
632396
632349
|
const nodeBin = process.execPath;
|
|
632397
|
-
const { execSync:
|
|
632350
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
632398
632351
|
let npmRoot = "";
|
|
632399
632352
|
try {
|
|
632400
|
-
npmRoot =
|
|
632353
|
+
npmRoot = execSync63("npm root -g", { encoding: "utf8" }).trim();
|
|
632401
632354
|
} catch {
|
|
632402
632355
|
}
|
|
632403
632356
|
const launcher = npmRoot ? `${npmRoot}/omnius/dist/launcher.cjs` : "";
|
|
@@ -640980,7 +640933,7 @@ async function handleBroker(arg, _ctx) {
|
|
|
640980
640933
|
);
|
|
640981
640934
|
}
|
|
640982
640935
|
async function handleParallel(arg, ctx3) {
|
|
640983
|
-
const { execSync:
|
|
640936
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
640984
640937
|
const baseUrl = ctx3.config.backendUrl || "http://localhost:11434";
|
|
640985
640938
|
const isRemote = ctx3.config.backendType === "nexus";
|
|
640986
640939
|
if (isRemote) {
|
|
@@ -641012,7 +640965,7 @@ async function handleParallel(arg, ctx3) {
|
|
|
641012
640965
|
}
|
|
641013
640966
|
let systemdVal = "";
|
|
641014
640967
|
try {
|
|
641015
|
-
const out =
|
|
640968
|
+
const out = execSync63(
|
|
641016
640969
|
"systemctl show ollama.service -p Environment 2>/dev/null || true",
|
|
641017
640970
|
{ encoding: "utf8" }
|
|
641018
640971
|
);
|
|
@@ -641047,7 +641000,7 @@ async function handleParallel(arg, ctx3) {
|
|
|
641047
641000
|
}
|
|
641048
641001
|
const isSystemd = (() => {
|
|
641049
641002
|
try {
|
|
641050
|
-
const out =
|
|
641003
|
+
const out = execSync63("systemctl is-active ollama.service 2>/dev/null", {
|
|
641051
641004
|
encoding: "utf8"
|
|
641052
641005
|
}).trim();
|
|
641053
641006
|
return out === "active" || out === "inactive";
|
|
@@ -643348,13 +643301,13 @@ async function showExposeDashboard(gateway, rl, ctx3) {
|
|
|
643348
643301
|
const cmd = `/endpoint ${id} --auth ${gateway.authKey ?? ""}`;
|
|
643349
643302
|
let copied = false;
|
|
643350
643303
|
try {
|
|
643351
|
-
const { execSync:
|
|
643304
|
+
const { execSync: execSync63 } = __require("node:child_process");
|
|
643352
643305
|
const platform7 = process.platform;
|
|
643353
643306
|
if (platform7 === "darwin") {
|
|
643354
|
-
|
|
643307
|
+
execSync63("pbcopy", { input: cmd, timeout: 3e3 });
|
|
643355
643308
|
copied = true;
|
|
643356
643309
|
} else if (platform7 === "win32") {
|
|
643357
|
-
|
|
643310
|
+
execSync63("clip", { input: cmd, timeout: 3e3 });
|
|
643358
643311
|
copied = true;
|
|
643359
643312
|
} else {
|
|
643360
643313
|
for (const tool of [
|
|
@@ -643363,7 +643316,7 @@ async function showExposeDashboard(gateway, rl, ctx3) {
|
|
|
643363
643316
|
"wl-copy"
|
|
643364
643317
|
]) {
|
|
643365
643318
|
try {
|
|
643366
|
-
|
|
643319
|
+
execSync63(tool, {
|
|
643367
643320
|
input: cmd,
|
|
643368
643321
|
timeout: 3e3,
|
|
643369
643322
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -643753,7 +643706,7 @@ var init_commands = __esm({
|
|
|
643753
643706
|
// packages/cli/src/tui/project-context.ts
|
|
643754
643707
|
import { existsSync as existsSync127, readFileSync as readFileSync104, readdirSync as readdirSync43, mkdirSync as mkdirSync74, writeFileSync as writeFileSync65 } from "node:fs";
|
|
643755
643708
|
import { join as join139, basename as basename26 } from "node:path";
|
|
643756
|
-
import { execSync as
|
|
643709
|
+
import { execSync as execSync56 } from "node:child_process";
|
|
643757
643710
|
import { homedir as homedir48 } from "node:os";
|
|
643758
643711
|
function projectContextUrlSpanAt(text2, index) {
|
|
643759
643712
|
PROJECT_CONTEXT_URL_RE.lastIndex = 0;
|
|
@@ -643812,18 +643765,18 @@ function loadProjectMap(repoRoot) {
|
|
|
643812
643765
|
}
|
|
643813
643766
|
function getGitInfo(repoRoot) {
|
|
643814
643767
|
try {
|
|
643815
|
-
|
|
643768
|
+
execSync56("git rev-parse --is-inside-work-tree", { cwd: repoRoot, stdio: "pipe" });
|
|
643816
643769
|
} catch {
|
|
643817
643770
|
return "";
|
|
643818
643771
|
}
|
|
643819
643772
|
const lines = [];
|
|
643820
643773
|
try {
|
|
643821
|
-
const branch =
|
|
643774
|
+
const branch = execSync56("git branch --show-current", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
643822
643775
|
if (branch) lines.push(`Branch: ${branch}`);
|
|
643823
643776
|
} catch {
|
|
643824
643777
|
}
|
|
643825
643778
|
try {
|
|
643826
|
-
const status =
|
|
643779
|
+
const status = execSync56("git status --porcelain", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
643827
643780
|
if (status) {
|
|
643828
643781
|
const changed = status.split("\n").length;
|
|
643829
643782
|
lines.push(`Working tree: ${changed} changed file(s)`);
|
|
@@ -643833,7 +643786,7 @@ function getGitInfo(repoRoot) {
|
|
|
643833
643786
|
} catch {
|
|
643834
643787
|
}
|
|
643835
643788
|
try {
|
|
643836
|
-
const log22 =
|
|
643789
|
+
const log22 = execSync56("git log --oneline -5 --no-decorate", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
643837
643790
|
if (log22) lines.push(`Recent commits:
|
|
643838
643791
|
${log22}`);
|
|
643839
643792
|
} catch {
|
|
@@ -648153,7 +648106,7 @@ var init_promptLoader3 = __esm({
|
|
|
648153
648106
|
// packages/cli/src/tui/dream-engine.ts
|
|
648154
648107
|
import { mkdirSync as mkdirSync80, writeFileSync as writeFileSync69, readFileSync as readFileSync110, existsSync as existsSync134, readdirSync as readdirSync47 } from "node:fs";
|
|
648155
648108
|
import { join as join147, basename as basename32 } from "node:path";
|
|
648156
|
-
import { execSync as
|
|
648109
|
+
import { execSync as execSync57 } from "node:child_process";
|
|
648157
648110
|
function setDreamWriteContent(fn) {
|
|
648158
648111
|
_dreamWriteContent = fn;
|
|
648159
648112
|
}
|
|
@@ -648526,7 +648479,7 @@ var init_dream_engine = __esm({
|
|
|
648526
648479
|
}
|
|
648527
648480
|
}
|
|
648528
648481
|
try {
|
|
648529
|
-
const output =
|
|
648482
|
+
const output = execSync57(cmd, {
|
|
648530
648483
|
cwd: this.repoRoot,
|
|
648531
648484
|
timeout: 3e4,
|
|
648532
648485
|
encoding: "utf-8",
|
|
@@ -649503,17 +649456,17 @@ ${summary}` };
|
|
|
649503
649456
|
try {
|
|
649504
649457
|
mkdirSync80(checkpointDir3, { recursive: true });
|
|
649505
649458
|
try {
|
|
649506
|
-
const gitStatus =
|
|
649459
|
+
const gitStatus = execSync57("git status --porcelain", {
|
|
649507
649460
|
cwd: this.repoRoot,
|
|
649508
649461
|
encoding: "utf-8",
|
|
649509
649462
|
timeout: 1e4
|
|
649510
649463
|
});
|
|
649511
|
-
const gitDiff =
|
|
649464
|
+
const gitDiff = execSync57("git diff", {
|
|
649512
649465
|
cwd: this.repoRoot,
|
|
649513
649466
|
encoding: "utf-8",
|
|
649514
649467
|
timeout: 1e4
|
|
649515
649468
|
});
|
|
649516
|
-
const gitHash =
|
|
649469
|
+
const gitHash = execSync57("git rev-parse HEAD 2>/dev/null || echo 'no-git'", {
|
|
649517
649470
|
cwd: this.repoRoot,
|
|
649518
649471
|
encoding: "utf-8",
|
|
649519
649472
|
timeout: 5e3
|
|
@@ -677886,7 +677839,7 @@ __export(aiwg_exports, {
|
|
|
677886
677839
|
import { existsSync as existsSync145, readFileSync as readFileSync120, readdirSync as readdirSync52, statSync as statSync52 } from "node:fs";
|
|
677887
677840
|
import { join as join157 } from "node:path";
|
|
677888
677841
|
import { homedir as homedir53 } from "node:os";
|
|
677889
|
-
import { execSync as
|
|
677842
|
+
import { execSync as execSync58 } from "node:child_process";
|
|
677890
677843
|
function resolveAiwgRoot() {
|
|
677891
677844
|
if (_cachedAiwgRoot !== void 0) return _cachedAiwgRoot;
|
|
677892
677845
|
const envRoot = process.env["OMNIUS_AIWG_ROOT"];
|
|
@@ -677900,7 +677853,7 @@ function resolveAiwgRoot() {
|
|
|
677900
677853
|
return shareDir;
|
|
677901
677854
|
}
|
|
677902
677855
|
try {
|
|
677903
|
-
const globalRoot =
|
|
677856
|
+
const globalRoot = execSync58("npm root -g", {
|
|
677904
677857
|
encoding: "utf-8",
|
|
677905
677858
|
timeout: 5e3,
|
|
677906
677859
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -677942,7 +677895,7 @@ function resolveAiwgRoot() {
|
|
|
677942
677895
|
}
|
|
677943
677896
|
}
|
|
677944
677897
|
try {
|
|
677945
|
-
const whichAiwg =
|
|
677898
|
+
const whichAiwg = execSync58("which aiwg 2>/dev/null || where aiwg 2>nul", {
|
|
677946
677899
|
encoding: "utf-8",
|
|
677947
677900
|
timeout: 3e3,
|
|
677948
677901
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -680830,9 +680783,9 @@ function resolveLocalPeerId() {
|
|
|
680830
680783
|
}
|
|
680831
680784
|
let scanResult = null;
|
|
680832
680785
|
try {
|
|
680833
|
-
const { execSync:
|
|
680786
|
+
const { execSync: execSync63 } = __require("node:child_process");
|
|
680834
680787
|
const cmd = `find "${homedir56()}" -maxdepth 4 -path '*/.omnius/nexus/status.json' -type f 2>/dev/null | head -50`;
|
|
680835
|
-
const out =
|
|
680788
|
+
const out = execSync63(cmd, { encoding: "utf-8", timeout: 2e3 }).trim();
|
|
680836
680789
|
for (const line of out.split("\n")) {
|
|
680837
680790
|
const f2 = line.trim();
|
|
680838
680791
|
if (!f2) continue;
|
|
@@ -680862,8 +680815,8 @@ function locateTorScript(filename) {
|
|
|
680862
680815
|
if (existsSync149(p2)) return p2;
|
|
680863
680816
|
}
|
|
680864
680817
|
try {
|
|
680865
|
-
const { execSync:
|
|
680866
|
-
const root =
|
|
680818
|
+
const { execSync: execSync63 } = __require("node:child_process");
|
|
680819
|
+
const root = execSync63("npm root -g", { encoding: "utf-8", timeout: 5e3 }).trim();
|
|
680867
680820
|
const p2 = join161(root, "omnius", "dist", "scripts", "tor", filename);
|
|
680868
680821
|
if (existsSync149(p2)) return p2;
|
|
680869
680822
|
} catch {
|
|
@@ -692085,7 +692038,7 @@ var init_usage_tracker = __esm({
|
|
|
692085
692038
|
});
|
|
692086
692039
|
|
|
692087
692040
|
// packages/cli/src/docker.ts
|
|
692088
|
-
import { execSync as
|
|
692041
|
+
import { execSync as execSync59, spawn as spawn32 } from "node:child_process";
|
|
692089
692042
|
import { existsSync as existsSync151, mkdirSync as mkdirSync94, writeFileSync as writeFileSync81 } from "node:fs";
|
|
692090
692043
|
import { join as join163, resolve as resolve64, dirname as dirname48 } from "node:path";
|
|
692091
692044
|
import { homedir as homedir57 } from "node:os";
|
|
@@ -692106,7 +692059,7 @@ function getDockerDir() {
|
|
|
692106
692059
|
}
|
|
692107
692060
|
function isDockerAvailable() {
|
|
692108
692061
|
try {
|
|
692109
|
-
|
|
692062
|
+
execSync59("docker info", { stdio: "pipe", timeout: 1e4 });
|
|
692110
692063
|
return true;
|
|
692111
692064
|
} catch {
|
|
692112
692065
|
return false;
|
|
@@ -692114,7 +692067,7 @@ function isDockerAvailable() {
|
|
|
692114
692067
|
}
|
|
692115
692068
|
function isDockerInstalled() {
|
|
692116
692069
|
try {
|
|
692117
|
-
|
|
692070
|
+
execSync59("docker --version", { stdio: "pipe", timeout: 5e3 });
|
|
692118
692071
|
return true;
|
|
692119
692072
|
} catch {
|
|
692120
692073
|
return false;
|
|
@@ -692139,31 +692092,31 @@ async function ensureDocker() {
|
|
|
692139
692092
|
}
|
|
692140
692093
|
try {
|
|
692141
692094
|
console.log("[omnius-docker] Docker not found. Installing via get.docker.com...");
|
|
692142
|
-
|
|
692095
|
+
execSync59("curl -fsSL https://get.docker.com | sh", {
|
|
692143
692096
|
stdio: "inherit",
|
|
692144
692097
|
timeout: 3e5
|
|
692145
692098
|
});
|
|
692146
692099
|
const user = process.env["USER"] || process.env["LOGNAME"];
|
|
692147
692100
|
if (user) {
|
|
692148
692101
|
try {
|
|
692149
|
-
|
|
692102
|
+
execSync59(`sudo usermod -aG docker ${user}`, { stdio: "pipe" });
|
|
692150
692103
|
} catch {
|
|
692151
692104
|
}
|
|
692152
692105
|
}
|
|
692153
692106
|
try {
|
|
692154
|
-
|
|
692107
|
+
execSync59("sudo systemctl start docker", { stdio: "pipe", timeout: 15e3 });
|
|
692155
692108
|
} catch {
|
|
692156
692109
|
}
|
|
692157
692110
|
try {
|
|
692158
|
-
|
|
692159
|
-
const runtimes =
|
|
692111
|
+
execSync59("nvidia-smi", { stdio: "pipe", timeout: 5e3 });
|
|
692112
|
+
const runtimes = execSync59("docker info --format '{{json .Runtimes}}'", {
|
|
692160
692113
|
stdio: "pipe",
|
|
692161
692114
|
timeout: 5e3
|
|
692162
692115
|
}).toString();
|
|
692163
692116
|
if (!runtimes.includes("nvidia")) {
|
|
692164
692117
|
console.log("[omnius-docker] NVIDIA GPU detected. Installing nvidia-container-toolkit...");
|
|
692165
692118
|
try {
|
|
692166
|
-
|
|
692119
|
+
execSync59(`
|
|
692167
692120
|
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg 2>/dev/null
|
|
692168
692121
|
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
|
|
692169
692122
|
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 )
|
|
@@ -692193,7 +692146,7 @@ async function ensureDocker() {
|
|
|
692193
692146
|
}
|
|
692194
692147
|
async function ensureNvidiaToolkit() {
|
|
692195
692148
|
try {
|
|
692196
|
-
|
|
692149
|
+
execSync59("nvidia-smi --query-gpu=name --format=csv,noheader", { stdio: "pipe", timeout: 5e3 });
|
|
692197
692150
|
} catch {
|
|
692198
692151
|
return { ok: false, message: "No NVIDIA GPU detected (nvidia-smi not found)" };
|
|
692199
692152
|
}
|
|
@@ -692204,7 +692157,7 @@ async function ensureNvidiaToolkit() {
|
|
|
692204
692157
|
return { ok: false, message: "Auto-install only supported on Linux. Install manually: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html" };
|
|
692205
692158
|
}
|
|
692206
692159
|
try {
|
|
692207
|
-
|
|
692160
|
+
execSync59(`
|
|
692208
692161
|
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg 2>/dev/null
|
|
692209
692162
|
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
|
|
692210
692163
|
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 )
|
|
@@ -692218,7 +692171,7 @@ async function ensureNvidiaToolkit() {
|
|
|
692218
692171
|
}
|
|
692219
692172
|
function isOmniusImageBuilt() {
|
|
692220
692173
|
try {
|
|
692221
|
-
const out =
|
|
692174
|
+
const out = execSync59(`docker images -q ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG}`, {
|
|
692222
692175
|
stdio: "pipe",
|
|
692223
692176
|
timeout: 5e3
|
|
692224
692177
|
}).toString().trim();
|
|
@@ -692242,7 +692195,7 @@ async function ensureOmniusImage(force = false) {
|
|
|
692242
692195
|
}
|
|
692243
692196
|
try {
|
|
692244
692197
|
console.log(`[omnius-docker] Building image ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG}...`);
|
|
692245
|
-
|
|
692198
|
+
execSync59(`docker build -t ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG} ${buildContext}`, {
|
|
692246
692199
|
stdio: "inherit",
|
|
692247
692200
|
timeout: 6e5
|
|
692248
692201
|
// 10 min
|
|
@@ -692316,11 +692269,11 @@ exec "$@"
|
|
|
692316
692269
|
}
|
|
692317
692270
|
function hasNvidiaGpu() {
|
|
692318
692271
|
try {
|
|
692319
|
-
|
|
692272
|
+
execSync59("nvidia-smi --query-gpu=name --format=csv,noheader", {
|
|
692320
692273
|
stdio: "pipe",
|
|
692321
692274
|
timeout: 5e3
|
|
692322
692275
|
});
|
|
692323
|
-
const runtimes =
|
|
692276
|
+
const runtimes = execSync59("docker info --format '{{json .Runtimes}}'", {
|
|
692324
692277
|
stdio: "pipe",
|
|
692325
692278
|
timeout: 5e3
|
|
692326
692279
|
}).toString();
|
|
@@ -692569,7 +692522,7 @@ import { createRequire as createRequire7 } from "node:module";
|
|
|
692569
692522
|
import { fileURLToPath as fileURLToPath19 } from "node:url";
|
|
692570
692523
|
import { dirname as dirname49, join as join165, resolve as resolve65 } from "node:path";
|
|
692571
692524
|
import { homedir as homedir58 } from "node:os";
|
|
692572
|
-
import { spawn as spawn33, execSync as
|
|
692525
|
+
import { spawn as spawn33, execSync as execSync60 } from "node:child_process";
|
|
692573
692526
|
import {
|
|
692574
692527
|
mkdirSync as mkdirSync95,
|
|
692575
692528
|
writeFileSync as writeFileSync82,
|
|
@@ -696890,7 +696843,7 @@ function handleV1RunsDelete(res, id) {
|
|
|
696890
696843
|
const containerName = `omnius-${id}`;
|
|
696891
696844
|
if (job.sandbox === "container") {
|
|
696892
696845
|
try {
|
|
696893
|
-
|
|
696846
|
+
execSync60(`docker stop ${containerName}`, {
|
|
696894
696847
|
timeout: 5e3,
|
|
696895
696848
|
stdio: "ignore"
|
|
696896
696849
|
});
|
|
@@ -699219,8 +699172,8 @@ data: ${JSON.stringify(data)}
|
|
|
699219
699172
|
}
|
|
699220
699173
|
setImmediate(() => {
|
|
699221
699174
|
try {
|
|
699222
|
-
const { execSync:
|
|
699223
|
-
|
|
699175
|
+
const { execSync: execSync63 } = require4("node:child_process");
|
|
699176
|
+
execSync63("npm update -g omnius 2>/dev/null || true", {
|
|
699224
699177
|
stdio: "pipe"
|
|
699225
699178
|
});
|
|
699226
699179
|
} catch {
|
|
@@ -699263,7 +699216,7 @@ data: ${JSON.stringify(data)}
|
|
|
699263
699216
|
return;
|
|
699264
699217
|
}
|
|
699265
699218
|
try {
|
|
699266
|
-
const { execSync:
|
|
699219
|
+
const { execSync: execSync63 } = require4("node:child_process");
|
|
699267
699220
|
let audioPath = null;
|
|
699268
699221
|
const ttsCmds = [
|
|
699269
699222
|
`espeak "${text2}" -w /tmp/tts_${Date.now()}.wav 2>/dev/null`,
|
|
@@ -699272,7 +699225,7 @@ data: ${JSON.stringify(data)}
|
|
|
699272
699225
|
];
|
|
699273
699226
|
for (const cmd of ttsCmds) {
|
|
699274
699227
|
try {
|
|
699275
|
-
|
|
699228
|
+
execSync63(cmd, { stdio: "pipe" });
|
|
699276
699229
|
audioPath = "/tmp/tts_" + Date.now() + ".wav";
|
|
699277
699230
|
break;
|
|
699278
699231
|
} catch {
|
|
@@ -702696,7 +702649,7 @@ var clipboard_media_exports = {};
|
|
|
702696
702649
|
__export(clipboard_media_exports, {
|
|
702697
702650
|
pasteClipboardImageToFile: () => pasteClipboardImageToFile
|
|
702698
702651
|
});
|
|
702699
|
-
import { execFileSync as execFileSync10, execSync as
|
|
702652
|
+
import { execFileSync as execFileSync10, execSync as execSync61 } from "node:child_process";
|
|
702700
702653
|
import { mkdirSync as mkdirSync96, readFileSync as readFileSync126, rmSync as rmSync12, writeFileSync as writeFileSync83 } from "node:fs";
|
|
702701
702654
|
import { join as join166 } from "node:path";
|
|
702702
702655
|
function pasteClipboardImageToFile(repoRoot) {
|
|
@@ -702711,7 +702664,7 @@ function pasteClipboardImageToFile(repoRoot) {
|
|
|
702711
702664
|
function readClipboardImage() {
|
|
702712
702665
|
if (process.platform === "darwin") {
|
|
702713
702666
|
try {
|
|
702714
|
-
|
|
702667
|
+
execSync61("command -v pngpaste", { stdio: "ignore", timeout: 1e3 });
|
|
702715
702668
|
const tmp = `/tmp/omnius-clipboard-${Date.now()}.png`;
|
|
702716
702669
|
execFileSync10("pngpaste", [tmp], { timeout: 3e3 });
|
|
702717
702670
|
const buffer2 = readFileSync126(tmp);
|
|
@@ -702782,7 +702735,7 @@ import {
|
|
|
702782
702735
|
mkdirSync as mkdirSync97
|
|
702783
702736
|
} from "node:fs";
|
|
702784
702737
|
import { existsSync as existsSync153 } from "node:fs";
|
|
702785
|
-
import { execSync as
|
|
702738
|
+
import { execSync as execSync62 } from "node:child_process";
|
|
702786
702739
|
import { homedir as homedir59 } from "node:os";
|
|
702787
702740
|
function formatTimeAgo2(date) {
|
|
702788
702741
|
const seconds = Math.floor((Date.now() - date.getTime()) / 1e3);
|
|
@@ -702949,9 +702902,9 @@ ${incompleteList}${more}
|
|
|
702949
702902
|
const scripts = pkg.scripts || {};
|
|
702950
702903
|
const checkScript = scripts["typecheck"] ? "typecheck" : scripts["build"] ? "build" : null;
|
|
702951
702904
|
if (checkScript) {
|
|
702952
|
-
const { execSync:
|
|
702905
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
702953
702906
|
try {
|
|
702954
|
-
|
|
702907
|
+
execSync63(`npm run ${checkScript} --silent 2>&1`, {
|
|
702955
702908
|
cwd: cwd4,
|
|
702956
702909
|
stdio: "pipe",
|
|
702957
702910
|
timeout: 12e4,
|
|
@@ -710746,7 +710699,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710746
710699
|
try {
|
|
710747
710700
|
if (process.platform === "win32") {
|
|
710748
710701
|
try {
|
|
710749
|
-
|
|
710702
|
+
execSync62(`taskkill /F /PID ${pid}`, {
|
|
710750
710703
|
timeout: 5e3,
|
|
710751
710704
|
stdio: "ignore"
|
|
710752
710705
|
});
|
|
@@ -710778,7 +710731,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710778
710731
|
if (pid > 0) {
|
|
710779
710732
|
if (process.platform === "win32") {
|
|
710780
710733
|
try {
|
|
710781
|
-
|
|
710734
|
+
execSync62(`taskkill /F /PID ${pid}`, {
|
|
710782
710735
|
timeout: 5e3,
|
|
710783
710736
|
stdio: "ignore"
|
|
710784
710737
|
});
|
|
@@ -710798,7 +710751,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710798
710751
|
} catch {
|
|
710799
710752
|
}
|
|
710800
710753
|
try {
|
|
710801
|
-
|
|
710754
|
+
execSync62(
|
|
710802
710755
|
process.platform === "win32" ? "timeout /t 1 /nobreak >nul" : "sleep 0.5",
|
|
710803
710756
|
{ timeout: 3e3, stdio: "ignore" }
|
|
710804
710757
|
);
|
|
@@ -710815,7 +710768,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710815
710768
|
} catch (err) {
|
|
710816
710769
|
if (attempt < 2) {
|
|
710817
710770
|
try {
|
|
710818
|
-
|
|
710771
|
+
execSync62(
|
|
710819
710772
|
process.platform === "win32" ? "timeout /t 1 /nobreak >nul" : "sleep 0.3",
|
|
710820
710773
|
{ timeout: 3e3, stdio: "ignore" }
|
|
710821
710774
|
);
|
|
@@ -710829,7 +710782,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710829
710782
|
);
|
|
710830
710783
|
if (process.platform === "win32") {
|
|
710831
710784
|
try {
|
|
710832
|
-
|
|
710785
|
+
execSync62(`rd /s /q "${omniusPath}"`, {
|
|
710833
710786
|
timeout: 1e4,
|
|
710834
710787
|
stdio: "ignore"
|
|
710835
710788
|
});
|