omnius 1.0.305 → 1.0.307
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 +258 -221
- 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;
|
|
@@ -23695,6 +23695,12 @@ function findCanonicalEntry(entries, valueHash, key) {
|
|
|
23695
23695
|
}
|
|
23696
23696
|
return null;
|
|
23697
23697
|
}
|
|
23698
|
+
function getEntryArtifactId(entry) {
|
|
23699
|
+
if (!entry || typeof entry !== "object")
|
|
23700
|
+
return null;
|
|
23701
|
+
const artifactId = entry["artifactId"];
|
|
23702
|
+
return typeof artifactId === "string" && artifactId.length > 0 ? artifactId : null;
|
|
23703
|
+
}
|
|
23698
23704
|
var _writeLocks, MemoryWriteTool;
|
|
23699
23705
|
var init_memory_write = __esm({
|
|
23700
23706
|
"packages/execution/dist/tools/memory-write.js"() {
|
|
@@ -23742,6 +23748,9 @@ var init_memory_write = __esm({
|
|
|
23742
23748
|
}
|
|
23743
23749
|
const omniusMemDir = resolve12(this.workingDir, ".omnius", "memory");
|
|
23744
23750
|
const legacyMemDir = resolve12(this.workingDir, ".omnius", "memory");
|
|
23751
|
+
let wroteMemory = false;
|
|
23752
|
+
let storedArtifactId = null;
|
|
23753
|
+
let existingArtifactId = null;
|
|
23745
23754
|
for (const memoryDir of [.../* @__PURE__ */ new Set([omniusMemDir, legacyMemDir])]) {
|
|
23746
23755
|
await mkdir3(memoryDir, { recursive: true });
|
|
23747
23756
|
const topicFile = join22(memoryDir, `${topic}.json`);
|
|
@@ -23752,7 +23761,13 @@ var init_memory_write = __esm({
|
|
|
23752
23761
|
entries = JSON.parse(raw);
|
|
23753
23762
|
} catch {
|
|
23754
23763
|
}
|
|
23764
|
+
const existingEntry = entries[key];
|
|
23765
|
+
if (existingEntry && typeof existingEntry === "object" && existingEntry["valueHash"] === normalizedValue.valueHash) {
|
|
23766
|
+
existingArtifactId = getEntryArtifactId(existingEntry);
|
|
23767
|
+
return;
|
|
23768
|
+
}
|
|
23755
23769
|
const artifactId = `mem-${randomBytes5(6).toString("hex")}`;
|
|
23770
|
+
storedArtifactId = artifactId;
|
|
23756
23771
|
const canonicalKey = findCanonicalEntry(entries, normalizedValue.valueHash, key);
|
|
23757
23772
|
entries[key] = canonicalKey ? {
|
|
23758
23773
|
value: `(duplicate of ${canonicalKey})`,
|
|
@@ -23772,8 +23787,20 @@ var init_memory_write = __esm({
|
|
|
23772
23787
|
const tempFile = `${topicFile}.tmp-${randomBytes5(4).toString("hex")}`;
|
|
23773
23788
|
await writeFile4(tempFile, JSON.stringify(entries, null, 2), "utf-8");
|
|
23774
23789
|
await rename2(tempFile, topicFile);
|
|
23790
|
+
wroteMemory = true;
|
|
23775
23791
|
});
|
|
23776
23792
|
}
|
|
23793
|
+
if (!wroteMemory) {
|
|
23794
|
+
const artifactSuffix = existingArtifactId ? ` [artifact: ${existingArtifactId}]` : "";
|
|
23795
|
+
const output = `Memory already stored: ${topic}.${key}${artifactSuffix}. No new memory was written; continue with the next step or call task_complete if this was the final bookkeeping step.`;
|
|
23796
|
+
return {
|
|
23797
|
+
success: true,
|
|
23798
|
+
output,
|
|
23799
|
+
llmContent: output,
|
|
23800
|
+
noop: true,
|
|
23801
|
+
durationMs: performance.now() - start2
|
|
23802
|
+
};
|
|
23803
|
+
}
|
|
23777
23804
|
const provenanceDir = resolve12(this.workingDir, ".omnius", "provenance");
|
|
23778
23805
|
try {
|
|
23779
23806
|
await mkdir3(provenanceDir, { recursive: true });
|
|
@@ -23781,7 +23808,7 @@ var init_memory_write = __esm({
|
|
|
23781
23808
|
type: "memory_write",
|
|
23782
23809
|
topic,
|
|
23783
23810
|
key,
|
|
23784
|
-
artifactId:
|
|
23811
|
+
artifactId: storedArtifactId,
|
|
23785
23812
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
23786
23813
|
source: "agent"
|
|
23787
23814
|
};
|
|
@@ -23792,7 +23819,7 @@ var init_memory_write = __esm({
|
|
|
23792
23819
|
await this.writeUnifiedMemory(topic, key, normalizedValue.value);
|
|
23793
23820
|
return {
|
|
23794
23821
|
success: true,
|
|
23795
|
-
output: `Stored memory: ${topic}.${key} [artifact: mem
|
|
23822
|
+
output: `Stored memory: ${topic}.${key} [artifact: ${storedArtifactId ?? "mem-unknown"}]`,
|
|
23796
23823
|
durationMs: performance.now() - start2
|
|
23797
23824
|
};
|
|
23798
23825
|
} catch (error) {
|
|
@@ -558490,7 +558517,7 @@ function evaluate2(inputs) {
|
|
|
558490
558517
|
compacted: cached?.compacted
|
|
558491
558518
|
};
|
|
558492
558519
|
}
|
|
558493
|
-
const cacheEligible = isReadLike || proposedCall.tool === "shell";
|
|
558520
|
+
const cacheEligible = isReadLike || proposedCall.tool === "shell" || proposedCall.tool === "memory_write";
|
|
558494
558521
|
if (cacheEligible) {
|
|
558495
558522
|
const cached = recentToolResults.get(fingerprint);
|
|
558496
558523
|
if (cached !== void 0) {
|
|
@@ -569562,11 +569589,11 @@ ${latest.output || ""}`.trim();
|
|
|
569562
569589
|
`[REPEAT GATE] Exact repeat #${hits} of ${toolName}(${argPreview}).`,
|
|
569563
569590
|
`You ALREADY have this result — re-reading identical arguments cannot produce new information, so this call was NOT executed.`,
|
|
569564
569591
|
``,
|
|
569565
|
-
`You are looping because progress tracking has drifted. Before any further
|
|
569592
|
+
`You are looping because progress tracking has drifted. Before any further redundant calls you MUST:`,
|
|
569566
569593
|
` 1. Call todo_write — decompose the remaining work into concrete, verifiable steps, mark the current step in_progress, and mark anything already done as completed.`,
|
|
569567
569594
|
` 2. Then take a CONCRETE action on the evidence you already have: edit/write the implicated file, run a verification command, or call task_complete with evidence.`,
|
|
569568
569595
|
``,
|
|
569569
|
-
`Do NOT repeat this exact call. If you believe
|
|
569596
|
+
`Do NOT repeat this exact call. If you believe state changed, perform the concrete change first, then retry with distinct evidence.`
|
|
569570
569597
|
].join("\n");
|
|
569571
569598
|
}
|
|
569572
569599
|
_renderKnowledgeBlock(recentToolResults) {
|
|
@@ -571370,8 +571397,8 @@ Respond with your assessment, then take action.`;
|
|
|
571370
571397
|
const memMod = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
|
571371
571398
|
let commitSha = "no-commit";
|
|
571372
571399
|
try {
|
|
571373
|
-
const { execSync:
|
|
571374
|
-
commitSha =
|
|
571400
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
571401
|
+
commitSha = execSync63("git rev-parse HEAD", {
|
|
571375
571402
|
cwd: this._workingDirectory,
|
|
571376
571403
|
stdio: ["ignore", "pipe", "ignore"]
|
|
571377
571404
|
}).toString().trim().slice(0, 12) || "no-commit";
|
|
@@ -571640,6 +571667,7 @@ TASK: ${scrubbedTask}` : scrubbedTask;
|
|
|
571640
571667
|
let lastShellPivotTurn = -1;
|
|
571641
571668
|
const recentToolResults = /* @__PURE__ */ new Map();
|
|
571642
571669
|
const dedupHitCount = /* @__PURE__ */ new Map();
|
|
571670
|
+
const noopedMemoryWriteFingerprints = /* @__PURE__ */ new Set();
|
|
571643
571671
|
const DEDUP_ESCALATION_THRESHOLD = 3;
|
|
571644
571672
|
const toolCallBudget = /* @__PURE__ */ new Map();
|
|
571645
571673
|
const loopTier = this.options.modelTier ?? "large";
|
|
@@ -574002,6 +574030,36 @@ Corrective action: try a different approach first: read relevant files, adjust a
|
|
|
574002
574030
|
toolCallBudget.set(tc.name, budgetRemaining - 1);
|
|
574003
574031
|
}
|
|
574004
574032
|
const toolFingerprint = this._buildToolFingerprint(tc.name, tc.arguments ?? {});
|
|
574033
|
+
if (tc.name === "memory_write" && noopedMemoryWriteFingerprints.has(toolFingerprint)) {
|
|
574034
|
+
this.emit({
|
|
574035
|
+
type: "tool_call",
|
|
574036
|
+
toolName: tc.name,
|
|
574037
|
+
toolArgs: tc.arguments,
|
|
574038
|
+
turn,
|
|
574039
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
574040
|
+
});
|
|
574041
|
+
const repeatNoopMsg = `[MEMORY WRITE NO-OP REPEAT BLOCK] Exact repeat of memory_write(${JSON.stringify(tc.arguments ?? {}).slice(0, 200)}).
|
|
574042
|
+
This same topic/key/value was already confirmed stored, so the call was not executed again.
|
|
574043
|
+
Use the saved fact to continue the promised synthesis or next concrete step, or call task_complete if this bookkeeping was the final step.`;
|
|
574044
|
+
this.emit({
|
|
574045
|
+
type: "tool_result",
|
|
574046
|
+
toolName: tc.name,
|
|
574047
|
+
success: false,
|
|
574048
|
+
content: repeatNoopMsg.slice(0, 120),
|
|
574049
|
+
turn,
|
|
574050
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
574051
|
+
});
|
|
574052
|
+
this._tagSyntheticFailure({
|
|
574053
|
+
mode: "step_repetition",
|
|
574054
|
+
rationale: "memory_write retried after an exact no-op was observed"
|
|
574055
|
+
});
|
|
574056
|
+
return {
|
|
574057
|
+
tc,
|
|
574058
|
+
output: repeatNoopMsg,
|
|
574059
|
+
success: false,
|
|
574060
|
+
systemGuidance: repeatNoopMsg
|
|
574061
|
+
};
|
|
574062
|
+
}
|
|
574005
574063
|
const baseIsReadLike = ![
|
|
574006
574064
|
"file_write",
|
|
574007
574065
|
"file_edit",
|
|
@@ -574108,7 +574166,8 @@ Corrective action: try a different approach first: read relevant files, adjust a
|
|
|
574108
574166
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
574109
574167
|
});
|
|
574110
574168
|
const _repeatGateMax = this._resolveRepeatGateMax();
|
|
574111
|
-
|
|
574169
|
+
const repeatGateEligible = isReadLike || tc.name === "memory_write";
|
|
574170
|
+
if (repeatGateEligible && _existingFp !== void 0 && _repeatGateMax > 0) {
|
|
574112
574171
|
if (criticDecision.hitNumber >= _repeatGateMax) {
|
|
574113
574172
|
repeatShortCircuit = {
|
|
574114
574173
|
success: false,
|
|
@@ -574966,7 +575025,8 @@ Respond with EXACTLY this structure before your next tool call:
|
|
|
574966
575025
|
}
|
|
574967
575026
|
}
|
|
574968
575027
|
}
|
|
574969
|
-
|
|
575028
|
+
const cacheableMemoryNoop = tc.name === "memory_write" && result.success && result.noop;
|
|
575029
|
+
if (isReadLike && result.success || tc.name === "shell" || cacheableMemoryNoop) {
|
|
574970
575030
|
recentToolResults.set(toolFingerprint, {
|
|
574971
575031
|
result: tc.name === "shell" ? this._buildShellCacheResult(tc.arguments, result) : (result.output ?? "").slice(0, 2e3),
|
|
574972
575032
|
compacted: false
|
|
@@ -574978,6 +575038,13 @@ Respond with EXACTLY this structure before your next tool call:
|
|
|
574978
575038
|
dedupHitCount.delete(firstKey);
|
|
574979
575039
|
}
|
|
574980
575040
|
}
|
|
575041
|
+
if (cacheableMemoryNoop) {
|
|
575042
|
+
noopedMemoryWriteFingerprints.add(toolFingerprint);
|
|
575043
|
+
const repeatGateSeed = Math.max(0, this._resolveRepeatGateMax() - 1);
|
|
575044
|
+
if (repeatGateSeed > 0) {
|
|
575045
|
+
dedupHitCount.set(toolFingerprint, Math.max(dedupHitCount.get(toolFingerprint) ?? 0, repeatGateSeed));
|
|
575046
|
+
}
|
|
575047
|
+
}
|
|
574981
575048
|
}
|
|
574982
575049
|
const isFileMutation = realFileMutation;
|
|
574983
575050
|
if (isFileMutation) {
|
|
@@ -575155,6 +575222,19 @@ Respond with EXACTLY this structure before your next tool call:
|
|
|
575155
575222
|
output += `
|
|
575156
575223
|
|
|
575157
575224
|
${criticGuidance}`;
|
|
575225
|
+
}
|
|
575226
|
+
if (tc.name === "memory_write" && result.success && result.noop) {
|
|
575227
|
+
const topic = String(tc.arguments?.["topic"] ?? "<missing topic>");
|
|
575228
|
+
const key = String(tc.arguments?.["key"] ?? "<missing key>");
|
|
575229
|
+
const bookkeepingGuidance = `[BOOKKEEPING ALREADY DONE]
|
|
575230
|
+
memory_write reported that ${topic}.${key} already contains this exact value; no new memory was written.
|
|
575231
|
+
Do not call memory_write again for this same topic/key/value. Continue with the promised synthesis or next concrete task step, or call task_complete if the memory write was the final bookkeeping step.`;
|
|
575232
|
+
output += `
|
|
575233
|
+
|
|
575234
|
+
${bookkeepingGuidance}`;
|
|
575235
|
+
runtimeSystemGuidance = runtimeSystemGuidance ? `${runtimeSystemGuidance}
|
|
575236
|
+
|
|
575237
|
+
${bookkeepingGuidance}` : bookkeepingGuidance;
|
|
575158
575238
|
}
|
|
575159
575239
|
if (!result.success && (this.options.modelTier === "small" || this.options.modelTier === "medium")) {
|
|
575160
575240
|
const recovery = this.buildRecoveryGuidance(tc.name, result.error ?? "", tc.arguments);
|
|
@@ -575395,6 +575475,10 @@ Do NOT retry ${tc.name} with similar arguments.`);
|
|
|
575395
575475
|
this._taskState.completedSteps.push(`${tc.name}: \`${filePath}\``);
|
|
575396
575476
|
} else if ((tc.name === "shell" || tc.name === "background_run") && /PASS|passed|success|✓/i.test(result.output)) {
|
|
575397
575477
|
this._taskState.completedSteps.push(`Test passed: \`${String(tc.arguments?.command ?? "").slice(0, 80)}\``);
|
|
575478
|
+
} else if (tc.name === "memory_write" && !result.noop) {
|
|
575479
|
+
const topic = String(tc.arguments?.["topic"] ?? "<missing topic>");
|
|
575480
|
+
const key = String(tc.arguments?.["key"] ?? "<missing key>");
|
|
575481
|
+
this._taskState.completedSteps.push(`Memory stored: ${topic}.${key}`);
|
|
575398
575482
|
}
|
|
575399
575483
|
}
|
|
575400
575484
|
if (result.output.length > 500 && result.success) {
|
|
@@ -580672,7 +580756,7 @@ ${result}`
|
|
|
580672
580756
|
const buffer2 = Buffer.from(rawBase64, "base64");
|
|
580673
580757
|
let resizedBase64 = null;
|
|
580674
580758
|
try {
|
|
580675
|
-
const { execSync:
|
|
580759
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
580676
580760
|
const { writeFileSync: writeFileSync87, readFileSync: readFileSync129, unlinkSync: unlinkSync35 } = await import("node:fs");
|
|
580677
580761
|
const { join: join172 } = await import("node:path");
|
|
580678
580762
|
const { tmpdir: tmpdir24 } = await import("node:os");
|
|
@@ -580682,7 +580766,7 @@ ${result}`
|
|
|
580682
580766
|
const pyBin = process.platform === "win32" ? "python" : "python3";
|
|
580683
580767
|
const escapedIn = tmpIn.replace(/\\/g, "\\\\");
|
|
580684
580768
|
const escapedOut = tmpOut.replace(/\\/g, "\\\\");
|
|
580685
|
-
|
|
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" });
|
|
580686
580770
|
const resizedBuf = readFileSync129(tmpOut);
|
|
580687
580771
|
resizedBase64 = `data:image/jpeg;base64,${resizedBuf.toString("base64")}`;
|
|
580688
580772
|
try {
|
|
@@ -580751,8 +580835,8 @@ ${result}`
|
|
|
580751
580835
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
580752
580836
|
});
|
|
580753
580837
|
try {
|
|
580754
|
-
const { execSync:
|
|
580755
|
-
|
|
580838
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
580839
|
+
execSync63("ollama pull moondream", {
|
|
580756
580840
|
timeout: 3e5,
|
|
580757
580841
|
stdio: "pipe"
|
|
580758
580842
|
});
|
|
@@ -606982,7 +607066,6 @@ __export(status_bar_exports, {
|
|
|
606982
607066
|
setTerminalTitle: () => setTerminalTitle,
|
|
606983
607067
|
unlockFooterRedraws: () => unlockFooterRedraws
|
|
606984
607068
|
});
|
|
606985
|
-
import { execSync as execSync52 } from "child_process";
|
|
606986
607069
|
import { readFileSync as readFileSync91 } from "node:fs";
|
|
606987
607070
|
function formatPoolAge(ms) {
|
|
606988
607071
|
if (ms < 6e4) return `${Math.max(0, Math.floor(ms / 1e3))}s`;
|
|
@@ -607003,30 +607086,6 @@ function refreshThemeVars() {
|
|
|
607003
607086
|
TEXT_PRIMARY = tuiTextPrimary() < 0 ? 252 : tuiTextPrimary();
|
|
607004
607087
|
TEXT_DIM = tuiTextDim();
|
|
607005
607088
|
}
|
|
607006
|
-
function digitBarSupported() {
|
|
607007
|
-
if (_digitBarSupported !== null) return _digitBarSupported;
|
|
607008
|
-
if (_isWindows) {
|
|
607009
|
-
_digitBarSupported = false;
|
|
607010
|
-
return false;
|
|
607011
|
-
}
|
|
607012
|
-
const termProgram = process.env.TERM_PROGRAM || "";
|
|
607013
|
-
if (/^(iTerm2|WezTerm|Kitty|Alacritty|Ghostty|Warp|Hyper|Tabby)$/i.test(
|
|
607014
|
-
termProgram
|
|
607015
|
-
)) {
|
|
607016
|
-
_digitBarSupported = true;
|
|
607017
|
-
return true;
|
|
607018
|
-
}
|
|
607019
|
-
try {
|
|
607020
|
-
const result = execSync52(
|
|
607021
|
-
'fc-list ":charset=1fbf0-1fbf9" 2>/dev/null || true',
|
|
607022
|
-
{ encoding: "utf8", timeout: 3e3 }
|
|
607023
|
-
);
|
|
607024
|
-
_digitBarSupported = result.trim().length > 0;
|
|
607025
|
-
} catch {
|
|
607026
|
-
_digitBarSupported = true;
|
|
607027
|
-
}
|
|
607028
|
-
return _digitBarSupported;
|
|
607029
|
-
}
|
|
607030
607089
|
function sanitizeSponsorHeaderText(value2, max = SPONSOR_HEADER_LABEL_MAX) {
|
|
607031
607090
|
const cleaned = stripAnsi(String(value2 ?? "")).replace(/[\x00-\x1F\x7F]/g, " ").replace(/\s+/g, " ").trim();
|
|
607032
607091
|
if (cleaned.length <= max) return cleaned;
|
|
@@ -607060,7 +607119,7 @@ function setTerminalTitle(task, version4) {
|
|
|
607060
607119
|
process.stdout.write(data);
|
|
607061
607120
|
}
|
|
607062
607121
|
}
|
|
607063
|
-
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;
|
|
607064
607123
|
var init_status_bar = __esm({
|
|
607065
607124
|
"packages/cli/src/tui/status-bar.ts"() {
|
|
607066
607125
|
"use strict";
|
|
@@ -607254,7 +607313,6 @@ var init_status_bar = __esm({
|
|
|
607254
607313
|
RESET4 = "\x1B[0m";
|
|
607255
607314
|
CURSOR_BLINK_BLOCK = "\x1B[1 q";
|
|
607256
607315
|
_isWindows = process.platform === "win32";
|
|
607257
|
-
_digitBarSupported = null;
|
|
607258
607316
|
SPONSOR_HEADER_LABEL_MAX = 48;
|
|
607259
607317
|
_termTitleWriter = null;
|
|
607260
607318
|
StatusBar = class _StatusBar {
|
|
@@ -610136,30 +610194,9 @@ ${CONTENT_BG_SEQ}`);
|
|
|
610136
610194
|
if (n2 < 1e6) return `${Math.round(n2 / 1e3)}K`;
|
|
610137
610195
|
return `${(n2 / 1e6).toFixed(1)}M`;
|
|
610138
610196
|
}
|
|
610139
|
-
/** Map digit 0-9 to
|
|
610140
|
-
static DIGIT_EMOJI =
|
|
610141
|
-
|
|
610142
|
-
// 0
|
|
610143
|
-
"🯱",
|
|
610144
|
-
// 1
|
|
610145
|
-
"🯲",
|
|
610146
|
-
// 2
|
|
610147
|
-
"🯳",
|
|
610148
|
-
// 3
|
|
610149
|
-
"🯴",
|
|
610150
|
-
// 4
|
|
610151
|
-
"🯵",
|
|
610152
|
-
// 5
|
|
610153
|
-
"🯶",
|
|
610154
|
-
// 6
|
|
610155
|
-
"🯷",
|
|
610156
|
-
// 7
|
|
610157
|
-
"🯸",
|
|
610158
|
-
// 8
|
|
610159
|
-
"🯹"
|
|
610160
|
-
// 9
|
|
610161
|
-
] : ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
610162
|
-
/** 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" */
|
|
610163
610200
|
static digitBar(n2) {
|
|
610164
610201
|
if (n2 < 0) return this.DIGIT_EMOJI[0].repeat(4);
|
|
610165
610202
|
const digits = String(n2).split("");
|
|
@@ -612106,7 +612143,7 @@ __export(personaplex_exports, {
|
|
|
612106
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";
|
|
612107
612144
|
import { join as join126, dirname as dirname40 } from "node:path";
|
|
612108
612145
|
import { homedir as homedir40 } from "node:os";
|
|
612109
|
-
import { execSync as
|
|
612146
|
+
import { execSync as execSync52, spawn as spawn28 } from "node:child_process";
|
|
612110
612147
|
import { fileURLToPath as fileURLToPath15 } from "node:url";
|
|
612111
612148
|
function personaplexPythonEnv(extra = {}) {
|
|
612112
612149
|
const env2 = { ...process.env, ...extra };
|
|
@@ -612144,7 +612181,7 @@ function detectJetson() {
|
|
|
612144
612181
|
try {
|
|
612145
612182
|
const model = readFileSync92("/proc/device-tree/model", "utf8").replace(/\0/g, "").trim();
|
|
612146
612183
|
if (/jetson|orin|tegra/i.test(model)) {
|
|
612147
|
-
const memInfo =
|
|
612184
|
+
const memInfo = execSync52("grep MemTotal /proc/meminfo", { encoding: "utf8", timeout: 3e3, stdio: "pipe" });
|
|
612148
612185
|
const memKB = parseInt(memInfo.match(/(\d+)/)?.[1] ?? "0", 10);
|
|
612149
612186
|
return { isJetson: true, model, totalMemGB: memKB / 1024 / 1024 };
|
|
612150
612187
|
}
|
|
@@ -612178,7 +612215,7 @@ function detectPersonaPlexCapability() {
|
|
|
612178
612215
|
};
|
|
612179
612216
|
}
|
|
612180
612217
|
try {
|
|
612181
|
-
const nvsmi =
|
|
612218
|
+
const nvsmi = execSync52("nvidia-smi --query-gpu=name,memory.total --format=csv,noheader,nounits", {
|
|
612182
612219
|
encoding: "utf8",
|
|
612183
612220
|
timeout: 5e3,
|
|
612184
612221
|
stdio: "pipe"
|
|
@@ -612190,7 +612227,7 @@ function detectPersonaPlexCapability() {
|
|
|
612190
612227
|
return { ...fail3(`GPU has ${vramGB.toFixed(1)}GB VRAM (need ≥8GB)`), gpuName: gpuName ?? "", vramGB };
|
|
612191
612228
|
}
|
|
612192
612229
|
try {
|
|
612193
|
-
|
|
612230
|
+
execSync52('python3 -c "import torch; assert torch.cuda.is_available()"', {
|
|
612194
612231
|
timeout: 1e4,
|
|
612195
612232
|
stdio: "pipe",
|
|
612196
612233
|
env: personaplexPythonEnv()
|
|
@@ -612264,7 +612301,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
612264
612301
|
mkdirSync66(PERSONAPLEX_DIR, { recursive: true });
|
|
612265
612302
|
let arch3 = "";
|
|
612266
612303
|
try {
|
|
612267
|
-
arch3 =
|
|
612304
|
+
arch3 = execSync52("uname -m", { encoding: "utf8", timeout: 3e3, stdio: "pipe" }).trim();
|
|
612268
612305
|
} catch {
|
|
612269
612306
|
}
|
|
612270
612307
|
const isAarch64 = arch3 === "aarch64" || arch3 === "arm64";
|
|
@@ -612285,16 +612322,16 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
612285
612322
|
log22("Checking system dependencies (libopus)...");
|
|
612286
612323
|
try {
|
|
612287
612324
|
if (process.platform === "linux") {
|
|
612288
|
-
|
|
612325
|
+
execSync52("dpkg -l libopus-dev 2>/dev/null || sudo apt-get install -y libopus-dev", { timeout: 3e4, stdio: "pipe" });
|
|
612289
612326
|
} else if (process.platform === "darwin") {
|
|
612290
|
-
|
|
612327
|
+
execSync52("brew list opus 2>/dev/null || brew install opus", { timeout: 6e4, stdio: "pipe" });
|
|
612291
612328
|
}
|
|
612292
612329
|
} catch {
|
|
612293
612330
|
}
|
|
612294
612331
|
if (isAarch64) {
|
|
612295
612332
|
log22("ARM64: Checking Rust toolchain for sphn build...");
|
|
612296
612333
|
try {
|
|
612297
|
-
|
|
612334
|
+
execSync52("rustc --version", { timeout: 5e3, stdio: "pipe" });
|
|
612298
612335
|
} catch {
|
|
612299
612336
|
log22("ARM64: Installing Rust toolchain (needed for sphn audio codec)...");
|
|
612300
612337
|
try {
|
|
@@ -612367,7 +612404,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
612367
612404
|
}
|
|
612368
612405
|
const serverPy = join126(venvDir, "lib", `python3.${process.versions.node ? "12" : "10"}`, "site-packages", "moshi", "server.py");
|
|
612369
612406
|
try {
|
|
612370
|
-
const sitePackages =
|
|
612407
|
+
const sitePackages = execSync52(`"${python}" -c "import moshi, os; print(os.path.dirname(moshi.__file__))"`, {
|
|
612371
612408
|
encoding: "utf8",
|
|
612372
612409
|
timeout: 5e3,
|
|
612373
612410
|
stdio: "pipe",
|
|
@@ -612385,7 +612422,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
612385
612422
|
} catch {
|
|
612386
612423
|
}
|
|
612387
612424
|
try {
|
|
612388
|
-
const sitePackages =
|
|
612425
|
+
const sitePackages = execSync52(`"${python}" -c "import moshi, os; print(os.path.dirname(moshi.__file__))"`, {
|
|
612389
612426
|
encoding: "utf8",
|
|
612390
612427
|
timeout: 5e3,
|
|
612391
612428
|
stdio: "pipe",
|
|
@@ -612490,7 +612527,7 @@ $2if filename.endswith(".safetensors"):`
|
|
|
612490
612527
|
} catch {
|
|
612491
612528
|
}
|
|
612492
612529
|
try {
|
|
612493
|
-
const sitePackages2 =
|
|
612530
|
+
const sitePackages2 = execSync52(`"${python}" -c "import moshi, os; print(os.path.dirname(moshi.__file__))"`, {
|
|
612494
612531
|
encoding: "utf8",
|
|
612495
612532
|
timeout: 5e3,
|
|
612496
612533
|
stdio: "pipe",
|
|
@@ -612626,14 +612663,14 @@ async function startPersonaPlexDaemon(onInfo) {
|
|
|
612626
612663
|
if (tier === "nf4-distilled") {
|
|
612627
612664
|
log22(`Weight tier: ${tier} — distilled NF4 (90% token match, ${repoInfo.sizeGB}GB)...`);
|
|
612628
612665
|
try {
|
|
612629
|
-
const weightPath =
|
|
612666
|
+
const weightPath = execSync52(
|
|
612630
612667
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', '${repoInfo.file}', token=False))"`,
|
|
612631
612668
|
{ encoding: "utf8", timeout: 6e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612632
612669
|
).trim();
|
|
612633
612670
|
if (existsSync111(weightPath)) {
|
|
612634
612671
|
if (!existsSync111(cachedBf16)) {
|
|
612635
612672
|
log22("Converting .pt checkpoint to safetensors (one-time)...");
|
|
612636
|
-
|
|
612673
|
+
execSync52(
|
|
612637
612674
|
`"${venvPython2}" -c "
|
|
612638
612675
|
import torch; from safetensors.torch import save_file
|
|
612639
612676
|
state = torch.load('${weightPath}', map_location='cpu', weights_only=True)
|
|
@@ -612665,13 +612702,13 @@ print('Converted')
|
|
|
612665
612702
|
}
|
|
612666
612703
|
}
|
|
612667
612704
|
try {
|
|
612668
|
-
const weightPath =
|
|
612705
|
+
const weightPath = execSync52(
|
|
612669
612706
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', '${repoInfo.file}'${repoInfo.needsToken ? "" : ", token=False"}))"`,
|
|
612670
612707
|
{ encoding: "utf8", timeout: 3e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612671
612708
|
).trim();
|
|
612672
612709
|
if (existsSync111(dequantScript) && existsSync111(weightPath)) {
|
|
612673
612710
|
try {
|
|
612674
|
-
|
|
612711
|
+
execSync52(
|
|
612675
612712
|
`"${venvPython2}" "${dequantScript}" --input "${weightPath}" --output "${cachedBf16}"`,
|
|
612676
612713
|
{ timeout: 3e5, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612677
612714
|
);
|
|
@@ -612684,7 +612721,7 @@ print('Converted')
|
|
|
612684
612721
|
}
|
|
612685
612722
|
}
|
|
612686
612723
|
try {
|
|
612687
|
-
const mimiPath =
|
|
612724
|
+
const mimiPath = execSync52(
|
|
612688
612725
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', 'tokenizer-e351c8d8-checkpoint125.safetensors', token=False))"`,
|
|
612689
612726
|
{ encoding: "utf8", timeout: 3e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612690
612727
|
).trim();
|
|
@@ -612692,7 +612729,7 @@ print('Converted')
|
|
|
612692
612729
|
} catch {
|
|
612693
612730
|
}
|
|
612694
612731
|
try {
|
|
612695
|
-
const tokPath =
|
|
612732
|
+
const tokPath = execSync52(
|
|
612696
612733
|
`"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', 'tokenizer_spm_32k_3.model', token=False))"`,
|
|
612697
612734
|
{ encoding: "utf8", timeout: 3e4, stdio: "pipe", env: personaplexPythonEnv() }
|
|
612698
612735
|
).trim();
|
|
@@ -612716,7 +612753,7 @@ print('Converted')
|
|
|
612716
612753
|
}
|
|
612717
612754
|
if (!ollamaModel) ollamaModel = "qwen3.5:4b";
|
|
612718
612755
|
try {
|
|
612719
|
-
const ollamaCheck =
|
|
612756
|
+
const ollamaCheck = execSync52("curl -s http://localhost:11434/api/tags", {
|
|
612720
612757
|
timeout: 3e3,
|
|
612721
612758
|
stdio: "pipe",
|
|
612722
612759
|
encoding: "utf8"
|
|
@@ -612790,7 +612827,7 @@ print('Converted')
|
|
|
612790
612827
|
return null;
|
|
612791
612828
|
}
|
|
612792
612829
|
try {
|
|
612793
|
-
|
|
612830
|
+
execSync52(`curl -sk -o /dev/null -w "%{http_code}" https://127.0.0.1:${PORT}/`, {
|
|
612794
612831
|
timeout: 3e3,
|
|
612795
612832
|
stdio: "pipe",
|
|
612796
612833
|
encoding: "utf8"
|
|
@@ -612813,7 +612850,7 @@ function stopPersonaPlex() {
|
|
|
612813
612850
|
if (isNaN(pid) || pid <= 0) return;
|
|
612814
612851
|
try {
|
|
612815
612852
|
if (process.platform === "win32") {
|
|
612816
|
-
|
|
612853
|
+
execSync52(`taskkill /F /PID ${pid}`, { timeout: 5e3, stdio: "ignore" });
|
|
612817
612854
|
} else {
|
|
612818
612855
|
process.kill(pid, "SIGTERM");
|
|
612819
612856
|
}
|
|
@@ -613124,7 +613161,7 @@ __export(setup_exports, {
|
|
|
613124
613161
|
updateOllama: () => updateOllama
|
|
613125
613162
|
});
|
|
613126
613163
|
import * as readline from "node:readline";
|
|
613127
|
-
import { execSync as
|
|
613164
|
+
import { execSync as execSync53, spawn as spawn29, exec as exec5 } from "node:child_process";
|
|
613128
613165
|
import { promisify as promisify6 } from "node:util";
|
|
613129
613166
|
import { existsSync as existsSync112, writeFileSync as writeFileSync58, readFileSync as readFileSync93, appendFileSync as appendFileSync10, mkdirSync as mkdirSync67 } from "node:fs";
|
|
613130
613167
|
import { join as join127 } from "node:path";
|
|
@@ -613247,7 +613284,7 @@ function detectSystemSpecs() {
|
|
|
613247
613284
|
let availableVramGB = 0;
|
|
613248
613285
|
let gpuName = "";
|
|
613249
613286
|
try {
|
|
613250
|
-
const memInfo =
|
|
613287
|
+
const memInfo = execSync53("free -b 2>/dev/null || sysctl -n hw.memsize 2>/dev/null", {
|
|
613251
613288
|
encoding: "utf8",
|
|
613252
613289
|
timeout: 5e3
|
|
613253
613290
|
});
|
|
@@ -613267,7 +613304,7 @@ function detectSystemSpecs() {
|
|
|
613267
613304
|
} catch {
|
|
613268
613305
|
}
|
|
613269
613306
|
try {
|
|
613270
|
-
const nvidiaSmi =
|
|
613307
|
+
const nvidiaSmi = execSync53(
|
|
613271
613308
|
"nvidia-smi --query-gpu=memory.total,memory.free,name --format=csv,noheader,nounits 2>/dev/null",
|
|
613272
613309
|
{ encoding: "utf8", timeout: 5e3 }
|
|
613273
613310
|
);
|
|
@@ -613279,7 +613316,7 @@ function detectSystemSpecs() {
|
|
|
613279
613316
|
}
|
|
613280
613317
|
if (gpuVramGB === 0) {
|
|
613281
613318
|
try {
|
|
613282
|
-
const rocmSmi =
|
|
613319
|
+
const rocmSmi = execSync53(
|
|
613283
613320
|
"rocm-smi --showmeminfo vram --csv 2>/dev/null",
|
|
613284
613321
|
{ encoding: "utf8", timeout: 5e3 }
|
|
613285
613322
|
);
|
|
@@ -613535,7 +613572,7 @@ function ensureCurl() {
|
|
|
613535
613572
|
for (const s2 of strategies) {
|
|
613536
613573
|
if (hasCmd(s2.check)) {
|
|
613537
613574
|
try {
|
|
613538
|
-
|
|
613575
|
+
execSync53(s2.install, { stdio: "inherit", timeout: 12e4 });
|
|
613539
613576
|
if (hasCmd("curl")) {
|
|
613540
613577
|
process.stdout.write(` ${c3.green("✔")} curl installed via ${s2.label}.
|
|
613541
613578
|
`);
|
|
@@ -613549,7 +613586,7 @@ function ensureCurl() {
|
|
|
613549
613586
|
}
|
|
613550
613587
|
if (plat === "darwin") {
|
|
613551
613588
|
try {
|
|
613552
|
-
|
|
613589
|
+
execSync53("xcode-select --install", { stdio: "inherit", timeout: 3e5 });
|
|
613553
613590
|
if (hasCmd("curl")) return true;
|
|
613554
613591
|
} catch {
|
|
613555
613592
|
}
|
|
@@ -613563,7 +613600,7 @@ function ensureZstd() {
|
|
|
613563
613600
|
if (process.platform === "darwin") {
|
|
613564
613601
|
if (!hasCmd("brew")) return false;
|
|
613565
613602
|
try {
|
|
613566
|
-
|
|
613603
|
+
execSync53("brew install zstd", { stdio: "inherit", timeout: 12e4 });
|
|
613567
613604
|
return hasCmd("zstd");
|
|
613568
613605
|
} catch {
|
|
613569
613606
|
return false;
|
|
@@ -613605,7 +613642,7 @@ function ensureZstd() {
|
|
|
613605
613642
|
candidates.push({ cmd: installCmd, env: process.env });
|
|
613606
613643
|
for (const cand of candidates) {
|
|
613607
613644
|
try {
|
|
613608
|
-
|
|
613645
|
+
execSync53(cand.cmd, {
|
|
613609
613646
|
stdio: cand.stdio ?? ["ignore", "inherit", "pipe"],
|
|
613610
613647
|
env: cand.env,
|
|
613611
613648
|
timeout: 18e4
|
|
@@ -613642,7 +613679,7 @@ function detectAskpassHelper() {
|
|
|
613642
613679
|
for (const name10 of ["ssh-askpass", "ksshaskpass", "x11-ssh-askpass"]) {
|
|
613643
613680
|
if (hasCmd(name10)) {
|
|
613644
613681
|
try {
|
|
613645
|
-
const p2 =
|
|
613682
|
+
const p2 = execSync53(`command -v ${name10}`, { encoding: "utf8" }).trim();
|
|
613646
613683
|
if (p2) return p2;
|
|
613647
613684
|
} catch {
|
|
613648
613685
|
}
|
|
@@ -613685,7 +613722,7 @@ osascript -e 'Tell application "System Events" to display dialog "Omnius needs a
|
|
|
613685
613722
|
}
|
|
613686
613723
|
try {
|
|
613687
613724
|
writeFileSync58(helperPath, body, { mode: 448 });
|
|
613688
|
-
|
|
613725
|
+
execSync53(`chmod 700 "${helperPath}"`, { stdio: "ignore" });
|
|
613689
613726
|
return helperPath;
|
|
613690
613727
|
} catch {
|
|
613691
613728
|
return null;
|
|
@@ -613754,7 +613791,7 @@ function runElevatedCommand(command, opts = {}) {
|
|
|
613754
613791
|
let lastErr = null;
|
|
613755
613792
|
for (const cand of candidates) {
|
|
613756
613793
|
try {
|
|
613757
|
-
|
|
613794
|
+
execSync53(cand.cmd, {
|
|
613758
613795
|
stdio: cand.stdio ?? ["ignore", "pipe", "pipe"],
|
|
613759
613796
|
env: cand.env,
|
|
613760
613797
|
timeout: timeout2
|
|
@@ -613791,7 +613828,7 @@ function runOllamaInstallScript() {
|
|
|
613791
613828
|
`);
|
|
613792
613829
|
}
|
|
613793
613830
|
const runOnce = () => {
|
|
613794
|
-
|
|
613831
|
+
execSync53(elevated.cmd, {
|
|
613795
613832
|
stdio: elevated.mode === "terminal" ? "inherit" : ["ignore", "inherit", "pipe"],
|
|
613796
613833
|
env: elevated.env,
|
|
613797
613834
|
timeout: 6e5
|
|
@@ -613870,7 +613907,7 @@ async function installOllamaMac(_rl) {
|
|
|
613870
613907
|
|
|
613871
613908
|
`);
|
|
613872
613909
|
try {
|
|
613873
|
-
|
|
613910
|
+
execSync53(
|
|
613874
613911
|
'/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',
|
|
613875
613912
|
{ stdio: "inherit", timeout: 6e5 }
|
|
613876
613913
|
);
|
|
@@ -613906,7 +613943,7 @@ async function installOllamaMac(_rl) {
|
|
|
613906
613943
|
|
|
613907
613944
|
`);
|
|
613908
613945
|
try {
|
|
613909
|
-
|
|
613946
|
+
execSync53("brew install ollama", {
|
|
613910
613947
|
stdio: "inherit",
|
|
613911
613948
|
timeout: 3e5
|
|
613912
613949
|
});
|
|
@@ -613933,7 +613970,7 @@ function installOllamaWindows() {
|
|
|
613933
613970
|
|
|
613934
613971
|
`);
|
|
613935
613972
|
try {
|
|
613936
|
-
|
|
613973
|
+
execSync53('powershell -Command "irm https://ollama.com/install.ps1 | iex"', {
|
|
613937
613974
|
stdio: "inherit",
|
|
613938
613975
|
timeout: 3e5
|
|
613939
613976
|
});
|
|
@@ -614013,7 +614050,7 @@ async function ensureOllamaRunning(backendUrl2, rl) {
|
|
|
614013
614050
|
}
|
|
614014
614051
|
function getOllamaVersion() {
|
|
614015
614052
|
try {
|
|
614016
|
-
const out =
|
|
614053
|
+
const out = execSync53("ollama --version", { encoding: "utf8", timeout: 5e3 });
|
|
614017
614054
|
const match = out.match(/(\d+\.\d+\.\d+)/);
|
|
614018
614055
|
return match ? match[1] : null;
|
|
614019
614056
|
} catch {
|
|
@@ -614070,7 +614107,7 @@ function updateOllama() {
|
|
|
614070
614107
|
}
|
|
614071
614108
|
function pullModelWithAutoUpdate(tag) {
|
|
614072
614109
|
try {
|
|
614073
|
-
|
|
614110
|
+
execSync53(`ollama pull ${tag}`, {
|
|
614074
614111
|
stdio: "inherit",
|
|
614075
614112
|
timeout: 36e5
|
|
614076
614113
|
// 1 hour max
|
|
@@ -614097,7 +614134,7 @@ function pullModelWithAutoUpdate(tag) {
|
|
|
614097
614134
|
process.stdout.write(` ${c3.cyan("●")} Retrying pull of ${c3.bold(tag)}...
|
|
614098
614135
|
|
|
614099
614136
|
`);
|
|
614100
|
-
|
|
614137
|
+
execSync53(`ollama pull ${tag}`, {
|
|
614101
614138
|
stdio: "inherit",
|
|
614102
614139
|
timeout: 36e5
|
|
614103
614140
|
});
|
|
@@ -614186,7 +614223,7 @@ function ensurePython3() {
|
|
|
614186
614223
|
if (plat === "darwin") {
|
|
614187
614224
|
if (hasCmd("brew")) {
|
|
614188
614225
|
try {
|
|
614189
|
-
|
|
614226
|
+
execSync53("brew install python3", { stdio: "inherit", timeout: 3e5 });
|
|
614190
614227
|
if (hasCmd("python3")) {
|
|
614191
614228
|
process.stdout.write(` ${c3.green("✔")} Python3 installed via Homebrew.
|
|
614192
614229
|
`);
|
|
@@ -614199,7 +614236,7 @@ function ensurePython3() {
|
|
|
614199
614236
|
for (const s2 of strategies) {
|
|
614200
614237
|
if (hasCmd(s2.check)) {
|
|
614201
614238
|
try {
|
|
614202
|
-
|
|
614239
|
+
execSync53(s2.install, { stdio: "inherit", timeout: 12e4 });
|
|
614203
614240
|
if (hasCmd("python3") || hasCmd("python")) {
|
|
614204
614241
|
process.stdout.write(` ${c3.green("✔")} Python3 installed via ${s2.label}.
|
|
614205
614242
|
`);
|
|
@@ -614215,11 +614252,11 @@ function ensurePython3() {
|
|
|
614215
614252
|
}
|
|
614216
614253
|
function checkPythonVenv() {
|
|
614217
614254
|
try {
|
|
614218
|
-
|
|
614255
|
+
execSync53("python3 -m venv --help", { stdio: "pipe", timeout: 5e3 });
|
|
614219
614256
|
return true;
|
|
614220
614257
|
} catch {
|
|
614221
614258
|
try {
|
|
614222
|
-
|
|
614259
|
+
execSync53("python -m venv --help", { stdio: "pipe", timeout: 5e3 });
|
|
614223
614260
|
return true;
|
|
614224
614261
|
} catch {
|
|
614225
614262
|
return false;
|
|
@@ -614238,7 +614275,7 @@ function ensurePythonVenv() {
|
|
|
614238
614275
|
for (const s2 of strategies) {
|
|
614239
614276
|
if (hasCmd(s2.check)) {
|
|
614240
614277
|
try {
|
|
614241
|
-
|
|
614278
|
+
execSync53(s2.install, { stdio: "inherit", timeout: 12e4 });
|
|
614242
614279
|
if (checkPythonVenv()) {
|
|
614243
614280
|
process.stdout.write(` ${c3.green("✔")} python3-venv installed via ${s2.label}.
|
|
614244
614281
|
`);
|
|
@@ -614845,7 +614882,7 @@ ${c3.cyan(OMNIUS_FIRST_RUN_BANNER)}
|
|
|
614845
614882
|
for (let i2 = 0; i2 < modelfileCandidates.length; i2++) {
|
|
614846
614883
|
writeFileSync58(modelfilePath, modelfileCandidates[i2] + "\n", "utf8");
|
|
614847
614884
|
try {
|
|
614848
|
-
|
|
614885
|
+
execSync53(`ollama create ${customName} -f ${modelfilePath}`, {
|
|
614849
614886
|
stdio: "pipe",
|
|
614850
614887
|
timeout: 12e4
|
|
614851
614888
|
});
|
|
@@ -614907,7 +614944,7 @@ function isFirstRun() {
|
|
|
614907
614944
|
function hasCmd(cmd) {
|
|
614908
614945
|
try {
|
|
614909
614946
|
const whichCmd = process.platform === "win32" ? `where ${cmd}` : `which ${cmd}`;
|
|
614910
|
-
|
|
614947
|
+
execSync53(whichCmd, { stdio: "pipe", timeout: 3e3 });
|
|
614911
614948
|
return true;
|
|
614912
614949
|
} catch {
|
|
614913
614950
|
return false;
|
|
@@ -614919,7 +614956,7 @@ function detectPkgManager() {
|
|
|
614919
614956
|
if (hasCmd("choco")) return "choco";
|
|
614920
614957
|
if (hasCmd("winget")) return "winget";
|
|
614921
614958
|
try {
|
|
614922
|
-
|
|
614959
|
+
execSync53(
|
|
614923
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'))"`,
|
|
614924
614961
|
{ stdio: "pipe", timeout: 12e4 }
|
|
614925
614962
|
);
|
|
@@ -614931,7 +614968,7 @@ function detectPkgManager() {
|
|
|
614931
614968
|
if (plat === "darwin") {
|
|
614932
614969
|
if (hasCmd("brew")) return "brew";
|
|
614933
614970
|
try {
|
|
614934
|
-
|
|
614971
|
+
execSync53(
|
|
614935
614972
|
'/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"',
|
|
614936
614973
|
{ stdio: "pipe", timeout: 3e5, env: { ...process.env, NONINTERACTIVE: "1" } }
|
|
614937
614974
|
);
|
|
@@ -614951,7 +614988,7 @@ function getVenvDir2() {
|
|
|
614951
614988
|
}
|
|
614952
614989
|
function hasVenvModule() {
|
|
614953
614990
|
try {
|
|
614954
|
-
|
|
614991
|
+
execSync53('python3 -c "import ensurepip, venv"', {
|
|
614955
614992
|
stdio: "pipe",
|
|
614956
614993
|
timeout: 5e3
|
|
614957
614994
|
});
|
|
@@ -614968,17 +615005,17 @@ function ensureVenv2(log22) {
|
|
|
614968
615005
|
const pythonCmd = isWin2 ? "python" : "python3";
|
|
614969
615006
|
if (existsSync112(pipPath)) {
|
|
614970
615007
|
try {
|
|
614971
|
-
|
|
615008
|
+
execSync53(`"${venvPyPath}" -m pip --version`, { stdio: "pipe", timeout: 1e4 });
|
|
614972
615009
|
return venvDir;
|
|
614973
615010
|
} catch {
|
|
614974
615011
|
log22("Python venv pip is broken — repairing...");
|
|
614975
615012
|
try {
|
|
614976
|
-
|
|
615013
|
+
execSync53(`"${venvPyPath}" -m ensurepip --upgrade`, { stdio: "pipe", timeout: 3e4 });
|
|
614977
615014
|
log22("pip repaired via ensurepip.");
|
|
614978
615015
|
return venvDir;
|
|
614979
615016
|
} catch {
|
|
614980
615017
|
try {
|
|
614981
|
-
|
|
615018
|
+
execSync53(`curl -sS https://bootstrap.pypa.io/get-pip.py | "${venvPyPath}"`, { stdio: "pipe", timeout: 6e4 });
|
|
614982
615019
|
log22("pip repaired via get-pip.py.");
|
|
614983
615020
|
return venvDir;
|
|
614984
615021
|
} catch {
|
|
@@ -614999,17 +615036,17 @@ function ensureVenv2(log22) {
|
|
|
614999
615036
|
try {
|
|
615000
615037
|
mkdirSync67(join127(homedir41(), ".omnius"), { recursive: true });
|
|
615001
615038
|
const pyCmd = hasCmd(pythonCmd) ? pythonCmd : "python3";
|
|
615002
|
-
|
|
615039
|
+
execSync53(`${pyCmd} -m venv --clear "${venvDir}"`, { stdio: "pipe", timeout: 3e4 });
|
|
615003
615040
|
try {
|
|
615004
|
-
|
|
615041
|
+
execSync53(`"${venvPyPath}" -m pip --version`, { stdio: "pipe", timeout: 1e4 });
|
|
615005
615042
|
} catch {
|
|
615006
615043
|
try {
|
|
615007
|
-
|
|
615044
|
+
execSync53(`"${venvPyPath}" -m ensurepip --upgrade`, { stdio: "pipe", timeout: 3e4 });
|
|
615008
615045
|
} catch {
|
|
615009
|
-
|
|
615046
|
+
execSync53(`curl -sS https://bootstrap.pypa.io/get-pip.py | "${venvPyPath}"`, { stdio: "pipe", timeout: 6e4 });
|
|
615010
615047
|
}
|
|
615011
615048
|
}
|
|
615012
|
-
|
|
615049
|
+
execSync53(`"${venvPyPath}" -m pip install --upgrade pip`, {
|
|
615013
615050
|
stdio: "pipe",
|
|
615014
615051
|
timeout: 6e4
|
|
615015
615052
|
});
|
|
@@ -615022,7 +615059,7 @@ function ensureVenv2(log22) {
|
|
|
615022
615059
|
}
|
|
615023
615060
|
function trySudoPasswordless(cmd, timeoutMs = 12e4) {
|
|
615024
615061
|
try {
|
|
615025
|
-
|
|
615062
|
+
execSync53(`sudo -n ${cmd}`, {
|
|
615026
615063
|
stdio: "pipe",
|
|
615027
615064
|
timeout: timeoutMs,
|
|
615028
615065
|
env: { ...process.env, DEBIAN_FRONTEND: "noninteractive" }
|
|
@@ -615035,7 +615072,7 @@ function trySudoPasswordless(cmd, timeoutMs = 12e4) {
|
|
|
615035
615072
|
function runWithSudo(cmd, password, timeoutMs = 12e4) {
|
|
615036
615073
|
try {
|
|
615037
615074
|
const escaped = cmd.replace(/'/g, "'\\''");
|
|
615038
|
-
|
|
615075
|
+
execSync53(`sudo -S bash -c '${escaped}'`, {
|
|
615039
615076
|
input: password + "\n",
|
|
615040
615077
|
stdio: ["pipe", "pipe", "pipe"],
|
|
615041
615078
|
timeout: timeoutMs,
|
|
@@ -615077,7 +615114,7 @@ async function sudoInstall(cmd, getSudoPassword, log22, cachedPasswordRef, timeo
|
|
|
615077
615114
|
try {
|
|
615078
615115
|
const isRoot = typeof process.getuid === "function" && process.getuid() === 0;
|
|
615079
615116
|
const escaped = cmd.replace(/'/g, "'\\''");
|
|
615080
|
-
|
|
615117
|
+
execSync53(isRoot ? `bash -c '${escaped}'` : `sudo bash -c '${escaped}'`, {
|
|
615081
615118
|
stdio: "inherit",
|
|
615082
615119
|
timeout: timeoutMs,
|
|
615083
615120
|
env: { ...process.env, DEBIAN_FRONTEND: "noninteractive" }
|
|
@@ -615143,7 +615180,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615143
615180
|
let winNeedsElevation = false;
|
|
615144
615181
|
if (process.platform === "win32") {
|
|
615145
615182
|
try {
|
|
615146
|
-
|
|
615183
|
+
execSync53("net session", { stdio: "pipe", timeout: 3e3 });
|
|
615147
615184
|
} catch {
|
|
615148
615185
|
winNeedsElevation = true;
|
|
615149
615186
|
log22(`Installing ${labels} via ${pm2} (requires admin — UAC prompt will appear)...`);
|
|
@@ -615190,12 +615227,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615190
615227
|
if (needsSudo) {
|
|
615191
615228
|
await sudoInstall(installCmd, getPassword, log22, cachedPasswordRef, 18e4);
|
|
615192
615229
|
} else if (winNeedsElevation) {
|
|
615193
|
-
|
|
615230
|
+
execSync53(
|
|
615194
615231
|
`powershell -NoProfile -Command "Start-Process -FilePath 'cmd.exe' -ArgumentList '/c ${installCmd.replace(/'/g, "''")}' -Verb RunAs -Wait"`,
|
|
615195
615232
|
{ stdio: "pipe", timeout: 18e4 }
|
|
615196
615233
|
);
|
|
615197
615234
|
} else {
|
|
615198
|
-
|
|
615235
|
+
execSync53(installCmd, { stdio: "pipe", timeout: 18e4 });
|
|
615199
615236
|
}
|
|
615200
615237
|
} catch (e2) {
|
|
615201
615238
|
const stderr = e2.stderr?.toString?.()?.trim?.() ?? "";
|
|
@@ -615208,7 +615245,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615208
615245
|
if (!hasCmd(d2.binary) && pipPkg) {
|
|
615209
615246
|
try {
|
|
615210
615247
|
const pipCmd = process.platform === "win32" ? `pip install ${pipPkg}` : `pip3 install ${pipPkg}`;
|
|
615211
|
-
|
|
615248
|
+
execSync53(pipCmd, { stdio: "pipe", timeout: 12e4 });
|
|
615212
615249
|
lastError = "";
|
|
615213
615250
|
} catch (e2) {
|
|
615214
615251
|
const stderr = e2.stderr?.toString?.()?.trim?.() ?? "";
|
|
@@ -615220,7 +615257,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615220
615257
|
}
|
|
615221
615258
|
if (process.platform === "win32" && !hasCmd(d2.binary)) {
|
|
615222
615259
|
try {
|
|
615223
|
-
const freshPath =
|
|
615260
|
+
const freshPath = execSync53(
|
|
615224
615261
|
`powershell -NoProfile -Command "[System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User')"`,
|
|
615225
615262
|
{ encoding: "utf8", timeout: 5e3, stdio: "pipe" }
|
|
615226
615263
|
).trim();
|
|
@@ -615266,7 +615303,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615266
615303
|
const venvCmds = {
|
|
615267
615304
|
apt: () => {
|
|
615268
615305
|
try {
|
|
615269
|
-
const pyVer =
|
|
615306
|
+
const pyVer = execSync53(
|
|
615270
615307
|
`python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"`,
|
|
615271
615308
|
{ encoding: "utf8", stdio: "pipe", timeout: 5e3 }
|
|
615272
615309
|
).trim();
|
|
@@ -615298,12 +615335,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615298
615335
|
const venvPip2 = join127(venvBin, "pip");
|
|
615299
615336
|
log22("Installing moondream-station in ~/.omnius/venv...");
|
|
615300
615337
|
try {
|
|
615301
|
-
|
|
615338
|
+
execSync53(`"${venvPip2}" install moondream-station`, { stdio: "pipe", timeout: 3e5 });
|
|
615302
615339
|
if (existsSync112(venvMoondream)) {
|
|
615303
615340
|
log22("moondream-station installed successfully.");
|
|
615304
615341
|
} else {
|
|
615305
615342
|
try {
|
|
615306
|
-
const check =
|
|
615343
|
+
const check = execSync53(`"${venvPip2}" show moondream-station`, { encoding: "utf8", stdio: "pipe", timeout: 5e3 });
|
|
615307
615344
|
if (check.includes("moondream")) {
|
|
615308
615345
|
log22("moondream-station package installed.");
|
|
615309
615346
|
}
|
|
@@ -615320,7 +615357,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615320
615357
|
const venvPip2 = join127(venvBin, isWin2 ? "pip.exe" : "pip");
|
|
615321
615358
|
let ocrStackInstalled = false;
|
|
615322
615359
|
try {
|
|
615323
|
-
|
|
615360
|
+
execSync53(
|
|
615324
615361
|
`"${venvPython2}" -c "import cv2, pytesseract, numpy, PIL"`,
|
|
615325
615362
|
{ stdio: "pipe", timeout: 1e4 }
|
|
615326
615363
|
);
|
|
@@ -615331,12 +615368,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
615331
615368
|
const ocrPackages = "pytesseract Pillow opencv-python-headless numpy";
|
|
615332
615369
|
log22("Installing OCR Python stack (pytesseract, OpenCV, Pillow, numpy)...");
|
|
615333
615370
|
try {
|
|
615334
|
-
|
|
615371
|
+
execSync53(
|
|
615335
615372
|
`"${venvPip2}" install ${ocrPackages}`,
|
|
615336
615373
|
{ stdio: "pipe", timeout: 3e5 }
|
|
615337
615374
|
);
|
|
615338
615375
|
try {
|
|
615339
|
-
|
|
615376
|
+
execSync53(
|
|
615340
615377
|
`"${venvPython2}" -c "import cv2, pytesseract, numpy, PIL"`,
|
|
615341
615378
|
{ stdio: "pipe", timeout: 1e4 }
|
|
615342
615379
|
);
|
|
@@ -615372,7 +615409,7 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
615372
615409
|
const archMap = { x64: "amd64", arm64: "arm64", arm: "arm" };
|
|
615373
615410
|
const cfArch = archMap[arch3] ?? "amd64";
|
|
615374
615411
|
try {
|
|
615375
|
-
|
|
615412
|
+
execSync53(
|
|
615376
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"`,
|
|
615377
615414
|
{ stdio: "pipe", timeout: 6e4 }
|
|
615378
615415
|
);
|
|
@@ -615388,7 +615425,7 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
615388
615425
|
try {
|
|
615389
615426
|
const terminalElevation = process.env["OMNIUS_ELEVATION_MODE"] === "terminal" && process.stdin.isTTY && process.stdout.isTTY;
|
|
615390
615427
|
const sudoMove = terminalElevation ? `sudo mv /tmp/cloudflared /usr/local/bin/cloudflared` : `sudo mv /tmp/cloudflared /usr/local/bin/cloudflared 2>/dev/null`;
|
|
615391
|
-
|
|
615428
|
+
execSync53(
|
|
615392
615429
|
`curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && ` + sudoMove,
|
|
615393
615430
|
{ stdio: terminalElevation ? "inherit" : "pipe", timeout: 6e4 }
|
|
615394
615431
|
);
|
|
@@ -615400,7 +615437,7 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
615400
615437
|
}
|
|
615401
615438
|
} else if (os9 === "darwin") {
|
|
615402
615439
|
try {
|
|
615403
|
-
|
|
615440
|
+
execSync53("brew install cloudflared", { stdio: "pipe", timeout: 12e4 });
|
|
615404
615441
|
if (hasCmd("cloudflared")) {
|
|
615405
615442
|
log22("cloudflared installed via Homebrew.");
|
|
615406
615443
|
return true;
|
|
@@ -615597,7 +615634,7 @@ function createExpandedVariantNamed(targetModel, baseModel, specs, sizeGB, kvByt
|
|
|
615597
615634
|
for (let i2 = 0; i2 < modelfileCandidates.length; i2++) {
|
|
615598
615635
|
writeFileSync58(modelfilePath, modelfileCandidates[i2] + "\n", "utf8");
|
|
615599
615636
|
try {
|
|
615600
|
-
|
|
615637
|
+
execSync53(`ollama create ${targetModel} -f ${modelfilePath}`, {
|
|
615601
615638
|
stdio: "pipe",
|
|
615602
615639
|
timeout: 12e4
|
|
615603
615640
|
});
|
|
@@ -615883,7 +615920,7 @@ async function repairAllExpandedVariants(backendUrl2) {
|
|
|
615883
615920
|
}
|
|
615884
615921
|
async function ensureNeovim() {
|
|
615885
615922
|
try {
|
|
615886
|
-
const nvimPath =
|
|
615923
|
+
const nvimPath = execSync53("which nvim 2>/dev/null || where nvim 2>nul", {
|
|
615887
615924
|
encoding: "utf8",
|
|
615888
615925
|
stdio: "pipe",
|
|
615889
615926
|
timeout: 5e3
|
|
@@ -615904,14 +615941,14 @@ async function ensureNeovim() {
|
|
|
615904
615941
|
const url = `https://github.com/neovim/neovim/releases/latest/download/${appImageName}`;
|
|
615905
615942
|
console.log(` Downloading Neovim (${appImageName})...`);
|
|
615906
615943
|
try {
|
|
615907
|
-
|
|
615908
|
-
|
|
615944
|
+
execSync53(`curl -fsSL "${url}" -o "${nvimDest}"`, { stdio: "pipe", timeout: 6e4 });
|
|
615945
|
+
execSync53(`chmod +x "${nvimDest}"`, { stdio: "pipe", timeout: 3e3 });
|
|
615909
615946
|
} catch (err) {
|
|
615910
615947
|
console.log(` Failed to download Neovim: ${err instanceof Error ? err.message : String(err)}`);
|
|
615911
615948
|
return null;
|
|
615912
615949
|
}
|
|
615913
615950
|
try {
|
|
615914
|
-
const ver =
|
|
615951
|
+
const ver = execSync53(`"${nvimDest}" --version`, { encoding: "utf8", stdio: "pipe", timeout: 5e3 }).split("\n")[0];
|
|
615915
615952
|
console.log(` Installed: ${ver}`);
|
|
615916
615953
|
} catch {
|
|
615917
615954
|
console.log(" Warning: nvim binary downloaded but may not work (missing FUSE? Try: nvim --appimage-extract)");
|
|
@@ -615926,8 +615963,8 @@ async function ensureNeovim() {
|
|
|
615926
615963
|
if (hasCmd("brew")) {
|
|
615927
615964
|
console.log(" Installing Neovim via Homebrew...");
|
|
615928
615965
|
try {
|
|
615929
|
-
|
|
615930
|
-
const nvimPath =
|
|
615966
|
+
execSync53("brew install neovim", { stdio: "inherit", timeout: 12e4 });
|
|
615967
|
+
const nvimPath = execSync53("which nvim", { encoding: "utf8", stdio: "pipe", timeout: 3e3 }).trim();
|
|
615931
615968
|
return nvimPath || null;
|
|
615932
615969
|
} catch {
|
|
615933
615970
|
console.log(" brew install neovim failed.");
|
|
@@ -615941,7 +615978,7 @@ async function ensureNeovim() {
|
|
|
615941
615978
|
if (hasCmd("choco")) {
|
|
615942
615979
|
console.log(" Installing Neovim via Chocolatey...");
|
|
615943
615980
|
try {
|
|
615944
|
-
|
|
615981
|
+
execSync53("choco install neovim -y", { stdio: "inherit", timeout: 12e4 });
|
|
615945
615982
|
return "nvim";
|
|
615946
615983
|
} catch {
|
|
615947
615984
|
console.log(" choco install neovim failed.");
|
|
@@ -615950,7 +615987,7 @@ async function ensureNeovim() {
|
|
|
615950
615987
|
if (hasCmd("winget")) {
|
|
615951
615988
|
console.log(" Installing Neovim via winget...");
|
|
615952
615989
|
try {
|
|
615953
|
-
|
|
615990
|
+
execSync53("winget install Neovim.Neovim --accept-source-agreements --accept-package-agreements", {
|
|
615954
615991
|
stdio: "inherit",
|
|
615955
615992
|
timeout: 12e4
|
|
615956
615993
|
});
|
|
@@ -620019,7 +620056,7 @@ var init_audio_waveform = __esm({
|
|
|
620019
620056
|
import { existsSync as existsSync118, unlinkSync as unlinkSync23 } from "node:fs";
|
|
620020
620057
|
import { tmpdir as tmpdir20 } from "node:os";
|
|
620021
620058
|
import { join as join131 } from "node:path";
|
|
620022
|
-
import { execSync as
|
|
620059
|
+
import { execSync as execSync54 } from "node:child_process";
|
|
620023
620060
|
function isNeovimActive() {
|
|
620024
620061
|
return _state2 !== null && !_state2.cleanedUp;
|
|
620025
620062
|
}
|
|
@@ -620036,7 +620073,7 @@ async function startNeovimMode(opts) {
|
|
|
620036
620073
|
}
|
|
620037
620074
|
let nvimPath;
|
|
620038
620075
|
try {
|
|
620039
|
-
nvimPath =
|
|
620076
|
+
nvimPath = execSync54("which nvim 2>/dev/null", { encoding: "utf8" }).trim();
|
|
620040
620077
|
if (!nvimPath) throw new Error();
|
|
620041
620078
|
} catch {
|
|
620042
620079
|
const installed = await ensureNeovim();
|
|
@@ -620718,8 +620755,8 @@ async function forceKillDaemon(port) {
|
|
|
620718
620755
|
}
|
|
620719
620756
|
}
|
|
620720
620757
|
try {
|
|
620721
|
-
const { execSync:
|
|
620722
|
-
const out =
|
|
620758
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
620759
|
+
const out = execSync63(
|
|
620723
620760
|
`lsof -ti :${p2} 2>/dev/null || fuser ${p2}/tcp 2>/dev/null || true`,
|
|
620724
620761
|
{ encoding: "utf8", timeout: 3e3 }
|
|
620725
620762
|
).trim();
|
|
@@ -623596,7 +623633,7 @@ import {
|
|
|
623596
623633
|
import { join as join137, dirname as dirname42, resolve as resolve57 } from "node:path";
|
|
623597
623634
|
import { homedir as homedir46, tmpdir as tmpdir21, platform as platform6 } from "node:os";
|
|
623598
623635
|
import {
|
|
623599
|
-
execSync as
|
|
623636
|
+
execSync as execSync55,
|
|
623600
623637
|
spawn as nodeSpawn
|
|
623601
623638
|
} from "node:child_process";
|
|
623602
623639
|
import { createRequire as createRequire6 } from "node:module";
|
|
@@ -625943,7 +625980,7 @@ except Exception as exc:
|
|
|
625943
625980
|
}
|
|
625944
625981
|
for (const player of ["paplay", "pw-play", "aplay"]) {
|
|
625945
625982
|
try {
|
|
625946
|
-
|
|
625983
|
+
execSync55(`which ${player}`, { stdio: "pipe" });
|
|
625947
625984
|
return [player, path12];
|
|
625948
625985
|
} catch {
|
|
625949
625986
|
}
|
|
@@ -626121,7 +626158,7 @@ except Exception as exc:
|
|
|
626121
626158
|
return false;
|
|
626122
626159
|
}
|
|
626123
626160
|
try {
|
|
626124
|
-
|
|
626161
|
+
execSync55(`${JSON.stringify(venvPy)} -c "import supertonic"`, {
|
|
626125
626162
|
stdio: "pipe",
|
|
626126
626163
|
timeout: 1e4
|
|
626127
626164
|
});
|
|
@@ -626253,7 +626290,7 @@ except Exception as exc:
|
|
|
626253
626290
|
if (this.python3Path) return this.python3Path;
|
|
626254
626291
|
for (const bin of ["python3", "python"]) {
|
|
626255
626292
|
try {
|
|
626256
|
-
const path12 =
|
|
626293
|
+
const path12 = execSync55(`which ${bin}`, { stdio: "pipe", timeout: 5e3 }).toString().trim();
|
|
626257
626294
|
if (path12) {
|
|
626258
626295
|
this.python3Path = path12;
|
|
626259
626296
|
return path12;
|
|
@@ -626317,7 +626354,7 @@ except Exception as exc:
|
|
|
626317
626354
|
return false;
|
|
626318
626355
|
}
|
|
626319
626356
|
try {
|
|
626320
|
-
|
|
626357
|
+
execSync55(`${py} -c "import mlx_audio"`, {
|
|
626321
626358
|
stdio: "pipe",
|
|
626322
626359
|
timeout: 1e4
|
|
626323
626360
|
});
|
|
@@ -626386,14 +626423,14 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
626386
626423
|
`tts_gen.main(["--model", ${JSON.stringify(mlxModelId)}, "--text", text, "--voice", ${JSON.stringify(mlxVoice)}, "--lang_code", ${JSON.stringify(mlxLangCode)}, "--audio_path", ${JSON.stringify(wavPath)}])`
|
|
626387
626424
|
].join("; ");
|
|
626388
626425
|
try {
|
|
626389
|
-
|
|
626426
|
+
execSync55(
|
|
626390
626427
|
`${py} -c ${JSON.stringify(pyScript)} ${JSON.stringify(JSON.stringify(cleaned))}`,
|
|
626391
626428
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
626392
626429
|
);
|
|
626393
626430
|
} catch (err) {
|
|
626394
626431
|
try {
|
|
626395
626432
|
const safeText = cleaned.replace(/'/g, "'\\''");
|
|
626396
|
-
|
|
626433
|
+
execSync55(
|
|
626397
626434
|
`${py} -m mlx_audio.tts.generate --model ${mlxModelId} --text '${safeText}' --voice ${mlxVoice} --lang_code ${mlxLangCode} --audio_path ${JSON.stringify(wavPath)}`,
|
|
626398
626435
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
626399
626436
|
);
|
|
@@ -626467,14 +626504,14 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
626467
626504
|
`tts_gen.main(["--model", ${JSON.stringify(mlxModelId)}, "--text", text, "--voice", ${JSON.stringify(mlxVoice)}, "--lang_code", ${JSON.stringify(mlxLangCode)}, "--audio_path", ${JSON.stringify(wavPath)}])`
|
|
626468
626505
|
].join("; ");
|
|
626469
626506
|
try {
|
|
626470
|
-
|
|
626507
|
+
execSync55(
|
|
626471
626508
|
`${py} -c ${JSON.stringify(pyScript)} ${JSON.stringify(JSON.stringify(cleaned))}`,
|
|
626472
626509
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
626473
626510
|
);
|
|
626474
626511
|
} catch {
|
|
626475
626512
|
try {
|
|
626476
626513
|
const safeText = cleaned.replace(/'/g, "'\\''");
|
|
626477
|
-
|
|
626514
|
+
execSync55(
|
|
626478
626515
|
`${py} -m mlx_audio.tts.generate --model ${mlxModelId} --text '${safeText}' --voice ${mlxVoice} --lang_code ${mlxLangCode} --audio_path ${JSON.stringify(wavPath)}`,
|
|
626479
626516
|
{ stdio: "pipe", timeout: 6e4, cwd: tmpdir21() }
|
|
626480
626517
|
);
|
|
@@ -626770,11 +626807,11 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
626770
626807
|
...isJetson ? (() => {
|
|
626771
626808
|
let jpVer = "v60";
|
|
626772
626809
|
try {
|
|
626773
|
-
const tegra = existsSync125("/etc/nv_tegra_release") ?
|
|
626810
|
+
const tegra = existsSync125("/etc/nv_tegra_release") ? execSync55("cat /etc/nv_tegra_release 2>/dev/null", {
|
|
626774
626811
|
encoding: "utf8",
|
|
626775
626812
|
timeout: 3e3
|
|
626776
626813
|
}).trim() : "";
|
|
626777
|
-
const dpkg =
|
|
626814
|
+
const dpkg = execSync55(
|
|
626778
626815
|
"dpkg -l nvidia-jetpack 2>/dev/null | grep nvidia-jetpack | awk '{print $3}'",
|
|
626779
626816
|
{ encoding: "utf8", timeout: 5e3 }
|
|
626780
626817
|
).trim();
|
|
@@ -632310,10 +632347,10 @@ The session corrections MUST become hard rules in the SKILL.md Rules section.`;
|
|
|
632310
632347
|
"Requesting sudo to migrate daemon to current user and restart..."
|
|
632311
632348
|
);
|
|
632312
632349
|
const nodeBin = process.execPath;
|
|
632313
|
-
const { execSync:
|
|
632350
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
632314
632351
|
let npmRoot = "";
|
|
632315
632352
|
try {
|
|
632316
|
-
npmRoot =
|
|
632353
|
+
npmRoot = execSync63("npm root -g", { encoding: "utf8" }).trim();
|
|
632317
632354
|
} catch {
|
|
632318
632355
|
}
|
|
632319
632356
|
const launcher = npmRoot ? `${npmRoot}/omnius/dist/launcher.cjs` : "";
|
|
@@ -640896,7 +640933,7 @@ async function handleBroker(arg, _ctx) {
|
|
|
640896
640933
|
);
|
|
640897
640934
|
}
|
|
640898
640935
|
async function handleParallel(arg, ctx3) {
|
|
640899
|
-
const { execSync:
|
|
640936
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
640900
640937
|
const baseUrl = ctx3.config.backendUrl || "http://localhost:11434";
|
|
640901
640938
|
const isRemote = ctx3.config.backendType === "nexus";
|
|
640902
640939
|
if (isRemote) {
|
|
@@ -640928,7 +640965,7 @@ async function handleParallel(arg, ctx3) {
|
|
|
640928
640965
|
}
|
|
640929
640966
|
let systemdVal = "";
|
|
640930
640967
|
try {
|
|
640931
|
-
const out =
|
|
640968
|
+
const out = execSync63(
|
|
640932
640969
|
"systemctl show ollama.service -p Environment 2>/dev/null || true",
|
|
640933
640970
|
{ encoding: "utf8" }
|
|
640934
640971
|
);
|
|
@@ -640963,7 +641000,7 @@ async function handleParallel(arg, ctx3) {
|
|
|
640963
641000
|
}
|
|
640964
641001
|
const isSystemd = (() => {
|
|
640965
641002
|
try {
|
|
640966
|
-
const out =
|
|
641003
|
+
const out = execSync63("systemctl is-active ollama.service 2>/dev/null", {
|
|
640967
641004
|
encoding: "utf8"
|
|
640968
641005
|
}).trim();
|
|
640969
641006
|
return out === "active" || out === "inactive";
|
|
@@ -643264,13 +643301,13 @@ async function showExposeDashboard(gateway, rl, ctx3) {
|
|
|
643264
643301
|
const cmd = `/endpoint ${id} --auth ${gateway.authKey ?? ""}`;
|
|
643265
643302
|
let copied = false;
|
|
643266
643303
|
try {
|
|
643267
|
-
const { execSync:
|
|
643304
|
+
const { execSync: execSync63 } = __require("node:child_process");
|
|
643268
643305
|
const platform7 = process.platform;
|
|
643269
643306
|
if (platform7 === "darwin") {
|
|
643270
|
-
|
|
643307
|
+
execSync63("pbcopy", { input: cmd, timeout: 3e3 });
|
|
643271
643308
|
copied = true;
|
|
643272
643309
|
} else if (platform7 === "win32") {
|
|
643273
|
-
|
|
643310
|
+
execSync63("clip", { input: cmd, timeout: 3e3 });
|
|
643274
643311
|
copied = true;
|
|
643275
643312
|
} else {
|
|
643276
643313
|
for (const tool of [
|
|
@@ -643279,7 +643316,7 @@ async function showExposeDashboard(gateway, rl, ctx3) {
|
|
|
643279
643316
|
"wl-copy"
|
|
643280
643317
|
]) {
|
|
643281
643318
|
try {
|
|
643282
|
-
|
|
643319
|
+
execSync63(tool, {
|
|
643283
643320
|
input: cmd,
|
|
643284
643321
|
timeout: 3e3,
|
|
643285
643322
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -643669,7 +643706,7 @@ var init_commands = __esm({
|
|
|
643669
643706
|
// packages/cli/src/tui/project-context.ts
|
|
643670
643707
|
import { existsSync as existsSync127, readFileSync as readFileSync104, readdirSync as readdirSync43, mkdirSync as mkdirSync74, writeFileSync as writeFileSync65 } from "node:fs";
|
|
643671
643708
|
import { join as join139, basename as basename26 } from "node:path";
|
|
643672
|
-
import { execSync as
|
|
643709
|
+
import { execSync as execSync56 } from "node:child_process";
|
|
643673
643710
|
import { homedir as homedir48 } from "node:os";
|
|
643674
643711
|
function projectContextUrlSpanAt(text2, index) {
|
|
643675
643712
|
PROJECT_CONTEXT_URL_RE.lastIndex = 0;
|
|
@@ -643728,18 +643765,18 @@ function loadProjectMap(repoRoot) {
|
|
|
643728
643765
|
}
|
|
643729
643766
|
function getGitInfo(repoRoot) {
|
|
643730
643767
|
try {
|
|
643731
|
-
|
|
643768
|
+
execSync56("git rev-parse --is-inside-work-tree", { cwd: repoRoot, stdio: "pipe" });
|
|
643732
643769
|
} catch {
|
|
643733
643770
|
return "";
|
|
643734
643771
|
}
|
|
643735
643772
|
const lines = [];
|
|
643736
643773
|
try {
|
|
643737
|
-
const branch =
|
|
643774
|
+
const branch = execSync56("git branch --show-current", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
643738
643775
|
if (branch) lines.push(`Branch: ${branch}`);
|
|
643739
643776
|
} catch {
|
|
643740
643777
|
}
|
|
643741
643778
|
try {
|
|
643742
|
-
const status =
|
|
643779
|
+
const status = execSync56("git status --porcelain", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
643743
643780
|
if (status) {
|
|
643744
643781
|
const changed = status.split("\n").length;
|
|
643745
643782
|
lines.push(`Working tree: ${changed} changed file(s)`);
|
|
@@ -643749,7 +643786,7 @@ function getGitInfo(repoRoot) {
|
|
|
643749
643786
|
} catch {
|
|
643750
643787
|
}
|
|
643751
643788
|
try {
|
|
643752
|
-
const log22 =
|
|
643789
|
+
const log22 = execSync56("git log --oneline -5 --no-decorate", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
643753
643790
|
if (log22) lines.push(`Recent commits:
|
|
643754
643791
|
${log22}`);
|
|
643755
643792
|
} catch {
|
|
@@ -648069,7 +648106,7 @@ var init_promptLoader3 = __esm({
|
|
|
648069
648106
|
// packages/cli/src/tui/dream-engine.ts
|
|
648070
648107
|
import { mkdirSync as mkdirSync80, writeFileSync as writeFileSync69, readFileSync as readFileSync110, existsSync as existsSync134, readdirSync as readdirSync47 } from "node:fs";
|
|
648071
648108
|
import { join as join147, basename as basename32 } from "node:path";
|
|
648072
|
-
import { execSync as
|
|
648109
|
+
import { execSync as execSync57 } from "node:child_process";
|
|
648073
648110
|
function setDreamWriteContent(fn) {
|
|
648074
648111
|
_dreamWriteContent = fn;
|
|
648075
648112
|
}
|
|
@@ -648442,7 +648479,7 @@ var init_dream_engine = __esm({
|
|
|
648442
648479
|
}
|
|
648443
648480
|
}
|
|
648444
648481
|
try {
|
|
648445
|
-
const output =
|
|
648482
|
+
const output = execSync57(cmd, {
|
|
648446
648483
|
cwd: this.repoRoot,
|
|
648447
648484
|
timeout: 3e4,
|
|
648448
648485
|
encoding: "utf-8",
|
|
@@ -649419,17 +649456,17 @@ ${summary}` };
|
|
|
649419
649456
|
try {
|
|
649420
649457
|
mkdirSync80(checkpointDir3, { recursive: true });
|
|
649421
649458
|
try {
|
|
649422
|
-
const gitStatus =
|
|
649459
|
+
const gitStatus = execSync57("git status --porcelain", {
|
|
649423
649460
|
cwd: this.repoRoot,
|
|
649424
649461
|
encoding: "utf-8",
|
|
649425
649462
|
timeout: 1e4
|
|
649426
649463
|
});
|
|
649427
|
-
const gitDiff =
|
|
649464
|
+
const gitDiff = execSync57("git diff", {
|
|
649428
649465
|
cwd: this.repoRoot,
|
|
649429
649466
|
encoding: "utf-8",
|
|
649430
649467
|
timeout: 1e4
|
|
649431
649468
|
});
|
|
649432
|
-
const gitHash =
|
|
649469
|
+
const gitHash = execSync57("git rev-parse HEAD 2>/dev/null || echo 'no-git'", {
|
|
649433
649470
|
cwd: this.repoRoot,
|
|
649434
649471
|
encoding: "utf-8",
|
|
649435
649472
|
timeout: 5e3
|
|
@@ -677802,7 +677839,7 @@ __export(aiwg_exports, {
|
|
|
677802
677839
|
import { existsSync as existsSync145, readFileSync as readFileSync120, readdirSync as readdirSync52, statSync as statSync52 } from "node:fs";
|
|
677803
677840
|
import { join as join157 } from "node:path";
|
|
677804
677841
|
import { homedir as homedir53 } from "node:os";
|
|
677805
|
-
import { execSync as
|
|
677842
|
+
import { execSync as execSync58 } from "node:child_process";
|
|
677806
677843
|
function resolveAiwgRoot() {
|
|
677807
677844
|
if (_cachedAiwgRoot !== void 0) return _cachedAiwgRoot;
|
|
677808
677845
|
const envRoot = process.env["OMNIUS_AIWG_ROOT"];
|
|
@@ -677816,7 +677853,7 @@ function resolveAiwgRoot() {
|
|
|
677816
677853
|
return shareDir;
|
|
677817
677854
|
}
|
|
677818
677855
|
try {
|
|
677819
|
-
const globalRoot =
|
|
677856
|
+
const globalRoot = execSync58("npm root -g", {
|
|
677820
677857
|
encoding: "utf-8",
|
|
677821
677858
|
timeout: 5e3,
|
|
677822
677859
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -677858,7 +677895,7 @@ function resolveAiwgRoot() {
|
|
|
677858
677895
|
}
|
|
677859
677896
|
}
|
|
677860
677897
|
try {
|
|
677861
|
-
const whichAiwg =
|
|
677898
|
+
const whichAiwg = execSync58("which aiwg 2>/dev/null || where aiwg 2>nul", {
|
|
677862
677899
|
encoding: "utf-8",
|
|
677863
677900
|
timeout: 3e3,
|
|
677864
677901
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -680746,9 +680783,9 @@ function resolveLocalPeerId() {
|
|
|
680746
680783
|
}
|
|
680747
680784
|
let scanResult = null;
|
|
680748
680785
|
try {
|
|
680749
|
-
const { execSync:
|
|
680786
|
+
const { execSync: execSync63 } = __require("node:child_process");
|
|
680750
680787
|
const cmd = `find "${homedir56()}" -maxdepth 4 -path '*/.omnius/nexus/status.json' -type f 2>/dev/null | head -50`;
|
|
680751
|
-
const out =
|
|
680788
|
+
const out = execSync63(cmd, { encoding: "utf-8", timeout: 2e3 }).trim();
|
|
680752
680789
|
for (const line of out.split("\n")) {
|
|
680753
680790
|
const f2 = line.trim();
|
|
680754
680791
|
if (!f2) continue;
|
|
@@ -680778,8 +680815,8 @@ function locateTorScript(filename) {
|
|
|
680778
680815
|
if (existsSync149(p2)) return p2;
|
|
680779
680816
|
}
|
|
680780
680817
|
try {
|
|
680781
|
-
const { execSync:
|
|
680782
|
-
const root =
|
|
680818
|
+
const { execSync: execSync63 } = __require("node:child_process");
|
|
680819
|
+
const root = execSync63("npm root -g", { encoding: "utf-8", timeout: 5e3 }).trim();
|
|
680783
680820
|
const p2 = join161(root, "omnius", "dist", "scripts", "tor", filename);
|
|
680784
680821
|
if (existsSync149(p2)) return p2;
|
|
680785
680822
|
} catch {
|
|
@@ -692001,7 +692038,7 @@ var init_usage_tracker = __esm({
|
|
|
692001
692038
|
});
|
|
692002
692039
|
|
|
692003
692040
|
// packages/cli/src/docker.ts
|
|
692004
|
-
import { execSync as
|
|
692041
|
+
import { execSync as execSync59, spawn as spawn32 } from "node:child_process";
|
|
692005
692042
|
import { existsSync as existsSync151, mkdirSync as mkdirSync94, writeFileSync as writeFileSync81 } from "node:fs";
|
|
692006
692043
|
import { join as join163, resolve as resolve64, dirname as dirname48 } from "node:path";
|
|
692007
692044
|
import { homedir as homedir57 } from "node:os";
|
|
@@ -692022,7 +692059,7 @@ function getDockerDir() {
|
|
|
692022
692059
|
}
|
|
692023
692060
|
function isDockerAvailable() {
|
|
692024
692061
|
try {
|
|
692025
|
-
|
|
692062
|
+
execSync59("docker info", { stdio: "pipe", timeout: 1e4 });
|
|
692026
692063
|
return true;
|
|
692027
692064
|
} catch {
|
|
692028
692065
|
return false;
|
|
@@ -692030,7 +692067,7 @@ function isDockerAvailable() {
|
|
|
692030
692067
|
}
|
|
692031
692068
|
function isDockerInstalled() {
|
|
692032
692069
|
try {
|
|
692033
|
-
|
|
692070
|
+
execSync59("docker --version", { stdio: "pipe", timeout: 5e3 });
|
|
692034
692071
|
return true;
|
|
692035
692072
|
} catch {
|
|
692036
692073
|
return false;
|
|
@@ -692055,31 +692092,31 @@ async function ensureDocker() {
|
|
|
692055
692092
|
}
|
|
692056
692093
|
try {
|
|
692057
692094
|
console.log("[omnius-docker] Docker not found. Installing via get.docker.com...");
|
|
692058
|
-
|
|
692095
|
+
execSync59("curl -fsSL https://get.docker.com | sh", {
|
|
692059
692096
|
stdio: "inherit",
|
|
692060
692097
|
timeout: 3e5
|
|
692061
692098
|
});
|
|
692062
692099
|
const user = process.env["USER"] || process.env["LOGNAME"];
|
|
692063
692100
|
if (user) {
|
|
692064
692101
|
try {
|
|
692065
|
-
|
|
692102
|
+
execSync59(`sudo usermod -aG docker ${user}`, { stdio: "pipe" });
|
|
692066
692103
|
} catch {
|
|
692067
692104
|
}
|
|
692068
692105
|
}
|
|
692069
692106
|
try {
|
|
692070
|
-
|
|
692107
|
+
execSync59("sudo systemctl start docker", { stdio: "pipe", timeout: 15e3 });
|
|
692071
692108
|
} catch {
|
|
692072
692109
|
}
|
|
692073
692110
|
try {
|
|
692074
|
-
|
|
692075
|
-
const runtimes =
|
|
692111
|
+
execSync59("nvidia-smi", { stdio: "pipe", timeout: 5e3 });
|
|
692112
|
+
const runtimes = execSync59("docker info --format '{{json .Runtimes}}'", {
|
|
692076
692113
|
stdio: "pipe",
|
|
692077
692114
|
timeout: 5e3
|
|
692078
692115
|
}).toString();
|
|
692079
692116
|
if (!runtimes.includes("nvidia")) {
|
|
692080
692117
|
console.log("[omnius-docker] NVIDIA GPU detected. Installing nvidia-container-toolkit...");
|
|
692081
692118
|
try {
|
|
692082
|
-
|
|
692119
|
+
execSync59(`
|
|
692083
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
|
|
692084
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
|
|
692085
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 )
|
|
@@ -692109,7 +692146,7 @@ async function ensureDocker() {
|
|
|
692109
692146
|
}
|
|
692110
692147
|
async function ensureNvidiaToolkit() {
|
|
692111
692148
|
try {
|
|
692112
|
-
|
|
692149
|
+
execSync59("nvidia-smi --query-gpu=name --format=csv,noheader", { stdio: "pipe", timeout: 5e3 });
|
|
692113
692150
|
} catch {
|
|
692114
692151
|
return { ok: false, message: "No NVIDIA GPU detected (nvidia-smi not found)" };
|
|
692115
692152
|
}
|
|
@@ -692120,7 +692157,7 @@ async function ensureNvidiaToolkit() {
|
|
|
692120
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" };
|
|
692121
692158
|
}
|
|
692122
692159
|
try {
|
|
692123
|
-
|
|
692160
|
+
execSync59(`
|
|
692124
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
|
|
692125
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
|
|
692126
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 )
|
|
@@ -692134,7 +692171,7 @@ async function ensureNvidiaToolkit() {
|
|
|
692134
692171
|
}
|
|
692135
692172
|
function isOmniusImageBuilt() {
|
|
692136
692173
|
try {
|
|
692137
|
-
const out =
|
|
692174
|
+
const out = execSync59(`docker images -q ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG}`, {
|
|
692138
692175
|
stdio: "pipe",
|
|
692139
692176
|
timeout: 5e3
|
|
692140
692177
|
}).toString().trim();
|
|
@@ -692158,7 +692195,7 @@ async function ensureOmniusImage(force = false) {
|
|
|
692158
692195
|
}
|
|
692159
692196
|
try {
|
|
692160
692197
|
console.log(`[omnius-docker] Building image ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG}...`);
|
|
692161
|
-
|
|
692198
|
+
execSync59(`docker build -t ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG} ${buildContext}`, {
|
|
692162
692199
|
stdio: "inherit",
|
|
692163
692200
|
timeout: 6e5
|
|
692164
692201
|
// 10 min
|
|
@@ -692232,11 +692269,11 @@ exec "$@"
|
|
|
692232
692269
|
}
|
|
692233
692270
|
function hasNvidiaGpu() {
|
|
692234
692271
|
try {
|
|
692235
|
-
|
|
692272
|
+
execSync59("nvidia-smi --query-gpu=name --format=csv,noheader", {
|
|
692236
692273
|
stdio: "pipe",
|
|
692237
692274
|
timeout: 5e3
|
|
692238
692275
|
});
|
|
692239
|
-
const runtimes =
|
|
692276
|
+
const runtimes = execSync59("docker info --format '{{json .Runtimes}}'", {
|
|
692240
692277
|
stdio: "pipe",
|
|
692241
692278
|
timeout: 5e3
|
|
692242
692279
|
}).toString();
|
|
@@ -692485,7 +692522,7 @@ import { createRequire as createRequire7 } from "node:module";
|
|
|
692485
692522
|
import { fileURLToPath as fileURLToPath19 } from "node:url";
|
|
692486
692523
|
import { dirname as dirname49, join as join165, resolve as resolve65 } from "node:path";
|
|
692487
692524
|
import { homedir as homedir58 } from "node:os";
|
|
692488
|
-
import { spawn as spawn33, execSync as
|
|
692525
|
+
import { spawn as spawn33, execSync as execSync60 } from "node:child_process";
|
|
692489
692526
|
import {
|
|
692490
692527
|
mkdirSync as mkdirSync95,
|
|
692491
692528
|
writeFileSync as writeFileSync82,
|
|
@@ -696806,7 +696843,7 @@ function handleV1RunsDelete(res, id) {
|
|
|
696806
696843
|
const containerName = `omnius-${id}`;
|
|
696807
696844
|
if (job.sandbox === "container") {
|
|
696808
696845
|
try {
|
|
696809
|
-
|
|
696846
|
+
execSync60(`docker stop ${containerName}`, {
|
|
696810
696847
|
timeout: 5e3,
|
|
696811
696848
|
stdio: "ignore"
|
|
696812
696849
|
});
|
|
@@ -699135,8 +699172,8 @@ data: ${JSON.stringify(data)}
|
|
|
699135
699172
|
}
|
|
699136
699173
|
setImmediate(() => {
|
|
699137
699174
|
try {
|
|
699138
|
-
const { execSync:
|
|
699139
|
-
|
|
699175
|
+
const { execSync: execSync63 } = require4("node:child_process");
|
|
699176
|
+
execSync63("npm update -g omnius 2>/dev/null || true", {
|
|
699140
699177
|
stdio: "pipe"
|
|
699141
699178
|
});
|
|
699142
699179
|
} catch {
|
|
@@ -699179,7 +699216,7 @@ data: ${JSON.stringify(data)}
|
|
|
699179
699216
|
return;
|
|
699180
699217
|
}
|
|
699181
699218
|
try {
|
|
699182
|
-
const { execSync:
|
|
699219
|
+
const { execSync: execSync63 } = require4("node:child_process");
|
|
699183
699220
|
let audioPath = null;
|
|
699184
699221
|
const ttsCmds = [
|
|
699185
699222
|
`espeak "${text2}" -w /tmp/tts_${Date.now()}.wav 2>/dev/null`,
|
|
@@ -699188,7 +699225,7 @@ data: ${JSON.stringify(data)}
|
|
|
699188
699225
|
];
|
|
699189
699226
|
for (const cmd of ttsCmds) {
|
|
699190
699227
|
try {
|
|
699191
|
-
|
|
699228
|
+
execSync63(cmd, { stdio: "pipe" });
|
|
699192
699229
|
audioPath = "/tmp/tts_" + Date.now() + ".wav";
|
|
699193
699230
|
break;
|
|
699194
699231
|
} catch {
|
|
@@ -702612,7 +702649,7 @@ var clipboard_media_exports = {};
|
|
|
702612
702649
|
__export(clipboard_media_exports, {
|
|
702613
702650
|
pasteClipboardImageToFile: () => pasteClipboardImageToFile
|
|
702614
702651
|
});
|
|
702615
|
-
import { execFileSync as execFileSync10, execSync as
|
|
702652
|
+
import { execFileSync as execFileSync10, execSync as execSync61 } from "node:child_process";
|
|
702616
702653
|
import { mkdirSync as mkdirSync96, readFileSync as readFileSync126, rmSync as rmSync12, writeFileSync as writeFileSync83 } from "node:fs";
|
|
702617
702654
|
import { join as join166 } from "node:path";
|
|
702618
702655
|
function pasteClipboardImageToFile(repoRoot) {
|
|
@@ -702627,7 +702664,7 @@ function pasteClipboardImageToFile(repoRoot) {
|
|
|
702627
702664
|
function readClipboardImage() {
|
|
702628
702665
|
if (process.platform === "darwin") {
|
|
702629
702666
|
try {
|
|
702630
|
-
|
|
702667
|
+
execSync61("command -v pngpaste", { stdio: "ignore", timeout: 1e3 });
|
|
702631
702668
|
const tmp = `/tmp/omnius-clipboard-${Date.now()}.png`;
|
|
702632
702669
|
execFileSync10("pngpaste", [tmp], { timeout: 3e3 });
|
|
702633
702670
|
const buffer2 = readFileSync126(tmp);
|
|
@@ -702698,7 +702735,7 @@ import {
|
|
|
702698
702735
|
mkdirSync as mkdirSync97
|
|
702699
702736
|
} from "node:fs";
|
|
702700
702737
|
import { existsSync as existsSync153 } from "node:fs";
|
|
702701
|
-
import { execSync as
|
|
702738
|
+
import { execSync as execSync62 } from "node:child_process";
|
|
702702
702739
|
import { homedir as homedir59 } from "node:os";
|
|
702703
702740
|
function formatTimeAgo2(date) {
|
|
702704
702741
|
const seconds = Math.floor((Date.now() - date.getTime()) / 1e3);
|
|
@@ -702865,9 +702902,9 @@ ${incompleteList}${more}
|
|
|
702865
702902
|
const scripts = pkg.scripts || {};
|
|
702866
702903
|
const checkScript = scripts["typecheck"] ? "typecheck" : scripts["build"] ? "build" : null;
|
|
702867
702904
|
if (checkScript) {
|
|
702868
|
-
const { execSync:
|
|
702905
|
+
const { execSync: execSync63 } = await import("node:child_process");
|
|
702869
702906
|
try {
|
|
702870
|
-
|
|
702907
|
+
execSync63(`npm run ${checkScript} --silent 2>&1`, {
|
|
702871
702908
|
cwd: cwd4,
|
|
702872
702909
|
stdio: "pipe",
|
|
702873
702910
|
timeout: 12e4,
|
|
@@ -710662,7 +710699,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710662
710699
|
try {
|
|
710663
710700
|
if (process.platform === "win32") {
|
|
710664
710701
|
try {
|
|
710665
|
-
|
|
710702
|
+
execSync62(`taskkill /F /PID ${pid}`, {
|
|
710666
710703
|
timeout: 5e3,
|
|
710667
710704
|
stdio: "ignore"
|
|
710668
710705
|
});
|
|
@@ -710694,7 +710731,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710694
710731
|
if (pid > 0) {
|
|
710695
710732
|
if (process.platform === "win32") {
|
|
710696
710733
|
try {
|
|
710697
|
-
|
|
710734
|
+
execSync62(`taskkill /F /PID ${pid}`, {
|
|
710698
710735
|
timeout: 5e3,
|
|
710699
710736
|
stdio: "ignore"
|
|
710700
710737
|
});
|
|
@@ -710714,7 +710751,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710714
710751
|
} catch {
|
|
710715
710752
|
}
|
|
710716
710753
|
try {
|
|
710717
|
-
|
|
710754
|
+
execSync62(
|
|
710718
710755
|
process.platform === "win32" ? "timeout /t 1 /nobreak >nul" : "sleep 0.5",
|
|
710719
710756
|
{ timeout: 3e3, stdio: "ignore" }
|
|
710720
710757
|
);
|
|
@@ -710731,7 +710768,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710731
710768
|
} catch (err) {
|
|
710732
710769
|
if (attempt < 2) {
|
|
710733
710770
|
try {
|
|
710734
|
-
|
|
710771
|
+
execSync62(
|
|
710735
710772
|
process.platform === "win32" ? "timeout /t 1 /nobreak >nul" : "sleep 0.3",
|
|
710736
710773
|
{ timeout: 3e3, stdio: "ignore" }
|
|
710737
710774
|
);
|
|
@@ -710745,7 +710782,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
710745
710782
|
);
|
|
710746
710783
|
if (process.platform === "win32") {
|
|
710747
710784
|
try {
|
|
710748
|
-
|
|
710785
|
+
execSync62(`rd /s /q "${omniusPath}"`, {
|
|
710749
710786
|
timeout: 1e4,
|
|
710750
710787
|
stdio: "ignore"
|
|
710751
710788
|
});
|