omnius 1.0.298 → 1.0.299
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 +213 -187
- 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: execSync64 } = await import("node:child_process");
|
|
9728
9728
|
try {
|
|
9729
|
-
|
|
9729
|
+
execSync64("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
|
+
execSync64("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;
|
|
@@ -571242,8 +571242,8 @@ Respond with your assessment, then take action.`;
|
|
|
571242
571242
|
const memMod = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
|
571243
571243
|
let commitSha = "no-commit";
|
|
571244
571244
|
try {
|
|
571245
|
-
const { execSync:
|
|
571246
|
-
commitSha =
|
|
571245
|
+
const { execSync: execSync64 } = await import("node:child_process");
|
|
571246
|
+
commitSha = execSync64("git rev-parse HEAD", {
|
|
571247
571247
|
cwd: this._workingDirectory,
|
|
571248
571248
|
stdio: ["ignore", "pipe", "ignore"]
|
|
571249
571249
|
}).toString().trim().slice(0, 12) || "no-commit";
|
|
@@ -580516,7 +580516,7 @@ ${result}`
|
|
|
580516
580516
|
const buffer2 = Buffer.from(rawBase64, "base64");
|
|
580517
580517
|
let resizedBase64 = null;
|
|
580518
580518
|
try {
|
|
580519
|
-
const { execSync:
|
|
580519
|
+
const { execSync: execSync64 } = await import("node:child_process");
|
|
580520
580520
|
const { writeFileSync: writeFileSync87, readFileSync: readFileSync129, unlinkSync: unlinkSync35 } = await import("node:fs");
|
|
580521
580521
|
const { join: join172 } = await import("node:path");
|
|
580522
580522
|
const { tmpdir: tmpdir24 } = await import("node:os");
|
|
@@ -580526,7 +580526,7 @@ ${result}`
|
|
|
580526
580526
|
const pyBin = process.platform === "win32" ? "python" : "python3";
|
|
580527
580527
|
const escapedIn = tmpIn.replace(/\\/g, "\\\\");
|
|
580528
580528
|
const escapedOut = tmpOut.replace(/\\/g, "\\\\");
|
|
580529
|
-
|
|
580529
|
+
execSync64(`${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" });
|
|
580530
580530
|
const resizedBuf = readFileSync129(tmpOut);
|
|
580531
580531
|
resizedBase64 = `data:image/jpeg;base64,${resizedBuf.toString("base64")}`;
|
|
580532
580532
|
try {
|
|
@@ -580595,8 +580595,8 @@ ${result}`
|
|
|
580595
580595
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
580596
580596
|
});
|
|
580597
580597
|
try {
|
|
580598
|
-
const { execSync:
|
|
580599
|
-
|
|
580598
|
+
const { execSync: execSync64 } = await import("node:child_process");
|
|
580599
|
+
execSync64("ollama pull moondream", {
|
|
580600
580600
|
timeout: 3e5,
|
|
580601
580601
|
stdio: "pipe"
|
|
580602
580602
|
});
|
|
@@ -606740,6 +606740,7 @@ __export(status_bar_exports, {
|
|
|
606740
606740
|
setTerminalTitle: () => setTerminalTitle,
|
|
606741
606741
|
unlockFooterRedraws: () => unlockFooterRedraws
|
|
606742
606742
|
});
|
|
606743
|
+
import { execSync as execSync52 } from "child_process";
|
|
606743
606744
|
import { readFileSync as readFileSync91 } from "node:fs";
|
|
606744
606745
|
function formatPoolAge(ms) {
|
|
606745
606746
|
if (ms < 6e4) return `${Math.max(0, Math.floor(ms / 1e3))}s`;
|
|
@@ -606760,6 +606761,30 @@ function refreshThemeVars() {
|
|
|
606760
606761
|
TEXT_PRIMARY = tuiTextPrimary() < 0 ? 252 : tuiTextPrimary();
|
|
606761
606762
|
TEXT_DIM = tuiTextDim();
|
|
606762
606763
|
}
|
|
606764
|
+
function digitBarSupported() {
|
|
606765
|
+
if (_digitBarSupported !== null) return _digitBarSupported;
|
|
606766
|
+
if (_isWindows) {
|
|
606767
|
+
_digitBarSupported = false;
|
|
606768
|
+
return false;
|
|
606769
|
+
}
|
|
606770
|
+
const termProgram = process.env.TERM_PROGRAM || "";
|
|
606771
|
+
if (/^(iTerm2|WezTerm|Kitty|Alacritty|Ghostty|Warp|Hyper|Tabby)$/i.test(
|
|
606772
|
+
termProgram
|
|
606773
|
+
)) {
|
|
606774
|
+
_digitBarSupported = true;
|
|
606775
|
+
return true;
|
|
606776
|
+
}
|
|
606777
|
+
try {
|
|
606778
|
+
const result = execSync52(
|
|
606779
|
+
'fc-list ":charset=1fbf0-1fbf9" 2>/dev/null || true',
|
|
606780
|
+
{ encoding: "utf8", timeout: 3e3 }
|
|
606781
|
+
);
|
|
606782
|
+
_digitBarSupported = result.trim().length > 0;
|
|
606783
|
+
} catch {
|
|
606784
|
+
_digitBarSupported = true;
|
|
606785
|
+
}
|
|
606786
|
+
return _digitBarSupported;
|
|
606787
|
+
}
|
|
606763
606788
|
function sanitizeSponsorHeaderText(value2, max = SPONSOR_HEADER_LABEL_MAX) {
|
|
606764
606789
|
const cleaned = stripAnsi(String(value2 ?? "")).replace(/[\x00-\x1F\x7F]/g, " ").replace(/\s+/g, " ").trim();
|
|
606765
606790
|
if (cleaned.length <= max) return cleaned;
|
|
@@ -606793,7 +606818,7 @@ function setTerminalTitle(task, version4) {
|
|
|
606793
606818
|
process.stdout.write(data);
|
|
606794
606819
|
}
|
|
606795
606820
|
}
|
|
606796
|
-
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;
|
|
606821
|
+
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, _digitBarSupported, SPONSOR_HEADER_LABEL_MAX, _termTitleWriter, StatusBar;
|
|
606797
606822
|
var init_status_bar = __esm({
|
|
606798
606823
|
"packages/cli/src/tui/status-bar.ts"() {
|
|
606799
606824
|
"use strict";
|
|
@@ -606987,6 +607012,7 @@ var init_status_bar = __esm({
|
|
|
606987
607012
|
RESET4 = "\x1B[0m";
|
|
606988
607013
|
CURSOR_BLINK_BLOCK = "\x1B[1 q";
|
|
606989
607014
|
_isWindows = process.platform === "win32";
|
|
607015
|
+
_digitBarSupported = null;
|
|
606990
607016
|
SPONSOR_HEADER_LABEL_MAX = 48;
|
|
606991
607017
|
_termTitleWriter = null;
|
|
606992
607018
|
StatusBar = class _StatusBar {
|
|
@@ -607449,7 +607475,7 @@ var init_status_bar = __esm({
|
|
|
607449
607475
|
const decorateMenuButton = (cmd, label) => {
|
|
607450
607476
|
return linkify(
|
|
607451
607477
|
cmd,
|
|
607452
|
-
|
|
607478
|
+
`\x1B[38;5;${HEADER_ACCENT_GREEN}m🭁\x1B[0m${HEADER_BUTTON_FG}${HEADER_BUTTON_BG}${label}\x1B[0m${PANEL_BG_SEQ}\x1B[38;5;${HEADER_ACCENT_GREEN}m🭝\x1B[0m${PANEL_BG_SEQ}`
|
|
607453
607479
|
);
|
|
607454
607480
|
};
|
|
607455
607481
|
const renderBtn = (cmd, label) => {
|
|
@@ -609863,8 +609889,8 @@ ${CONTENT_BG_SEQ}`);
|
|
|
609863
609889
|
if (n2 < 1e6) return `${Math.round(n2 / 1e3)}K`;
|
|
609864
609890
|
return `${(n2 / 1e6).toFixed(1)}M`;
|
|
609865
609891
|
}
|
|
609866
|
-
/** Map digit 0-9 to ornamental digits
|
|
609867
|
-
static DIGIT_EMOJI =
|
|
609892
|
+
/** Map digit 0-9 to ornamental digits 🯰🯱🯲🯳🯴🯵🯶🯷🯸🯹 (or plain ASCII when font lacks them) */
|
|
609893
|
+
static DIGIT_EMOJI = digitBarSupported() ? [
|
|
609868
609894
|
"🯰",
|
|
609869
609895
|
// 0
|
|
609870
609896
|
"🯱",
|
|
@@ -609885,7 +609911,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
609885
609911
|
// 8
|
|
609886
609912
|
"🯹"
|
|
609887
609913
|
// 9
|
|
609888
|
-
];
|
|
609914
|
+
] : ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
609889
609915
|
/** Convert a number to a digit-bar string: 1234 → "🯱🯲🯳🯴" */
|
|
609890
609916
|
static digitBar(n2) {
|
|
609891
609917
|
if (n2 < 0) return this.DIGIT_EMOJI[0].repeat(4);
|
|
@@ -609965,9 +609991,9 @@ ${CONTENT_BG_SEQ}`);
|
|
|
609965
609991
|
);
|
|
609966
609992
|
const ctxColor = ctxPct > 50 ? c3.green : ctxPct > 20 ? c3.yellow : c3.red;
|
|
609967
609993
|
const ctxSizeStr = _StatusBar.digitBar(ctxTotal);
|
|
609968
|
-
ctxSuffix = " " + ctxColor(`${ctxPct}%`) + c3.dim(` ${ctxSizeStr}`);
|
|
609994
|
+
ctxSuffix = " " + ctxColor(`${_StatusBar.digitBar(ctxPct)}%`) + c3.dim(` ${ctxSizeStr}`);
|
|
609969
609995
|
ctxSuffixW = 1 + `${ctxPct}%`.length + 1 + ctxSizeStr.length;
|
|
609970
|
-
ctxCompSuffix = " " + ctxColor(`${ctxPct}%`);
|
|
609996
|
+
ctxCompSuffix = " " + ctxColor(`${_StatusBar.digitBar(ctxPct)}%`);
|
|
609971
609997
|
ctxCompSuffixW = 1 + `${ctxPct}%`.length;
|
|
609972
609998
|
}
|
|
609973
609999
|
const promptSizeStr = m2.lastPromptTokens > 0 ? _StatusBar.digitBar(m2.lastPromptTokens) : "";
|
|
@@ -610027,7 +610053,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
610027
610053
|
}
|
|
610028
610054
|
}
|
|
610029
610055
|
if (this._telegramStatus.active) {
|
|
610030
|
-
const suffix = this._telegramStatus.activeSubAgents > 0 ? ` ${this._telegramStatus.activeSubAgents}` : "";
|
|
610056
|
+
const suffix = this._telegramStatus.activeSubAgents > 0 ? ` ${_StatusBar.digitBar(this._telegramStatus.activeSubAgents)}` : "";
|
|
610031
610057
|
const label = `✈ tg${suffix}`;
|
|
610032
610058
|
const compact3 = `✈${suffix}`;
|
|
610033
610059
|
sections.push({
|
|
@@ -610101,8 +610127,8 @@ ${CONTENT_BG_SEQ}`);
|
|
|
610101
610127
|
});
|
|
610102
610128
|
const modelStr = modelParams.join(",");
|
|
610103
610129
|
const visibleReqs = Array.from(this._expose.modelUsage.entries()).filter(([m3]) => !INTERNAL_CAPS.has(m3)).reduce((sum, [, n2]) => sum + n2, 0);
|
|
610104
|
-
const reqStr = visibleReqs > 0 ? ` ${visibleReqs}req` : "";
|
|
610105
|
-
const connStr = this._expose.activeConnections > 0 ? ` ${this._expose.activeConnections}conn` : "";
|
|
610130
|
+
const reqStr = visibleReqs > 0 ? ` ${_StatusBar.digitBar(visibleReqs)}req` : "";
|
|
610131
|
+
const connStr = this._expose.activeConnections > 0 ? ` ${_StatusBar.digitBar(this._expose.activeConnections)}conn` : "";
|
|
610106
610132
|
const exposeExpanded = statusEmoji + pastel2(183, (modelStr ? " " + modelStr : "") + reqStr + connStr);
|
|
610107
610133
|
const exposeCompact = statusEmoji + (modelStr ? pastel2(183, " " + modelStr) : "");
|
|
610108
610134
|
const expFullStr = (modelStr ? " " + modelStr : "") + reqStr + connStr;
|
|
@@ -610128,41 +610154,41 @@ ${CONTENT_BG_SEQ}`);
|
|
|
610128
610154
|
let hwCompW = 0;
|
|
610129
610155
|
if (rm4.cpuUtil >= 0) {
|
|
610130
610156
|
const cpuColor = rm4.cpuUtil > 80 ? c3.red : rm4.cpuUtil > 50 ? c3.yellow : c3.green;
|
|
610131
|
-
const cpuCoresInfo = rm4.cpuCores > 0 ? ` (${rm4.cpuCores}c` + (rm4.cpuModel ? " " + rm4.cpuModel.replace(/\s+/g, " ").slice(0, 30) : "") + ")" : "";
|
|
610132
|
-
hwExpStr += `CPU ${cpuColor(rm4.cpuUtil + "%")}${c3.dim(cpuCoresInfo)}`;
|
|
610133
|
-
hwCompStr += `CPU ${cpuColor(rm4.cpuUtil + "%")}`;
|
|
610157
|
+
const cpuCoresInfo = rm4.cpuCores > 0 ? ` (${_StatusBar.digitBar(rm4.cpuCores)}c` + (rm4.cpuModel ? " " + rm4.cpuModel.replace(/\s+/g, " ").slice(0, 30) : "") + ")" : "";
|
|
610158
|
+
hwExpStr += `CPU ${cpuColor(_StatusBar.digitBar(rm4.cpuUtil) + "%")}${c3.dim(cpuCoresInfo)}`;
|
|
610159
|
+
hwCompStr += `CPU ${cpuColor(_StatusBar.digitBar(rm4.cpuUtil) + "%")}`;
|
|
610134
610160
|
hwExpW += 4 + `${rm4.cpuUtil}%`.length + cpuCoresInfo.length;
|
|
610135
610161
|
hwCompW += 4 + `${rm4.cpuUtil}%`.length;
|
|
610136
610162
|
}
|
|
610137
610163
|
if (rm4.memUtil >= 0) {
|
|
610138
610164
|
const memColor = rm4.memUtil > 80 ? c3.red : rm4.memUtil > 50 ? c3.yellow : c3.green;
|
|
610139
610165
|
const memDetail = rm4.memTotalGB > 0 ? ` (${rm4.memUsedGB}/${rm4.memTotalGB}GB)` : "";
|
|
610140
|
-
hwExpStr += ` RAM ${memColor(rm4.memUtil + "%")}${c3.dim(memDetail)}`;
|
|
610141
|
-
hwCompStr += ` RAM ${memColor(rm4.memUtil + "%")}`;
|
|
610166
|
+
hwExpStr += ` RAM ${memColor(_StatusBar.digitBar(rm4.memUtil) + "%")}${c3.dim(memDetail)}`;
|
|
610167
|
+
hwCompStr += ` RAM ${memColor(_StatusBar.digitBar(rm4.memUtil) + "%")}`;
|
|
610142
610168
|
hwExpW += 5 + `${rm4.memUtil}%`.length + memDetail.length;
|
|
610143
610169
|
hwCompW += 5 + `${rm4.memUtil}%`.length;
|
|
610144
610170
|
}
|
|
610145
610171
|
if (rm4.diskUtil >= 0) {
|
|
610146
610172
|
const diskColor = rm4.diskUtil > 90 ? c3.red : rm4.diskUtil > 75 ? c3.yellow : c3.green;
|
|
610147
610173
|
const diskDetail = rm4.diskTotalGB > 0 ? ` (${rm4.diskFreeGB.toFixed(rm4.diskFreeGB < 10 ? 1 : 0)}GB free)` : "";
|
|
610148
|
-
hwExpStr += ` DISK ${diskColor(rm4.diskUtil + "%")}${c3.dim(diskDetail)}`;
|
|
610149
|
-
hwCompStr += ` DISK ${diskColor(rm4.diskUtil + "%")}`;
|
|
610174
|
+
hwExpStr += ` DISK ${diskColor(_StatusBar.digitBar(rm4.diskUtil) + "%")}${c3.dim(diskDetail)}`;
|
|
610175
|
+
hwCompStr += ` DISK ${diskColor(_StatusBar.digitBar(rm4.diskUtil) + "%")}`;
|
|
610150
610176
|
hwExpW += 6 + `${rm4.diskUtil}%`.length + diskDetail.length;
|
|
610151
610177
|
hwCompW += 6 + `${rm4.diskUtil}%`.length;
|
|
610152
610178
|
}
|
|
610153
610179
|
if (rm4.gpuUtil >= 0) {
|
|
610154
610180
|
const gpuColor = rm4.gpuUtil > 80 ? c3.red : rm4.gpuUtil > 50 ? c3.yellow : c3.green;
|
|
610155
610181
|
const gpuNameShort = rm4.gpuName ? ` (${rm4.gpuName.slice(0, 20)})` : "";
|
|
610156
|
-
hwExpStr += ` GPU ${gpuColor(rm4.gpuUtil + "%")}${c3.dim(gpuNameShort)}`;
|
|
610157
|
-
hwCompStr += ` GPU ${gpuColor(rm4.gpuUtil + "%")}`;
|
|
610182
|
+
hwExpStr += ` GPU ${gpuColor(_StatusBar.digitBar(rm4.gpuUtil) + "%")}${c3.dim(gpuNameShort)}`;
|
|
610183
|
+
hwCompStr += ` GPU ${gpuColor(_StatusBar.digitBar(rm4.gpuUtil) + "%")}`;
|
|
610158
610184
|
hwExpW += 5 + `${rm4.gpuUtil}%`.length + gpuNameShort.length;
|
|
610159
610185
|
hwCompW += 5 + `${rm4.gpuUtil}%`.length;
|
|
610160
610186
|
}
|
|
610161
610187
|
if (rm4.vramUtil >= 0) {
|
|
610162
610188
|
const vramColor = rm4.vramUtil > 80 ? c3.red : rm4.vramUtil > 50 ? c3.yellow : c3.green;
|
|
610163
610189
|
const vramDetail = rm4.vramTotalMB > 0 ? ` (${rm4.vramUsedMB}/${rm4.vramTotalMB}MB)` : "";
|
|
610164
|
-
hwExpStr += ` VRAM ${vramColor(rm4.vramUtil + "%")}${c3.dim(vramDetail)}`;
|
|
610165
|
-
hwCompStr += ` VRAM ${vramColor(rm4.vramUtil + "%")}`;
|
|
610190
|
+
hwExpStr += ` VRAM ${vramColor(_StatusBar.digitBar(rm4.vramUtil) + "%")}${c3.dim(vramDetail)}`;
|
|
610191
|
+
hwCompStr += ` VRAM ${vramColor(_StatusBar.digitBar(rm4.vramUtil) + "%")}`;
|
|
610166
610192
|
hwExpW += 6 + `${rm4.vramUtil}%`.length + vramDetail.length;
|
|
610167
610193
|
hwCompW += 6 + `${rm4.vramUtil}%`.length;
|
|
610168
610194
|
}
|
|
@@ -610171,7 +610197,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
610171
610197
|
const ready = pool3.readyGpuInstances;
|
|
610172
610198
|
const target = pool3.targetGpuInstances;
|
|
610173
610199
|
const poolColor = pool3.mode === "constrained" ? c3.yellow : target > 0 && ready < target ? c3.yellow : c3.green;
|
|
610174
|
-
const poolDetail = pool3.mode === "constrained" ? "queue" : `${ready}/${target}`;
|
|
610200
|
+
const poolDetail = pool3.mode === "constrained" ? "queue" : `${_StatusBar.digitBar(ready)}/${_StatusBar.digitBar(target)}`;
|
|
610175
610201
|
const poolOwned = pool3.instances.filter((i2) => i2.poolOwned);
|
|
610176
610202
|
const pidSummary = poolOwned.length === 0 ? "" : ` PID[${poolOwned.map((i2) => `${i2.pid}@${i2.gpuIndex ?? "?"}`).slice(0, 3).join(",")}]`;
|
|
610177
610203
|
const oldestAgeMs = poolOwned.reduce(
|
|
@@ -610180,7 +610206,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
610180
610206
|
);
|
|
610181
610207
|
const ageSummary = oldestAgeMs > 0 ? ` age=${formatPoolAge(oldestAgeMs)}` : "";
|
|
610182
610208
|
const poolText = ` OLLAMA ${poolColor(`${pool3.mode}:${poolDetail}`)}${c3.dim(pidSummary)}${c3.dim(ageSummary)}`;
|
|
610183
|
-
const compactText3 = ` OLLAMA ${poolColor(pool3.mode === "constrained" ? "queue" : `${ready}/${target}`)}`;
|
|
610209
|
+
const compactText3 = ` OLLAMA ${poolColor(pool3.mode === "constrained" ? "queue" : `${_StatusBar.digitBar(ready)}/${_StatusBar.digitBar(target)}`)}`;
|
|
610184
610210
|
hwExpStr += poolText;
|
|
610185
610211
|
hwCompStr += compactText3;
|
|
610186
610212
|
hwExpW += 8 + `${pool3.mode}:${poolDetail}`.length + pidSummary.length + ageSummary.length;
|
|
@@ -610213,7 +610239,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
610213
610239
|
}
|
|
610214
610240
|
if (this._recording) {
|
|
610215
610241
|
const dot = this._recBlink ? pastel2(210, "●") : " ";
|
|
610216
|
-
const countdown = this._countdown > 0 ? c3.dim(` ${this._countdown}s`) : "";
|
|
610242
|
+
const countdown = this._countdown > 0 ? c3.dim(` ${_StatusBar.digitBar(this._countdown)}s`) : "";
|
|
610217
610243
|
const recStr = dot + pastel2(210, " REC") + countdown;
|
|
610218
610244
|
const recW = 1 + 4 + (this._countdown > 0 ? 1 + `${this._countdown}s`.length : 0);
|
|
610219
610245
|
sections.push({
|
|
@@ -611830,7 +611856,7 @@ __export(personaplex_exports, {
|
|
|
611830
611856
|
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";
|
|
611831
611857
|
import { join as join126, dirname as dirname40 } from "node:path";
|
|
611832
611858
|
import { homedir as homedir40 } from "node:os";
|
|
611833
|
-
import { execSync as
|
|
611859
|
+
import { execSync as execSync53, spawn as spawn28 } from "node:child_process";
|
|
611834
611860
|
import { fileURLToPath as fileURLToPath15 } from "node:url";
|
|
611835
611861
|
function personaplexPythonEnv(extra = {}) {
|
|
611836
611862
|
const env2 = { ...process.env, ...extra };
|
|
@@ -611868,7 +611894,7 @@ function detectJetson() {
|
|
|
611868
611894
|
try {
|
|
611869
611895
|
const model = readFileSync92("/proc/device-tree/model", "utf8").replace(/\0/g, "").trim();
|
|
611870
611896
|
if (/jetson|orin|tegra/i.test(model)) {
|
|
611871
|
-
const memInfo =
|
|
611897
|
+
const memInfo = execSync53("grep MemTotal /proc/meminfo", { encoding: "utf8", timeout: 3e3, stdio: "pipe" });
|
|
611872
611898
|
const memKB = parseInt(memInfo.match(/(\d+)/)?.[1] ?? "0", 10);
|
|
611873
611899
|
return { isJetson: true, model, totalMemGB: memKB / 1024 / 1024 };
|
|
611874
611900
|
}
|
|
@@ -611902,7 +611928,7 @@ function detectPersonaPlexCapability() {
|
|
|
611902
611928
|
};
|
|
611903
611929
|
}
|
|
611904
611930
|
try {
|
|
611905
|
-
const nvsmi =
|
|
611931
|
+
const nvsmi = execSync53("nvidia-smi --query-gpu=name,memory.total --format=csv,noheader,nounits", {
|
|
611906
611932
|
encoding: "utf8",
|
|
611907
611933
|
timeout: 5e3,
|
|
611908
611934
|
stdio: "pipe"
|
|
@@ -611914,7 +611940,7 @@ function detectPersonaPlexCapability() {
|
|
|
611914
611940
|
return { ...fail3(`GPU has ${vramGB.toFixed(1)}GB VRAM (need ≥8GB)`), gpuName: gpuName ?? "", vramGB };
|
|
611915
611941
|
}
|
|
611916
611942
|
try {
|
|
611917
|
-
|
|
611943
|
+
execSync53('python3 -c "import torch; assert torch.cuda.is_available()"', {
|
|
611918
611944
|
timeout: 1e4,
|
|
611919
611945
|
stdio: "pipe",
|
|
611920
611946
|
env: personaplexPythonEnv()
|
|
@@ -611988,7 +612014,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
611988
612014
|
mkdirSync66(PERSONAPLEX_DIR, { recursive: true });
|
|
611989
612015
|
let arch3 = "";
|
|
611990
612016
|
try {
|
|
611991
|
-
arch3 =
|
|
612017
|
+
arch3 = execSync53("uname -m", { encoding: "utf8", timeout: 3e3, stdio: "pipe" }).trim();
|
|
611992
612018
|
} catch {
|
|
611993
612019
|
}
|
|
611994
612020
|
const isAarch64 = arch3 === "aarch64" || arch3 === "arm64";
|
|
@@ -612009,16 +612035,16 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
612009
612035
|
log22("Checking system dependencies (libopus)...");
|
|
612010
612036
|
try {
|
|
612011
612037
|
if (process.platform === "linux") {
|
|
612012
|
-
|
|
612038
|
+
execSync53("dpkg -l libopus-dev 2>/dev/null || sudo apt-get install -y libopus-dev", { timeout: 3e4, stdio: "pipe" });
|
|
612013
612039
|
} else if (process.platform === "darwin") {
|
|
612014
|
-
|
|
612040
|
+
execSync53("brew list opus 2>/dev/null || brew install opus", { timeout: 6e4, stdio: "pipe" });
|
|
612015
612041
|
}
|
|
612016
612042
|
} catch {
|
|
612017
612043
|
}
|
|
612018
612044
|
if (isAarch64) {
|
|
612019
612045
|
log22("ARM64: Checking Rust toolchain for sphn build...");
|
|
612020
612046
|
try {
|
|
612021
|
-
|
|
612047
|
+
execSync53("rustc --version", { timeout: 5e3, stdio: "pipe" });
|
|
612022
612048
|
} catch {
|
|
612023
612049
|
log22("ARM64: Installing Rust toolchain (needed for sphn audio codec)...");
|
|
612024
612050
|
try {
|
|
@@ -612091,7 +612117,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
612091
612117
|
}
|
|
612092
612118
|
const serverPy = join126(venvDir, "lib", `python3.${process.versions.node ? "12" : "10"}`, "site-packages", "moshi", "server.py");
|
|
612093
612119
|
try {
|
|
612094
|
-
const sitePackages =
|
|
612120
|
+
const sitePackages = execSync53(`"${python}" -c "import moshi, os; print(os.path.dirname(moshi.__file__))"`, {
|
|
612095
612121
|
encoding: "utf8",
|
|
612096
612122
|
timeout: 5e3,
|
|
612097
612123
|
stdio: "pipe",
|
|
@@ -612109,7 +612135,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
612109
612135
|
} catch {
|
|
612110
612136
|
}
|
|
612111
612137
|
try {
|
|
612112
|
-
const sitePackages =
|
|
612138
|
+
const sitePackages = execSync53(`"${python}" -c "import moshi, os; print(os.path.dirname(moshi.__file__))"`, {
|
|
612113
612139
|
encoding: "utf8",
|
|
612114
612140
|
timeout: 5e3,
|
|
612115
612141
|
stdio: "pipe",
|
|
@@ -612214,7 +612240,7 @@ $2if filename.endswith(".safetensors"):`
|
|
|
612214
612240
|
} catch {
|
|
612215
612241
|
}
|
|
612216
612242
|
try {
|
|
612217
|
-
const sitePackages2 =
|
|
612243
|
+
const sitePackages2 = execSync53(`"${python}" -c "import moshi, os; print(os.path.dirname(moshi.__file__))"`, {
|
|
612218
612244
|
encoding: "utf8",
|
|
612219
612245
|
timeout: 5e3,
|
|
612220
612246
|
stdio: "pipe",
|
|
@@ -612350,14 +612376,14 @@ async function startPersonaPlexDaemon(onInfo) {
|
|
|
612350
612376
|
if (tier === "nf4-distilled") {
|
|
612351
612377
|
log22(`Weight tier: ${tier} — distilled NF4 (90% token match, ${repoInfo.sizeGB}GB)...`);
|
|
612352
612378
|
try {
|
|
612353
|
-
const weightPath =
|
|
612379
|
+
const weightPath = execSync53(
|
|
612354
612380
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', '${repoInfo.file}', token=False))"`,
|
|
612355
612381
|
{ encoding: "utf8", timeout: 6e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612356
612382
|
).trim();
|
|
612357
612383
|
if (existsSync111(weightPath)) {
|
|
612358
612384
|
if (!existsSync111(cachedBf16)) {
|
|
612359
612385
|
log22("Converting .pt checkpoint to safetensors (one-time)...");
|
|
612360
|
-
|
|
612386
|
+
execSync53(
|
|
612361
612387
|
`"${venvPython2}" -c "
|
|
612362
612388
|
import torch; from safetensors.torch import save_file
|
|
612363
612389
|
state = torch.load('${weightPath}', map_location='cpu', weights_only=True)
|
|
@@ -612389,13 +612415,13 @@ print('Converted')
|
|
|
612389
612415
|
}
|
|
612390
612416
|
}
|
|
612391
612417
|
try {
|
|
612392
|
-
const weightPath =
|
|
612418
|
+
const weightPath = execSync53(
|
|
612393
612419
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', '${repoInfo.file}'${repoInfo.needsToken ? "" : ", token=False"}))"`,
|
|
612394
612420
|
{ encoding: "utf8", timeout: 3e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612395
612421
|
).trim();
|
|
612396
612422
|
if (existsSync111(dequantScript) && existsSync111(weightPath)) {
|
|
612397
612423
|
try {
|
|
612398
|
-
|
|
612424
|
+
execSync53(
|
|
612399
612425
|
`"${venvPython2}" "${dequantScript}" --input "${weightPath}" --output "${cachedBf16}"`,
|
|
612400
612426
|
{ timeout: 3e5, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612401
612427
|
);
|
|
@@ -612408,7 +612434,7 @@ print('Converted')
|
|
|
612408
612434
|
}
|
|
612409
612435
|
}
|
|
612410
612436
|
try {
|
|
612411
|
-
const mimiPath =
|
|
612437
|
+
const mimiPath = execSync53(
|
|
612412
612438
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', 'tokenizer-e351c8d8-checkpoint125.safetensors', token=False))"`,
|
|
612413
612439
|
{ encoding: "utf8", timeout: 3e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612414
612440
|
).trim();
|
|
@@ -612416,7 +612442,7 @@ print('Converted')
|
|
|
612416
612442
|
} catch {
|
|
612417
612443
|
}
|
|
612418
612444
|
try {
|
|
612419
|
-
const tokPath =
|
|
612445
|
+
const tokPath = execSync53(
|
|
612420
612446
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', 'tokenizer_spm_32k_3.model', token=False))"`,
|
|
612421
612447
|
{ encoding: "utf8", timeout: 3e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612422
612448
|
).trim();
|
|
@@ -612440,7 +612466,7 @@ print('Converted')
|
|
|
612440
612466
|
}
|
|
612441
612467
|
if (!ollamaModel) ollamaModel = "qwen3.5:4b";
|
|
612442
612468
|
try {
|
|
612443
|
-
const ollamaCheck =
|
|
612469
|
+
const ollamaCheck = execSync53("curl -s http://localhost:11434/api/tags", {
|
|
612444
612470
|
timeout: 3e3,
|
|
612445
612471
|
stdio: "pipe",
|
|
612446
612472
|
encoding: "utf8"
|
|
@@ -612514,7 +612540,7 @@ print('Converted')
|
|
|
612514
612540
|
return null;
|
|
612515
612541
|
}
|
|
612516
612542
|
try {
|
|
612517
|
-
|
|
612543
|
+
execSync53(`curl -sk -o /dev/null -w "%{http_code}" https://127.0.0.1:${PORT}/`, {
|
|
612518
612544
|
timeout: 3e3,
|
|
612519
612545
|
stdio: "pipe",
|
|
612520
612546
|
encoding: "utf8"
|
|
@@ -612537,7 +612563,7 @@ function stopPersonaPlex() {
|
|
|
612537
612563
|
if (isNaN(pid) || pid <= 0) return;
|
|
612538
612564
|
try {
|
|
612539
612565
|
if (process.platform === "win32") {
|
|
612540
|
-
|
|
612566
|
+
execSync53(`taskkill /F /PID ${pid}`, { timeout: 5e3, stdio: "ignore" });
|
|
612541
612567
|
} else {
|
|
612542
612568
|
process.kill(pid, "SIGTERM");
|
|
612543
612569
|
}
|
|
@@ -612848,7 +612874,7 @@ __export(setup_exports, {
|
|
|
612848
612874
|
updateOllama: () => updateOllama
|
|
612849
612875
|
});
|
|
612850
612876
|
import * as readline from "node:readline";
|
|
612851
|
-
import { execSync as
|
|
612877
|
+
import { execSync as execSync54, spawn as spawn29, exec as exec5 } from "node:child_process";
|
|
612852
612878
|
import { promisify as promisify6 } from "node:util";
|
|
612853
612879
|
import { existsSync as existsSync112, writeFileSync as writeFileSync58, readFileSync as readFileSync93, appendFileSync as appendFileSync10, mkdirSync as mkdirSync67 } from "node:fs";
|
|
612854
612880
|
import { join as join127 } from "node:path";
|
|
@@ -612971,7 +612997,7 @@ function detectSystemSpecs() {
|
|
|
612971
612997
|
let availableVramGB = 0;
|
|
612972
612998
|
let gpuName = "";
|
|
612973
612999
|
try {
|
|
612974
|
-
const memInfo =
|
|
613000
|
+
const memInfo = execSync54("free -b 2>/dev/null || sysctl -n hw.memsize 2>/dev/null", {
|
|
612975
613001
|
encoding: "utf8",
|
|
612976
613002
|
timeout: 5e3
|
|
612977
613003
|
});
|
|
@@ -612991,7 +613017,7 @@ function detectSystemSpecs() {
|
|
|
612991
613017
|
} catch {
|
|
612992
613018
|
}
|
|
612993
613019
|
try {
|
|
612994
|
-
const nvidiaSmi =
|
|
613020
|
+
const nvidiaSmi = execSync54(
|
|
612995
613021
|
"nvidia-smi --query-gpu=memory.total,memory.free,name --format=csv,noheader,nounits 2>/dev/null",
|
|
612996
613022
|
{ encoding: "utf8", timeout: 5e3 }
|
|
612997
613023
|
);
|
|
@@ -613003,7 +613029,7 @@ function detectSystemSpecs() {
|
|
|
613003
613029
|
}
|
|
613004
613030
|
if (gpuVramGB === 0) {
|
|
613005
613031
|
try {
|
|
613006
|
-
const rocmSmi =
|
|
613032
|
+
const rocmSmi = execSync54(
|
|
613007
613033
|
"rocm-smi --showmeminfo vram --csv 2>/dev/null",
|
|
613008
613034
|
{ encoding: "utf8", timeout: 5e3 }
|
|
613009
613035
|
);
|
|
@@ -613259,7 +613285,7 @@ function ensureCurl() {
|
|
|
613259
613285
|
for (const s2 of strategies) {
|
|
613260
613286
|
if (hasCmd(s2.check)) {
|
|
613261
613287
|
try {
|
|
613262
|
-
|
|
613288
|
+
execSync54(s2.install, { stdio: "inherit", timeout: 12e4 });
|
|
613263
613289
|
if (hasCmd("curl")) {
|
|
613264
613290
|
process.stdout.write(` ${c3.green("✔")} curl installed via ${s2.label}.
|
|
613265
613291
|
`);
|
|
@@ -613273,7 +613299,7 @@ function ensureCurl() {
|
|
|
613273
613299
|
}
|
|
613274
613300
|
if (plat === "darwin") {
|
|
613275
613301
|
try {
|
|
613276
|
-
|
|
613302
|
+
execSync54("xcode-select --install", { stdio: "inherit", timeout: 3e5 });
|
|
613277
613303
|
if (hasCmd("curl")) return true;
|
|
613278
613304
|
} catch {
|
|
613279
613305
|
}
|
|
@@ -613287,7 +613313,7 @@ function ensureZstd() {
|
|
|
613287
613313
|
if (process.platform === "darwin") {
|
|
613288
613314
|
if (!hasCmd("brew")) return false;
|
|
613289
613315
|
try {
|
|
613290
|
-
|
|
613316
|
+
execSync54("brew install zstd", { stdio: "inherit", timeout: 12e4 });
|
|
613291
613317
|
return hasCmd("zstd");
|
|
613292
613318
|
} catch {
|
|
613293
613319
|
return false;
|
|
@@ -613329,7 +613355,7 @@ function ensureZstd() {
|
|
|
613329
613355
|
candidates.push({ cmd: installCmd, env: process.env });
|
|
613330
613356
|
for (const cand of candidates) {
|
|
613331
613357
|
try {
|
|
613332
|
-
|
|
613358
|
+
execSync54(cand.cmd, {
|
|
613333
613359
|
stdio: cand.stdio ?? ["ignore", "inherit", "pipe"],
|
|
613334
613360
|
env: cand.env,
|
|
613335
613361
|
timeout: 18e4
|
|
@@ -613366,7 +613392,7 @@ function detectAskpassHelper() {
|
|
|
613366
613392
|
for (const name10 of ["ssh-askpass", "ksshaskpass", "x11-ssh-askpass"]) {
|
|
613367
613393
|
if (hasCmd(name10)) {
|
|
613368
613394
|
try {
|
|
613369
|
-
const p2 =
|
|
613395
|
+
const p2 = execSync54(`command -v ${name10}`, { encoding: "utf8" }).trim();
|
|
613370
613396
|
if (p2) return p2;
|
|
613371
613397
|
} catch {
|
|
613372
613398
|
}
|
|
@@ -613409,7 +613435,7 @@ osascript -e 'Tell application "System Events" to display dialog "Omnius needs a
|
|
|
613409
613435
|
}
|
|
613410
613436
|
try {
|
|
613411
613437
|
writeFileSync58(helperPath, body, { mode: 448 });
|
|
613412
|
-
|
|
613438
|
+
execSync54(`chmod 700 "${helperPath}"`, { stdio: "ignore" });
|
|
613413
613439
|
return helperPath;
|
|
613414
613440
|
} catch {
|
|
613415
613441
|
return null;
|
|
@@ -613478,7 +613504,7 @@ function runElevatedCommand(command, opts = {}) {
|
|
|
613478
613504
|
let lastErr = null;
|
|
613479
613505
|
for (const cand of candidates) {
|
|
613480
613506
|
try {
|
|
613481
|
-
|
|
613507
|
+
execSync54(cand.cmd, {
|
|
613482
613508
|
stdio: cand.stdio ?? ["ignore", "pipe", "pipe"],
|
|
613483
613509
|
env: cand.env,
|
|
613484
613510
|
timeout: timeout2
|
|
@@ -613515,7 +613541,7 @@ function runOllamaInstallScript() {
|
|
|
613515
613541
|
`);
|
|
613516
613542
|
}
|
|
613517
613543
|
const runOnce = () => {
|
|
613518
|
-
|
|
613544
|
+
execSync54(elevated.cmd, {
|
|
613519
613545
|
stdio: elevated.mode === "terminal" ? "inherit" : ["ignore", "inherit", "pipe"],
|
|
613520
613546
|
env: elevated.env,
|
|
613521
613547
|
timeout: 6e5
|
|
@@ -613594,7 +613620,7 @@ async function installOllamaMac(_rl) {
|
|
|
613594
613620
|
|
|
613595
613621
|
`);
|
|
613596
613622
|
try {
|
|
613597
|
-
|
|
613623
|
+
execSync54(
|
|
613598
613624
|
'/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',
|
|
613599
613625
|
{ stdio: "inherit", timeout: 6e5 }
|
|
613600
613626
|
);
|
|
@@ -613630,7 +613656,7 @@ async function installOllamaMac(_rl) {
|
|
|
613630
613656
|
|
|
613631
613657
|
`);
|
|
613632
613658
|
try {
|
|
613633
|
-
|
|
613659
|
+
execSync54("brew install ollama", {
|
|
613634
613660
|
stdio: "inherit",
|
|
613635
613661
|
timeout: 3e5
|
|
613636
613662
|
});
|
|
@@ -613657,7 +613683,7 @@ function installOllamaWindows() {
|
|
|
613657
613683
|
|
|
613658
613684
|
`);
|
|
613659
613685
|
try {
|
|
613660
|
-
|
|
613686
|
+
execSync54('powershell -Command "irm https://ollama.com/install.ps1 | iex"', {
|
|
613661
613687
|
stdio: "inherit",
|
|
613662
613688
|
timeout: 3e5
|
|
613663
613689
|
});
|
|
@@ -613737,7 +613763,7 @@ async function ensureOllamaRunning(backendUrl2, rl) {
|
|
|
613737
613763
|
}
|
|
613738
613764
|
function getOllamaVersion() {
|
|
613739
613765
|
try {
|
|
613740
|
-
const out =
|
|
613766
|
+
const out = execSync54("ollama --version", { encoding: "utf8", timeout: 5e3 });
|
|
613741
613767
|
const match = out.match(/(\d+\.\d+\.\d+)/);
|
|
613742
613768
|
return match ? match[1] : null;
|
|
613743
613769
|
} catch {
|
|
@@ -613794,7 +613820,7 @@ function updateOllama() {
|
|
|
613794
613820
|
}
|
|
613795
613821
|
function pullModelWithAutoUpdate(tag) {
|
|
613796
613822
|
try {
|
|
613797
|
-
|
|
613823
|
+
execSync54(`ollama pull ${tag}`, {
|
|
613798
613824
|
stdio: "inherit",
|
|
613799
613825
|
timeout: 36e5
|
|
613800
613826
|
// 1 hour max
|
|
@@ -613821,7 +613847,7 @@ function pullModelWithAutoUpdate(tag) {
|
|
|
613821
613847
|
process.stdout.write(` ${c3.cyan("●")} Retrying pull of ${c3.bold(tag)}...
|
|
613822
613848
|
|
|
613823
613849
|
`);
|
|
613824
|
-
|
|
613850
|
+
execSync54(`ollama pull ${tag}`, {
|
|
613825
613851
|
stdio: "inherit",
|
|
613826
613852
|
timeout: 36e5
|
|
613827
613853
|
});
|
|
@@ -613910,7 +613936,7 @@ function ensurePython3() {
|
|
|
613910
613936
|
if (plat === "darwin") {
|
|
613911
613937
|
if (hasCmd("brew")) {
|
|
613912
613938
|
try {
|
|
613913
|
-
|
|
613939
|
+
execSync54("brew install python3", { stdio: "inherit", timeout: 3e5 });
|
|
613914
613940
|
if (hasCmd("python3")) {
|
|
613915
613941
|
process.stdout.write(` ${c3.green("✔")} Python3 installed via Homebrew.
|
|
613916
613942
|
`);
|
|
@@ -613923,7 +613949,7 @@ function ensurePython3() {
|
|
|
613923
613949
|
for (const s2 of strategies) {
|
|
613924
613950
|
if (hasCmd(s2.check)) {
|
|
613925
613951
|
try {
|
|
613926
|
-
|
|
613952
|
+
execSync54(s2.install, { stdio: "inherit", timeout: 12e4 });
|
|
613927
613953
|
if (hasCmd("python3") || hasCmd("python")) {
|
|
613928
613954
|
process.stdout.write(` ${c3.green("✔")} Python3 installed via ${s2.label}.
|
|
613929
613955
|
`);
|
|
@@ -613939,11 +613965,11 @@ function ensurePython3() {
|
|
|
613939
613965
|
}
|
|
613940
613966
|
function checkPythonVenv() {
|
|
613941
613967
|
try {
|
|
613942
|
-
|
|
613968
|
+
execSync54("python3 -m venv --help", { stdio: "pipe", timeout: 5e3 });
|
|
613943
613969
|
return true;
|
|
613944
613970
|
} catch {
|
|
613945
613971
|
try {
|
|
613946
|
-
|
|
613972
|
+
execSync54("python -m venv --help", { stdio: "pipe", timeout: 5e3 });
|
|
613947
613973
|
return true;
|
|
613948
613974
|
} catch {
|
|
613949
613975
|
return false;
|
|
@@ -613962,7 +613988,7 @@ function ensurePythonVenv() {
|
|
|
613962
613988
|
for (const s2 of strategies) {
|
|
613963
613989
|
if (hasCmd(s2.check)) {
|
|
613964
613990
|
try {
|
|
613965
|
-
|
|
613991
|
+
execSync54(s2.install, { stdio: "inherit", timeout: 12e4 });
|
|
613966
613992
|
if (checkPythonVenv()) {
|
|
613967
613993
|
process.stdout.write(` ${c3.green("✔")} python3-venv installed via ${s2.label}.
|
|
613968
613994
|
`);
|
|
@@ -614569,7 +614595,7 @@ ${c3.cyan(OMNIUS_FIRST_RUN_BANNER)}
|
|
|
614569
614595
|
for (let i2 = 0; i2 < modelfileCandidates.length; i2++) {
|
|
614570
614596
|
writeFileSync58(modelfilePath, modelfileCandidates[i2] + "\n", "utf8");
|
|
614571
614597
|
try {
|
|
614572
|
-
|
|
614598
|
+
execSync54(`ollama create ${customName} -f ${modelfilePath}`, {
|
|
614573
614599
|
stdio: "pipe",
|
|
614574
614600
|
timeout: 12e4
|
|
614575
614601
|
});
|
|
@@ -614631,7 +614657,7 @@ function isFirstRun() {
|
|
|
614631
614657
|
function hasCmd(cmd) {
|
|
614632
614658
|
try {
|
|
614633
614659
|
const whichCmd = process.platform === "win32" ? `where ${cmd}` : `which ${cmd}`;
|
|
614634
|
-
|
|
614660
|
+
execSync54(whichCmd, { stdio: "pipe", timeout: 3e3 });
|
|
614635
614661
|
return true;
|
|
614636
614662
|
} catch {
|
|
614637
614663
|
return false;
|
|
@@ -614643,7 +614669,7 @@ function detectPkgManager() {
|
|
|
614643
614669
|
if (hasCmd("choco")) return "choco";
|
|
614644
614670
|
if (hasCmd("winget")) return "winget";
|
|
614645
614671
|
try {
|
|
614646
|
-
|
|
614672
|
+
execSync54(
|
|
614647
614673
|
`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'))"`,
|
|
614648
614674
|
{ stdio: "pipe", timeout: 12e4 }
|
|
614649
614675
|
);
|
|
@@ -614655,7 +614681,7 @@ function detectPkgManager() {
|
|
|
614655
614681
|
if (plat === "darwin") {
|
|
614656
614682
|
if (hasCmd("brew")) return "brew";
|
|
614657
614683
|
try {
|
|
614658
|
-
|
|
614684
|
+
execSync54(
|
|
614659
614685
|
'/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',
|
|
614660
614686
|
{ stdio: "pipe", timeout: 3e5, env: { ...process.env, NONINTERACTIVE: "1" } }
|
|
614661
614687
|
);
|
|
@@ -614675,7 +614701,7 @@ function getVenvDir2() {
|
|
|
614675
614701
|
}
|
|
614676
614702
|
function hasVenvModule() {
|
|
614677
614703
|
try {
|
|
614678
|
-
|
|
614704
|
+
execSync54('python3 -c "import ensurepip, venv"', {
|
|
614679
614705
|
stdio: "pipe",
|
|
614680
614706
|
timeout: 5e3
|
|
614681
614707
|
});
|
|
@@ -614692,17 +614718,17 @@ function ensureVenv2(log22) {
|
|
|
614692
614718
|
const pythonCmd = isWin2 ? "python" : "python3";
|
|
614693
614719
|
if (existsSync112(pipPath)) {
|
|
614694
614720
|
try {
|
|
614695
|
-
|
|
614721
|
+
execSync54(`"${venvPyPath}" -m pip --version`, { stdio: "pipe", timeout: 1e4 });
|
|
614696
614722
|
return venvDir;
|
|
614697
614723
|
} catch {
|
|
614698
614724
|
log22("Python venv pip is broken — repairing...");
|
|
614699
614725
|
try {
|
|
614700
|
-
|
|
614726
|
+
execSync54(`"${venvPyPath}" -m ensurepip --upgrade`, { stdio: "pipe", timeout: 3e4 });
|
|
614701
614727
|
log22("pip repaired via ensurepip.");
|
|
614702
614728
|
return venvDir;
|
|
614703
614729
|
} catch {
|
|
614704
614730
|
try {
|
|
614705
|
-
|
|
614731
|
+
execSync54(`curl -sS https://bootstrap.pypa.io/get-pip.py | "${venvPyPath}"`, { stdio: "pipe", timeout: 6e4 });
|
|
614706
614732
|
log22("pip repaired via get-pip.py.");
|
|
614707
614733
|
return venvDir;
|
|
614708
614734
|
} catch {
|
|
@@ -614723,17 +614749,17 @@ function ensureVenv2(log22) {
|
|
|
614723
614749
|
try {
|
|
614724
614750
|
mkdirSync67(join127(homedir41(), ".omnius"), { recursive: true });
|
|
614725
614751
|
const pyCmd = hasCmd(pythonCmd) ? pythonCmd : "python3";
|
|
614726
|
-
|
|
614752
|
+
execSync54(`${pyCmd} -m venv --clear "${venvDir}"`, { stdio: "pipe", timeout: 3e4 });
|
|
614727
614753
|
try {
|
|
614728
|
-
|
|
614754
|
+
execSync54(`"${venvPyPath}" -m pip --version`, { stdio: "pipe", timeout: 1e4 });
|
|
614729
614755
|
} catch {
|
|
614730
614756
|
try {
|
|
614731
|
-
|
|
614757
|
+
execSync54(`"${venvPyPath}" -m ensurepip --upgrade`, { stdio: "pipe", timeout: 3e4 });
|
|
614732
614758
|
} catch {
|
|
614733
|
-
|
|
614759
|
+
execSync54(`curl -sS https://bootstrap.pypa.io/get-pip.py | "${venvPyPath}"`, { stdio: "pipe", timeout: 6e4 });
|
|
614734
614760
|
}
|
|
614735
614761
|
}
|
|
614736
|
-
|
|
614762
|
+
execSync54(`"${venvPyPath}" -m pip install --upgrade pip`, {
|
|
614737
614763
|
stdio: "pipe",
|
|
614738
614764
|
timeout: 6e4
|
|
614739
614765
|
});
|
|
@@ -614746,7 +614772,7 @@ function ensureVenv2(log22) {
|
|
|
614746
614772
|
}
|
|
614747
614773
|
function trySudoPasswordless(cmd, timeoutMs = 12e4) {
|
|
614748
614774
|
try {
|
|
614749
|
-
|
|
614775
|
+
execSync54(`sudo -n ${cmd}`, {
|
|
614750
614776
|
stdio: "pipe",
|
|
614751
614777
|
timeout: timeoutMs,
|
|
614752
614778
|
env: { ...process.env, DEBIAN_FRONTEND: "noninteractive" }
|
|
@@ -614759,7 +614785,7 @@ function trySudoPasswordless(cmd, timeoutMs = 12e4) {
|
|
|
614759
614785
|
function runWithSudo(cmd, password, timeoutMs = 12e4) {
|
|
614760
614786
|
try {
|
|
614761
614787
|
const escaped = cmd.replace(/'/g, "'\\''");
|
|
614762
|
-
|
|
614788
|
+
execSync54(`sudo -S bash -c '${escaped}'`, {
|
|
614763
614789
|
input: password + "\n",
|
|
614764
614790
|
stdio: ["pipe", "pipe", "pipe"],
|
|
614765
614791
|
timeout: timeoutMs,
|
|
@@ -614801,7 +614827,7 @@ async function sudoInstall(cmd, getSudoPassword, log22, cachedPasswordRef, timeo
|
|
|
614801
614827
|
try {
|
|
614802
614828
|
const isRoot = typeof process.getuid === "function" && process.getuid() === 0;
|
|
614803
614829
|
const escaped = cmd.replace(/'/g, "'\\''");
|
|
614804
|
-
|
|
614830
|
+
execSync54(isRoot ? `bash -c '${escaped}'` : `sudo bash -c '${escaped}'`, {
|
|
614805
614831
|
stdio: "inherit",
|
|
614806
614832
|
timeout: timeoutMs,
|
|
614807
614833
|
env: { ...process.env, DEBIAN_FRONTEND: "noninteractive" }
|
|
@@ -614867,7 +614893,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
614867
614893
|
let winNeedsElevation = false;
|
|
614868
614894
|
if (process.platform === "win32") {
|
|
614869
614895
|
try {
|
|
614870
|
-
|
|
614896
|
+
execSync54("net session", { stdio: "pipe", timeout: 3e3 });
|
|
614871
614897
|
} catch {
|
|
614872
614898
|
winNeedsElevation = true;
|
|
614873
614899
|
log22(`Installing ${labels} via ${pm2} (requires admin — UAC prompt will appear)...`);
|
|
@@ -614914,12 +614940,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
614914
614940
|
if (needsSudo) {
|
|
614915
614941
|
await sudoInstall(installCmd, getPassword, log22, cachedPasswordRef, 18e4);
|
|
614916
614942
|
} else if (winNeedsElevation) {
|
|
614917
|
-
|
|
614943
|
+
execSync54(
|
|
614918
614944
|
`powershell -NoProfile -Command "Start-Process -FilePath 'cmd.exe' -ArgumentList '/c ${installCmd.replace(/'/g, "''")}' -Verb RunAs -Wait"`,
|
|
614919
614945
|
{ stdio: "pipe", timeout: 18e4 }
|
|
614920
614946
|
);
|
|
614921
614947
|
} else {
|
|
614922
|
-
|
|
614948
|
+
execSync54(installCmd, { stdio: "pipe", timeout: 18e4 });
|
|
614923
614949
|
}
|
|
614924
614950
|
} catch (e2) {
|
|
614925
614951
|
const stderr = e2.stderr?.toString?.()?.trim?.() ?? "";
|
|
@@ -614932,7 +614958,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
614932
614958
|
if (!hasCmd(d2.binary) && pipPkg) {
|
|
614933
614959
|
try {
|
|
614934
614960
|
const pipCmd = process.platform === "win32" ? `pip install ${pipPkg}` : `pip3 install ${pipPkg}`;
|
|
614935
|
-
|
|
614961
|
+
execSync54(pipCmd, { stdio: "pipe", timeout: 12e4 });
|
|
614936
614962
|
lastError = "";
|
|
614937
614963
|
} catch (e2) {
|
|
614938
614964
|
const stderr = e2.stderr?.toString?.()?.trim?.() ?? "";
|
|
@@ -614944,7 +614970,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
614944
614970
|
}
|
|
614945
614971
|
if (process.platform === "win32" && !hasCmd(d2.binary)) {
|
|
614946
614972
|
try {
|
|
614947
|
-
const freshPath =
|
|
614973
|
+
const freshPath = execSync54(
|
|
614948
614974
|
`powershell -NoProfile -Command "[System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User')"`,
|
|
614949
614975
|
{ encoding: "utf8", timeout: 5e3, stdio: "pipe" }
|
|
614950
614976
|
).trim();
|
|
@@ -614990,7 +615016,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
614990
615016
|
const venvCmds = {
|
|
614991
615017
|
apt: () => {
|
|
614992
615018
|
try {
|
|
614993
|
-
const pyVer =
|
|
615019
|
+
const pyVer = execSync54(
|
|
614994
615020
|
`python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"`,
|
|
614995
615021
|
{ encoding: "utf8", stdio: "pipe", timeout: 5e3 }
|
|
614996
615022
|
).trim();
|
|
@@ -615022,12 +615048,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615022
615048
|
const venvPip2 = join127(venvBin, "pip");
|
|
615023
615049
|
log22("Installing moondream-station in ~/.omnius/venv...");
|
|
615024
615050
|
try {
|
|
615025
|
-
|
|
615051
|
+
execSync54(`"${venvPip2}" install moondream-station`, { stdio: "pipe", timeout: 3e5 });
|
|
615026
615052
|
if (existsSync112(venvMoondream)) {
|
|
615027
615053
|
log22("moondream-station installed successfully.");
|
|
615028
615054
|
} else {
|
|
615029
615055
|
try {
|
|
615030
|
-
const check =
|
|
615056
|
+
const check = execSync54(`"${venvPip2}" show moondream-station`, { encoding: "utf8", stdio: "pipe", timeout: 5e3 });
|
|
615031
615057
|
if (check.includes("moondream")) {
|
|
615032
615058
|
log22("moondream-station package installed.");
|
|
615033
615059
|
}
|
|
@@ -615044,7 +615070,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615044
615070
|
const venvPip2 = join127(venvBin, isWin2 ? "pip.exe" : "pip");
|
|
615045
615071
|
let ocrStackInstalled = false;
|
|
615046
615072
|
try {
|
|
615047
|
-
|
|
615073
|
+
execSync54(
|
|
615048
615074
|
`"${venvPython2}" -c "import cv2, pytesseract, numpy, PIL"`,
|
|
615049
615075
|
{ stdio: "pipe", timeout: 1e4 }
|
|
615050
615076
|
);
|
|
@@ -615055,12 +615081,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615055
615081
|
const ocrPackages = "pytesseract Pillow opencv-python-headless numpy";
|
|
615056
615082
|
log22("Installing OCR Python stack (pytesseract, OpenCV, Pillow, numpy)...");
|
|
615057
615083
|
try {
|
|
615058
|
-
|
|
615084
|
+
execSync54(
|
|
615059
615085
|
`"${venvPip2}" install ${ocrPackages}`,
|
|
615060
615086
|
{ stdio: "pipe", timeout: 3e5 }
|
|
615061
615087
|
);
|
|
615062
615088
|
try {
|
|
615063
|
-
|
|
615089
|
+
execSync54(
|
|
615064
615090
|
`"${venvPython2}" -c "import cv2, pytesseract, numpy, PIL"`,
|
|
615065
615091
|
{ stdio: "pipe", timeout: 1e4 }
|
|
615066
615092
|
);
|
|
@@ -615096,7 +615122,7 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
615096
615122
|
const archMap = { x64: "amd64", arm64: "arm64", arm: "arm" };
|
|
615097
615123
|
const cfArch = archMap[arch3] ?? "amd64";
|
|
615098
615124
|
try {
|
|
615099
|
-
|
|
615125
|
+
execSync54(
|
|
615100
615126
|
`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"`,
|
|
615101
615127
|
{ stdio: "pipe", timeout: 6e4 }
|
|
615102
615128
|
);
|
|
@@ -615112,7 +615138,7 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
615112
615138
|
try {
|
|
615113
615139
|
const terminalElevation = process.env["OMNIUS_ELEVATION_MODE"] === "terminal" && process.stdin.isTTY && process.stdout.isTTY;
|
|
615114
615140
|
const sudoMove = terminalElevation ? `sudo mv /tmp/cloudflared /usr/local/bin/cloudflared` : `sudo mv /tmp/cloudflared /usr/local/bin/cloudflared 2>/dev/null`;
|
|
615115
|
-
|
|
615141
|
+
execSync54(
|
|
615116
615142
|
`curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && ` + sudoMove,
|
|
615117
615143
|
{ stdio: terminalElevation ? "inherit" : "pipe", timeout: 6e4 }
|
|
615118
615144
|
);
|
|
@@ -615124,7 +615150,7 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
615124
615150
|
}
|
|
615125
615151
|
} else if (os9 === "darwin") {
|
|
615126
615152
|
try {
|
|
615127
|
-
|
|
615153
|
+
execSync54("brew install cloudflared", { stdio: "pipe", timeout: 12e4 });
|
|
615128
615154
|
if (hasCmd("cloudflared")) {
|
|
615129
615155
|
log22("cloudflared installed via Homebrew.");
|
|
615130
615156
|
return true;
|
|
@@ -615321,7 +615347,7 @@ function createExpandedVariantNamed(targetModel, baseModel, specs, sizeGB, kvByt
|
|
|
615321
615347
|
for (let i2 = 0; i2 < modelfileCandidates.length; i2++) {
|
|
615322
615348
|
writeFileSync58(modelfilePath, modelfileCandidates[i2] + "\n", "utf8");
|
|
615323
615349
|
try {
|
|
615324
|
-
|
|
615350
|
+
execSync54(`ollama create ${targetModel} -f ${modelfilePath}`, {
|
|
615325
615351
|
stdio: "pipe",
|
|
615326
615352
|
timeout: 12e4
|
|
615327
615353
|
});
|
|
@@ -615607,7 +615633,7 @@ async function repairAllExpandedVariants(backendUrl2) {
|
|
|
615607
615633
|
}
|
|
615608
615634
|
async function ensureNeovim() {
|
|
615609
615635
|
try {
|
|
615610
|
-
const nvimPath =
|
|
615636
|
+
const nvimPath = execSync54("which nvim 2>/dev/null || where nvim 2>nul", {
|
|
615611
615637
|
encoding: "utf8",
|
|
615612
615638
|
stdio: "pipe",
|
|
615613
615639
|
timeout: 5e3
|
|
@@ -615628,14 +615654,14 @@ async function ensureNeovim() {
|
|
|
615628
615654
|
const url = `https://github.com/neovim/neovim/releases/latest/download/${appImageName}`;
|
|
615629
615655
|
console.log(` Downloading Neovim (${appImageName})...`);
|
|
615630
615656
|
try {
|
|
615631
|
-
|
|
615632
|
-
|
|
615657
|
+
execSync54(`curl -fsSL "${url}" -o "${nvimDest}"`, { stdio: "pipe", timeout: 6e4 });
|
|
615658
|
+
execSync54(`chmod +x "${nvimDest}"`, { stdio: "pipe", timeout: 3e3 });
|
|
615633
615659
|
} catch (err) {
|
|
615634
615660
|
console.log(` Failed to download Neovim: ${err instanceof Error ? err.message : String(err)}`);
|
|
615635
615661
|
return null;
|
|
615636
615662
|
}
|
|
615637
615663
|
try {
|
|
615638
|
-
const ver =
|
|
615664
|
+
const ver = execSync54(`"${nvimDest}" --version`, { encoding: "utf8", stdio: "pipe", timeout: 5e3 }).split("\n")[0];
|
|
615639
615665
|
console.log(` Installed: ${ver}`);
|
|
615640
615666
|
} catch {
|
|
615641
615667
|
console.log(" Warning: nvim binary downloaded but may not work (missing FUSE? Try: nvim --appimage-extract)");
|
|
@@ -615650,8 +615676,8 @@ async function ensureNeovim() {
|
|
|
615650
615676
|
if (hasCmd("brew")) {
|
|
615651
615677
|
console.log(" Installing Neovim via Homebrew...");
|
|
615652
615678
|
try {
|
|
615653
|
-
|
|
615654
|
-
const nvimPath =
|
|
615679
|
+
execSync54("brew install neovim", { stdio: "inherit", timeout: 12e4 });
|
|
615680
|
+
const nvimPath = execSync54("which nvim", { encoding: "utf8", stdio: "pipe", timeout: 3e3 }).trim();
|
|
615655
615681
|
return nvimPath || null;
|
|
615656
615682
|
} catch {
|
|
615657
615683
|
console.log(" brew install neovim failed.");
|
|
@@ -615665,7 +615691,7 @@ async function ensureNeovim() {
|
|
|
615665
615691
|
if (hasCmd("choco")) {
|
|
615666
615692
|
console.log(" Installing Neovim via Chocolatey...");
|
|
615667
615693
|
try {
|
|
615668
|
-
|
|
615694
|
+
execSync54("choco install neovim -y", { stdio: "inherit", timeout: 12e4 });
|
|
615669
615695
|
return "nvim";
|
|
615670
615696
|
} catch {
|
|
615671
615697
|
console.log(" choco install neovim failed.");
|
|
@@ -615674,7 +615700,7 @@ async function ensureNeovim() {
|
|
|
615674
615700
|
if (hasCmd("winget")) {
|
|
615675
615701
|
console.log(" Installing Neovim via winget...");
|
|
615676
615702
|
try {
|
|
615677
|
-
|
|
615703
|
+
execSync54("winget install Neovim.Neovim --accept-source-agreements --accept-package-agreements", {
|
|
615678
615704
|
stdio: "inherit",
|
|
615679
615705
|
timeout: 12e4
|
|
615680
615706
|
});
|
|
@@ -619743,7 +619769,7 @@ var init_audio_waveform = __esm({
|
|
|
619743
619769
|
import { existsSync as existsSync118, unlinkSync as unlinkSync23 } from "node:fs";
|
|
619744
619770
|
import { tmpdir as tmpdir20 } from "node:os";
|
|
619745
619771
|
import { join as join131 } from "node:path";
|
|
619746
|
-
import { execSync as
|
|
619772
|
+
import { execSync as execSync55 } from "node:child_process";
|
|
619747
619773
|
function isNeovimActive() {
|
|
619748
619774
|
return _state2 !== null && !_state2.cleanedUp;
|
|
619749
619775
|
}
|
|
@@ -619760,7 +619786,7 @@ async function startNeovimMode(opts) {
|
|
|
619760
619786
|
}
|
|
619761
619787
|
let nvimPath;
|
|
619762
619788
|
try {
|
|
619763
|
-
nvimPath =
|
|
619789
|
+
nvimPath = execSync55("which nvim 2>/dev/null", { encoding: "utf8" }).trim();
|
|
619764
619790
|
if (!nvimPath) throw new Error();
|
|
619765
619791
|
} catch {
|
|
619766
619792
|
const installed = await ensureNeovim();
|
|
@@ -620442,8 +620468,8 @@ async function forceKillDaemon(port) {
|
|
|
620442
620468
|
}
|
|
620443
620469
|
}
|
|
620444
620470
|
try {
|
|
620445
|
-
const { execSync:
|
|
620446
|
-
const out =
|
|
620471
|
+
const { execSync: execSync64 } = await import("node:child_process");
|
|
620472
|
+
const out = execSync64(
|
|
620447
620473
|
`lsof -ti :${p2} 2>/dev/null || fuser ${p2}/tcp 2>/dev/null || true`,
|
|
620448
620474
|
{ encoding: "utf8", timeout: 3e3 }
|
|
620449
620475
|
).trim();
|
|
@@ -623320,7 +623346,7 @@ import {
|
|
|
623320
623346
|
import { join as join137, dirname as dirname42, resolve as resolve57 } from "node:path";
|
|
623321
623347
|
import { homedir as homedir46, tmpdir as tmpdir21, platform as platform6 } from "node:os";
|
|
623322
623348
|
import {
|
|
623323
|
-
execSync as
|
|
623349
|
+
execSync as execSync56,
|
|
623324
623350
|
spawn as nodeSpawn
|
|
623325
623351
|
} from "node:child_process";
|
|
623326
623352
|
import { createRequire as createRequire6 } from "node:module";
|
|
@@ -625667,7 +625693,7 @@ except Exception as exc:
|
|
|
625667
625693
|
}
|
|
625668
625694
|
for (const player of ["paplay", "pw-play", "aplay"]) {
|
|
625669
625695
|
try {
|
|
625670
|
-
|
|
625696
|
+
execSync56(`which ${player}`, { stdio: "pipe" });
|
|
625671
625697
|
return [player, path12];
|
|
625672
625698
|
} catch {
|
|
625673
625699
|
}
|
|
@@ -625845,7 +625871,7 @@ except Exception as exc:
|
|
|
625845
625871
|
return false;
|
|
625846
625872
|
}
|
|
625847
625873
|
try {
|
|
625848
|
-
|
|
625874
|
+
execSync56(`${JSON.stringify(venvPy)} -c "import supertonic"`, {
|
|
625849
625875
|
stdio: "pipe",
|
|
625850
625876
|
timeout: 1e4
|
|
625851
625877
|
});
|
|
@@ -625977,7 +626003,7 @@ except Exception as exc:
|
|
|
625977
626003
|
if (this.python3Path) return this.python3Path;
|
|
625978
626004
|
for (const bin of ["python3", "python"]) {
|
|
625979
626005
|
try {
|
|
625980
|
-
const path12 =
|
|
626006
|
+
const path12 = execSync56(`which ${bin}`, { stdio: "pipe", timeout: 5e3 }).toString().trim();
|
|
625981
626007
|
if (path12) {
|
|
625982
626008
|
this.python3Path = path12;
|
|
625983
626009
|
return path12;
|
|
@@ -626041,7 +626067,7 @@ except Exception as exc:
|
|
|
626041
626067
|
return false;
|
|
626042
626068
|
}
|
|
626043
626069
|
try {
|
|
626044
|
-
|
|
626070
|
+
execSync56(`${py} -c "import mlx_audio"`, {
|
|
626045
626071
|
stdio: "pipe",
|
|
626046
626072
|
timeout: 1e4
|
|
626047
626073
|
});
|
|
@@ -626110,14 +626136,14 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
626110
626136
|
`tts_gen.main(["--model", ${JSON.stringify(mlxModelId)}, "--text", text, "--voice", ${JSON.stringify(mlxVoice)}, "--lang_code", ${JSON.stringify(mlxLangCode)}, "--audio_path", ${JSON.stringify(wavPath)}])`
|
|
626111
626137
|
].join("; ");
|
|
626112
626138
|
try {
|
|
626113
|
-
|
|
626139
|
+
execSync56(
|
|
626114
626140
|
`${py} -c ${JSON.stringify(pyScript)} ${JSON.stringify(JSON.stringify(cleaned))}`,
|
|
626115
626141
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
626116
626142
|
);
|
|
626117
626143
|
} catch (err) {
|
|
626118
626144
|
try {
|
|
626119
626145
|
const safeText = cleaned.replace(/'/g, "'\\''");
|
|
626120
|
-
|
|
626146
|
+
execSync56(
|
|
626121
626147
|
`${py} -m mlx_audio.tts.generate --model ${mlxModelId} --text '${safeText}' --voice ${mlxVoice} --lang_code ${mlxLangCode} --audio_path ${JSON.stringify(wavPath)}`,
|
|
626122
626148
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
626123
626149
|
);
|
|
@@ -626191,14 +626217,14 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
626191
626217
|
`tts_gen.main(["--model", ${JSON.stringify(mlxModelId)}, "--text", text, "--voice", ${JSON.stringify(mlxVoice)}, "--lang_code", ${JSON.stringify(mlxLangCode)}, "--audio_path", ${JSON.stringify(wavPath)}])`
|
|
626192
626218
|
].join("; ");
|
|
626193
626219
|
try {
|
|
626194
|
-
|
|
626220
|
+
execSync56(
|
|
626195
626221
|
`${py} -c ${JSON.stringify(pyScript)} ${JSON.stringify(JSON.stringify(cleaned))}`,
|
|
626196
626222
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
626197
626223
|
);
|
|
626198
626224
|
} catch {
|
|
626199
626225
|
try {
|
|
626200
626226
|
const safeText = cleaned.replace(/'/g, "'\\''");
|
|
626201
|
-
|
|
626227
|
+
execSync56(
|
|
626202
626228
|
`${py} -m mlx_audio.tts.generate --model ${mlxModelId} --text '${safeText}' --voice ${mlxVoice} --lang_code ${mlxLangCode} --audio_path ${JSON.stringify(wavPath)}`,
|
|
626203
626229
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
626204
626230
|
);
|
|
@@ -626494,11 +626520,11 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
626494
626520
|
...isJetson ? (() => {
|
|
626495
626521
|
let jpVer = "v60";
|
|
626496
626522
|
try {
|
|
626497
|
-
const tegra = existsSync125("/etc/nv_tegra_release") ?
|
|
626523
|
+
const tegra = existsSync125("/etc/nv_tegra_release") ? execSync56("cat /etc/nv_tegra_release 2>/dev/null", {
|
|
626498
626524
|
encoding: "utf8",
|
|
626499
626525
|
timeout: 3e3
|
|
626500
626526
|
}).trim() : "";
|
|
626501
|
-
const dpkg =
|
|
626527
|
+
const dpkg = execSync56(
|
|
626502
626528
|
"dpkg -l nvidia-jetpack 2>/dev/null | grep nvidia-jetpack | awk '{print $3}'",
|
|
626503
626529
|
{ encoding: "utf8", timeout: 5e3 }
|
|
626504
626530
|
).trim();
|
|
@@ -632034,10 +632060,10 @@ The session corrections MUST become hard rules in the SKILL.md Rules section.`;
|
|
|
632034
632060
|
"Requesting sudo to migrate daemon to current user and restart..."
|
|
632035
632061
|
);
|
|
632036
632062
|
const nodeBin = process.execPath;
|
|
632037
|
-
const { execSync:
|
|
632063
|
+
const { execSync: execSync64 } = await import("node:child_process");
|
|
632038
632064
|
let npmRoot = "";
|
|
632039
632065
|
try {
|
|
632040
|
-
npmRoot =
|
|
632066
|
+
npmRoot = execSync64("npm root -g", { encoding: "utf8" }).trim();
|
|
632041
632067
|
} catch {
|
|
632042
632068
|
}
|
|
632043
632069
|
const launcher = npmRoot ? `${npmRoot}/omnius/dist/launcher.cjs` : "";
|
|
@@ -640620,7 +640646,7 @@ async function handleBroker(arg, _ctx) {
|
|
|
640620
640646
|
);
|
|
640621
640647
|
}
|
|
640622
640648
|
async function handleParallel(arg, ctx3) {
|
|
640623
|
-
const { execSync:
|
|
640649
|
+
const { execSync: execSync64 } = await import("node:child_process");
|
|
640624
640650
|
const baseUrl = ctx3.config.backendUrl || "http://localhost:11434";
|
|
640625
640651
|
const isRemote = ctx3.config.backendType === "nexus";
|
|
640626
640652
|
if (isRemote) {
|
|
@@ -640652,7 +640678,7 @@ async function handleParallel(arg, ctx3) {
|
|
|
640652
640678
|
}
|
|
640653
640679
|
let systemdVal = "";
|
|
640654
640680
|
try {
|
|
640655
|
-
const out =
|
|
640681
|
+
const out = execSync64(
|
|
640656
640682
|
"systemctl show ollama.service -p Environment 2>/dev/null || true",
|
|
640657
640683
|
{ encoding: "utf8" }
|
|
640658
640684
|
);
|
|
@@ -640687,7 +640713,7 @@ async function handleParallel(arg, ctx3) {
|
|
|
640687
640713
|
}
|
|
640688
640714
|
const isSystemd = (() => {
|
|
640689
640715
|
try {
|
|
640690
|
-
const out =
|
|
640716
|
+
const out = execSync64("systemctl is-active ollama.service 2>/dev/null", {
|
|
640691
640717
|
encoding: "utf8"
|
|
640692
640718
|
}).trim();
|
|
640693
640719
|
return out === "active" || out === "inactive";
|
|
@@ -642988,13 +643014,13 @@ async function showExposeDashboard(gateway, rl, ctx3) {
|
|
|
642988
643014
|
const cmd = `/endpoint ${id} --auth ${gateway.authKey ?? ""}`;
|
|
642989
643015
|
let copied = false;
|
|
642990
643016
|
try {
|
|
642991
|
-
const { execSync:
|
|
643017
|
+
const { execSync: execSync64 } = __require("node:child_process");
|
|
642992
643018
|
const platform7 = process.platform;
|
|
642993
643019
|
if (platform7 === "darwin") {
|
|
642994
|
-
|
|
643020
|
+
execSync64("pbcopy", { input: cmd, timeout: 3e3 });
|
|
642995
643021
|
copied = true;
|
|
642996
643022
|
} else if (platform7 === "win32") {
|
|
642997
|
-
|
|
643023
|
+
execSync64("clip", { input: cmd, timeout: 3e3 });
|
|
642998
643024
|
copied = true;
|
|
642999
643025
|
} else {
|
|
643000
643026
|
for (const tool of [
|
|
@@ -643003,7 +643029,7 @@ async function showExposeDashboard(gateway, rl, ctx3) {
|
|
|
643003
643029
|
"wl-copy"
|
|
643004
643030
|
]) {
|
|
643005
643031
|
try {
|
|
643006
|
-
|
|
643032
|
+
execSync64(tool, {
|
|
643007
643033
|
input: cmd,
|
|
643008
643034
|
timeout: 3e3,
|
|
643009
643035
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -643393,7 +643419,7 @@ var init_commands = __esm({
|
|
|
643393
643419
|
// packages/cli/src/tui/project-context.ts
|
|
643394
643420
|
import { existsSync as existsSync127, readFileSync as readFileSync104, readdirSync as readdirSync43, mkdirSync as mkdirSync74, writeFileSync as writeFileSync65 } from "node:fs";
|
|
643395
643421
|
import { join as join139, basename as basename26 } from "node:path";
|
|
643396
|
-
import { execSync as
|
|
643422
|
+
import { execSync as execSync57 } from "node:child_process";
|
|
643397
643423
|
import { homedir as homedir48 } from "node:os";
|
|
643398
643424
|
function projectContextUrlSpanAt(text2, index) {
|
|
643399
643425
|
PROJECT_CONTEXT_URL_RE.lastIndex = 0;
|
|
@@ -643452,18 +643478,18 @@ function loadProjectMap(repoRoot) {
|
|
|
643452
643478
|
}
|
|
643453
643479
|
function getGitInfo(repoRoot) {
|
|
643454
643480
|
try {
|
|
643455
|
-
|
|
643481
|
+
execSync57("git rev-parse --is-inside-work-tree", { cwd: repoRoot, stdio: "pipe" });
|
|
643456
643482
|
} catch {
|
|
643457
643483
|
return "";
|
|
643458
643484
|
}
|
|
643459
643485
|
const lines = [];
|
|
643460
643486
|
try {
|
|
643461
|
-
const branch =
|
|
643487
|
+
const branch = execSync57("git branch --show-current", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
643462
643488
|
if (branch) lines.push(`Branch: ${branch}`);
|
|
643463
643489
|
} catch {
|
|
643464
643490
|
}
|
|
643465
643491
|
try {
|
|
643466
|
-
const status =
|
|
643492
|
+
const status = execSync57("git status --porcelain", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
643467
643493
|
if (status) {
|
|
643468
643494
|
const changed = status.split("\n").length;
|
|
643469
643495
|
lines.push(`Working tree: ${changed} changed file(s)`);
|
|
@@ -643473,7 +643499,7 @@ function getGitInfo(repoRoot) {
|
|
|
643473
643499
|
} catch {
|
|
643474
643500
|
}
|
|
643475
643501
|
try {
|
|
643476
|
-
const log22 =
|
|
643502
|
+
const log22 = execSync57("git log --oneline -5 --no-decorate", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
643477
643503
|
if (log22) lines.push(`Recent commits:
|
|
643478
643504
|
${log22}`);
|
|
643479
643505
|
} catch {
|
|
@@ -647793,7 +647819,7 @@ var init_promptLoader3 = __esm({
|
|
|
647793
647819
|
// packages/cli/src/tui/dream-engine.ts
|
|
647794
647820
|
import { mkdirSync as mkdirSync80, writeFileSync as writeFileSync69, readFileSync as readFileSync110, existsSync as existsSync134, readdirSync as readdirSync47 } from "node:fs";
|
|
647795
647821
|
import { join as join147, basename as basename32 } from "node:path";
|
|
647796
|
-
import { execSync as
|
|
647822
|
+
import { execSync as execSync58 } from "node:child_process";
|
|
647797
647823
|
function setDreamWriteContent(fn) {
|
|
647798
647824
|
_dreamWriteContent = fn;
|
|
647799
647825
|
}
|
|
@@ -648166,7 +648192,7 @@ var init_dream_engine = __esm({
|
|
|
648166
648192
|
}
|
|
648167
648193
|
}
|
|
648168
648194
|
try {
|
|
648169
|
-
const output =
|
|
648195
|
+
const output = execSync58(cmd, {
|
|
648170
648196
|
cwd: this.repoRoot,
|
|
648171
648197
|
timeout: 3e4,
|
|
648172
648198
|
encoding: "utf-8",
|
|
@@ -649143,17 +649169,17 @@ ${summary}` };
|
|
|
649143
649169
|
try {
|
|
649144
649170
|
mkdirSync80(checkpointDir3, { recursive: true });
|
|
649145
649171
|
try {
|
|
649146
|
-
const gitStatus =
|
|
649172
|
+
const gitStatus = execSync58("git status --porcelain", {
|
|
649147
649173
|
cwd: this.repoRoot,
|
|
649148
649174
|
encoding: "utf-8",
|
|
649149
649175
|
timeout: 1e4
|
|
649150
649176
|
});
|
|
649151
|
-
const gitDiff =
|
|
649177
|
+
const gitDiff = execSync58("git diff", {
|
|
649152
649178
|
cwd: this.repoRoot,
|
|
649153
649179
|
encoding: "utf-8",
|
|
649154
649180
|
timeout: 1e4
|
|
649155
649181
|
});
|
|
649156
|
-
const gitHash =
|
|
649182
|
+
const gitHash = execSync58("git rev-parse HEAD 2>/dev/null || echo 'no-git'", {
|
|
649157
649183
|
cwd: this.repoRoot,
|
|
649158
649184
|
encoding: "utf-8",
|
|
649159
649185
|
timeout: 5e3
|
|
@@ -677526,7 +677552,7 @@ __export(aiwg_exports, {
|
|
|
677526
677552
|
import { existsSync as existsSync145, readFileSync as readFileSync120, readdirSync as readdirSync52, statSync as statSync52 } from "node:fs";
|
|
677527
677553
|
import { join as join157 } from "node:path";
|
|
677528
677554
|
import { homedir as homedir53 } from "node:os";
|
|
677529
|
-
import { execSync as
|
|
677555
|
+
import { execSync as execSync59 } from "node:child_process";
|
|
677530
677556
|
function resolveAiwgRoot() {
|
|
677531
677557
|
if (_cachedAiwgRoot !== void 0) return _cachedAiwgRoot;
|
|
677532
677558
|
const envRoot = process.env["OMNIUS_AIWG_ROOT"];
|
|
@@ -677540,7 +677566,7 @@ function resolveAiwgRoot() {
|
|
|
677540
677566
|
return shareDir;
|
|
677541
677567
|
}
|
|
677542
677568
|
try {
|
|
677543
|
-
const globalRoot =
|
|
677569
|
+
const globalRoot = execSync59("npm root -g", {
|
|
677544
677570
|
encoding: "utf-8",
|
|
677545
677571
|
timeout: 5e3,
|
|
677546
677572
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -677582,7 +677608,7 @@ function resolveAiwgRoot() {
|
|
|
677582
677608
|
}
|
|
677583
677609
|
}
|
|
677584
677610
|
try {
|
|
677585
|
-
const whichAiwg =
|
|
677611
|
+
const whichAiwg = execSync59("which aiwg 2>/dev/null || where aiwg 2>nul", {
|
|
677586
677612
|
encoding: "utf-8",
|
|
677587
677613
|
timeout: 3e3,
|
|
677588
677614
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -680470,9 +680496,9 @@ function resolveLocalPeerId() {
|
|
|
680470
680496
|
}
|
|
680471
680497
|
let scanResult = null;
|
|
680472
680498
|
try {
|
|
680473
|
-
const { execSync:
|
|
680499
|
+
const { execSync: execSync64 } = __require("node:child_process");
|
|
680474
680500
|
const cmd = `find "${homedir56()}" -maxdepth 4 -path '*/.omnius/nexus/status.json' -type f 2>/dev/null | head -50`;
|
|
680475
|
-
const out =
|
|
680501
|
+
const out = execSync64(cmd, { encoding: "utf-8", timeout: 2e3 }).trim();
|
|
680476
680502
|
for (const line of out.split("\n")) {
|
|
680477
680503
|
const f2 = line.trim();
|
|
680478
680504
|
if (!f2) continue;
|
|
@@ -680502,8 +680528,8 @@ function locateTorScript(filename) {
|
|
|
680502
680528
|
if (existsSync149(p2)) return p2;
|
|
680503
680529
|
}
|
|
680504
680530
|
try {
|
|
680505
|
-
const { execSync:
|
|
680506
|
-
const root =
|
|
680531
|
+
const { execSync: execSync64 } = __require("node:child_process");
|
|
680532
|
+
const root = execSync64("npm root -g", { encoding: "utf-8", timeout: 5e3 }).trim();
|
|
680507
680533
|
const p2 = join161(root, "omnius", "dist", "scripts", "tor", filename);
|
|
680508
680534
|
if (existsSync149(p2)) return p2;
|
|
680509
680535
|
} catch {
|
|
@@ -691725,7 +691751,7 @@ var init_usage_tracker = __esm({
|
|
|
691725
691751
|
});
|
|
691726
691752
|
|
|
691727
691753
|
// packages/cli/src/docker.ts
|
|
691728
|
-
import { execSync as
|
|
691754
|
+
import { execSync as execSync60, spawn as spawn32 } from "node:child_process";
|
|
691729
691755
|
import { existsSync as existsSync151, mkdirSync as mkdirSync94, writeFileSync as writeFileSync81 } from "node:fs";
|
|
691730
691756
|
import { join as join163, resolve as resolve64, dirname as dirname48 } from "node:path";
|
|
691731
691757
|
import { homedir as homedir57 } from "node:os";
|
|
@@ -691746,7 +691772,7 @@ function getDockerDir() {
|
|
|
691746
691772
|
}
|
|
691747
691773
|
function isDockerAvailable() {
|
|
691748
691774
|
try {
|
|
691749
|
-
|
|
691775
|
+
execSync60("docker info", { stdio: "pipe", timeout: 1e4 });
|
|
691750
691776
|
return true;
|
|
691751
691777
|
} catch {
|
|
691752
691778
|
return false;
|
|
@@ -691754,7 +691780,7 @@ function isDockerAvailable() {
|
|
|
691754
691780
|
}
|
|
691755
691781
|
function isDockerInstalled() {
|
|
691756
691782
|
try {
|
|
691757
|
-
|
|
691783
|
+
execSync60("docker --version", { stdio: "pipe", timeout: 5e3 });
|
|
691758
691784
|
return true;
|
|
691759
691785
|
} catch {
|
|
691760
691786
|
return false;
|
|
@@ -691779,31 +691805,31 @@ async function ensureDocker() {
|
|
|
691779
691805
|
}
|
|
691780
691806
|
try {
|
|
691781
691807
|
console.log("[omnius-docker] Docker not found. Installing via get.docker.com...");
|
|
691782
|
-
|
|
691808
|
+
execSync60("curl -fsSL https://get.docker.com | sh", {
|
|
691783
691809
|
stdio: "inherit",
|
|
691784
691810
|
timeout: 3e5
|
|
691785
691811
|
});
|
|
691786
691812
|
const user = process.env["USER"] || process.env["LOGNAME"];
|
|
691787
691813
|
if (user) {
|
|
691788
691814
|
try {
|
|
691789
|
-
|
|
691815
|
+
execSync60(`sudo usermod -aG docker ${user}`, { stdio: "pipe" });
|
|
691790
691816
|
} catch {
|
|
691791
691817
|
}
|
|
691792
691818
|
}
|
|
691793
691819
|
try {
|
|
691794
|
-
|
|
691820
|
+
execSync60("sudo systemctl start docker", { stdio: "pipe", timeout: 15e3 });
|
|
691795
691821
|
} catch {
|
|
691796
691822
|
}
|
|
691797
691823
|
try {
|
|
691798
|
-
|
|
691799
|
-
const runtimes =
|
|
691824
|
+
execSync60("nvidia-smi", { stdio: "pipe", timeout: 5e3 });
|
|
691825
|
+
const runtimes = execSync60("docker info --format '{{json .Runtimes}}'", {
|
|
691800
691826
|
stdio: "pipe",
|
|
691801
691827
|
timeout: 5e3
|
|
691802
691828
|
}).toString();
|
|
691803
691829
|
if (!runtimes.includes("nvidia")) {
|
|
691804
691830
|
console.log("[omnius-docker] NVIDIA GPU detected. Installing nvidia-container-toolkit...");
|
|
691805
691831
|
try {
|
|
691806
|
-
|
|
691832
|
+
execSync60(`
|
|
691807
691833
|
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg 2>/dev/null
|
|
691808
691834
|
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
|
|
691809
691835
|
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 )
|
|
@@ -691833,7 +691859,7 @@ async function ensureDocker() {
|
|
|
691833
691859
|
}
|
|
691834
691860
|
async function ensureNvidiaToolkit() {
|
|
691835
691861
|
try {
|
|
691836
|
-
|
|
691862
|
+
execSync60("nvidia-smi --query-gpu=name --format=csv,noheader", { stdio: "pipe", timeout: 5e3 });
|
|
691837
691863
|
} catch {
|
|
691838
691864
|
return { ok: false, message: "No NVIDIA GPU detected (nvidia-smi not found)" };
|
|
691839
691865
|
}
|
|
@@ -691844,7 +691870,7 @@ async function ensureNvidiaToolkit() {
|
|
|
691844
691870
|
return { ok: false, message: "Auto-install only supported on Linux. Install manually: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html" };
|
|
691845
691871
|
}
|
|
691846
691872
|
try {
|
|
691847
|
-
|
|
691873
|
+
execSync60(`
|
|
691848
691874
|
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg 2>/dev/null
|
|
691849
691875
|
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
|
|
691850
691876
|
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 )
|
|
@@ -691858,7 +691884,7 @@ async function ensureNvidiaToolkit() {
|
|
|
691858
691884
|
}
|
|
691859
691885
|
function isOmniusImageBuilt() {
|
|
691860
691886
|
try {
|
|
691861
|
-
const out =
|
|
691887
|
+
const out = execSync60(`docker images -q ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG}`, {
|
|
691862
691888
|
stdio: "pipe",
|
|
691863
691889
|
timeout: 5e3
|
|
691864
691890
|
}).toString().trim();
|
|
@@ -691882,7 +691908,7 @@ async function ensureOmniusImage(force = false) {
|
|
|
691882
691908
|
}
|
|
691883
691909
|
try {
|
|
691884
691910
|
console.log(`[omnius-docker] Building image ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG}...`);
|
|
691885
|
-
|
|
691911
|
+
execSync60(`docker build -t ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG} ${buildContext}`, {
|
|
691886
691912
|
stdio: "inherit",
|
|
691887
691913
|
timeout: 6e5
|
|
691888
691914
|
// 10 min
|
|
@@ -691956,11 +691982,11 @@ exec "$@"
|
|
|
691956
691982
|
}
|
|
691957
691983
|
function hasNvidiaGpu() {
|
|
691958
691984
|
try {
|
|
691959
|
-
|
|
691985
|
+
execSync60("nvidia-smi --query-gpu=name --format=csv,noheader", {
|
|
691960
691986
|
stdio: "pipe",
|
|
691961
691987
|
timeout: 5e3
|
|
691962
691988
|
});
|
|
691963
|
-
const runtimes =
|
|
691989
|
+
const runtimes = execSync60("docker info --format '{{json .Runtimes}}'", {
|
|
691964
691990
|
stdio: "pipe",
|
|
691965
691991
|
timeout: 5e3
|
|
691966
691992
|
}).toString();
|
|
@@ -692209,7 +692235,7 @@ import { createRequire as createRequire7 } from "node:module";
|
|
|
692209
692235
|
import { fileURLToPath as fileURLToPath19 } from "node:url";
|
|
692210
692236
|
import { dirname as dirname49, join as join165, resolve as resolve65 } from "node:path";
|
|
692211
692237
|
import { homedir as homedir58 } from "node:os";
|
|
692212
|
-
import { spawn as spawn33, execSync as
|
|
692238
|
+
import { spawn as spawn33, execSync as execSync61 } from "node:child_process";
|
|
692213
692239
|
import {
|
|
692214
692240
|
mkdirSync as mkdirSync95,
|
|
692215
692241
|
writeFileSync as writeFileSync82,
|
|
@@ -696530,7 +696556,7 @@ function handleV1RunsDelete(res, id) {
|
|
|
696530
696556
|
const containerName = `omnius-${id}`;
|
|
696531
696557
|
if (job.sandbox === "container") {
|
|
696532
696558
|
try {
|
|
696533
|
-
|
|
696559
|
+
execSync61(`docker stop ${containerName}`, {
|
|
696534
696560
|
timeout: 5e3,
|
|
696535
696561
|
stdio: "ignore"
|
|
696536
696562
|
});
|
|
@@ -698859,8 +698885,8 @@ data: ${JSON.stringify(data)}
|
|
|
698859
698885
|
}
|
|
698860
698886
|
setImmediate(() => {
|
|
698861
698887
|
try {
|
|
698862
|
-
const { execSync:
|
|
698863
|
-
|
|
698888
|
+
const { execSync: execSync64 } = require4("node:child_process");
|
|
698889
|
+
execSync64("npm update -g omnius 2>/dev/null || true", {
|
|
698864
698890
|
stdio: "pipe"
|
|
698865
698891
|
});
|
|
698866
698892
|
} catch {
|
|
@@ -698903,7 +698929,7 @@ data: ${JSON.stringify(data)}
|
|
|
698903
698929
|
return;
|
|
698904
698930
|
}
|
|
698905
698931
|
try {
|
|
698906
|
-
const { execSync:
|
|
698932
|
+
const { execSync: execSync64 } = require4("node:child_process");
|
|
698907
698933
|
let audioPath = null;
|
|
698908
698934
|
const ttsCmds = [
|
|
698909
698935
|
`espeak "${text2}" -w /tmp/tts_${Date.now()}.wav 2>/dev/null`,
|
|
@@ -698912,7 +698938,7 @@ data: ${JSON.stringify(data)}
|
|
|
698912
698938
|
];
|
|
698913
698939
|
for (const cmd of ttsCmds) {
|
|
698914
698940
|
try {
|
|
698915
|
-
|
|
698941
|
+
execSync64(cmd, { stdio: "pipe" });
|
|
698916
698942
|
audioPath = "/tmp/tts_" + Date.now() + ".wav";
|
|
698917
698943
|
break;
|
|
698918
698944
|
} catch {
|
|
@@ -702336,7 +702362,7 @@ var clipboard_media_exports = {};
|
|
|
702336
702362
|
__export(clipboard_media_exports, {
|
|
702337
702363
|
pasteClipboardImageToFile: () => pasteClipboardImageToFile
|
|
702338
702364
|
});
|
|
702339
|
-
import { execFileSync as execFileSync10, execSync as
|
|
702365
|
+
import { execFileSync as execFileSync10, execSync as execSync62 } from "node:child_process";
|
|
702340
702366
|
import { mkdirSync as mkdirSync96, readFileSync as readFileSync126, rmSync as rmSync12, writeFileSync as writeFileSync83 } from "node:fs";
|
|
702341
702367
|
import { join as join166 } from "node:path";
|
|
702342
702368
|
function pasteClipboardImageToFile(repoRoot) {
|
|
@@ -702351,7 +702377,7 @@ function pasteClipboardImageToFile(repoRoot) {
|
|
|
702351
702377
|
function readClipboardImage() {
|
|
702352
702378
|
if (process.platform === "darwin") {
|
|
702353
702379
|
try {
|
|
702354
|
-
|
|
702380
|
+
execSync62("command -v pngpaste", { stdio: "ignore", timeout: 1e3 });
|
|
702355
702381
|
const tmp = `/tmp/omnius-clipboard-${Date.now()}.png`;
|
|
702356
702382
|
execFileSync10("pngpaste", [tmp], { timeout: 3e3 });
|
|
702357
702383
|
const buffer2 = readFileSync126(tmp);
|
|
@@ -702422,7 +702448,7 @@ import {
|
|
|
702422
702448
|
mkdirSync as mkdirSync97
|
|
702423
702449
|
} from "node:fs";
|
|
702424
702450
|
import { existsSync as existsSync153 } from "node:fs";
|
|
702425
|
-
import { execSync as
|
|
702451
|
+
import { execSync as execSync63 } from "node:child_process";
|
|
702426
702452
|
import { homedir as homedir59 } from "node:os";
|
|
702427
702453
|
function formatTimeAgo2(date) {
|
|
702428
702454
|
const seconds = Math.floor((Date.now() - date.getTime()) / 1e3);
|
|
@@ -702589,9 +702615,9 @@ ${incompleteList}${more}
|
|
|
702589
702615
|
const scripts = pkg.scripts || {};
|
|
702590
702616
|
const checkScript = scripts["typecheck"] ? "typecheck" : scripts["build"] ? "build" : null;
|
|
702591
702617
|
if (checkScript) {
|
|
702592
|
-
const { execSync:
|
|
702618
|
+
const { execSync: execSync64 } = await import("node:child_process");
|
|
702593
702619
|
try {
|
|
702594
|
-
|
|
702620
|
+
execSync64(`npm run ${checkScript} --silent 2>&1`, {
|
|
702595
702621
|
cwd: cwd4,
|
|
702596
702622
|
stdio: "pipe",
|
|
702597
702623
|
timeout: 12e4,
|
|
@@ -710353,7 +710379,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710353
710379
|
try {
|
|
710354
710380
|
if (process.platform === "win32") {
|
|
710355
710381
|
try {
|
|
710356
|
-
|
|
710382
|
+
execSync63(`taskkill /F /PID ${pid}`, {
|
|
710357
710383
|
timeout: 5e3,
|
|
710358
710384
|
stdio: "ignore"
|
|
710359
710385
|
});
|
|
@@ -710385,7 +710411,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710385
710411
|
if (pid > 0) {
|
|
710386
710412
|
if (process.platform === "win32") {
|
|
710387
710413
|
try {
|
|
710388
|
-
|
|
710414
|
+
execSync63(`taskkill /F /PID ${pid}`, {
|
|
710389
710415
|
timeout: 5e3,
|
|
710390
710416
|
stdio: "ignore"
|
|
710391
710417
|
});
|
|
@@ -710405,7 +710431,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710405
710431
|
} catch {
|
|
710406
710432
|
}
|
|
710407
710433
|
try {
|
|
710408
|
-
|
|
710434
|
+
execSync63(
|
|
710409
710435
|
process.platform === "win32" ? "timeout /t 1 /nobreak >nul" : "sleep 0.5",
|
|
710410
710436
|
{ timeout: 3e3, stdio: "ignore" }
|
|
710411
710437
|
);
|
|
@@ -710422,7 +710448,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710422
710448
|
} catch (err) {
|
|
710423
710449
|
if (attempt < 2) {
|
|
710424
710450
|
try {
|
|
710425
|
-
|
|
710451
|
+
execSync63(
|
|
710426
710452
|
process.platform === "win32" ? "timeout /t 1 /nobreak >nul" : "sleep 0.3",
|
|
710427
710453
|
{ timeout: 3e3, stdio: "ignore" }
|
|
710428
710454
|
);
|
|
@@ -710436,7 +710462,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710436
710462
|
);
|
|
710437
710463
|
if (process.platform === "win32") {
|
|
710438
710464
|
try {
|
|
710439
|
-
|
|
710465
|
+
execSync63(`rd /s /q "${omniusPath}"`, {
|
|
710440
710466
|
timeout: 1e4,
|
|
710441
710467
|
stdio: "ignore"
|
|
710442
710468
|
});
|