omnius 1.0.628 → 1.0.629
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 +811 -705
- package/dist/update-worker.js +196 -165
- package/docs/DISCOVERY.json +79 -7
- package/docs/DISCOVERY.md +2 -2
- package/docs/reference/rest-api.md +1 -1
- package/docs/rest/INDEX.md +1 -1
- package/docs/rest/endpoints/voice-vision.md +20 -1
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5349,8 +5349,12 @@ var init_security_classifier = __esm({
|
|
|
5349
5349
|
match: /^(file_read|file_explore|list_directory|grep_search|glob_find|find_files)$/,
|
|
5350
5350
|
info: LOCAL_READ
|
|
5351
5351
|
},
|
|
5352
|
+
// Advanced OCR can create TXT/CSV/PDF output directories (and batch/debug
|
|
5353
|
+
// artifacts), so it is not a read-only capability even though its primary
|
|
5354
|
+
// input is an image.
|
|
5355
|
+
{ match: /^ocr_image_advanced$/, info: LOCAL_WRITE },
|
|
5352
5356
|
{
|
|
5353
|
-
match: /^(image_read|ocr|ocr_pdf|
|
|
5357
|
+
match: /^(image_read|ocr|ocr_pdf|pdf_to_text|structured_read|read_structured_file)$/,
|
|
5354
5358
|
info: LOCAL_READ
|
|
5355
5359
|
},
|
|
5356
5360
|
{
|
|
@@ -6252,6 +6256,148 @@ function ensureCommand(command) {
|
|
|
6252
6256
|
_cache.set(command, result);
|
|
6253
6257
|
return result;
|
|
6254
6258
|
}
|
|
6259
|
+
function ensureTesseractLanguages(languages) {
|
|
6260
|
+
const normalized3 = (languages.trim() || "eng").toLowerCase();
|
|
6261
|
+
const cacheKey = `tesseract-language:${normalized3}`;
|
|
6262
|
+
const cached2 = _cache.get(cacheKey);
|
|
6263
|
+
if (cached2)
|
|
6264
|
+
return cached2;
|
|
6265
|
+
const requested = [...new Set(normalized3.split("+").map((item) => item.trim()).filter(Boolean))];
|
|
6266
|
+
if (requested.length === 0 || requested.some((item) => !/^[a-z0-9_]+$/i.test(item))) {
|
|
6267
|
+
const result2 = {
|
|
6268
|
+
available: false,
|
|
6269
|
+
installed: false,
|
|
6270
|
+
error: "OCR language must be one or more Tesseract language codes separated by '+', for example eng or eng+fra."
|
|
6271
|
+
};
|
|
6272
|
+
_cache.set(cacheKey, result2);
|
|
6273
|
+
return result2;
|
|
6274
|
+
}
|
|
6275
|
+
const command = ensureCommand("tesseract");
|
|
6276
|
+
if (!command.available) {
|
|
6277
|
+
_cache.set(cacheKey, command);
|
|
6278
|
+
return command;
|
|
6279
|
+
}
|
|
6280
|
+
const availableBefore = listTesseractLanguages();
|
|
6281
|
+
const missing = requested.filter((language) => !availableBefore.has(language));
|
|
6282
|
+
if (missing.length === 0) {
|
|
6283
|
+
const result2 = { available: true, installed: false };
|
|
6284
|
+
_cache.set(cacheKey, result2);
|
|
6285
|
+
return result2;
|
|
6286
|
+
}
|
|
6287
|
+
const pm = detectPackageManager();
|
|
6288
|
+
const packages = tesseractLanguagePackages(pm, missing);
|
|
6289
|
+
if (!packages || packages.length === 0) {
|
|
6290
|
+
const result2 = {
|
|
6291
|
+
available: false,
|
|
6292
|
+
installed: false,
|
|
6293
|
+
error: `Tesseract languages missing: ${missing.join(", ")}. Automatic language-package setup is unsupported on ${pm ?? "this platform"}.`
|
|
6294
|
+
};
|
|
6295
|
+
_cache.set(cacheKey, result2);
|
|
6296
|
+
return result2;
|
|
6297
|
+
}
|
|
6298
|
+
try {
|
|
6299
|
+
runInstall(packageInstallCommand(pm, packages));
|
|
6300
|
+
} catch (error) {
|
|
6301
|
+
const result2 = {
|
|
6302
|
+
available: false,
|
|
6303
|
+
installed: false,
|
|
6304
|
+
error: `Failed to auto-install Tesseract language data (${missing.join(", ")}): ${error instanceof Error ? error.message.slice(0, 300) : String(error).slice(0, 300)}`
|
|
6305
|
+
};
|
|
6306
|
+
_cache.set(cacheKey, result2);
|
|
6307
|
+
return result2;
|
|
6308
|
+
}
|
|
6309
|
+
const availableAfter = listTesseractLanguages();
|
|
6310
|
+
const stillMissing = requested.filter((language) => !availableAfter.has(language));
|
|
6311
|
+
const result = stillMissing.length === 0 ? { available: true, installed: true } : {
|
|
6312
|
+
available: false,
|
|
6313
|
+
installed: true,
|
|
6314
|
+
error: `Installed Tesseract language packages but traineddata is still unavailable: ${stillMissing.join(", ")}.`
|
|
6315
|
+
};
|
|
6316
|
+
_cache.set(cacheKey, result);
|
|
6317
|
+
return result;
|
|
6318
|
+
}
|
|
6319
|
+
function listTesseractLanguages() {
|
|
6320
|
+
try {
|
|
6321
|
+
const output2 = execSync3("tesseract --list-langs", {
|
|
6322
|
+
encoding: "utf8",
|
|
6323
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
6324
|
+
timeout: 15e3
|
|
6325
|
+
});
|
|
6326
|
+
return new Set(output2.split(/\r?\n/).map((line) => line.trim()).filter((line) => /^[a-z0-9_]+$/i.test(line)));
|
|
6327
|
+
} catch {
|
|
6328
|
+
return /* @__PURE__ */ new Set();
|
|
6329
|
+
}
|
|
6330
|
+
}
|
|
6331
|
+
function tesseractLanguagePackages(pm, languages) {
|
|
6332
|
+
if (!pm)
|
|
6333
|
+
return null;
|
|
6334
|
+
switch (pm) {
|
|
6335
|
+
case "apt":
|
|
6336
|
+
return languages.map((language) => language === "osd" ? "tesseract-ocr-osd" : `tesseract-ocr-${language.replace(/_/g, "-")}`);
|
|
6337
|
+
case "dnf":
|
|
6338
|
+
return languages.map((language) => language === "osd" ? "tesseract-osd" : `tesseract-langpack-${language}`);
|
|
6339
|
+
case "pacman":
|
|
6340
|
+
return languages.map((language) => language === "osd" ? "tesseract-data-osd" : `tesseract-data-${language}`);
|
|
6341
|
+
// Homebrew and Chocolatey package the core language set differently. Do
|
|
6342
|
+
// not pretend a package exists; return an actionable verified failure.
|
|
6343
|
+
case "brew":
|
|
6344
|
+
case "choco":
|
|
6345
|
+
return null;
|
|
6346
|
+
}
|
|
6347
|
+
}
|
|
6348
|
+
function ensureJetsonOcrPythonPackages() {
|
|
6349
|
+
const cacheKey = "jetson-ocr-python";
|
|
6350
|
+
const cached2 = _cache.get(cacheKey);
|
|
6351
|
+
if (cached2)
|
|
6352
|
+
return cached2;
|
|
6353
|
+
const pm = detectPackageManager();
|
|
6354
|
+
if (pm !== "apt") {
|
|
6355
|
+
const result = {
|
|
6356
|
+
available: false,
|
|
6357
|
+
installed: false,
|
|
6358
|
+
error: `Jetson OCR system-package setup requires apt; detected ${pm ?? "no supported package manager"}.`
|
|
6359
|
+
};
|
|
6360
|
+
_cache.set(cacheKey, result);
|
|
6361
|
+
return result;
|
|
6362
|
+
}
|
|
6363
|
+
const packages = [
|
|
6364
|
+
"python3-venv",
|
|
6365
|
+
"python3-opencv",
|
|
6366
|
+
"python3-numpy",
|
|
6367
|
+
"python3-pil",
|
|
6368
|
+
"python3-pytesseract",
|
|
6369
|
+
"python3-reportlab"
|
|
6370
|
+
];
|
|
6371
|
+
try {
|
|
6372
|
+
runInstall(packageInstallCommand(pm, packages));
|
|
6373
|
+
const result = { available: true, installed: true };
|
|
6374
|
+
_cache.set(cacheKey, result);
|
|
6375
|
+
return result;
|
|
6376
|
+
} catch (error) {
|
|
6377
|
+
const result = {
|
|
6378
|
+
available: false,
|
|
6379
|
+
installed: false,
|
|
6380
|
+
error: `Could not auto-install Jetson OCR Python packages: ${error instanceof Error ? error.message.slice(0, 300) : String(error).slice(0, 300)}`
|
|
6381
|
+
};
|
|
6382
|
+
_cache.set(cacheKey, result);
|
|
6383
|
+
return result;
|
|
6384
|
+
}
|
|
6385
|
+
}
|
|
6386
|
+
function packageInstallCommand(pm, packages) {
|
|
6387
|
+
const joined = packages.join(" ");
|
|
6388
|
+
switch (pm) {
|
|
6389
|
+
case "apt":
|
|
6390
|
+
return `apt-get install -y ${joined}`;
|
|
6391
|
+
case "dnf":
|
|
6392
|
+
return `dnf install -y ${joined}`;
|
|
6393
|
+
case "pacman":
|
|
6394
|
+
return `pacman -S --noconfirm ${joined}`;
|
|
6395
|
+
case "brew":
|
|
6396
|
+
return `brew install ${joined}`;
|
|
6397
|
+
case "choco":
|
|
6398
|
+
return `choco install -y ${joined}`;
|
|
6399
|
+
}
|
|
6400
|
+
}
|
|
6255
6401
|
function repairCommandPackage(command) {
|
|
6256
6402
|
const dep = DESKTOP_DEPS.find((d2) => d2.command === command);
|
|
6257
6403
|
if (!dep) {
|
|
@@ -7329,7 +7475,7 @@ function extractRecursiveRmTargets(command) {
|
|
|
7329
7475
|
function splitExecutableShellSegments(command) {
|
|
7330
7476
|
const segments = [];
|
|
7331
7477
|
let current = "";
|
|
7332
|
-
let
|
|
7478
|
+
let quote = null;
|
|
7333
7479
|
let escaped = false;
|
|
7334
7480
|
const flush3 = () => {
|
|
7335
7481
|
if (current.trim())
|
|
@@ -7343,19 +7489,19 @@ function splitExecutableShellSegments(command) {
|
|
|
7343
7489
|
escaped = false;
|
|
7344
7490
|
continue;
|
|
7345
7491
|
}
|
|
7346
|
-
if (ch === "\\" &&
|
|
7492
|
+
if (ch === "\\" && quote !== "'") {
|
|
7347
7493
|
current += ch;
|
|
7348
7494
|
escaped = true;
|
|
7349
7495
|
continue;
|
|
7350
7496
|
}
|
|
7351
|
-
if (
|
|
7497
|
+
if (quote) {
|
|
7352
7498
|
current += ch;
|
|
7353
|
-
if (ch ===
|
|
7354
|
-
|
|
7499
|
+
if (ch === quote)
|
|
7500
|
+
quote = null;
|
|
7355
7501
|
continue;
|
|
7356
7502
|
}
|
|
7357
7503
|
if (ch === "'" || ch === '"') {
|
|
7358
|
-
|
|
7504
|
+
quote = ch;
|
|
7359
7505
|
current += ch;
|
|
7360
7506
|
continue;
|
|
7361
7507
|
}
|
|
@@ -7438,7 +7584,7 @@ function skipEnvPrefix(tokens3, index) {
|
|
|
7438
7584
|
function shellTokens(segment) {
|
|
7439
7585
|
const out = [];
|
|
7440
7586
|
let current = "";
|
|
7441
|
-
let
|
|
7587
|
+
let quote = null;
|
|
7442
7588
|
let escaped = false;
|
|
7443
7589
|
for (const ch of segment) {
|
|
7444
7590
|
if (escaped) {
|
|
@@ -7446,19 +7592,19 @@ function shellTokens(segment) {
|
|
|
7446
7592
|
escaped = false;
|
|
7447
7593
|
continue;
|
|
7448
7594
|
}
|
|
7449
|
-
if (ch === "\\" &&
|
|
7595
|
+
if (ch === "\\" && quote !== "'") {
|
|
7450
7596
|
escaped = true;
|
|
7451
7597
|
continue;
|
|
7452
7598
|
}
|
|
7453
|
-
if (
|
|
7454
|
-
if (ch ===
|
|
7455
|
-
|
|
7599
|
+
if (quote) {
|
|
7600
|
+
if (ch === quote)
|
|
7601
|
+
quote = null;
|
|
7456
7602
|
else
|
|
7457
7603
|
current += ch;
|
|
7458
7604
|
continue;
|
|
7459
7605
|
}
|
|
7460
7606
|
if (ch === "'" || ch === '"') {
|
|
7461
|
-
|
|
7607
|
+
quote = ch;
|
|
7462
7608
|
continue;
|
|
7463
7609
|
}
|
|
7464
7610
|
if (/\s/.test(ch)) {
|
|
@@ -7905,17 +8051,17 @@ ${result.output ?? ""}`;
|
|
|
7905
8051
|
* scripts from presenting the status of a later unrelated command.
|
|
7906
8052
|
*/
|
|
7907
8053
|
exactTrailingExitReporterPrimary(command) {
|
|
7908
|
-
let
|
|
8054
|
+
let quote = null;
|
|
7909
8055
|
let separator = -1;
|
|
7910
8056
|
for (let index = 0; index < command.length; index++) {
|
|
7911
8057
|
const ch = command[index];
|
|
7912
|
-
if (
|
|
7913
|
-
if (ch ===
|
|
7914
|
-
|
|
8058
|
+
if (quote) {
|
|
8059
|
+
if (ch === quote && command[index - 1] !== "\\")
|
|
8060
|
+
quote = null;
|
|
7915
8061
|
continue;
|
|
7916
8062
|
}
|
|
7917
8063
|
if (ch === "'" || ch === '"') {
|
|
7918
|
-
|
|
8064
|
+
quote = ch;
|
|
7919
8065
|
continue;
|
|
7920
8066
|
}
|
|
7921
8067
|
if (ch === ";") {
|
|
@@ -7924,7 +8070,7 @@ ${result.output ?? ""}`;
|
|
|
7924
8070
|
separator = index;
|
|
7925
8071
|
}
|
|
7926
8072
|
}
|
|
7927
|
-
if (
|
|
8073
|
+
if (quote || separator < 1)
|
|
7928
8074
|
return null;
|
|
7929
8075
|
const primary = command.slice(0, separator).trim();
|
|
7930
8076
|
const reporter = command.slice(separator + 1).trim();
|
|
@@ -59706,9 +59852,9 @@ ${textResult.text}`,
|
|
|
59706
59852
|
if (ollamaResult)
|
|
59707
59853
|
return ollamaResult;
|
|
59708
59854
|
try {
|
|
59709
|
-
const { execSync:
|
|
59855
|
+
const { execSync: execSync39 } = await import("node:child_process");
|
|
59710
59856
|
try {
|
|
59711
|
-
|
|
59857
|
+
execSync39("ollama pull moondream", { timeout: 3e5, stdio: "pipe" });
|
|
59712
59858
|
const retryOllama = await this.tryOllamaVision(buffer2, filename, action, prompt, length4, start2, preferredModel);
|
|
59713
59859
|
if (retryOllama)
|
|
59714
59860
|
return retryOllama;
|
|
@@ -89289,8 +89435,8 @@ function stringifyParameterValue(value2) {
|
|
|
89289
89435
|
return String(value2);
|
|
89290
89436
|
return JSON.stringify(value2);
|
|
89291
89437
|
}
|
|
89292
|
-
function escapeForExistingShellQuote(value2,
|
|
89293
|
-
if (
|
|
89438
|
+
function escapeForExistingShellQuote(value2, quote) {
|
|
89439
|
+
if (quote === "'")
|
|
89294
89440
|
return value2.replace(/'/g, `'\\''`);
|
|
89295
89441
|
return value2.replace(/[`$\\!"]/g, "\\$&");
|
|
89296
89442
|
}
|
|
@@ -89636,8 +89782,8 @@ ${repair}` : output2,
|
|
|
89636
89782
|
if (val === void 0 || val === null)
|
|
89637
89783
|
return "";
|
|
89638
89784
|
const normalizedMode = mode ?? "shell";
|
|
89639
|
-
const
|
|
89640
|
-
const closedBySameQuote = (
|
|
89785
|
+
const quote = source[offset - 1];
|
|
89786
|
+
const closedBySameQuote = (quote === "'" || quote === '"') && source[offset + match.length] === quote;
|
|
89641
89787
|
if (normalizedMode === "raw") {
|
|
89642
89788
|
if (!parameterAllowsUnsafeRaw(this.parameters, key)) {
|
|
89643
89789
|
throw new Error(`Unsafe raw interpolation rejected for parameter "${key}". Add x-omnius-unsafeRaw: true to the parameter schema only when raw shell insertion is intentional.`);
|
|
@@ -89646,7 +89792,7 @@ ${repair}` : output2,
|
|
|
89646
89792
|
}
|
|
89647
89793
|
const text2 = normalizedMode === "json" ? JSON.stringify(val) : stringifyParameterValue(val);
|
|
89648
89794
|
if (closedBySameQuote)
|
|
89649
|
-
return escapeForExistingShellQuote(text2,
|
|
89795
|
+
return escapeForExistingShellQuote(text2, quote);
|
|
89650
89796
|
return this.shellQuote(text2);
|
|
89651
89797
|
});
|
|
89652
89798
|
}
|
|
@@ -163055,8 +163201,8 @@ var require_get_intrinsic = __commonJS({
|
|
|
163055
163201
|
throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
|
|
163056
163202
|
}
|
|
163057
163203
|
var result = [];
|
|
163058
|
-
$replace(string2, rePropName, function(match, number,
|
|
163059
|
-
result[result.length] =
|
|
163204
|
+
$replace(string2, rePropName, function(match, number, quote, subString) {
|
|
163205
|
+
result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match;
|
|
163060
163206
|
});
|
|
163061
163207
|
return result;
|
|
163062
163208
|
};
|
|
@@ -321370,7 +321516,7 @@ var require_parse3 = __commonJS({
|
|
|
321370
321516
|
const parts = [];
|
|
321371
321517
|
let bracket = 0;
|
|
321372
321518
|
let paren = 0;
|
|
321373
|
-
let
|
|
321519
|
+
let quote = 0;
|
|
321374
321520
|
let value2 = "";
|
|
321375
321521
|
let escaped = false;
|
|
321376
321522
|
for (const ch of input) {
|
|
@@ -321385,11 +321531,11 @@ var require_parse3 = __commonJS({
|
|
|
321385
321531
|
continue;
|
|
321386
321532
|
}
|
|
321387
321533
|
if (ch === '"') {
|
|
321388
|
-
|
|
321534
|
+
quote = quote === 1 ? 0 : 1;
|
|
321389
321535
|
value2 += ch;
|
|
321390
321536
|
continue;
|
|
321391
321537
|
}
|
|
321392
|
-
if (
|
|
321538
|
+
if (quote === 0) {
|
|
321393
321539
|
if (ch === "[") {
|
|
321394
321540
|
bracket++;
|
|
321395
321541
|
} else if (ch === "]" && bracket > 0) {
|
|
@@ -321466,7 +321612,7 @@ var require_parse3 = __commonJS({
|
|
|
321466
321612
|
}
|
|
321467
321613
|
let bracket = 0;
|
|
321468
321614
|
let paren = 0;
|
|
321469
|
-
let
|
|
321615
|
+
let quote = 0;
|
|
321470
321616
|
let escaped = false;
|
|
321471
321617
|
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
321472
321618
|
const ch = pattern[i2];
|
|
@@ -321479,10 +321625,10 @@ var require_parse3 = __commonJS({
|
|
|
321479
321625
|
continue;
|
|
321480
321626
|
}
|
|
321481
321627
|
if (ch === '"') {
|
|
321482
|
-
|
|
321628
|
+
quote = quote === 1 ? 0 : 1;
|
|
321483
321629
|
continue;
|
|
321484
321630
|
}
|
|
321485
|
-
if (
|
|
321631
|
+
if (quote === 1) {
|
|
321486
321632
|
continue;
|
|
321487
321633
|
}
|
|
321488
321634
|
if (ch === "[") {
|
|
@@ -342174,14 +342320,16 @@ Next action: ${receipt2.nextAction}`
|
|
|
342174
342320
|
// packages/execution/dist/tools/ocr-image-advanced.js
|
|
342175
342321
|
import { existsSync as existsSync56, mkdirSync as mkdirSync32, statSync as statSync23 } from "node:fs";
|
|
342176
342322
|
import { resolve as resolve33, basename as basename10, dirname as dirname22, join as join65 } from "node:path";
|
|
342177
|
-
import { execSync as execSync18 } from "node:child_process";
|
|
342178
342323
|
import { fileURLToPath as fileURLToPath8 } from "node:url";
|
|
342179
|
-
import {
|
|
342324
|
+
import { tmpdir as tmpdir10 } from "node:os";
|
|
342180
342325
|
function findOcrScript() {
|
|
342181
342326
|
const thisDir = dirname22(fileURLToPath8(import.meta.url));
|
|
342182
342327
|
const devPath2 = resolve33(thisDir, "../../scripts/ocr-advanced.py");
|
|
342183
342328
|
if (existsSync56(devPath2))
|
|
342184
342329
|
return devPath2;
|
|
342330
|
+
const packagedPath = resolve33(thisDir, "scripts/ocr-advanced.py");
|
|
342331
|
+
if (existsSync56(packagedPath))
|
|
342332
|
+
return packagedPath;
|
|
342185
342333
|
const bundledPath = resolve33(thisDir, "../scripts/ocr-advanced.py");
|
|
342186
342334
|
if (existsSync56(bundledPath))
|
|
342187
342335
|
return bundledPath;
|
|
@@ -342190,9 +342338,6 @@ function findOcrScript() {
|
|
|
342190
342338
|
return sameDirPath;
|
|
342191
342339
|
return null;
|
|
342192
342340
|
}
|
|
342193
|
-
function quote(value2) {
|
|
342194
|
-
return JSON.stringify(value2);
|
|
342195
|
-
}
|
|
342196
342341
|
function ocrPythonEnv(extra = {}) {
|
|
342197
342342
|
return {
|
|
342198
342343
|
...process.env,
|
|
@@ -342203,10 +342348,9 @@ function ocrPythonEnv(extra = {}) {
|
|
|
342203
342348
|
...extra
|
|
342204
342349
|
};
|
|
342205
342350
|
}
|
|
342206
|
-
function verifyOcrPythonStack(python2) {
|
|
342351
|
+
async function verifyOcrPythonStack(python2) {
|
|
342207
342352
|
try {
|
|
342208
|
-
|
|
342209
|
-
stdio: "pipe",
|
|
342353
|
+
await execFileText2(python2, ["-c", OCR_IMPORT_PROBE], {
|
|
342210
342354
|
timeout: 1e4,
|
|
342211
342355
|
env: ocrPythonEnv()
|
|
342212
342356
|
});
|
|
@@ -342215,12 +342359,11 @@ function verifyOcrPythonStack(python2) {
|
|
|
342215
342359
|
return false;
|
|
342216
342360
|
}
|
|
342217
342361
|
}
|
|
342218
|
-
function findPythonLauncher() {
|
|
342219
|
-
const candidates = process.platform === "win32" ? ["python", "py -3"] : ["python3", "python"];
|
|
342362
|
+
async function findPythonLauncher() {
|
|
342363
|
+
const candidates = process.platform === "win32" ? [["python"], ["py", "-3"]] : [["python3"], ["python"]];
|
|
342220
342364
|
for (const candidate of candidates) {
|
|
342221
342365
|
try {
|
|
342222
|
-
|
|
342223
|
-
stdio: "pipe",
|
|
342366
|
+
await execFileText2(candidate[0], [...candidate.slice(1), "-c", "import sys; raise SystemExit(0 if sys.version_info >= (3, 9) else 1)"], {
|
|
342224
342367
|
timeout: 5e3
|
|
342225
342368
|
});
|
|
342226
342369
|
return candidate;
|
|
@@ -342229,61 +342372,95 @@ function findPythonLauncher() {
|
|
|
342229
342372
|
}
|
|
342230
342373
|
return null;
|
|
342231
342374
|
}
|
|
342232
|
-
function installOcrPythonStack(python2) {
|
|
342375
|
+
async function installOcrPythonStack(python2) {
|
|
342233
342376
|
try {
|
|
342234
|
-
|
|
342235
|
-
stdio: "pipe",
|
|
342377
|
+
await execFileText2(python2, ["-m", "ensurepip", "--upgrade"], {
|
|
342236
342378
|
timeout: 12e4,
|
|
342237
342379
|
env: ocrPythonEnv()
|
|
342238
342380
|
});
|
|
342239
342381
|
} catch {
|
|
342240
342382
|
}
|
|
342241
|
-
|
|
342242
|
-
|
|
342243
|
-
timeout: 3e5,
|
|
342383
|
+
await execFileText2(python2, ["-m", "pip", "install", "--disable-pip-version-check", "--upgrade", ...OCR_PYTHON_PACKAGES], {
|
|
342384
|
+
timeout: OCR_SETUP_TIMEOUT_MS,
|
|
342244
342385
|
env: ocrPythonEnv()
|
|
342245
342386
|
});
|
|
342246
342387
|
}
|
|
342247
|
-
function
|
|
342388
|
+
async function ensureOcrPythonImpl() {
|
|
342248
342389
|
const py = venvPython(OCR_VENV_DIR);
|
|
342390
|
+
if (isJetsonHost() && !await verifyOcrPythonStack("python3")) {
|
|
342391
|
+
const systemPackages = ensureJetsonOcrPythonPackages();
|
|
342392
|
+
if (!systemPackages.available) {
|
|
342393
|
+
return {
|
|
342394
|
+
error: `Jetson OCR dependencies are unavailable: ${systemPackages.error ?? "automatic system-package setup failed"}. Run the daemon with passwordless sudo or install the reported Ubuntu packages, then retry.`
|
|
342395
|
+
};
|
|
342396
|
+
}
|
|
342397
|
+
if (!await verifyOcrPythonStack("python3")) {
|
|
342398
|
+
return { error: "Jetson OCR system-package setup completed but Python cannot import cv2, pytesseract, numpy, Pillow, and reportlab." };
|
|
342399
|
+
}
|
|
342400
|
+
}
|
|
342249
342401
|
if (!existsSync56(py)) {
|
|
342250
|
-
const launcher = findPythonLauncher();
|
|
342402
|
+
const launcher = await findPythonLauncher();
|
|
342251
342403
|
if (!launcher) {
|
|
342252
342404
|
return { error: "Python 3.9+ not found; cannot create managed OCR venv." };
|
|
342253
342405
|
}
|
|
342254
342406
|
try {
|
|
342255
342407
|
mkdirSync32(dirname22(OCR_VENV_DIR), { recursive: true });
|
|
342256
|
-
|
|
342257
|
-
stdio: "pipe",
|
|
342408
|
+
await execFileText2(launcher[0], [...launcher.slice(1), "-m", "venv", ...isJetsonHost() ? ["--system-site-packages"] : [], OCR_VENV_DIR], {
|
|
342258
342409
|
timeout: 6e4
|
|
342259
342410
|
});
|
|
342260
342411
|
} catch (err) {
|
|
342261
342412
|
return { error: `Could not create managed OCR venv at ${OCR_VENV_DIR}: ${err instanceof Error ? err.message : String(err)}` };
|
|
342262
342413
|
}
|
|
342263
342414
|
}
|
|
342264
|
-
if (verifyOcrPythonStack(py))
|
|
342415
|
+
if (await verifyOcrPythonStack(py))
|
|
342265
342416
|
return { python: py, installed: false };
|
|
342417
|
+
if (isJetsonHost()) {
|
|
342418
|
+
return {
|
|
342419
|
+
error: `Jetson OCR runtime at ${OCR_VENV_DIR} cannot import its JetPack system packages. Remove this OCR runtime and retry after the system packages are available; no generic PyPI fallback is used on Jetson.`
|
|
342420
|
+
};
|
|
342421
|
+
}
|
|
342266
342422
|
try {
|
|
342267
|
-
installOcrPythonStack(py);
|
|
342423
|
+
await installOcrPythonStack(py);
|
|
342268
342424
|
} catch (err) {
|
|
342269
342425
|
const stderr = err?.stderr?.toString?.() ?? "";
|
|
342270
342426
|
const msg = (stderr || (err instanceof Error ? err.message : String(err))).slice(0, 800);
|
|
342271
342427
|
return { error: `Could not auto-install OCR Python stack into ${OCR_VENV_DIR}: ${msg}` };
|
|
342272
342428
|
}
|
|
342273
|
-
if (verifyOcrPythonStack(py))
|
|
342429
|
+
if (await verifyOcrPythonStack(py))
|
|
342274
342430
|
return { python: py, installed: true };
|
|
342275
342431
|
return {
|
|
342276
|
-
error: `OCR Python stack auto-install completed but import verification failed in ${OCR_VENV_DIR}. Required imports: cv2, pytesseract, numpy, PIL.`
|
|
342432
|
+
error: `OCR Python stack auto-install completed but import verification failed in ${OCR_VENV_DIR}. Required imports: cv2, pytesseract, numpy, PIL, reportlab.`
|
|
342277
342433
|
};
|
|
342278
342434
|
}
|
|
342279
|
-
|
|
342435
|
+
function ensureOcrPython() {
|
|
342436
|
+
if (!ocrSetupPromise) {
|
|
342437
|
+
ocrSetupPromise = ensureOcrPythonImpl().finally(() => {
|
|
342438
|
+
ocrSetupPromise = null;
|
|
342439
|
+
});
|
|
342440
|
+
}
|
|
342441
|
+
return ocrSetupPromise;
|
|
342442
|
+
}
|
|
342443
|
+
var OCR_VENV_DIR, OCR_PYTHON_PACKAGES, OCR_IMPORT_PROBE, OCR_SETUP_TIMEOUT_MS, OCR_PIPELINE_TIMEOUT_MS, ocrSetupPromise, OcrImageAdvancedTool;
|
|
342280
342444
|
var init_ocr_image_advanced = __esm({
|
|
342281
342445
|
"packages/execution/dist/tools/ocr-image-advanced.js"() {
|
|
342282
342446
|
"use strict";
|
|
342283
342447
|
init_system_deps();
|
|
342284
342448
|
init_venv_paths();
|
|
342285
|
-
|
|
342286
|
-
|
|
342449
|
+
init_process_async();
|
|
342450
|
+
init_jetson_monitor();
|
|
342451
|
+
init_model_store();
|
|
342452
|
+
OCR_VENV_DIR = unifiedRuntimeDir("vision", "ocr-advanced");
|
|
342453
|
+
OCR_PYTHON_PACKAGES = [
|
|
342454
|
+
"pytesseract==0.3.13",
|
|
342455
|
+
"Pillow==11.1.0",
|
|
342456
|
+
"opencv-python-headless==4.10.0.84",
|
|
342457
|
+
"numpy==2.0.2",
|
|
342458
|
+
"reportlab==4.2.5"
|
|
342459
|
+
];
|
|
342460
|
+
OCR_IMPORT_PROBE = "import cv2, pytesseract, numpy, PIL, reportlab";
|
|
342461
|
+
OCR_SETUP_TIMEOUT_MS = 5 * 6e4;
|
|
342462
|
+
OCR_PIPELINE_TIMEOUT_MS = 5 * 6e4;
|
|
342463
|
+
ocrSetupPromise = null;
|
|
342287
342464
|
OcrImageAdvancedTool = class {
|
|
342288
342465
|
workingDir;
|
|
342289
342466
|
name = "ocr_image_advanced";
|
|
@@ -342329,19 +342506,39 @@ var init_ocr_image_advanced = __esm({
|
|
|
342329
342506
|
constructor(workingDir) {
|
|
342330
342507
|
this.workingDir = workingDir;
|
|
342331
342508
|
}
|
|
342509
|
+
activeController = null;
|
|
342510
|
+
/** ToolExecutor calls this when a REST deadline expires. */
|
|
342511
|
+
cancel() {
|
|
342512
|
+
this.activeController?.abort();
|
|
342513
|
+
}
|
|
342332
342514
|
async execute(args) {
|
|
342333
342515
|
const start2 = performance.now();
|
|
342334
342516
|
const rawPath = args["image"];
|
|
342335
|
-
const language = args["language"] ?? "eng";
|
|
342517
|
+
const language = (args["language"] ?? "eng").toLowerCase();
|
|
342336
342518
|
const doRegions = args["regions"] === true;
|
|
342337
342519
|
const region = args["region"];
|
|
342338
342520
|
const psm = args["psm"];
|
|
342339
342521
|
const debug = args["debug"] === true;
|
|
342340
342522
|
const outputDir2 = args["output_dir"];
|
|
342341
342523
|
const batch2 = args["batch"] === true;
|
|
342342
|
-
if (!rawPath) {
|
|
342524
|
+
if (!rawPath || typeof rawPath !== "string") {
|
|
342343
342525
|
return { success: false, output: "", error: "image path is required", durationMs: 0 };
|
|
342344
342526
|
}
|
|
342527
|
+
if (typeof language !== "string" || !/^[a-z0-9_]+(?:\+[a-z0-9_]+)*$/i.test(language)) {
|
|
342528
|
+
return { success: false, output: "", error: "language must contain Tesseract language codes separated by '+', for example eng or eng+fra", durationMs: performance.now() - start2 };
|
|
342529
|
+
}
|
|
342530
|
+
if (region !== void 0 && (typeof region !== "string" || !/^\d+,\d+,\d+,\d+$/.test(region))) {
|
|
342531
|
+
return { success: false, output: "", error: "region must be x,y,w,h using non-negative integer pixels", durationMs: performance.now() - start2 };
|
|
342532
|
+
}
|
|
342533
|
+
if (region && region.split(",").slice(2).some((value2) => Number(value2) <= 0)) {
|
|
342534
|
+
return { success: false, output: "", error: "region width and height must be greater than zero", durationMs: performance.now() - start2 };
|
|
342535
|
+
}
|
|
342536
|
+
if (psm !== void 0 && (!Number.isInteger(psm) || ![4, 6, 11].includes(psm))) {
|
|
342537
|
+
return { success: false, output: "", error: "psm must be one of 4, 6, or 11", durationMs: performance.now() - start2 };
|
|
342538
|
+
}
|
|
342539
|
+
if (outputDir2 !== void 0 && (typeof outputDir2 !== "string" || !outputDir2.trim())) {
|
|
342540
|
+
return { success: false, output: "", error: "output_dir must be a non-empty path when provided", durationMs: performance.now() - start2 };
|
|
342541
|
+
}
|
|
342345
342542
|
const fullPath = resolve33(this.workingDir, rawPath);
|
|
342346
342543
|
if (!existsSync56(fullPath)) {
|
|
342347
342544
|
return { success: false, output: "", error: `File not found: ${rawPath}`, durationMs: performance.now() - start2 };
|
|
@@ -342349,16 +342546,16 @@ var init_ocr_image_advanced = __esm({
|
|
|
342349
342546
|
if (!batch2) {
|
|
342350
342547
|
const stat10 = statSync23(fullPath);
|
|
342351
342548
|
if (stat10.isDirectory()) {
|
|
342352
|
-
return this.executeBatchOrSingle(fullPath, language, doRegions, region, psm, debug, outputDir2, true, start2);
|
|
342549
|
+
return await this.executeBatchOrSingle(fullPath, language, doRegions, region, psm, debug, outputDir2, true, start2);
|
|
342353
342550
|
}
|
|
342354
342551
|
if (stat10.size > 50 * 1024 * 1024) {
|
|
342355
342552
|
return { success: false, output: "", error: `Image too large: ${(stat10.size / 1024 / 1024).toFixed(0)}MB (max 50MB)`, durationMs: performance.now() - start2 };
|
|
342356
342553
|
}
|
|
342357
342554
|
}
|
|
342358
|
-
return this.executeBatchOrSingle(fullPath, language, doRegions, region, psm, debug, outputDir2, batch2, start2);
|
|
342555
|
+
return await this.executeBatchOrSingle(fullPath, language, doRegions, region, psm, debug, outputDir2, batch2, start2);
|
|
342359
342556
|
}
|
|
342360
|
-
executeBatchOrSingle(fullPath, language, doRegions, region, psm, debug, outputDir2, batch2, start2) {
|
|
342361
|
-
const tesCheck =
|
|
342557
|
+
async executeBatchOrSingle(fullPath, language, doRegions, region, psm, debug, outputDir2, batch2, start2) {
|
|
342558
|
+
const tesCheck = ensureTesseractLanguages(language);
|
|
342362
342559
|
if (!tesCheck.available) {
|
|
342363
342560
|
return {
|
|
342364
342561
|
success: false,
|
|
@@ -342367,7 +342564,7 @@ var init_ocr_image_advanced = __esm({
|
|
|
342367
342564
|
durationMs: performance.now() - start2
|
|
342368
342565
|
};
|
|
342369
342566
|
}
|
|
342370
|
-
const python2 = ensureOcrPython();
|
|
342567
|
+
const python2 = await ensureOcrPython();
|
|
342371
342568
|
const script = findOcrScript();
|
|
342372
342569
|
if (!script) {
|
|
342373
342570
|
return {
|
|
@@ -342385,40 +342582,34 @@ var init_ocr_image_advanced = __esm({
|
|
|
342385
342582
|
durationMs: performance.now() - start2
|
|
342386
342583
|
};
|
|
342387
342584
|
}
|
|
342388
|
-
return this.runPythonPipeline(python2.python, script, fullPath, language, doRegions, region, psm, debug, outputDir2, batch2, start2);
|
|
342585
|
+
return await this.runPythonPipeline(python2.python, script, fullPath, language, doRegions, region, psm, debug, outputDir2, batch2, start2);
|
|
342389
342586
|
}
|
|
342390
|
-
runPythonPipeline(python2, script, imagePath, language, regions, region, psm, debug, outputDir2, batch2, start2) {
|
|
342391
|
-
const
|
|
342392
|
-
JSON.stringify(python2),
|
|
342393
|
-
JSON.stringify(script),
|
|
342394
|
-
JSON.stringify(imagePath),
|
|
342395
|
-
"-l",
|
|
342396
|
-
language,
|
|
342397
|
-
"--output",
|
|
342398
|
-
"json"
|
|
342399
|
-
];
|
|
342587
|
+
async runPythonPipeline(python2, script, imagePath, language, regions, region, psm, debug, outputDir2, batch2, start2) {
|
|
342588
|
+
const commandArgs = [script, imagePath, "-l", language, "--output", "json"];
|
|
342400
342589
|
if (regions)
|
|
342401
|
-
|
|
342590
|
+
commandArgs.push("--regions");
|
|
342402
342591
|
if (region)
|
|
342403
|
-
|
|
342592
|
+
commandArgs.push("--region", region);
|
|
342404
342593
|
if (psm)
|
|
342405
|
-
|
|
342594
|
+
commandArgs.push("--psm", String(psm));
|
|
342406
342595
|
if (batch2)
|
|
342407
|
-
|
|
342596
|
+
commandArgs.push("--batch");
|
|
342408
342597
|
if (outputDir2)
|
|
342409
|
-
|
|
342598
|
+
commandArgs.push("--output-dir", resolve33(this.workingDir, outputDir2));
|
|
342410
342599
|
let debugDir;
|
|
342411
342600
|
if (debug) {
|
|
342412
342601
|
debugDir = join65(tmpdir10(), `omnius-ocr-debug-${Date.now()}`);
|
|
342413
|
-
|
|
342602
|
+
commandArgs.push("--debug-dir", debugDir);
|
|
342414
342603
|
}
|
|
342604
|
+
const controller = new AbortController();
|
|
342605
|
+
this.activeController = controller;
|
|
342415
342606
|
try {
|
|
342416
|
-
const stdout =
|
|
342417
|
-
|
|
342418
|
-
|
|
342419
|
-
|
|
342420
|
-
|
|
342421
|
-
|
|
342607
|
+
const stdout = await execFileText2(python2, commandArgs, {
|
|
342608
|
+
timeout: OCR_PIPELINE_TIMEOUT_MS,
|
|
342609
|
+
cwd: this.workingDir,
|
|
342610
|
+
env: ocrPythonEnv(),
|
|
342611
|
+
signal: controller.signal,
|
|
342612
|
+
maxBuffer: 16 * 1024 * 1024
|
|
342422
342613
|
});
|
|
342423
342614
|
const result = JSON.parse(stdout);
|
|
342424
342615
|
if (result.error) {
|
|
@@ -342445,7 +342636,8 @@ var init_ocr_image_advanced = __esm({
|
|
|
342445
342636
|
return {
|
|
342446
342637
|
success: true,
|
|
342447
342638
|
output: parts2.join("\n"),
|
|
342448
|
-
durationMs: performance.now() - start2
|
|
342639
|
+
durationMs: performance.now() - start2,
|
|
342640
|
+
data: result
|
|
342449
342641
|
};
|
|
342450
342642
|
}
|
|
342451
342643
|
const parts = [];
|
|
@@ -342488,7 +342680,8 @@ var init_ocr_image_advanced = __esm({
|
|
|
342488
342680
|
return {
|
|
342489
342681
|
success: true,
|
|
342490
342682
|
output: parts.join("\n"),
|
|
342491
|
-
durationMs: performance.now() - start2
|
|
342683
|
+
durationMs: performance.now() - start2,
|
|
342684
|
+
data: result
|
|
342492
342685
|
};
|
|
342493
342686
|
} catch (err) {
|
|
342494
342687
|
const stderr = err?.stderr?.toString?.() ?? "";
|
|
@@ -342506,6 +342699,9 @@ var init_ocr_image_advanced = __esm({
|
|
|
342506
342699
|
error: `Advanced OCR failed: ${(stderr || (err instanceof Error ? err.message : String(err))).slice(0, 500)}`,
|
|
342507
342700
|
durationMs: performance.now() - start2
|
|
342508
342701
|
};
|
|
342702
|
+
} finally {
|
|
342703
|
+
if (this.activeController === controller)
|
|
342704
|
+
this.activeController = null;
|
|
342509
342705
|
}
|
|
342510
342706
|
}
|
|
342511
342707
|
};
|
|
@@ -342513,7 +342709,7 @@ var init_ocr_image_advanced = __esm({
|
|
|
342513
342709
|
});
|
|
342514
342710
|
|
|
342515
342711
|
// packages/execution/dist/tools/browser-action.js
|
|
342516
|
-
import { execSync as
|
|
342712
|
+
import { execSync as execSync18, spawn as spawn16 } from "node:child_process";
|
|
342517
342713
|
import { copyFileSync as copyFileSync2, existsSync as existsSync57, mkdirSync as mkdirSync33, readFileSync as readFileSync42 } from "node:fs";
|
|
342518
342714
|
import { basename as basename11, dirname as dirname23, join as join66, resolve as resolve34 } from "node:path";
|
|
342519
342715
|
import { fileURLToPath as fileURLToPath9 } from "node:url";
|
|
@@ -342572,7 +342768,7 @@ function killBrowserActionServicePort() {
|
|
|
342572
342768
|
];
|
|
342573
342769
|
for (const cmd of commands) {
|
|
342574
342770
|
try {
|
|
342575
|
-
|
|
342771
|
+
execSync18(cmd, { stdio: "ignore", timeout: 5e3 });
|
|
342576
342772
|
break;
|
|
342577
342773
|
} catch {
|
|
342578
342774
|
}
|
|
@@ -342581,7 +342777,7 @@ function killBrowserActionServicePort() {
|
|
|
342581
342777
|
function findPython3() {
|
|
342582
342778
|
for (const cmd of ["python3", "python"]) {
|
|
342583
342779
|
try {
|
|
342584
|
-
const ver =
|
|
342780
|
+
const ver = execSync18(`${cmd} --version 2>&1`, { stdio: "pipe", timeout: 5e3 }).toString().trim();
|
|
342585
342781
|
if (ver.includes("Python 3"))
|
|
342586
342782
|
return cmd;
|
|
342587
342783
|
} catch {
|
|
@@ -343387,7 +343583,7 @@ ${truncated}`,
|
|
|
343387
343583
|
});
|
|
343388
343584
|
|
|
343389
343585
|
// packages/execution/dist/tools/autoresearch.js
|
|
343390
|
-
import { execSync as
|
|
343586
|
+
import { execSync as execSync19, spawn as spawn17 } from "node:child_process";
|
|
343391
343587
|
import { existsSync as existsSync58, readFileSync as readFileSync43, writeFileSync as writeFileSync29, mkdirSync as mkdirSync34, appendFileSync as appendFileSync3, copyFileSync as copyFileSync3 } from "node:fs";
|
|
343392
343588
|
import { join as join67, resolve as resolve35, dirname as dirname24 } from "node:path";
|
|
343393
343589
|
import { fileURLToPath as fileURLToPath10 } from "node:url";
|
|
@@ -343517,13 +343713,13 @@ Requires: NVIDIA GPU, Python 3.10+, uv (astral.sh package manager).`;
|
|
|
343517
343713
|
async setup(workspace, args, start2) {
|
|
343518
343714
|
const output2 = [];
|
|
343519
343715
|
try {
|
|
343520
|
-
|
|
343716
|
+
execSync19("which uv", { encoding: "utf-8", timeout: 5e3 });
|
|
343521
343717
|
output2.push("uv: found");
|
|
343522
343718
|
} catch {
|
|
343523
343719
|
return { success: false, output: "", error: "uv not found. Install with: curl -LsSf https://astral.sh/uv/install.sh | sh", durationMs: Date.now() - start2 };
|
|
343524
343720
|
}
|
|
343525
343721
|
try {
|
|
343526
|
-
const gpuInfo =
|
|
343722
|
+
const gpuInfo = execSync19("nvidia-smi --query-gpu=name,memory.total --format=csv,noheader 2>/dev/null || echo 'no GPU'", { encoding: "utf-8", timeout: 1e4 }).trim();
|
|
343527
343723
|
output2.push(`GPU: ${gpuInfo}`);
|
|
343528
343724
|
} catch {
|
|
343529
343725
|
output2.push("GPU: detection failed (nvidia-smi not available)");
|
|
@@ -343573,10 +343769,10 @@ explicit = true
|
|
|
343573
343769
|
writeFileSync29(join67(workspace, "pyproject.toml"), pyprojectContent, "utf-8");
|
|
343574
343770
|
output2.push("Created pyproject.toml");
|
|
343575
343771
|
try {
|
|
343576
|
-
|
|
343772
|
+
execSync19("git rev-parse --git-dir", { cwd: workspace, encoding: "utf-8", timeout: 5e3 });
|
|
343577
343773
|
output2.push("Git: already initialized");
|
|
343578
343774
|
} catch {
|
|
343579
|
-
|
|
343775
|
+
execSync19("git init && git add -A && git commit -m 'autoresearch: initial setup'", {
|
|
343580
343776
|
cwd: workspace,
|
|
343581
343777
|
encoding: "utf-8",
|
|
343582
343778
|
timeout: 1e4
|
|
@@ -343586,14 +343782,14 @@ explicit = true
|
|
|
343586
343782
|
const tag = String(args["tag"] ?? (/* @__PURE__ */ new Date()).toISOString().slice(5, 10).replace("-", ""));
|
|
343587
343783
|
const branchName = `autoresearch/${tag}`;
|
|
343588
343784
|
try {
|
|
343589
|
-
|
|
343785
|
+
execSync19(`git checkout -b ${branchName}`, { cwd: workspace, encoding: "utf-8", timeout: 5e3 });
|
|
343590
343786
|
output2.push(`Branch: created ${branchName}`);
|
|
343591
343787
|
} catch {
|
|
343592
343788
|
output2.push(`Branch: ${branchName} may already exist, staying on current branch`);
|
|
343593
343789
|
}
|
|
343594
343790
|
output2.push("Installing dependencies with uv sync (this may take a while)...");
|
|
343595
343791
|
try {
|
|
343596
|
-
const uvOut =
|
|
343792
|
+
const uvOut = execSync19("uv sync 2>&1", { cwd: workspace, encoding: "utf-8", timeout: 3e5 });
|
|
343597
343793
|
output2.push(`uv sync: ${uvOut.trim().split("\n").slice(-3).join(" | ")}`);
|
|
343598
343794
|
} catch (err) {
|
|
343599
343795
|
const e2 = err;
|
|
@@ -343602,7 +343798,7 @@ explicit = true
|
|
|
343602
343798
|
const numShards = Number(args["num_shards"] ?? 10);
|
|
343603
343799
|
output2.push(`Preparing data (${numShards} shards)...`);
|
|
343604
343800
|
try {
|
|
343605
|
-
const prepOut =
|
|
343801
|
+
const prepOut = execSync19(`uv run prepare.py --num-shards ${numShards} 2>&1`, {
|
|
343606
343802
|
cwd: workspace,
|
|
343607
343803
|
encoding: "utf-8",
|
|
343608
343804
|
timeout: 6e5
|
|
@@ -343639,7 +343835,7 @@ Next steps:
|
|
|
343639
343835
|
}
|
|
343640
343836
|
if (!existsSync58(join67(workspace, ".venv")) && existsSync58(join67(workspace, "pyproject.toml"))) {
|
|
343641
343837
|
try {
|
|
343642
|
-
|
|
343838
|
+
execSync19("uv sync 2>&1", { cwd: workspace, encoding: "utf-8", timeout: 3e5 });
|
|
343643
343839
|
} catch {
|
|
343644
343840
|
}
|
|
343645
343841
|
}
|
|
@@ -343789,15 +343985,15 @@ Run autoresearch(action="setup") to begin.`,
|
|
|
343789
343985
|
}
|
|
343790
343986
|
output2.push(`Workspace: ${workspace}`);
|
|
343791
343987
|
try {
|
|
343792
|
-
const branch =
|
|
343988
|
+
const branch = execSync19("git branch --show-current", { cwd: workspace, encoding: "utf-8", timeout: 5e3 }).trim();
|
|
343793
343989
|
output2.push(`Branch: ${branch}`);
|
|
343794
|
-
const lastCommit =
|
|
343990
|
+
const lastCommit = execSync19("git log --oneline -1", { cwd: workspace, encoding: "utf-8", timeout: 5e3 }).trim();
|
|
343795
343991
|
output2.push(`Last commit: ${lastCommit}`);
|
|
343796
343992
|
} catch {
|
|
343797
343993
|
output2.push("Git: not initialized");
|
|
343798
343994
|
}
|
|
343799
343995
|
try {
|
|
343800
|
-
const gpuInfo =
|
|
343996
|
+
const gpuInfo = execSync19("nvidia-smi --query-gpu=name,memory.total,memory.used --format=csv,noheader 2>/dev/null", { encoding: "utf-8", timeout: 1e4 }).trim();
|
|
343801
343997
|
output2.push(`GPU: ${gpuInfo}`);
|
|
343802
343998
|
} catch {
|
|
343803
343999
|
output2.push("GPU: not detected");
|
|
@@ -343840,12 +344036,12 @@ Run autoresearch(action="setup") to begin.`,
|
|
|
343840
344036
|
memGb = memGb ?? 0;
|
|
343841
344037
|
let commitHash = "0000000";
|
|
343842
344038
|
try {
|
|
343843
|
-
|
|
343844
|
-
|
|
343845
|
-
commitHash =
|
|
344039
|
+
execSync19("git add train.py", { cwd: workspace, encoding: "utf-8", timeout: 5e3 });
|
|
344040
|
+
execSync19(`git commit -m "autoresearch: ${desc}"`, { cwd: workspace, encoding: "utf-8", timeout: 1e4 });
|
|
344041
|
+
commitHash = execSync19("git rev-parse --short HEAD", { cwd: workspace, encoding: "utf-8", timeout: 5e3 }).trim();
|
|
343846
344042
|
} catch {
|
|
343847
344043
|
try {
|
|
343848
|
-
commitHash =
|
|
344044
|
+
commitHash = execSync19("git rev-parse --short HEAD", { cwd: workspace, encoding: "utf-8", timeout: 5e3 }).trim();
|
|
343849
344045
|
} catch {
|
|
343850
344046
|
}
|
|
343851
344047
|
}
|
|
@@ -343879,14 +344075,14 @@ Branch advanced. Ready for next experiment.`,
|
|
|
343879
344075
|
memGb = memGb ?? 0;
|
|
343880
344076
|
let commitHash = "0000000";
|
|
343881
344077
|
try {
|
|
343882
|
-
commitHash =
|
|
344078
|
+
commitHash = execSync19("git rev-parse --short HEAD", { cwd: workspace, encoding: "utf-8", timeout: 5e3 }).trim();
|
|
343883
344079
|
} catch {
|
|
343884
344080
|
}
|
|
343885
344081
|
const row2 = `${commitHash} ${valBpb.toFixed(6)} ${memGb.toFixed(1)} discard ${desc}
|
|
343886
344082
|
`;
|
|
343887
344083
|
appendFileSync3(tsvPath, row2, "utf-8");
|
|
343888
344084
|
try {
|
|
343889
|
-
|
|
344085
|
+
execSync19("git checkout -- train.py", { cwd: workspace, encoding: "utf-8", timeout: 5e3 });
|
|
343890
344086
|
} catch {
|
|
343891
344087
|
return {
|
|
343892
344088
|
success: false,
|
|
@@ -343907,10 +344103,10 @@ train.py reverted to last kept state. Ready for next experiment.`,
|
|
|
343907
344103
|
});
|
|
343908
344104
|
|
|
343909
344105
|
// packages/execution/dist/tools/scheduler.js
|
|
343910
|
-
import { execSync as
|
|
344106
|
+
import { execSync as execSync20, exec as execCb, spawnSync as spawnSync7 } from "node:child_process";
|
|
343911
344107
|
import { readFile as readFile19, writeFile as writeFile22, mkdir as mkdir18 } from "node:fs/promises";
|
|
343912
344108
|
import { resolve as resolve36, join as join68 } from "node:path";
|
|
343913
|
-
import { homedir as
|
|
344109
|
+
import { homedir as homedir13 } from "node:os";
|
|
343914
344110
|
import { randomBytes as randomBytes12, createHash as createHash25 } from "node:crypto";
|
|
343915
344111
|
function isValidCron(expr) {
|
|
343916
344112
|
const parts = expr.trim().split(/\s+/);
|
|
@@ -344081,7 +344277,7 @@ function describeCron(expr) {
|
|
|
344081
344277
|
}
|
|
344082
344278
|
function getCurrentCrontab() {
|
|
344083
344279
|
try {
|
|
344084
|
-
return
|
|
344280
|
+
return execSync20("crontab -l 2>/dev/null", { stdio: "pipe" }).toString().split("\n");
|
|
344085
344281
|
} catch {
|
|
344086
344282
|
return [];
|
|
344087
344283
|
}
|
|
@@ -344104,7 +344300,7 @@ function writeCrontab(lines) {
|
|
|
344104
344300
|
function findOmniusBinary() {
|
|
344105
344301
|
for (const cmd of ["omnius"]) {
|
|
344106
344302
|
try {
|
|
344107
|
-
const path16 =
|
|
344303
|
+
const path16 = execSync20(`which ${cmd} 2>/dev/null`, { stdio: "pipe" }).toString().trim();
|
|
344108
344304
|
if (path16)
|
|
344109
344305
|
return path16;
|
|
344110
344306
|
} catch {
|
|
@@ -344205,7 +344401,7 @@ async function saveStore(workingDir, store2) {
|
|
|
344205
344401
|
await writeFile22(join68(dir, "tasks.json"), JSON.stringify(store2, null, 2), "utf-8");
|
|
344206
344402
|
}
|
|
344207
344403
|
function globalStoreDir() {
|
|
344208
|
-
const home2 = process.env["OMNIUS_HOME"]?.trim() || join68(
|
|
344404
|
+
const home2 = process.env["OMNIUS_HOME"]?.trim() || join68(homedir13(), ".omnius");
|
|
344209
344405
|
return join68(home2, "scheduled");
|
|
344210
344406
|
}
|
|
344211
344407
|
async function loadGlobalStore() {
|
|
@@ -345940,13 +346136,13 @@ var init_opencode = __esm({
|
|
|
345940
346136
|
});
|
|
345941
346137
|
|
|
345942
346138
|
// packages/execution/dist/tools/factory.js
|
|
345943
|
-
import { execSync as
|
|
346139
|
+
import { execSync as execSync21, spawn as spawn19 } from "node:child_process";
|
|
345944
346140
|
import { existsSync as existsSync60 } from "node:fs";
|
|
345945
346141
|
import { join as join72 } from "node:path";
|
|
345946
346142
|
function findDroid() {
|
|
345947
346143
|
for (const cmd of ["droid"]) {
|
|
345948
346144
|
try {
|
|
345949
|
-
const path16 =
|
|
346145
|
+
const path16 = execSync21(`which ${cmd} 2>/dev/null`, { stdio: "pipe" }).toString().trim();
|
|
345950
346146
|
if (path16)
|
|
345951
346147
|
return path16;
|
|
345952
346148
|
} catch {
|
|
@@ -345966,7 +346162,7 @@ function findDroid() {
|
|
|
345966
346162
|
}
|
|
345967
346163
|
function getVersion2(binary) {
|
|
345968
346164
|
try {
|
|
345969
|
-
return
|
|
346165
|
+
return execSync21(`${binary} --version 2>/dev/null`, { stdio: "pipe", timeout: 1e4 }).toString().trim();
|
|
345970
346166
|
} catch {
|
|
345971
346167
|
return "unknown";
|
|
345972
346168
|
}
|
|
@@ -345975,12 +346171,12 @@ function installDroid() {
|
|
|
345975
346171
|
const platform12 = process.platform;
|
|
345976
346172
|
try {
|
|
345977
346173
|
if (platform12 === "win32") {
|
|
345978
|
-
|
|
346174
|
+
execSync21('powershell -Command "irm https://app.factory.ai/cli/windows | iex"', {
|
|
345979
346175
|
stdio: "pipe",
|
|
345980
346176
|
timeout: 12e4
|
|
345981
346177
|
});
|
|
345982
346178
|
} else {
|
|
345983
|
-
|
|
346179
|
+
execSync21("curl -fsSL https://app.factory.ai/cli | sh", {
|
|
345984
346180
|
stdio: "pipe",
|
|
345985
346181
|
timeout: 12e4
|
|
345986
346182
|
});
|
|
@@ -346249,10 +346445,10 @@ var init_factory = __esm({
|
|
|
346249
346445
|
});
|
|
346250
346446
|
|
|
346251
346447
|
// packages/execution/dist/tools/cron-agent.js
|
|
346252
|
-
import { execSync as
|
|
346448
|
+
import { execSync as execSync22 } from "node:child_process";
|
|
346253
346449
|
import { readFile as readFile22, writeFile as writeFile25, mkdir as mkdir21 } from "node:fs/promises";
|
|
346254
346450
|
import { resolve as resolve40, join as join73 } from "node:path";
|
|
346255
|
-
import { homedir as
|
|
346451
|
+
import { homedir as homedir14 } from "node:os";
|
|
346256
346452
|
import { randomBytes as randomBytes15 } from "node:crypto";
|
|
346257
346453
|
function isValidCron2(expr) {
|
|
346258
346454
|
const parts = expr.trim().split(/\s+/);
|
|
@@ -346414,19 +346610,19 @@ function parseMonth3(raw) {
|
|
|
346414
346610
|
}
|
|
346415
346611
|
function getCurrentCrontab2() {
|
|
346416
346612
|
try {
|
|
346417
|
-
return
|
|
346613
|
+
return execSync22("crontab -l 2>/dev/null", { stdio: "pipe" }).toString().split("\n");
|
|
346418
346614
|
} catch {
|
|
346419
346615
|
return [];
|
|
346420
346616
|
}
|
|
346421
346617
|
}
|
|
346422
346618
|
function writeCrontab2(lines) {
|
|
346423
346619
|
const content = lines.join("\n") + "\n";
|
|
346424
|
-
|
|
346620
|
+
execSync22(`echo ${JSON.stringify(content)} | crontab -`, { stdio: "pipe" });
|
|
346425
346621
|
}
|
|
346426
346622
|
function findOmniusBinary2() {
|
|
346427
346623
|
for (const cmd of ["omnius"]) {
|
|
346428
346624
|
try {
|
|
346429
|
-
const path16 =
|
|
346625
|
+
const path16 = execSync22(`which ${cmd} 2>/dev/null`, { stdio: "pipe" }).toString().trim();
|
|
346430
346626
|
if (path16)
|
|
346431
346627
|
return path16;
|
|
346432
346628
|
} catch {
|
|
@@ -346482,7 +346678,7 @@ async function saveStore2(workingDir, store2) {
|
|
|
346482
346678
|
await writeFile25(join73(dir, "store.json"), JSON.stringify(store2, null, 2), "utf-8");
|
|
346483
346679
|
}
|
|
346484
346680
|
function globalCronDir() {
|
|
346485
|
-
return join73(
|
|
346681
|
+
return join73(homedir14(), ".omnius", "cron-agents");
|
|
346486
346682
|
}
|
|
346487
346683
|
async function loadGlobalCronStore() {
|
|
346488
346684
|
try {
|
|
@@ -346828,7 +347024,7 @@ ${truncated}`, durationMs: performance.now() - start2 };
|
|
|
346828
347024
|
];
|
|
346829
347025
|
if (job.verifyCommand) {
|
|
346830
347026
|
try {
|
|
346831
|
-
const result =
|
|
347027
|
+
const result = execSync22(job.verifyCommand, {
|
|
346832
347028
|
cwd: this.workingDir,
|
|
346833
347029
|
stdio: "pipe",
|
|
346834
347030
|
timeout: 3e4
|
|
@@ -349620,7 +349816,7 @@ var init_project_scaffolding = __esm({
|
|
|
349620
349816
|
// packages/execution/dist/tools/todo-store.js
|
|
349621
349817
|
import { existsSync as existsSync62, readFileSync as readFileSync45, writeFileSync as writeFileSync31, mkdirSync as mkdirSync36, renameSync as renameSync10, unlinkSync as unlinkSync12, readdirSync as readdirSync20, rmSync as rmSync8, statSync as statSync24 } from "node:fs";
|
|
349622
349818
|
import { join as join75 } from "node:path";
|
|
349623
|
-
import { homedir as
|
|
349819
|
+
import { homedir as homedir15 } from "node:os";
|
|
349624
349820
|
import { randomBytes as randomBytes17 } from "node:crypto";
|
|
349625
349821
|
function canonicalTodoContent(content) {
|
|
349626
349822
|
return content.trim().replace(/\s+/g, " ").toLowerCase();
|
|
@@ -349637,7 +349833,7 @@ function emit(type, data) {
|
|
|
349637
349833
|
}
|
|
349638
349834
|
}
|
|
349639
349835
|
function todoDir() {
|
|
349640
|
-
return join75(
|
|
349836
|
+
return join75(homedir15(), ".omnius", "todos");
|
|
349641
349837
|
}
|
|
349642
349838
|
function safeSessionId(sessionId) {
|
|
349643
349839
|
return sessionId.replace(/[^a-zA-Z0-9_.-]/g, "_");
|
|
@@ -349986,16 +350182,16 @@ function looksLikeVerifierResultProse(command) {
|
|
|
349986
350182
|
return /^(?:the\s+)?(?:build|tests?|verification)\s+(?:has\s+)?(?:passed|succeeded|failed|is\s+successful)\b/i.test(command);
|
|
349987
350183
|
}
|
|
349988
350184
|
function stripTopLevelFallback(command) {
|
|
349989
|
-
let
|
|
350185
|
+
let quote = null;
|
|
349990
350186
|
for (let index = 0; index < command.length - 1; index++) {
|
|
349991
350187
|
const ch = command[index];
|
|
349992
|
-
if (
|
|
349993
|
-
if (ch ===
|
|
349994
|
-
|
|
350188
|
+
if (quote) {
|
|
350189
|
+
if (ch === quote && command[index - 1] !== "\\")
|
|
350190
|
+
quote = null;
|
|
349995
350191
|
continue;
|
|
349996
350192
|
}
|
|
349997
350193
|
if (ch === "'" || ch === '"') {
|
|
349998
|
-
|
|
350194
|
+
quote = ch;
|
|
349999
350195
|
continue;
|
|
350000
350196
|
}
|
|
350001
350197
|
if (ch === "|" && command[index + 1] === "|") {
|
|
@@ -350005,16 +350201,16 @@ function stripTopLevelFallback(command) {
|
|
|
350005
350201
|
return { command, removed: false };
|
|
350006
350202
|
}
|
|
350007
350203
|
function unsupportedVerifierShellSyntax(command) {
|
|
350008
|
-
let
|
|
350204
|
+
let quote = null;
|
|
350009
350205
|
for (let index = 0; index < command.length; index++) {
|
|
350010
350206
|
const ch = command[index];
|
|
350011
|
-
if (
|
|
350012
|
-
if (ch ===
|
|
350013
|
-
|
|
350207
|
+
if (quote) {
|
|
350208
|
+
if (ch === quote && command[index - 1] !== "\\")
|
|
350209
|
+
quote = null;
|
|
350014
350210
|
continue;
|
|
350015
350211
|
}
|
|
350016
350212
|
if (ch === "'" || ch === '"') {
|
|
350017
|
-
|
|
350213
|
+
quote = ch;
|
|
350018
350214
|
continue;
|
|
350019
350215
|
}
|
|
350020
350216
|
if (ch === "|") {
|
|
@@ -355494,7 +355690,7 @@ var require_typescript = __commonJS({
|
|
|
355494
355690
|
pseudoBigIntToString: () => pseudoBigIntToString,
|
|
355495
355691
|
punctuationPart: () => punctuationPart,
|
|
355496
355692
|
pushIfUnique: () => pushIfUnique,
|
|
355497
|
-
quote: () =>
|
|
355693
|
+
quote: () => quote,
|
|
355498
355694
|
quotePreferenceFromString: () => quotePreferenceFromString,
|
|
355499
355695
|
rangeContainsPosition: () => rangeContainsPosition,
|
|
355500
355696
|
rangeContainsPositionExclusive: () => rangeContainsPositionExclusive,
|
|
@@ -366264,7 +366460,7 @@ ${lanes.join("\n")}
|
|
|
366264
366460
|
return String.fromCharCode(...valueChars);
|
|
366265
366461
|
}
|
|
366266
366462
|
function scanString(jsxAttributeString = false) {
|
|
366267
|
-
const
|
|
366463
|
+
const quote2 = charCodeUnchecked(pos);
|
|
366268
366464
|
pos++;
|
|
366269
366465
|
let result = "";
|
|
366270
366466
|
let start22 = pos;
|
|
@@ -366276,7 +366472,7 @@ ${lanes.join("\n")}
|
|
|
366276
366472
|
break;
|
|
366277
366473
|
}
|
|
366278
366474
|
const ch = charCodeUnchecked(pos);
|
|
366279
|
-
if (ch ===
|
|
366475
|
+
if (ch === quote2) {
|
|
366280
366476
|
result += text2.substring(start22, pos);
|
|
366281
366477
|
pos++;
|
|
366282
366478
|
break;
|
|
@@ -505221,7 +505417,7 @@ ${lanes.join("\n")}
|
|
|
505221
505417
|
return checker.getContextualType(node, contextFlags);
|
|
505222
505418
|
}
|
|
505223
505419
|
}
|
|
505224
|
-
function
|
|
505420
|
+
function quote(sourceFile, preferences, text2) {
|
|
505225
505421
|
const quotePreference = getQuotePreference(sourceFile, preferences);
|
|
505226
505422
|
const quoted = JSON.stringify(text2);
|
|
505227
505423
|
return quotePreference === 0 ? `'${stripQuotes(quoted).replace(/'/g, () => "\\'").replace(/\\"/g, '"')}'` : quoted;
|
|
@@ -524169,8 +524365,8 @@ ${newComment.split("\n").map((c9) => ` * ${c9}`).join("\n")}
|
|
|
524169
524365
|
changes.insertText(sourceFile, position, getImportTypePrefix(moduleSpecifier, quotePreference));
|
|
524170
524366
|
}
|
|
524171
524367
|
function getImportTypePrefix(moduleSpecifier, quotePreference) {
|
|
524172
|
-
const
|
|
524173
|
-
return `import(${
|
|
524368
|
+
const quote2 = getQuoteFromPreference(quotePreference);
|
|
524369
|
+
return `import(${quote2}${moduleSpecifier}${quote2}).`;
|
|
524174
524370
|
}
|
|
524175
524371
|
function needsTypeOnly({ addAsTypeOnly }) {
|
|
524176
524372
|
return addAsTypeOnly === 2;
|
|
@@ -526619,7 +526815,7 @@ ${newComment.split("\n").map((c9) => ` * ${c9}`).join("\n")}
|
|
|
526619
526815
|
if (!isValidCharacter(character)) {
|
|
526620
526816
|
return;
|
|
526621
526817
|
}
|
|
526622
|
-
const replacement = useHtmlEntity ? htmlEntity[character] : `{${
|
|
526818
|
+
const replacement = useHtmlEntity ? htmlEntity[character] : `{${quote(sourceFile, preferences, character)}}`;
|
|
526623
526819
|
changes.replaceRangeWithText(sourceFile, { pos: start2, end: start2 + 1 }, replacement);
|
|
526624
526820
|
}
|
|
526625
526821
|
var deleteUnmatchedParameter = "deleteUnmatchedParameter";
|
|
@@ -532371,7 +532567,7 @@ ${newComment.split("\n").map((c9) => ` * ${c9}`).join("\n")}
|
|
|
532371
532567
|
});
|
|
532372
532568
|
}
|
|
532373
532569
|
function completionNameForLiteral(sourceFile, preferences, literal) {
|
|
532374
|
-
return typeof literal === "object" ? pseudoBigIntToString(literal) + "n" : isString(literal) ?
|
|
532570
|
+
return typeof literal === "object" ? pseudoBigIntToString(literal) + "n" : isString(literal) ? quote(sourceFile, preferences, literal) : JSON.stringify(literal);
|
|
532375
532571
|
}
|
|
532376
532572
|
function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
532377
532573
|
return {
|
|
@@ -532484,7 +532680,7 @@ ${newComment.split("\n").map((c9) => ` * ${c9}`).join("\n")}
|
|
|
532484
532680
|
const type = typeChecker.getTypeOfSymbolAtLocation(symbol3, location);
|
|
532485
532681
|
if (preferences.jsxAttributeCompletionStyle === "auto" && !(type.flags & 8448) && !(type.flags & 134217728 && find(type.types, (type2) => !!(type2.flags & 8448)))) {
|
|
532486
532682
|
if (type.flags & 12583968 || type.flags & 134217728 && every(type.types, (type2) => !!(type2.flags & (12583968 | 4) || isStringAndEmptyAnonymousObjectIntersection(type2)))) {
|
|
532487
|
-
insertText = `${escapeSnippetText(name10)}=${
|
|
532683
|
+
insertText = `${escapeSnippetText(name10)}=${quote(sourceFile, preferences, "$1")}`;
|
|
532488
532684
|
isSnippet = true;
|
|
532489
532685
|
} else {
|
|
532490
532686
|
useBraces2 = true;
|
|
@@ -533039,7 +533235,7 @@ ${newComment.split("\n").map((c9) => ` * ${c9}`).join("\n")}
|
|
|
533039
533235
|
}
|
|
533040
533236
|
function getInsertTextAndReplacementSpanForImportCompletion(name10, importStatementCompletion, origin, useSemicolons, sourceFile, program, preferences) {
|
|
533041
533237
|
const replacementSpan = importStatementCompletion.replacementSpan;
|
|
533042
|
-
const quotedModuleSpecifier = escapeSnippetText(
|
|
533238
|
+
const quotedModuleSpecifier = escapeSnippetText(quote(sourceFile, preferences, origin.moduleSpecifier));
|
|
533043
533239
|
const exportKind = origin.isDefaultExport ? 1 : origin.exportName === "export=" ? 2 : 0;
|
|
533044
533240
|
const tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : "";
|
|
533045
533241
|
const importKind = ts_codefix_exports.getImportKind(
|
|
@@ -533074,7 +533270,7 @@ ${newComment.split("\n").map((c9) => ` * ${c9}`).join("\n")}
|
|
|
533074
533270
|
if (/^\d+$/.test(name10)) {
|
|
533075
533271
|
return name10;
|
|
533076
533272
|
}
|
|
533077
|
-
return
|
|
533273
|
+
return quote(sourceFile, preferences, name10);
|
|
533078
533274
|
}
|
|
533079
533275
|
function isRecommendedCompletionMatch(localSymbol, recommendedCompletion, checker) {
|
|
533080
533276
|
return localSymbol === recommendedCompletion || !!(localSymbol.flags & 1048576) && checker.getExportSymbolOfSymbol(localSymbol) === recommendedCompletion;
|
|
@@ -537685,8 +537881,8 @@ ${newComment.split("\n").map((c9) => ` * ${c9}`).join("\n")}
|
|
|
537685
537881
|
}
|
|
537686
537882
|
}
|
|
537687
537883
|
if (entry.kind !== 0 && isNumericLiteral(entry.node) && isAccessExpression(entry.node.parent)) {
|
|
537688
|
-
const
|
|
537689
|
-
return { prefixText:
|
|
537884
|
+
const quote2 = getQuoteFromPreference(quotePreference);
|
|
537885
|
+
return { prefixText: quote2, suffixText: quote2 };
|
|
537690
537886
|
}
|
|
537691
537887
|
return emptyOptions;
|
|
537692
537888
|
}
|
|
@@ -551745,7 +551941,7 @@ ${options2.prefix}` : "\n" : options2.prefix
|
|
|
551745
551941
|
pseudoBigIntToString: () => pseudoBigIntToString,
|
|
551746
551942
|
punctuationPart: () => punctuationPart,
|
|
551747
551943
|
pushIfUnique: () => pushIfUnique,
|
|
551748
|
-
quote: () =>
|
|
551944
|
+
quote: () => quote,
|
|
551749
551945
|
quotePreferenceFromString: () => quotePreferenceFromString,
|
|
551750
551946
|
rangeContainsPosition: () => rangeContainsPosition,
|
|
551751
551947
|
rangeContainsPositionExclusive: () => rangeContainsPositionExclusive,
|
|
@@ -567965,7 +568161,7 @@ var require_parse4 = __commonJS({
|
|
|
567965
568161
|
const parts = [];
|
|
567966
568162
|
let bracket = 0;
|
|
567967
568163
|
let paren = 0;
|
|
567968
|
-
let
|
|
568164
|
+
let quote = 0;
|
|
567969
568165
|
let value2 = "";
|
|
567970
568166
|
let escaped = false;
|
|
567971
568167
|
for (const ch of input) {
|
|
@@ -567980,11 +568176,11 @@ var require_parse4 = __commonJS({
|
|
|
567980
568176
|
continue;
|
|
567981
568177
|
}
|
|
567982
568178
|
if (ch === '"') {
|
|
567983
|
-
|
|
568179
|
+
quote = quote === 1 ? 0 : 1;
|
|
567984
568180
|
value2 += ch;
|
|
567985
568181
|
continue;
|
|
567986
568182
|
}
|
|
567987
|
-
if (
|
|
568183
|
+
if (quote === 0) {
|
|
567988
568184
|
if (ch === "[") {
|
|
567989
568185
|
bracket++;
|
|
567990
568186
|
} else if (ch === "]" && bracket > 0) {
|
|
@@ -568061,7 +568257,7 @@ var require_parse4 = __commonJS({
|
|
|
568061
568257
|
}
|
|
568062
568258
|
let bracket = 0;
|
|
568063
568259
|
let paren = 0;
|
|
568064
|
-
let
|
|
568260
|
+
let quote = 0;
|
|
568065
568261
|
let escaped = false;
|
|
568066
568262
|
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
568067
568263
|
const ch = pattern[i2];
|
|
@@ -568074,10 +568270,10 @@ var require_parse4 = __commonJS({
|
|
|
568074
568270
|
continue;
|
|
568075
568271
|
}
|
|
568076
568272
|
if (ch === '"') {
|
|
568077
|
-
|
|
568273
|
+
quote = quote === 1 ? 0 : 1;
|
|
568078
568274
|
continue;
|
|
568079
568275
|
}
|
|
568080
|
-
if (
|
|
568276
|
+
if (quote === 1) {
|
|
568081
568277
|
continue;
|
|
568082
568278
|
}
|
|
568083
568279
|
if (ch === "[") {
|
|
@@ -596491,11 +596687,11 @@ var init_code_neighbors = __esm({
|
|
|
596491
596687
|
});
|
|
596492
596688
|
|
|
596493
596689
|
// packages/execution/dist/tools/process-health.js
|
|
596494
|
-
import { execSync as
|
|
596690
|
+
import { execSync as execSync23 } from "node:child_process";
|
|
596495
596691
|
function getSystemStatus() {
|
|
596496
596692
|
const lines = ["# System Health\n"];
|
|
596497
596693
|
try {
|
|
596498
|
-
const uptime2 =
|
|
596694
|
+
const uptime2 = execSync23("uptime", { encoding: "utf-8", timeout: 3e3 }).trim();
|
|
596499
596695
|
const loadMatch = uptime2.match(/load average:\s*([\d.]+),\s*([\d.]+),\s*([\d.]+)/);
|
|
596500
596696
|
if (loadMatch) {
|
|
596501
596697
|
lines.push(`CPU Load: ${loadMatch[1]} (1m) ${loadMatch[2]} (5m) ${loadMatch[3]} (15m)`);
|
|
@@ -596508,20 +596704,20 @@ function getSystemStatus() {
|
|
|
596508
596704
|
} catch {
|
|
596509
596705
|
}
|
|
596510
596706
|
try {
|
|
596511
|
-
const mem =
|
|
596707
|
+
const mem = execSync23("free -h | head -2", { encoding: "utf-8", timeout: 3e3 }).trim();
|
|
596512
596708
|
lines.push(`
|
|
596513
596709
|
${mem}`);
|
|
596514
596710
|
} catch {
|
|
596515
596711
|
}
|
|
596516
596712
|
try {
|
|
596517
|
-
const top =
|
|
596713
|
+
const top = execSync23("ps aux --sort=-%cpu | head -8", { encoding: "utf-8", timeout: 3e3 }).trim();
|
|
596518
596714
|
lines.push(`
|
|
596519
596715
|
Top processes by CPU:
|
|
596520
596716
|
${top}`);
|
|
596521
596717
|
} catch {
|
|
596522
596718
|
}
|
|
596523
596719
|
try {
|
|
596524
|
-
const nodeCount =
|
|
596720
|
+
const nodeCount = execSync23("ps aux | grep 'node ' | grep -v grep | wc -l", { encoding: "utf-8", timeout: 3e3 }).trim();
|
|
596525
596721
|
lines.push(`
|
|
596526
596722
|
Node.js processes: ${nodeCount}`);
|
|
596527
596723
|
} catch {
|
|
@@ -596530,7 +596726,7 @@ Node.js processes: ${nodeCount}`);
|
|
|
596530
596726
|
}
|
|
596531
596727
|
function findOrphans() {
|
|
596532
596728
|
try {
|
|
596533
|
-
const psOutput =
|
|
596729
|
+
const psOutput = execSync23(`ps -eo pid,ppid,%cpu,%mem,etime,args --no-headers 2>/dev/null | grep -E "${OMNIUS_PATTERNS}" | grep -v grep`, { encoding: "utf-8", timeout: 5e3, stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
596534
596730
|
if (!psOutput)
|
|
596535
596731
|
return "No Omnius-related orphan processes found.";
|
|
596536
596732
|
const myPid = process.pid;
|
|
@@ -596643,7 +596839,7 @@ var init_process_health = __esm({
|
|
|
596643
596839
|
});
|
|
596644
596840
|
|
|
596645
596841
|
// packages/execution/dist/tools/audio-capture.js
|
|
596646
|
-
import { execSync as
|
|
596842
|
+
import { execSync as execSync24 } from "node:child_process";
|
|
596647
596843
|
import { readFileSync as readFileSync48, unlinkSync as unlinkSync13, existsSync as existsSync65, mkdirSync as mkdirSync38, statSync as statSync27 } from "node:fs";
|
|
596648
596844
|
import { join as join80 } from "node:path";
|
|
596649
596845
|
import { tmpdir as tmpdir11 } from "node:os";
|
|
@@ -596711,7 +596907,7 @@ var init_audio_capture = __esm({
|
|
|
596711
596907
|
listDevices(start2) {
|
|
596712
596908
|
const devices = [];
|
|
596713
596909
|
try {
|
|
596714
|
-
const alsaList =
|
|
596910
|
+
const alsaList = execSync24("arecord -l 2>/dev/null", { encoding: "utf8", timeout: 5e3 });
|
|
596715
596911
|
const lines = alsaList.split("\n").filter((l2) => l2.startsWith("card "));
|
|
596716
596912
|
for (const line of lines) {
|
|
596717
596913
|
const match = line.match(/card (\d+): (.+?) \[(.+?)\], device (\d+): (.+?) \[(.+?)\]/);
|
|
@@ -596722,7 +596918,7 @@ var init_audio_capture = __esm({
|
|
|
596722
596918
|
} catch {
|
|
596723
596919
|
}
|
|
596724
596920
|
try {
|
|
596725
|
-
const sources =
|
|
596921
|
+
const sources = execSync24("pactl list short sources 2>/dev/null", { encoding: "utf8", timeout: 5e3 });
|
|
596726
596922
|
for (const line of sources.trim().split("\n").filter(Boolean)) {
|
|
596727
596923
|
const parts = line.split(" ");
|
|
596728
596924
|
if (parts.length >= 2) {
|
|
@@ -596803,7 +596999,7 @@ ${devices.join("\n")}`,
|
|
|
596803
596999
|
].join(" ");
|
|
596804
597000
|
}
|
|
596805
597001
|
try {
|
|
596806
|
-
|
|
597002
|
+
execSync24(cmd, { timeout: timeoutMs, stdio: "pipe" });
|
|
596807
597003
|
} catch (err) {
|
|
596808
597004
|
const msg = err instanceof Error ? err.message : String(err);
|
|
596809
597005
|
if (msg.includes("Device or resource busy")) {
|
|
@@ -596841,7 +597037,7 @@ Saved to: ${tempFile}`,
|
|
|
596841
597037
|
const device2 = args["device"] || "default";
|
|
596842
597038
|
const tempFile = join80(tmpdir11(), `omnius-level-${Date.now()}.raw`);
|
|
596843
597039
|
try {
|
|
596844
|
-
|
|
597040
|
+
execSync24(`arecord -D ${device2} -f S16_LE -r 16000 -c 1 -d 1 -t raw -q ${tempFile}`, { timeout: 5e3, stdio: "pipe" });
|
|
596845
597041
|
if (!existsSync65(tempFile)) {
|
|
596846
597042
|
return { success: false, output: "", error: "Could not read mic level.", durationMs: performance.now() - start2 };
|
|
596847
597043
|
}
|
|
@@ -596894,10 +597090,10 @@ Saved to: ${tempFile}`,
|
|
|
596894
597090
|
});
|
|
596895
597091
|
|
|
596896
597092
|
// packages/execution/dist/tools/audio-playback.js
|
|
596897
|
-
import { execFileSync as execFileSync2, execSync as
|
|
597093
|
+
import { execFileSync as execFileSync2, execSync as execSync25, spawn as spawn20 } from "node:child_process";
|
|
596898
597094
|
import { copyFileSync as copyFileSync4, existsSync as existsSync66, statSync as statSync28, writeFileSync as writeFileSync32, mkdirSync as mkdirSync39, readdirSync as readdirSync23, writeSync as writeSync2, rmSync as rmSync9 } from "node:fs";
|
|
596899
597095
|
import { basename as basename14, dirname as dirname27, extname as extname14, isAbsolute as isAbsolute5, join as join81, resolve as resolve42 } from "node:path";
|
|
596900
|
-
import { homedir as
|
|
597096
|
+
import { homedir as homedir16, tmpdir as tmpdir12 } from "node:os";
|
|
596901
597097
|
function ttsPythonEnv(extra = {}) {
|
|
596902
597098
|
const { TRANSFORMERS_CACHE: _deprecatedCache, ...baseEnv } = process.env;
|
|
596903
597099
|
const { TRANSFORMERS_CACHE: _extraDeprecatedCache, ...safeExtra } = extra;
|
|
@@ -597012,7 +597208,7 @@ function generatedVoiceDir() {
|
|
|
597012
597208
|
return join81(voiceDir(), "generated");
|
|
597013
597209
|
}
|
|
597014
597210
|
function expandHome(path16) {
|
|
597015
|
-
return path16.startsWith("~/") ? join81(
|
|
597211
|
+
return path16.startsWith("~/") ? join81(homedir16(), path16.slice(2)) : path16;
|
|
597016
597212
|
}
|
|
597017
597213
|
function resolvePath3(path16) {
|
|
597018
597214
|
const expanded = expandHome(path16);
|
|
@@ -597166,7 +597362,7 @@ function mergeDir(src2, dst) {
|
|
|
597166
597362
|
}
|
|
597167
597363
|
function consolidateVoiceDirs() {
|
|
597168
597364
|
const globalVoice = voiceDir();
|
|
597169
|
-
const oldVoice = join81(
|
|
597365
|
+
const oldVoice = join81(homedir16(), ".open-agents", "voice");
|
|
597170
597366
|
if (existsSync66(oldVoice)) {
|
|
597171
597367
|
mergeDir(join81(oldVoice, "clone-refs"), join81(globalVoice, "clone-refs"));
|
|
597172
597368
|
mergeDir(join81(oldVoice, "models"), join81(globalVoice, "models"));
|
|
@@ -597186,7 +597382,7 @@ function consolidateVoiceDirs() {
|
|
|
597186
597382
|
dir = dirname27(dir);
|
|
597187
597383
|
}
|
|
597188
597384
|
for (const root of _projectRoots) {
|
|
597189
|
-
const rootDir2 = join81(
|
|
597385
|
+
const rootDir2 = join81(homedir16(), root);
|
|
597190
597386
|
if (!existsSync66(rootDir2))
|
|
597191
597387
|
continue;
|
|
597192
597388
|
try {
|
|
@@ -598761,7 +598957,7 @@ ${tried.map((line) => `- ${line}`).join("\n")}`,
|
|
|
598761
598957
|
if (targetVolume !== void 0) {
|
|
598762
598958
|
const vol = Math.min(100, Math.max(0, Math.round(targetVolume)));
|
|
598763
598959
|
try {
|
|
598764
|
-
|
|
598960
|
+
execSync25(`amixer set Master ${vol}% 2>/dev/null`, {
|
|
598765
598961
|
timeout: 5e3,
|
|
598766
598962
|
stdio: "pipe"
|
|
598767
598963
|
});
|
|
@@ -598772,7 +598968,7 @@ ${tried.map((line) => `- ${line}`).join("\n")}`,
|
|
|
598772
598968
|
};
|
|
598773
598969
|
} catch {
|
|
598774
598970
|
try {
|
|
598775
|
-
|
|
598971
|
+
execSync25(`pactl set-sink-volume @DEFAULT_SINK@ ${vol}%`, {
|
|
598776
598972
|
timeout: 5e3,
|
|
598777
598973
|
stdio: "pipe"
|
|
598778
598974
|
});
|
|
@@ -598792,7 +598988,7 @@ ${tried.map((line) => `- ${line}`).join("\n")}`,
|
|
|
598792
598988
|
}
|
|
598793
598989
|
}
|
|
598794
598990
|
try {
|
|
598795
|
-
const out =
|
|
598991
|
+
const out = execSync25("amixer get Master 2>/dev/null", {
|
|
598796
598992
|
encoding: "utf8",
|
|
598797
598993
|
timeout: 5e3
|
|
598798
598994
|
});
|
|
@@ -598807,7 +599003,7 @@ ${tried.map((line) => `- ${line}`).join("\n")}`,
|
|
|
598807
599003
|
};
|
|
598808
599004
|
} catch {
|
|
598809
599005
|
try {
|
|
598810
|
-
const out =
|
|
599006
|
+
const out = execSync25("pactl get-sink-volume @DEFAULT_SINK@ 2>/dev/null", { encoding: "utf8", timeout: 5e3 });
|
|
598811
599007
|
const match = out.match(/(\d+)%/);
|
|
598812
599008
|
return {
|
|
598813
599009
|
success: true,
|
|
@@ -598827,7 +599023,7 @@ ${tried.map((line) => `- ${line}`).join("\n")}`,
|
|
|
598827
599023
|
listDevices(start2) {
|
|
598828
599024
|
const devices = [];
|
|
598829
599025
|
try {
|
|
598830
|
-
const alsaList =
|
|
599026
|
+
const alsaList = execSync25("aplay -l 2>/dev/null", {
|
|
598831
599027
|
encoding: "utf8",
|
|
598832
599028
|
timeout: 5e3
|
|
598833
599029
|
});
|
|
@@ -598841,7 +599037,7 @@ ${tried.map((line) => `- ${line}`).join("\n")}`,
|
|
|
598841
599037
|
} catch {
|
|
598842
599038
|
}
|
|
598843
599039
|
try {
|
|
598844
|
-
const sinks =
|
|
599040
|
+
const sinks = execSync25("pactl list short sinks 2>/dev/null", {
|
|
598845
599041
|
encoding: "utf8",
|
|
598846
599042
|
timeout: 5e3
|
|
598847
599043
|
});
|
|
@@ -599018,7 +599214,7 @@ ${devices.join("\n")}`,
|
|
|
599018
599214
|
});
|
|
599019
599215
|
|
|
599020
599216
|
// packages/execution/dist/tools/wifi-control.js
|
|
599021
|
-
import { execSync as
|
|
599217
|
+
import { execSync as execSync26 } from "node:child_process";
|
|
599022
599218
|
var WifiControlTool;
|
|
599023
599219
|
var init_wifi_control = __esm({
|
|
599024
599220
|
"packages/execution/dist/tools/wifi-control.js"() {
|
|
@@ -599086,17 +599282,17 @@ var init_wifi_control = __esm({
|
|
|
599086
599282
|
return { success: false, output: "", error: "No WiFi interface found. Connect a WiFi adapter.", durationMs: performance.now() - start2 };
|
|
599087
599283
|
}
|
|
599088
599284
|
try {
|
|
599089
|
-
|
|
599285
|
+
execSync26(`test -d /sys/class/net/${iface}`, { timeout: 2e3, stdio: "pipe" });
|
|
599090
599286
|
} catch {
|
|
599091
599287
|
return { success: false, output: "", error: `WiFi interface '${iface}' does not exist. Use wifi_control action='interfaces' to see available adapters.`, durationMs: performance.now() - start2 };
|
|
599092
599288
|
}
|
|
599093
599289
|
try {
|
|
599094
|
-
|
|
599095
|
-
|
|
599290
|
+
execSync26(`nmcli device wifi rescan ifname ${iface} 2>/dev/null`, { timeout: 1e4, stdio: "pipe" });
|
|
599291
|
+
execSync26("sleep 1", { timeout: 5e3 });
|
|
599096
599292
|
} catch {
|
|
599097
599293
|
}
|
|
599098
599294
|
try {
|
|
599099
|
-
const raw =
|
|
599295
|
+
const raw = execSync26(`nmcli -t -f BSSID,SSID,MODE,CHAN,FREQ,RATE,SIGNAL,BARS,SECURITY,IN-USE device wifi list ifname ${iface} 2>/dev/null`, { encoding: "utf8", timeout: 15e3 });
|
|
599100
599296
|
const networks = [];
|
|
599101
599297
|
for (const line of raw.trim().split("\n").filter(Boolean)) {
|
|
599102
599298
|
const parts = line.split(":");
|
|
@@ -599134,7 +599330,7 @@ ${"-".repeat(90)}
|
|
|
599134
599330
|
};
|
|
599135
599331
|
} catch (err) {
|
|
599136
599332
|
try {
|
|
599137
|
-
const iwScan =
|
|
599333
|
+
const iwScan = execSync26(`iw dev ${iface} scan 2>/dev/null | grep -E "SSID:|signal:|freq:" | head -60`, { encoding: "utf8", timeout: 15e3 });
|
|
599138
599334
|
return { success: true, output: `WiFi scan (iw fallback) on ${iface}:
|
|
599139
599335
|
${iwScan}`, durationMs: performance.now() - start2 };
|
|
599140
599336
|
} catch {
|
|
@@ -599148,36 +599344,36 @@ ${iwScan}`, durationMs: performance.now() - start2 };
|
|
|
599148
599344
|
listInterfaces(start2) {
|
|
599149
599345
|
const interfaces = [];
|
|
599150
599346
|
try {
|
|
599151
|
-
const ifaces =
|
|
599347
|
+
const ifaces = execSync26("ls /sys/class/net/", { encoding: "utf8", timeout: 5e3 }).trim().split("\n");
|
|
599152
599348
|
for (const iface of ifaces) {
|
|
599153
599349
|
try {
|
|
599154
|
-
|
|
599350
|
+
execSync26(`test -d /sys/class/net/${iface}/wireless`, { timeout: 2e3, stdio: "pipe" });
|
|
599155
599351
|
let info = ` ${iface}:`;
|
|
599156
599352
|
try {
|
|
599157
|
-
const driver =
|
|
599353
|
+
const driver = execSync26(`readlink /sys/class/net/${iface}/device/driver 2>/dev/null`, { encoding: "utf8", timeout: 2e3 }).trim().split("/").pop();
|
|
599158
599354
|
info += ` driver=${driver}`;
|
|
599159
599355
|
} catch {
|
|
599160
599356
|
}
|
|
599161
599357
|
try {
|
|
599162
|
-
const mac =
|
|
599358
|
+
const mac = execSync26(`cat /sys/class/net/${iface}/address 2>/dev/null`, { encoding: "utf8", timeout: 2e3 }).trim();
|
|
599163
599359
|
info += ` mac=${mac}`;
|
|
599164
599360
|
} catch {
|
|
599165
599361
|
}
|
|
599166
599362
|
try {
|
|
599167
|
-
const state3 =
|
|
599363
|
+
const state3 = execSync26(`cat /sys/class/net/${iface}/operstate 2>/dev/null`, { encoding: "utf8", timeout: 2e3 }).trim();
|
|
599168
599364
|
info += ` state=${state3}`;
|
|
599169
599365
|
} catch {
|
|
599170
599366
|
}
|
|
599171
599367
|
try {
|
|
599172
|
-
const uevent =
|
|
599368
|
+
const uevent = execSync26(`cat /sys/class/net/${iface}/device/uevent 2>/dev/null`, { encoding: "utf8", timeout: 2e3 });
|
|
599173
599369
|
const prodMatch = uevent.match(/PRODUCT=([^\n]+)/);
|
|
599174
599370
|
if (prodMatch)
|
|
599175
599371
|
info += ` usb=${prodMatch[1]}`;
|
|
599176
599372
|
} catch {
|
|
599177
599373
|
}
|
|
599178
599374
|
try {
|
|
599179
|
-
const conn =
|
|
599180
|
-
const devConn =
|
|
599375
|
+
const conn = execSync26(`nmcli -t -f NAME connection show --active 2>/dev/null | head -1`, { encoding: "utf8", timeout: 3e3 }).trim();
|
|
599376
|
+
const devConn = execSync26(`nmcli -t -f DEVICE connection show --active 2>/dev/null | head -1`, { encoding: "utf8", timeout: 3e3 }).trim();
|
|
599181
599377
|
if (devConn === iface && conn)
|
|
599182
599378
|
info += ` connected="${conn}"`;
|
|
599183
599379
|
} catch {
|
|
@@ -599189,7 +599385,7 @@ ${iwScan}`, durationMs: performance.now() - start2 };
|
|
|
599189
599385
|
} catch {
|
|
599190
599386
|
}
|
|
599191
599387
|
try {
|
|
599192
|
-
const lsusb =
|
|
599388
|
+
const lsusb = execSync26("lsusb 2>/dev/null", { encoding: "utf8", timeout: 5e3 });
|
|
599193
599389
|
const usbWifi = lsusb.split("\n").filter((l2) => /wireless|wifi|802\.11|rtl88|mt76|ath9k|ac600|archer/i.test(l2) && !l2.includes("Bluetooth"));
|
|
599194
599390
|
for (const dev of usbWifi) {
|
|
599195
599391
|
const already = interfaces.some((i2) => {
|
|
@@ -599227,7 +599423,7 @@ ${interfaces.join("\n")}`,
|
|
|
599227
599423
|
}
|
|
599228
599424
|
const cmd = password ? `nmcli device wifi connect "${ssid}" password "${password}" ifname ${iface}` : `nmcli device wifi connect "${ssid}" ifname ${iface}`;
|
|
599229
599425
|
try {
|
|
599230
|
-
|
|
599426
|
+
execSync26(cmd, { encoding: "utf8", timeout: 3e4, stdio: "pipe" });
|
|
599231
599427
|
} catch (err) {
|
|
599232
599428
|
const msg = err instanceof Error ? err.message : String(err);
|
|
599233
599429
|
if (msg.includes("No network with SSID")) {
|
|
@@ -599239,8 +599435,8 @@ ${interfaces.join("\n")}`,
|
|
|
599239
599435
|
return { success: false, output: "", error: `Failed to connect to "${ssid}": ${msg.slice(0, 300)}`, durationMs: performance.now() - start2 };
|
|
599240
599436
|
}
|
|
599241
599437
|
try {
|
|
599242
|
-
|
|
599243
|
-
const ip =
|
|
599438
|
+
execSync26("sleep 2", { timeout: 5e3 });
|
|
599439
|
+
const ip = execSync26(`ip addr show ${iface} | grep "inet " | awk '{print $2}'`, { encoding: "utf8", timeout: 5e3 }).trim();
|
|
599244
599440
|
return { success: true, output: `Connected to "${ssid}" on ${iface}.
|
|
599245
599441
|
IP address: ${ip}`, durationMs: performance.now() - start2 };
|
|
599246
599442
|
} catch {
|
|
@@ -599256,7 +599452,7 @@ IP address: ${ip}`, durationMs: performance.now() - start2 };
|
|
|
599256
599452
|
return { success: false, output: "", error: "No WiFi interface found.", durationMs: performance.now() - start2 };
|
|
599257
599453
|
}
|
|
599258
599454
|
try {
|
|
599259
|
-
|
|
599455
|
+
execSync26(`nmcli device disconnect ${iface}`, { timeout: 1e4, stdio: "pipe" });
|
|
599260
599456
|
return { success: true, output: `Disconnected ${iface} from WiFi.`, durationMs: performance.now() - start2 };
|
|
599261
599457
|
} catch (err) {
|
|
599262
599458
|
return { success: false, output: "", error: `Disconnect failed: ${err instanceof Error ? err.message : String(err)}`, durationMs: performance.now() - start2 };
|
|
@@ -599272,24 +599468,24 @@ IP address: ${ip}`, durationMs: performance.now() - start2 };
|
|
|
599272
599468
|
}
|
|
599273
599469
|
const info = [`WiFi status for ${iface}:`];
|
|
599274
599470
|
try {
|
|
599275
|
-
const state3 =
|
|
599471
|
+
const state3 = execSync26(`nmcli -t -f GENERAL.STATE device show ${iface} 2>/dev/null`, { encoding: "utf8", timeout: 5e3 });
|
|
599276
599472
|
const stateMatch = state3.match(/GENERAL\.STATE:(.+)/);
|
|
599277
599473
|
info.push(` State: ${stateMatch ? stateMatch[1].trim() : "unknown"}`);
|
|
599278
599474
|
} catch {
|
|
599279
599475
|
}
|
|
599280
599476
|
try {
|
|
599281
|
-
const conn =
|
|
599477
|
+
const conn = execSync26(`nmcli -t -f GENERAL.CONNECTION device show ${iface} 2>/dev/null`, { encoding: "utf8", timeout: 5e3 });
|
|
599282
599478
|
const connMatch = conn.match(/GENERAL\.CONNECTION:(.+)/);
|
|
599283
599479
|
info.push(` Network: ${connMatch ? connMatch[1].trim() || "(not connected)" : "(not connected)"}`);
|
|
599284
599480
|
} catch {
|
|
599285
599481
|
}
|
|
599286
599482
|
try {
|
|
599287
|
-
const ip =
|
|
599483
|
+
const ip = execSync26(`ip addr show ${iface} 2>/dev/null | grep "inet " | awk '{print $2}'`, { encoding: "utf8", timeout: 5e3 }).trim();
|
|
599288
599484
|
info.push(` IP: ${ip || "(no IP)"}`);
|
|
599289
599485
|
} catch {
|
|
599290
599486
|
}
|
|
599291
599487
|
try {
|
|
599292
|
-
const iwconfig =
|
|
599488
|
+
const iwconfig = execSync26(`iwconfig ${iface} 2>/dev/null`, { encoding: "utf8", timeout: 5e3 });
|
|
599293
599489
|
const signalMatch = iwconfig.match(/Signal level[=:](-?\d+)\s*dBm/);
|
|
599294
599490
|
const linkMatch = iwconfig.match(/Link Quality[=:](\d+\/\d+)/);
|
|
599295
599491
|
const bitRateMatch = iwconfig.match(/Bit Rate[=:]([^\s]+)/);
|
|
@@ -599305,13 +599501,13 @@ IP address: ${ip}`, durationMs: performance.now() - start2 };
|
|
|
599305
599501
|
} catch {
|
|
599306
599502
|
}
|
|
599307
599503
|
try {
|
|
599308
|
-
const gw =
|
|
599504
|
+
const gw = execSync26(`ip route show dev ${iface} 2>/dev/null | grep default | awk '{print $3}'`, { encoding: "utf8", timeout: 5e3 }).trim();
|
|
599309
599505
|
if (gw)
|
|
599310
599506
|
info.push(` Gateway: ${gw}`);
|
|
599311
599507
|
} catch {
|
|
599312
599508
|
}
|
|
599313
599509
|
try {
|
|
599314
|
-
const dns2 =
|
|
599510
|
+
const dns2 = execSync26(`nmcli -t -f IP4.DNS device show ${iface} 2>/dev/null`, { encoding: "utf8", timeout: 5e3 });
|
|
599315
599511
|
const dnsServers = dns2.match(/IP4\.DNS\[?\d*\]?:(.+)/g);
|
|
599316
599512
|
if (dnsServers)
|
|
599317
599513
|
info.push(` DNS: ${dnsServers.map((d2) => d2.split(":")[1]).join(", ")}`);
|
|
@@ -599330,7 +599526,7 @@ IP address: ${ip}`, durationMs: performance.now() - start2 };
|
|
|
599330
599526
|
const enable = args["enable"] !== false;
|
|
599331
599527
|
if (enable) {
|
|
599332
599528
|
try {
|
|
599333
|
-
|
|
599529
|
+
execSync26(`ip link set ${iface} down && iw dev ${iface} set type monitor && ip link set ${iface} up`, { timeout: 1e4, stdio: "pipe" });
|
|
599334
599530
|
return { success: true, output: `Monitor mode ENABLED on ${iface}. Use 'monitor enable=false' to restore managed mode.`, durationMs: performance.now() - start2 };
|
|
599335
599531
|
} catch (err) {
|
|
599336
599532
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -599341,7 +599537,7 @@ IP address: ${ip}`, durationMs: performance.now() - start2 };
|
|
|
599341
599537
|
}
|
|
599342
599538
|
} else {
|
|
599343
599539
|
try {
|
|
599344
|
-
|
|
599540
|
+
execSync26(`ip link set ${iface} down && iw dev ${iface} set type managed && ip link set ${iface} up`, { timeout: 1e4, stdio: "pipe" });
|
|
599345
599541
|
return { success: true, output: `Monitor mode DISABLED on ${iface}. Restored to managed mode.`, durationMs: performance.now() - start2 };
|
|
599346
599542
|
} catch (err) {
|
|
599347
599543
|
return { success: false, output: "", error: `Failed to disable monitor mode: ${err instanceof Error ? err.message : String(err)}`, durationMs: performance.now() - start2 };
|
|
@@ -599353,10 +599549,10 @@ IP address: ${ip}`, durationMs: performance.now() - start2 };
|
|
|
599353
599549
|
// =========================================================================
|
|
599354
599550
|
findWifiInterface() {
|
|
599355
599551
|
try {
|
|
599356
|
-
const ifaces =
|
|
599552
|
+
const ifaces = execSync26("ls /sys/class/net/", { encoding: "utf8", timeout: 3e3 }).trim().split("\n");
|
|
599357
599553
|
for (const iface of ifaces) {
|
|
599358
599554
|
try {
|
|
599359
|
-
|
|
599555
|
+
execSync26(`test -d /sys/class/net/${iface}/wireless`, { timeout: 2e3, stdio: "pipe" });
|
|
599360
599556
|
return iface;
|
|
599361
599557
|
} catch {
|
|
599362
599558
|
}
|
|
@@ -599370,7 +599566,7 @@ IP address: ${ip}`, durationMs: performance.now() - start2 };
|
|
|
599370
599566
|
});
|
|
599371
599567
|
|
|
599372
599568
|
// packages/execution/dist/tools/bluetooth-scan.js
|
|
599373
|
-
import { execSync as
|
|
599569
|
+
import { execSync as execSync27 } from "node:child_process";
|
|
599374
599570
|
var BluetoothScanTool;
|
|
599375
599571
|
var init_bluetooth_scan = __esm({
|
|
599376
599572
|
"packages/execution/dist/tools/bluetooth-scan.js"() {
|
|
@@ -599424,7 +599620,7 @@ var init_bluetooth_scan = __esm({
|
|
|
599424
599620
|
const timeout2 = args["timeout"] || 8;
|
|
599425
599621
|
const devices = [];
|
|
599426
599622
|
try {
|
|
599427
|
-
const classic =
|
|
599623
|
+
const classic = execSync27(`hcitool -i ${hci} scan --length=${timeout2} 2>/dev/null`, { encoding: "utf8", timeout: (timeout2 + 5) * 1e3 });
|
|
599428
599624
|
for (const line of classic.split("\n")) {
|
|
599429
599625
|
const match = line.trim().match(/^([0-9A-F:]{17})\s+(.+)$/i);
|
|
599430
599626
|
if (match)
|
|
@@ -599433,7 +599629,7 @@ var init_bluetooth_scan = __esm({
|
|
|
599433
599629
|
} catch {
|
|
599434
599630
|
}
|
|
599435
599631
|
try {
|
|
599436
|
-
const ble =
|
|
599632
|
+
const ble = execSync27(`timeout ${Math.min(timeout2, 5)} hcitool -i ${hci} lescan --duplicates 2>/dev/null || true`, { encoding: "utf8", timeout: (timeout2 + 5) * 1e3 });
|
|
599437
599633
|
const seen = /* @__PURE__ */ new Set();
|
|
599438
599634
|
for (const line of ble.split("\n")) {
|
|
599439
599635
|
const match = line.trim().match(/^([0-9A-F:]{17})\s+(.*)$/i);
|
|
@@ -599446,7 +599642,7 @@ var init_bluetooth_scan = __esm({
|
|
|
599446
599642
|
}
|
|
599447
599643
|
if (devices.length === 0) {
|
|
599448
599644
|
try {
|
|
599449
|
-
const btctl =
|
|
599645
|
+
const btctl = execSync27(`echo -e "scan on\\n" | timeout ${timeout2} bluetoothctl 2>/dev/null | grep "Device "`, { encoding: "utf8", timeout: (timeout2 + 5) * 1e3 });
|
|
599450
599646
|
for (const line of btctl.split("\n")) {
|
|
599451
599647
|
const match = line.match(/Device\s+([0-9A-F:]{17})\s+(.+)/i);
|
|
599452
599648
|
if (match)
|
|
@@ -599470,7 +599666,7 @@ ${lines.join("\n")}`,
|
|
|
599470
599666
|
listInterfaces(start2) {
|
|
599471
599667
|
const adapters = [];
|
|
599472
599668
|
try {
|
|
599473
|
-
const hciconfig =
|
|
599669
|
+
const hciconfig = execSync27("hciconfig -a 2>/dev/null", { encoding: "utf8", timeout: 5e3 });
|
|
599474
599670
|
const blocks = hciconfig.split(/^(hci\d+)/m);
|
|
599475
599671
|
for (let i2 = 1; i2 < blocks.length; i2 += 2) {
|
|
599476
599672
|
const name10 = blocks[i2];
|
|
@@ -599482,9 +599678,9 @@ ${lines.join("\n")}`,
|
|
|
599482
599678
|
}
|
|
599483
599679
|
} catch {
|
|
599484
599680
|
try {
|
|
599485
|
-
const devs =
|
|
599681
|
+
const devs = execSync27("ls /sys/class/bluetooth/ 2>/dev/null", { encoding: "utf8", timeout: 3e3 }).trim().split("\n").filter(Boolean);
|
|
599486
599682
|
for (const dev of devs) {
|
|
599487
|
-
const addr =
|
|
599683
|
+
const addr = execSync27(`cat /sys/class/bluetooth/${dev}/address 2>/dev/null`, { encoding: "utf8", timeout: 2e3 }).trim();
|
|
599488
599684
|
adapters.push(` ${dev}: ${addr}`);
|
|
599489
599685
|
}
|
|
599490
599686
|
} catch {
|
|
@@ -599502,7 +599698,7 @@ ${adapters.join("\n")}`, durationMs: performance.now() - start2 };
|
|
|
599502
599698
|
return { success: false, output: "", error: "Missing 'address'. Provide a Bluetooth MAC address.", durationMs: performance.now() - start2 };
|
|
599503
599699
|
}
|
|
599504
599700
|
try {
|
|
599505
|
-
const info =
|
|
599701
|
+
const info = execSync27(`hcitool info ${address} 2>/dev/null`, { encoding: "utf8", timeout: 1e4 });
|
|
599506
599702
|
return { success: true, output: `Bluetooth device ${address}:
|
|
599507
599703
|
${info}`, durationMs: performance.now() - start2 };
|
|
599508
599704
|
} catch {
|
|
@@ -599514,7 +599710,7 @@ ${info}`, durationMs: performance.now() - start2 };
|
|
|
599514
599710
|
});
|
|
599515
599711
|
|
|
599516
599712
|
// packages/execution/dist/tools/sdr-scan.js
|
|
599517
|
-
import { execSync as
|
|
599713
|
+
import { execSync as execSync28 } from "node:child_process";
|
|
599518
599714
|
import { readFileSync as readFileSync49, unlinkSync as unlinkSync14, existsSync as existsSync67, mkdirSync as mkdirSync40, statSync as statSync29 } from "node:fs";
|
|
599519
599715
|
import { join as join82 } from "node:path";
|
|
599520
599716
|
import { tmpdir as tmpdir13 } from "node:os";
|
|
@@ -599589,9 +599785,9 @@ var init_sdr_scan = __esm({
|
|
|
599589
599785
|
*/
|
|
599590
599786
|
async ensureSdrTools() {
|
|
599591
599787
|
try {
|
|
599592
|
-
|
|
599788
|
+
execSync28("which rtl_test", { timeout: 3e3, stdio: "pipe" });
|
|
599593
599789
|
try {
|
|
599594
|
-
|
|
599790
|
+
execSync28("timeout 2 rtl_test -t 2>&1 | grep -q 'Found'", { timeout: 5e3, stdio: "pipe" });
|
|
599595
599791
|
return true;
|
|
599596
599792
|
} catch {
|
|
599597
599793
|
await this.fixSdrPermissions();
|
|
@@ -599623,7 +599819,7 @@ var init_sdr_scan = __esm({
|
|
|
599623
599819
|
} catch {
|
|
599624
599820
|
}
|
|
599625
599821
|
try {
|
|
599626
|
-
|
|
599822
|
+
execSync28("which rtl_test", { timeout: 3e3, stdio: "pipe" });
|
|
599627
599823
|
return true;
|
|
599628
599824
|
} catch {
|
|
599629
599825
|
}
|
|
@@ -599640,7 +599836,7 @@ var init_sdr_scan = __esm({
|
|
|
599640
599836
|
let usbDetected = false;
|
|
599641
599837
|
let usbLine = "";
|
|
599642
599838
|
try {
|
|
599643
|
-
const lsusb =
|
|
599839
|
+
const lsusb = execSync28("lsusb 2>/dev/null", { encoding: "utf8", timeout: 5e3 });
|
|
599644
599840
|
for (const line of lsusb.split("\n")) {
|
|
599645
599841
|
if (line.includes("0bda:2838") || line.includes("RTL2838") || line.toLowerCase().includes("rtl-sdr")) {
|
|
599646
599842
|
usbDetected = true;
|
|
@@ -599663,7 +599859,7 @@ Tools not installed (sudo required). Run: sudo apt install rtl-sdr`,
|
|
|
599663
599859
|
};
|
|
599664
599860
|
}
|
|
599665
599861
|
try {
|
|
599666
|
-
const info =
|
|
599862
|
+
const info = execSync28("timeout 3 rtl_test -t 2>&1 || true", { encoding: "utf8", timeout: 8e3 });
|
|
599667
599863
|
const lines = info.split("\n").filter((l2) => l2.includes("Found") || l2.includes("Using") || l2.includes("Tuner") || l2.includes("gain"));
|
|
599668
599864
|
return {
|
|
599669
599865
|
success: true,
|
|
@@ -599697,7 +599893,7 @@ Tools installed but rtl_test failed — device may be in use by another process.
|
|
|
599697
599893
|
try {
|
|
599698
599894
|
let output2 = "";
|
|
599699
599895
|
try {
|
|
599700
|
-
output2 =
|
|
599896
|
+
output2 = execSync28(cmd, { encoding: "utf8", timeout: (duration + 20) * 1e3 });
|
|
599701
599897
|
} catch (cmdErr) {
|
|
599702
599898
|
output2 = cmdErr.stdout?.toString() || cmdErr.stderr?.toString() || "";
|
|
599703
599899
|
}
|
|
@@ -599746,9 +599942,9 @@ ${sigLines.join("\n")}`,
|
|
|
599746
599942
|
const duration = args["duration"] || 30;
|
|
599747
599943
|
for (const tool of ["dump1090", "rtl_adsb"]) {
|
|
599748
599944
|
try {
|
|
599749
|
-
|
|
599945
|
+
execSync28(`which ${tool}`, { timeout: 3e3, stdio: "pipe" });
|
|
599750
599946
|
const cmd = tool === "dump1090" ? `timeout ${duration} dump1090 --raw --no-interactive 2>&1` : `timeout ${duration} rtl_adsb 2>&1`;
|
|
599751
|
-
const output2 =
|
|
599947
|
+
const output2 = execSync28(cmd, { encoding: "utf8", timeout: (duration + 10) * 1e3 });
|
|
599752
599948
|
const messages2 = output2.split("\n").filter((l2) => l2.startsWith("*") || l2.includes("ICAO")).length;
|
|
599753
599949
|
return {
|
|
599754
599950
|
success: true,
|
|
@@ -599768,7 +599964,7 @@ ${output2.slice(0, 2e3)}`,
|
|
|
599768
599964
|
const frequency = args["frequency"] || "98.1M";
|
|
599769
599965
|
const duration = Math.min(args["duration"] || 10, 30);
|
|
599770
599966
|
try {
|
|
599771
|
-
|
|
599967
|
+
execSync28("which rtl_fm", { timeout: 3e3, stdio: "pipe" });
|
|
599772
599968
|
} catch {
|
|
599773
599969
|
return { success: false, output: "", error: "rtl_fm not installed. Run: sudo apt install rtl-sdr", durationMs: performance.now() - start2 };
|
|
599774
599970
|
}
|
|
@@ -599777,7 +599973,7 @@ ${output2.slice(0, 2e3)}`,
|
|
|
599777
599973
|
mkdirSync40(captureDir, { recursive: true });
|
|
599778
599974
|
const outFile = join82(captureDir, `fm-${Date.now()}.wav`);
|
|
599779
599975
|
try {
|
|
599780
|
-
|
|
599976
|
+
execSync28(`timeout ${duration + 3} rtl_fm -M wbfm -f ${frequency} -s 200000 -r 48000 - 2>/dev/null | timeout ${duration} ffmpeg -hide_banner -loglevel error -f s16le -ar 48000 -ac 1 -i - -y ${outFile}`, { timeout: (duration + 8) * 1e3, stdio: "pipe" });
|
|
599781
599977
|
if (existsSync67(outFile)) {
|
|
599782
599978
|
const size = Math.round(__require("fs").statSync(outFile).size / 1024);
|
|
599783
599979
|
return { success: true, output: `Recorded ${duration}s of FM ${frequency} (${size}KB WAV).
|
|
@@ -599792,7 +599988,7 @@ Saved to: ${outFile}`, durationMs: performance.now() - start2 };
|
|
|
599792
599988
|
});
|
|
599793
599989
|
|
|
599794
599990
|
// packages/execution/dist/tools/flipper-zero.js
|
|
599795
|
-
import { execSync as
|
|
599991
|
+
import { execSync as execSync29 } from "node:child_process";
|
|
599796
599992
|
var FLIPPER_USB_IDS, FlipperZeroTool;
|
|
599797
599993
|
var init_flipper_zero = __esm({
|
|
599798
599994
|
"packages/execution/dist/tools/flipper-zero.js"() {
|
|
@@ -599866,15 +600062,15 @@ var init_flipper_zero = __esm({
|
|
|
599866
600062
|
detectDevices(start2) {
|
|
599867
600063
|
const devices = [];
|
|
599868
600064
|
try {
|
|
599869
|
-
const acmDevs =
|
|
600065
|
+
const acmDevs = execSync29("ls /dev/ttyACM* 2>/dev/null", { encoding: "utf8", timeout: 3e3 }).trim().split("\n").filter(Boolean);
|
|
599870
600066
|
for (const dev of acmDevs) {
|
|
599871
600067
|
let isFlipper = false;
|
|
599872
600068
|
let info = dev;
|
|
599873
600069
|
try {
|
|
599874
600070
|
const idx = dev.match(/ttyACM(\d+)/)?.[1];
|
|
599875
600071
|
if (idx) {
|
|
599876
|
-
const manufacturer =
|
|
599877
|
-
const product =
|
|
600072
|
+
const manufacturer = execSync29(`cat /sys/class/tty/ttyACM${idx}/device/../manufacturer 2>/dev/null`, { encoding: "utf8", timeout: 2e3 }).trim();
|
|
600073
|
+
const product = execSync29(`cat /sys/class/tty/ttyACM${idx}/device/../product 2>/dev/null`, { encoding: "utf8", timeout: 2e3 }).trim();
|
|
599878
600074
|
if (manufacturer.toLowerCase().includes("flipper") || product.toLowerCase().includes("flipper")) {
|
|
599879
600075
|
isFlipper = true;
|
|
599880
600076
|
info = `${dev}: ${manufacturer} ${product}`;
|
|
@@ -599884,7 +600080,7 @@ var init_flipper_zero = __esm({
|
|
|
599884
600080
|
}
|
|
599885
600081
|
if (!isFlipper) {
|
|
599886
600082
|
try {
|
|
599887
|
-
const lsusb =
|
|
600083
|
+
const lsusb = execSync29("lsusb 2>/dev/null", { encoding: "utf8", timeout: 5e3 });
|
|
599888
600084
|
if (lsusb.toLowerCase().includes("flipper")) {
|
|
599889
600085
|
isFlipper = true;
|
|
599890
600086
|
const flipperLine = lsusb.split("\n").find((l2) => l2.toLowerCase().includes("flipper"));
|
|
@@ -599903,7 +600099,7 @@ var init_flipper_zero = __esm({
|
|
|
599903
600099
|
}
|
|
599904
600100
|
if (devices.length === 0) {
|
|
599905
600101
|
try {
|
|
599906
|
-
const lsusb =
|
|
600102
|
+
const lsusb = execSync29("lsusb 2>/dev/null", { encoding: "utf8", timeout: 5e3 });
|
|
599907
600103
|
const flipperLine = lsusb.split("\n").find((l2) => l2.toLowerCase().includes("flipper") || FLIPPER_USB_IDS.some((id2) => l2.includes(id2)));
|
|
599908
600104
|
if (flipperLine) {
|
|
599909
600105
|
return { success: true, output: `Flipper Zero detected on USB but no serial interface:
|
|
@@ -600000,10 +600196,10 @@ ${devices.join("\n")}`, durationMs: performance.now() - start2 };
|
|
|
600000
600196
|
// =========================================================================
|
|
600001
600197
|
findFlipperDevice() {
|
|
600002
600198
|
try {
|
|
600003
|
-
const devs =
|
|
600199
|
+
const devs = execSync29("ls /dev/ttyACM* 2>/dev/null", { encoding: "utf8", timeout: 3e3 }).trim().split("\n").filter(Boolean);
|
|
600004
600200
|
for (const dev of devs) {
|
|
600005
600201
|
try {
|
|
600006
|
-
const udev =
|
|
600202
|
+
const udev = execSync29(`udevadm info --query=all --name=${dev} 2>/dev/null`, { encoding: "utf8", timeout: 3e3 });
|
|
600007
600203
|
if (/flipper/i.test(udev) || udev.includes("0483") && udev.includes("5740")) {
|
|
600008
600204
|
return dev;
|
|
600009
600205
|
}
|
|
@@ -600018,7 +600214,7 @@ ${devices.join("\n")}`, durationMs: performance.now() - start2 };
|
|
|
600018
600214
|
sendFlipperCommand(device2, command, timeoutSec, start2, label) {
|
|
600019
600215
|
try {
|
|
600020
600216
|
const serialCmd = `stty -F ${device2} 115200 raw -echo -echoe -echok 2>/dev/null; echo "${command}" > ${device2}; timeout ${timeoutSec} cat ${device2} 2>/dev/null`;
|
|
600021
|
-
const output2 =
|
|
600217
|
+
const output2 = execSync29(serialCmd, { encoding: "utf8", timeout: (timeoutSec + 5) * 1e3 });
|
|
600022
600218
|
const cleanOutput = output2.replace(/\r/g, "").trim();
|
|
600023
600219
|
if (!cleanOutput) {
|
|
600024
600220
|
return { success: true, output: `${label || command}: No response from Flipper (device may be busy or in another mode).`, durationMs: performance.now() - start2 };
|
|
@@ -600038,7 +600234,7 @@ ${cleanOutput}`, durationMs: performance.now() - start2 };
|
|
|
600038
600234
|
});
|
|
600039
600235
|
|
|
600040
600236
|
// packages/execution/dist/tools/meshtastic-tool.js
|
|
600041
|
-
import { execSync as
|
|
600237
|
+
import { execSync as execSync30 } from "node:child_process";
|
|
600042
600238
|
import { existsSync as existsSync68 } from "node:fs";
|
|
600043
600239
|
var MESH_VENV, MESH_CLI, MeshtasticTool;
|
|
600044
600240
|
var init_meshtastic_tool = __esm({
|
|
@@ -600150,7 +600346,7 @@ ${metricMatch[0]}` : "Telemetry data not available";
|
|
|
600150
600346
|
async runMeshCmd(port2, cmdArgs, start2, label, transform) {
|
|
600151
600347
|
await this.ensureSerialAccess(port2);
|
|
600152
600348
|
try {
|
|
600153
|
-
const output2 =
|
|
600349
|
+
const output2 = execSync30(`${MESH_CLI} --port ${port2} ${cmdArgs}`, { encoding: "utf8", timeout: 3e4, stdio: ["pipe", "pipe", "pipe"] });
|
|
600154
600350
|
const result = transform ? transform(output2) : output2;
|
|
600155
600351
|
return { success: true, output: `${label}:
|
|
600156
600352
|
${result.trim()}`, durationMs: performance.now() - start2 };
|
|
@@ -600163,7 +600359,7 @@ ${result.trim()}`, durationMs: performance.now() - start2 };
|
|
|
600163
600359
|
timeout: 3e4,
|
|
600164
600360
|
description: "Omnius needs serial port access for Meshtastic device"
|
|
600165
600361
|
});
|
|
600166
|
-
const output2 =
|
|
600362
|
+
const output2 = execSync30(`${MESH_CLI} --port ${port2} ${cmdArgs}`, { encoding: "utf8", timeout: 3e4, stdio: ["pipe", "pipe", "pipe"] });
|
|
600167
600363
|
const result2 = transform ? transform(output2) : output2;
|
|
600168
600364
|
return { success: true, output: `${label}:
|
|
600169
600365
|
${result2.trim()}`, durationMs: performance.now() - start2 };
|
|
@@ -600182,7 +600378,7 @@ ${result.trim()}`, durationMs: performance.now() - start2 };
|
|
|
600182
600378
|
/** Ensure serial port is accessible without sudo */
|
|
600183
600379
|
async ensureSerialAccess(port2) {
|
|
600184
600380
|
try {
|
|
600185
|
-
|
|
600381
|
+
execSync30(`test -r ${port2} && test -w ${port2}`, { timeout: 2e3, stdio: "pipe" });
|
|
600186
600382
|
} catch {
|
|
600187
600383
|
try {
|
|
600188
600384
|
await runElevated(`chmod 666 ${port2} && echo 'SUBSYSTEM=="tty", ATTRS{idVendor}=="303a", MODE="0666"' > /etc/udev/rules.d/99-meshtastic.rules && udevadm control --reload-rules`, { timeout: 3e4, description: "Omnius needs serial port access for Meshtastic" });
|
|
@@ -600195,7 +600391,7 @@ ${result.trim()}`, durationMs: performance.now() - start2 };
|
|
|
600195
600391
|
if (!existsSync68(dev))
|
|
600196
600392
|
continue;
|
|
600197
600393
|
try {
|
|
600198
|
-
const udev =
|
|
600394
|
+
const udev = execSync30(`udevadm info --query=all --name=${dev} 2>/dev/null`, { encoding: "utf8", timeout: 3e3 });
|
|
600199
600395
|
if (/heltec|meshtastic|t-beam|espressif|rak|wisblock/i.test(udev)) {
|
|
600200
600396
|
return dev;
|
|
600201
600397
|
}
|
|
@@ -600213,7 +600409,7 @@ ${result.trim()}`, durationMs: performance.now() - start2 };
|
|
|
600213
600409
|
if (existsSync68(MESH_CLI))
|
|
600214
600410
|
return true;
|
|
600215
600411
|
try {
|
|
600216
|
-
|
|
600412
|
+
execSync30(`python3 -m venv ${MESH_VENV} && ${MESH_VENV}/bin/pip install meshtastic`, {
|
|
600217
600413
|
timeout: 12e4,
|
|
600218
600414
|
stdio: "pipe"
|
|
600219
600415
|
});
|
|
@@ -600229,7 +600425,7 @@ ${result.trim()}`, durationMs: performance.now() - start2 };
|
|
|
600229
600425
|
// packages/execution/dist/tools/audio-analyze.js
|
|
600230
600426
|
import { existsSync as existsSync69, mkdirSync as mkdirSync41, writeFileSync as writeFileSync33 } from "node:fs";
|
|
600231
600427
|
import { basename as basename15, isAbsolute as isAbsolute6, join as join83, resolve as resolve43 } from "node:path";
|
|
600232
|
-
import { homedir as
|
|
600428
|
+
import { homedir as homedir17, tmpdir as tmpdir14 } from "node:os";
|
|
600233
600429
|
import { fileURLToPath as fileURLToPath11 } from "node:url";
|
|
600234
600430
|
function audioAnalysisPythonEnv(extra = {}) {
|
|
600235
600431
|
const env2 = { ...process.env, ...extra };
|
|
@@ -600251,7 +600447,7 @@ var init_audio_analyze = __esm({
|
|
|
600251
600447
|
init_media_capability();
|
|
600252
600448
|
init_process_async();
|
|
600253
600449
|
init_audio_classifier_runtime();
|
|
600254
|
-
VENV_DIR = join83(
|
|
600450
|
+
VENV_DIR = join83(homedir17(), ".omnius", "audio-ml-venv");
|
|
600255
600451
|
VENV_PIP = join83(VENV_DIR, "bin", "pip");
|
|
600256
600452
|
VENV_PYTHON = join83(VENV_DIR, "bin", "python3");
|
|
600257
600453
|
AudioAnalyzeTool = class {
|
|
@@ -600648,7 +600844,7 @@ except Exception as e:
|
|
|
600648
600844
|
// =========================================================================
|
|
600649
600845
|
async startListening(args, start2) {
|
|
600650
600846
|
const duration = args["duration"] || 30;
|
|
600651
|
-
const contextDir = join83(
|
|
600847
|
+
const contextDir = join83(homedir17(), ".omnius", "audio-context");
|
|
600652
600848
|
if (!existsSync69(contextDir))
|
|
600653
600849
|
mkdirSync41(contextDir, { recursive: true });
|
|
600654
600850
|
const audioFile = join83(tmpdir14(), `omnius-listen-${Date.now()}.wav`);
|
|
@@ -600856,10 +601052,10 @@ ${output2}`, durationMs: performance.now() - start2 };
|
|
|
600856
601052
|
});
|
|
600857
601053
|
|
|
600858
601054
|
// packages/execution/dist/tools/gps-location.js
|
|
600859
|
-
import { execSync as
|
|
601055
|
+
import { execSync as execSync31, spawnSync as spawnSync8 } from "node:child_process";
|
|
600860
601056
|
import { existsSync as existsSync70, readFileSync as readFileSync50, writeFileSync as writeFileSync34, mkdirSync as mkdirSync42 } from "node:fs";
|
|
600861
601057
|
import { join as join84 } from "node:path";
|
|
600862
|
-
import { tmpdir as tmpdir15, homedir as
|
|
601058
|
+
import { tmpdir as tmpdir15, homedir as homedir18 } from "node:os";
|
|
600863
601059
|
var GPS_USB_IDS, GpsLocationTool;
|
|
600864
601060
|
var init_gps_location = __esm({
|
|
600865
601061
|
"packages/execution/dist/tools/gps-location.js"() {
|
|
@@ -600961,21 +601157,21 @@ var init_gps_location = __esm({
|
|
|
600961
601157
|
required: ["action"]
|
|
600962
601158
|
};
|
|
600963
601159
|
/** Venv for pyserial + pynmea2 (same stack as proven gps_service) */
|
|
600964
|
-
GPS_VENV = join84(
|
|
601160
|
+
GPS_VENV = join84(homedir18(), ".omnius", "gps-venv");
|
|
600965
601161
|
GPS_PYTHON = join84(this.GPS_VENV, "bin", "python3");
|
|
600966
601162
|
GPS_PIP = join84(this.GPS_VENV, "bin", "pip");
|
|
600967
601163
|
/** Ensure pyserial + pynmea2 venv exists */
|
|
600968
601164
|
async ensureGpsVenv() {
|
|
600969
601165
|
if (existsSync70(this.GPS_PYTHON)) {
|
|
600970
601166
|
try {
|
|
600971
|
-
|
|
601167
|
+
execSync31(`${this.GPS_PYTHON} -c "import serial, pynmea2"`, { timeout: 5e3, stdio: "pipe" });
|
|
600972
601168
|
return true;
|
|
600973
601169
|
} catch {
|
|
600974
601170
|
}
|
|
600975
601171
|
}
|
|
600976
601172
|
try {
|
|
600977
|
-
|
|
600978
|
-
|
|
601173
|
+
execSync31(`python3 -m venv ${this.GPS_VENV}`, { timeout: 3e4, stdio: "pipe" });
|
|
601174
|
+
execSync31(`${this.GPS_PIP} install pyserial pynmea2`, { timeout: 6e4, stdio: "pipe" });
|
|
600979
601175
|
return true;
|
|
600980
601176
|
} catch {
|
|
600981
601177
|
return false;
|
|
@@ -600987,7 +601183,7 @@ var init_gps_location = __esm({
|
|
|
600987
601183
|
const scriptFile = join84(tmpdir15(), `omnius-gps-${Date.now()}.py`);
|
|
600988
601184
|
writeFileSync34(scriptFile, script);
|
|
600989
601185
|
try {
|
|
600990
|
-
const output2 =
|
|
601186
|
+
const output2 = execSync31(`${this.GPS_PYTHON} ${scriptFile}`, {
|
|
600991
601187
|
encoding: "utf8",
|
|
600992
601188
|
timeout: timeoutMs,
|
|
600993
601189
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -601138,7 +601334,7 @@ Confirmed GPS on: ${result.gps_confirmed} (NMEA sentences detected)` : "\n\nNo N
|
|
|
601138
601334
|
detectGpsFallback(start2) {
|
|
601139
601335
|
const devices = [];
|
|
601140
601336
|
try {
|
|
601141
|
-
const lsusb =
|
|
601337
|
+
const lsusb = execSync31("lsusb 2>/dev/null", { encoding: "utf8", timeout: 5e3 });
|
|
601142
601338
|
for (const known of GPS_USB_IDS) {
|
|
601143
601339
|
if (lsusb.toLowerCase().includes(`${known.vid}:${known.pid}`)) {
|
|
601144
601340
|
devices.push(` ${known.name}`);
|
|
@@ -601147,7 +601343,7 @@ Confirmed GPS on: ${result.gps_confirmed} (NMEA sentences detected)` : "\n\nNo N
|
|
|
601147
601343
|
} catch {
|
|
601148
601344
|
}
|
|
601149
601345
|
try {
|
|
601150
|
-
const serialDevs =
|
|
601346
|
+
const serialDevs = execSync31("ls /dev/ttyUSB* /dev/ttyACM* 2>/dev/null", { encoding: "utf8", timeout: 3e3 }).trim().split("\n").filter(Boolean);
|
|
601151
601347
|
for (const dev of serialDevs) {
|
|
601152
601348
|
if (!devices.some((d2) => d2.includes(dev))) {
|
|
601153
601349
|
devices.push(` Serial: ${dev} (unidentified — may be GPS)`);
|
|
@@ -601169,7 +601365,7 @@ ${devices.join("\n")}` : "No GPS devices found. Connect a USB GPS receiver.",
|
|
|
601169
601365
|
const timeout2 = args["timeout"] || 30;
|
|
601170
601366
|
if (await this.ensureGpsd(args)) {
|
|
601171
601367
|
try {
|
|
601172
|
-
const output2 =
|
|
601368
|
+
const output2 = execSync31(`timeout ${timeout2} gpspipe -w -n 20 2>/dev/null | grep -m 1 '"class":"TPV"'`, {
|
|
601173
601369
|
encoding: "utf8",
|
|
601174
601370
|
timeout: (timeout2 + 5) * 1e3
|
|
601175
601371
|
});
|
|
@@ -601357,7 +601553,7 @@ Sample: ${result.sample_nmea.join("\n")}` : ""), durationMs: performance.now() -
|
|
|
601357
601553
|
const duration = args["duration"] || 10;
|
|
601358
601554
|
if (await this.ensureGpsd(args)) {
|
|
601359
601555
|
try {
|
|
601360
|
-
const output2 =
|
|
601556
|
+
const output2 = execSync31(`timeout ${duration} gpspipe -r 2>/dev/null`, {
|
|
601361
601557
|
encoding: "utf8",
|
|
601362
601558
|
timeout: (duration + 5) * 1e3
|
|
601363
601559
|
});
|
|
@@ -601377,8 +601573,8 @@ ${output2.slice(0, 3e3)}`,
|
|
|
601377
601573
|
return { success: false, output: "", error: "No GPS device found.", durationMs: performance.now() - start2 };
|
|
601378
601574
|
const baud = this.detectBaud(device2);
|
|
601379
601575
|
try {
|
|
601380
|
-
|
|
601381
|
-
const raw =
|
|
601576
|
+
execSync31(`stty -F ${device2} ${baud} raw -echo 2>/dev/null`, { timeout: 5e3, stdio: "pipe" });
|
|
601577
|
+
const raw = execSync31(`timeout ${duration} cat ${device2}`, { encoding: "utf8", timeout: (duration + 5) * 1e3 });
|
|
601382
601578
|
const lines = raw.trim().split("\n").filter((l2) => l2.startsWith("$"));
|
|
601383
601579
|
return {
|
|
601384
601580
|
success: true,
|
|
@@ -601396,7 +601592,7 @@ ${lines.join("\n").slice(0, 3e3)}`,
|
|
|
601396
601592
|
async getSatellites(args, start2) {
|
|
601397
601593
|
if (await this.ensureGpsd(args)) {
|
|
601398
601594
|
try {
|
|
601399
|
-
const output2 =
|
|
601595
|
+
const output2 = execSync31(`timeout 10 gpspipe -w -n 50 2>/dev/null | grep -m 1 '"class":"SKY"'`, {
|
|
601400
601596
|
encoding: "utf8",
|
|
601401
601597
|
timeout: 15e3
|
|
601402
601598
|
});
|
|
@@ -601431,7 +601627,7 @@ ${gsvLines.join("\n") || "No GSV data — receiver may not have locked yet"}`,
|
|
|
601431
601627
|
async getGpsTime(args, start2) {
|
|
601432
601628
|
if (await this.ensureGpsd(args)) {
|
|
601433
601629
|
try {
|
|
601434
|
-
const output2 =
|
|
601630
|
+
const output2 = execSync31(`timeout 10 gpspipe -w -n 10 2>/dev/null | grep -m 1 '"class":"TPV"'`, {
|
|
601435
601631
|
encoding: "utf8",
|
|
601436
601632
|
timeout: 15e3
|
|
601437
601633
|
});
|
|
@@ -601461,7 +601657,7 @@ Drift: ${drift != null ? drift + "ms" : "unknown"}`,
|
|
|
601461
601657
|
return { success: false, output: "", error: "gpsd required for track recording. Connect a GPS device.", durationMs: performance.now() - start2 };
|
|
601462
601658
|
}
|
|
601463
601659
|
try {
|
|
601464
|
-
|
|
601660
|
+
execSync31(`timeout ${duration} gpxlogger -d -f ${outputPath3} 2>/dev/null`, {
|
|
601465
601661
|
timeout: (duration + 10) * 1e3,
|
|
601466
601662
|
stdio: "pipe"
|
|
601467
601663
|
});
|
|
@@ -601491,7 +601687,7 @@ ${content.slice(0, 500)}`,
|
|
|
601491
601687
|
/** Ensure gpsd is installed and running with the GPS device */
|
|
601492
601688
|
async ensureGpsd(args) {
|
|
601493
601689
|
try {
|
|
601494
|
-
|
|
601690
|
+
execSync31("which gpsd", { timeout: 3e3, stdio: "pipe" });
|
|
601495
601691
|
} catch {
|
|
601496
601692
|
try {
|
|
601497
601693
|
const result = await runElevated("apt-get install -y gpsd gpsd-clients gpsd-tools", {
|
|
@@ -601505,7 +601701,7 @@ ${content.slice(0, 500)}`,
|
|
|
601505
601701
|
}
|
|
601506
601702
|
}
|
|
601507
601703
|
try {
|
|
601508
|
-
|
|
601704
|
+
execSync31("pgrep gpsd", { timeout: 3e3, stdio: "pipe" });
|
|
601509
601705
|
return true;
|
|
601510
601706
|
} catch {
|
|
601511
601707
|
}
|
|
@@ -601517,7 +601713,7 @@ ${content.slice(0, 500)}`,
|
|
|
601517
601713
|
timeout: 15e3,
|
|
601518
601714
|
description: "Omnius needs to start the GPS daemon"
|
|
601519
601715
|
});
|
|
601520
|
-
|
|
601716
|
+
execSync31("sleep 2", { timeout: 5e3 });
|
|
601521
601717
|
return true;
|
|
601522
601718
|
} catch {
|
|
601523
601719
|
return false;
|
|
@@ -601542,7 +601738,7 @@ ${content.slice(0, 500)}`,
|
|
|
601542
601738
|
if (!existsSync70(dev))
|
|
601543
601739
|
continue;
|
|
601544
601740
|
try {
|
|
601545
|
-
const udev =
|
|
601741
|
+
const udev = execSync31(`udevadm info --query=all --name=${dev} 2>/dev/null`, { encoding: "utf8", timeout: 3e3 });
|
|
601546
601742
|
const vidMatch = udev.match(/ID_VENDOR_ID=([0-9a-f]+)/i);
|
|
601547
601743
|
const vid = vidMatch?.[1]?.toLowerCase() || "";
|
|
601548
601744
|
if (vid && GPS_VENDOR_IDS.has(vid))
|
|
@@ -601570,8 +601766,8 @@ ${content.slice(0, 500)}`,
|
|
|
601570
601766
|
probeNmea(device2) {
|
|
601571
601767
|
for (const baud of [9600, 4800, 38400, 115200]) {
|
|
601572
601768
|
try {
|
|
601573
|
-
|
|
601574
|
-
const data =
|
|
601769
|
+
execSync31(`stty -F ${device2} ${baud} raw -echo 2>/dev/null`, { timeout: 3e3, stdio: "pipe" });
|
|
601770
|
+
const data = execSync31(`timeout 2 cat ${device2} 2>/dev/null || true`, { encoding: "utf8", timeout: 5e3 });
|
|
601575
601771
|
if (/\$G[PNLA](GGA|RMC|GSV|GSA|GLL|VTG)/i.test(data))
|
|
601576
601772
|
return true;
|
|
601577
601773
|
} catch {
|
|
@@ -601582,7 +601778,7 @@ ${content.slice(0, 500)}`,
|
|
|
601582
601778
|
/** Detect baud rate for GPS device — matches USB ID then auto-probes */
|
|
601583
601779
|
detectBaud(device2) {
|
|
601584
601780
|
try {
|
|
601585
|
-
const udev =
|
|
601781
|
+
const udev = execSync31(`udevadm info --query=all --name=${device2} 2>/dev/null`, { encoding: "utf8", timeout: 3e3 });
|
|
601586
601782
|
for (const gps of GPS_USB_IDS) {
|
|
601587
601783
|
if (udev.toLowerCase().includes(gps.vid) && udev.toLowerCase().includes(gps.pid))
|
|
601588
601784
|
return gps.baud;
|
|
@@ -601595,8 +601791,8 @@ ${content.slice(0, 500)}`,
|
|
|
601595
601791
|
}
|
|
601596
601792
|
for (const baud of [9600, 4800, 38400, 115200]) {
|
|
601597
601793
|
try {
|
|
601598
|
-
|
|
601599
|
-
const data =
|
|
601794
|
+
execSync31(`stty -F ${device2} ${baud} raw -echo 2>/dev/null`, { timeout: 3e3, stdio: "pipe" });
|
|
601795
|
+
const data = execSync31(`timeout 2 cat ${device2} 2>/dev/null || true`, { encoding: "utf8", timeout: 5e3 });
|
|
601600
601796
|
if (/\$G[PNLA]/i.test(data))
|
|
601601
601797
|
return baud;
|
|
601602
601798
|
} catch {
|
|
@@ -601689,7 +601885,7 @@ def _omnius_normalized_features(features):
|
|
|
601689
601885
|
import { execFile as execFile7 } from "node:child_process";
|
|
601690
601886
|
import { existsSync as existsSync71, mkdirSync as mkdirSync43, writeFileSync as writeFileSync35, readFileSync as readFileSync51 } from "node:fs";
|
|
601691
601887
|
import { join as join85 } from "node:path";
|
|
601692
|
-
import { homedir as
|
|
601888
|
+
import { homedir as homedir19, tmpdir as tmpdir16 } from "node:os";
|
|
601693
601889
|
function visualMemoryPythonEnv(extra = {}) {
|
|
601694
601890
|
const env2 = { ...process.env, ...extra };
|
|
601695
601891
|
applyMediaCudaDeviceFilterToEnv(env2, "vision");
|
|
@@ -601812,8 +602008,8 @@ var init_visual_memory = __esm({
|
|
|
601812
602008
|
"use strict";
|
|
601813
602009
|
init_cuda_device_filter();
|
|
601814
602010
|
init_clip_feature_python();
|
|
601815
|
-
VMEM_DIR = join85(
|
|
601816
|
-
VENV_DIR2 = join85(
|
|
602011
|
+
VMEM_DIR = join85(homedir19(), ".omnius", "visual-memory");
|
|
602012
|
+
VENV_DIR2 = join85(homedir19(), ".omnius", "vision-ml-venv");
|
|
601817
602013
|
VENV_PY = join85(VENV_DIR2, "bin", "python3");
|
|
601818
602014
|
VENV_PIP2 = join85(VENV_DIR2, "bin", "pip");
|
|
601819
602015
|
VISUAL_MEMORY_ACTIONS = /* @__PURE__ */ new Set(["detect", "enroll", "identify", "teach", "recognize", "describe", "list", "forget"]);
|
|
@@ -602491,10 +602687,10 @@ ${objects.join("\n") || " (none taught)"}`,
|
|
|
602491
602687
|
});
|
|
602492
602688
|
|
|
602493
602689
|
// packages/execution/dist/tools/multimodal-memory.js
|
|
602494
|
-
import { execSync as
|
|
602690
|
+
import { execSync as execSync32 } from "node:child_process";
|
|
602495
602691
|
import { appendFileSync as appendFileSync5, existsSync as existsSync72, mkdirSync as mkdirSync44, writeFileSync as writeFileSync36, readFileSync as readFileSync52, readdirSync as readdirSync24 } from "node:fs";
|
|
602496
602692
|
import { join as join86 } from "node:path";
|
|
602497
|
-
import { homedir as
|
|
602693
|
+
import { homedir as homedir20, tmpdir as tmpdir17 } from "node:os";
|
|
602498
602694
|
import { randomUUID as randomUUID18 } from "node:crypto";
|
|
602499
602695
|
var MM_DIR, MM_INDEX, MultimodalMemoryTool;
|
|
602500
602696
|
var init_multimodal_memory = __esm({
|
|
@@ -602502,7 +602698,7 @@ var init_multimodal_memory = __esm({
|
|
|
602502
602698
|
"use strict";
|
|
602503
602699
|
init_clip_feature_python();
|
|
602504
602700
|
init_camera_capture();
|
|
602505
|
-
MM_DIR = join86(
|
|
602701
|
+
MM_DIR = join86(homedir20(), ".omnius", "multimodal-episodes");
|
|
602506
602702
|
MM_INDEX = join86(MM_DIR, "index.json");
|
|
602507
602703
|
MultimodalMemoryTool = class {
|
|
602508
602704
|
name = "multimodal_memory";
|
|
@@ -602598,7 +602794,7 @@ var init_multimodal_memory = __esm({
|
|
|
602598
602794
|
episode.visual = { faceIds: [], faceNames: [], objects: [], imagePath, clipEmbedding: null };
|
|
602599
602795
|
results.push(`Photo captured (${cameraDevice || "auto"})`);
|
|
602600
602796
|
try {
|
|
602601
|
-
const venvPy = join86(
|
|
602797
|
+
const venvPy = join86(homedir20(), ".omnius", "vision-ml-venv", "bin", "python3");
|
|
602602
602798
|
if (existsSync72(venvPy)) {
|
|
602603
602799
|
const clipScript = `
|
|
602604
602800
|
import json, torch
|
|
@@ -602615,7 +602811,7 @@ print(json.dumps(features[0].cpu().numpy().tolist()))
|
|
|
602615
602811
|
`;
|
|
602616
602812
|
const scriptFile = join86(tmpdir17(), `mm-clip-${Date.now()}.py`);
|
|
602617
602813
|
writeFileSync36(scriptFile, clipScript);
|
|
602618
|
-
const clipOutput =
|
|
602814
|
+
const clipOutput = execSync32(`${venvPy} ${scriptFile}`, { encoding: "utf8", timeout: 12e4, env: { ...process.env, PYTHONUNBUFFERED: "1" } });
|
|
602619
602815
|
const embedding = JSON.parse(clipOutput.trim().split("\n").pop());
|
|
602620
602816
|
episode.visual.clipEmbedding = embedding;
|
|
602621
602817
|
results.push(`CLIP embedding computed (${embedding.length}d)`);
|
|
@@ -602623,7 +602819,7 @@ print(json.dumps(features[0].cpu().numpy().tolist()))
|
|
|
602623
602819
|
} catch {
|
|
602624
602820
|
}
|
|
602625
602821
|
try {
|
|
602626
|
-
const venvPy = join86(
|
|
602822
|
+
const venvPy = join86(homedir20(), ".omnius", "vision-ml-venv", "bin", "python3");
|
|
602627
602823
|
if (existsSync72(venvPy)) {
|
|
602628
602824
|
const faceScript = `
|
|
602629
602825
|
import json, sys, cv2
|
|
@@ -602637,7 +602833,7 @@ print(json.dumps(result))
|
|
|
602637
602833
|
`;
|
|
602638
602834
|
const scriptFile = join86(tmpdir17(), `mm-face-${Date.now()}.py`);
|
|
602639
602835
|
writeFileSync36(scriptFile, faceScript);
|
|
602640
|
-
const faceOutput =
|
|
602836
|
+
const faceOutput = execSync32(`${venvPy} ${scriptFile}`, { encoding: "utf8", timeout: 6e4, env: { ...process.env, PYTHONUNBUFFERED: "1" } });
|
|
602641
602837
|
const faces = JSON.parse(faceOutput.trim().split("\n").pop());
|
|
602642
602838
|
episode.visual.faceIds = faces.map((_, i2) => `face_${i2}`);
|
|
602643
602839
|
if (faces.length > 0)
|
|
@@ -602653,7 +602849,7 @@ print(json.dumps(result))
|
|
|
602653
602849
|
}
|
|
602654
602850
|
try {
|
|
602655
602851
|
const audioPath = join86(episodeDir2, "audio.wav");
|
|
602656
|
-
|
|
602852
|
+
execSync32(`arecord -D default -f S16_LE -r 16000 -c 1 -d ${duration} -q ${audioPath}`, { timeout: (duration + 5) * 1e3, stdio: "pipe" });
|
|
602657
602853
|
if (existsSync72(audioPath)) {
|
|
602658
602854
|
episode.audio = { transcript: null, soundClass: null, recordingPath: audioPath, rmsDb: null };
|
|
602659
602855
|
results.push(`${duration}s audio recorded`);
|
|
@@ -602670,7 +602866,7 @@ print(json.dumps(result))
|
|
|
602670
602866
|
} catch {
|
|
602671
602867
|
}
|
|
602672
602868
|
try {
|
|
602673
|
-
const mlVenvPy = join86(
|
|
602869
|
+
const mlVenvPy = join86(homedir20(), ".omnius", "audio-ml-venv", "bin", "python3");
|
|
602674
602870
|
if (existsSync72(mlVenvPy)) {
|
|
602675
602871
|
const classifyScript = `
|
|
602676
602872
|
import os; os.environ["TF_CPP_MIN_LOG_LEVEL"]="3"; os.environ["TF_ENABLE_ONEDNN_OPTS"]="0"
|
|
@@ -602689,14 +602885,14 @@ print(classes[top])
|
|
|
602689
602885
|
`;
|
|
602690
602886
|
const scriptFile = join86(tmpdir17(), `mm-yamnet-${Date.now()}.py`);
|
|
602691
602887
|
writeFileSync36(scriptFile, classifyScript);
|
|
602692
|
-
const soundClass =
|
|
602888
|
+
const soundClass = execSync32(`${mlVenvPy} ${scriptFile}`, { encoding: "utf8", timeout: 12e4 }).trim().split("\n").pop();
|
|
602693
602889
|
episode.audio.soundClass = soundClass;
|
|
602694
602890
|
results.push(`Sound: ${soundClass}`);
|
|
602695
602891
|
}
|
|
602696
602892
|
} catch {
|
|
602697
602893
|
}
|
|
602698
602894
|
try {
|
|
602699
|
-
const transcribeResult =
|
|
602895
|
+
const transcribeResult = execSync32(`which transcribe-cli 2>/dev/null && transcribe-cli ${audioPath} 2>/dev/null || echo ""`, { encoding: "utf8", timeout: 6e4 }).trim();
|
|
602700
602896
|
if (transcribeResult && transcribeResult.length > 5) {
|
|
602701
602897
|
episode.audio.transcript = transcribeResult;
|
|
602702
602898
|
results.push(`Transcript: "${transcribeResult.slice(0, 80)}"`);
|
|
@@ -602757,7 +602953,7 @@ Recall with: multimodal_memory action=recall query="..."`,
|
|
|
602757
602953
|
};
|
|
602758
602954
|
if (episode.visual?.imagePath && existsSync72(episode.visual.imagePath)) {
|
|
602759
602955
|
try {
|
|
602760
|
-
const venvPy = join86(
|
|
602956
|
+
const venvPy = join86(homedir20(), ".omnius", "vision-ml-venv", "bin", "python3");
|
|
602761
602957
|
if (existsSync72(venvPy)) {
|
|
602762
602958
|
const enrollScript = `
|
|
602763
602959
|
import json, sys, os, time, numpy as np
|
|
@@ -602785,7 +602981,7 @@ else:
|
|
|
602785
602981
|
`;
|
|
602786
602982
|
const scriptFile = join86(tmpdir17(), `mm-enroll-${Date.now()}.py`);
|
|
602787
602983
|
writeFileSync36(scriptFile, enrollScript);
|
|
602788
|
-
const enrollOutput =
|
|
602984
|
+
const enrollOutput = execSync32(`${venvPy} ${scriptFile}`, { encoding: "utf8", timeout: 6e4, env: { ...process.env, PYTHONUNBUFFERED: "1" } });
|
|
602789
602985
|
const enrollResult = JSON.parse(enrollOutput.trim().split("\n").pop());
|
|
602790
602986
|
if (enrollResult.enrolled) {
|
|
602791
602987
|
episode.text.content += `. Face enrolled for recognition (${enrollResult.samples} samples).`;
|
|
@@ -602825,7 +603021,7 @@ Recall later: multimodal_memory action=recall query="${personName}"`,
|
|
|
602825
603021
|
const queryLower = query.toLowerCase();
|
|
602826
603022
|
let queryClipEmbedding = null;
|
|
602827
603023
|
try {
|
|
602828
|
-
const venvPy = join86(
|
|
603024
|
+
const venvPy = join86(homedir20(), ".omnius", "vision-ml-venv", "bin", "python3");
|
|
602829
603025
|
if (existsSync72(venvPy)) {
|
|
602830
603026
|
const clipTextScript = `
|
|
602831
603027
|
import json, torch
|
|
@@ -602840,7 +603036,7 @@ print(json.dumps(features[0].cpu().numpy().tolist()))
|
|
|
602840
603036
|
`;
|
|
602841
603037
|
const scriptFile = join86(tmpdir17(), `mm-clipq-${Date.now()}.py`);
|
|
602842
603038
|
writeFileSync36(scriptFile, clipTextScript);
|
|
602843
|
-
const output2 =
|
|
603039
|
+
const output2 = execSync32(`${venvPy} ${scriptFile}`, { encoding: "utf8", timeout: 6e4, env: { ...process.env, PYTHONUNBUFFERED: "1" } });
|
|
602844
603040
|
queryClipEmbedding = JSON.parse(output2.trim().split("\n").pop());
|
|
602845
603041
|
}
|
|
602846
603042
|
} catch {
|
|
@@ -603910,10 +604106,10 @@ var init_vibevoice_runtime = __esm({
|
|
|
603910
604106
|
});
|
|
603911
604107
|
|
|
603912
604108
|
// packages/execution/dist/tools/asr-listen.js
|
|
603913
|
-
import { execSync as
|
|
604109
|
+
import { execSync as execSync33 } from "node:child_process";
|
|
603914
604110
|
import { existsSync as existsSync74, mkdirSync as mkdirSync46, writeFileSync as writeFileSync38, readFileSync as readFileSync54, unlinkSync as unlinkSync15 } from "node:fs";
|
|
603915
604111
|
import { join as join88 } from "node:path";
|
|
603916
|
-
import { tmpdir as tmpdir18, homedir as
|
|
604112
|
+
import { tmpdir as tmpdir18, homedir as homedir21 } from "node:os";
|
|
603917
604113
|
function asrPythonEnv(extra = {}) {
|
|
603918
604114
|
const env2 = { ...process.env, ...extra };
|
|
603919
604115
|
applyMediaCudaDeviceFilterToEnv(env2, "asr");
|
|
@@ -604034,10 +604230,10 @@ var init_asr_listen = __esm({
|
|
|
604034
604230
|
const audioFile = join88(captureDir, `listen-${Date.now()}.wav`);
|
|
604035
604231
|
try {
|
|
604036
604232
|
try {
|
|
604037
|
-
|
|
604038
|
-
|
|
604233
|
+
execSync33(`which pw-record`, { stdio: "pipe", timeout: 2e3 });
|
|
604234
|
+
execSync33(`pw-record --channels 1 --rate 16000 --format s16 ${audioFile} & PID=$!; sleep ${duration}; kill $PID 2>/dev/null; wait $PID 2>/dev/null`, { timeout: (duration + 5) * 1e3, stdio: "pipe", shell: "/bin/bash" });
|
|
604039
604235
|
} catch {
|
|
604040
|
-
|
|
604236
|
+
execSync33(`arecord -D ${device2} -f S16_LE -r 16000 -c 1 -d ${duration} -q ${audioFile}`, {
|
|
604041
604237
|
timeout: (duration + 5) * 1e3,
|
|
604042
604238
|
stdio: "pipe"
|
|
604043
604239
|
});
|
|
@@ -604207,7 +604403,7 @@ print(json.dumps({"ok": False, "error": "No whisper backend available"}))
|
|
|
604207
604403
|
const scriptFile = join88(tmpdir18(), `omnius-asr-whisper-${Date.now()}.py`);
|
|
604208
604404
|
writeFileSync38(scriptFile, whisperScript);
|
|
604209
604405
|
const pyPaths = [
|
|
604210
|
-
join88(
|
|
604406
|
+
join88(homedir21(), ".omnius", "venv", "bin", "python3"),
|
|
604211
604407
|
"python3",
|
|
604212
604408
|
"python"
|
|
604213
604409
|
];
|
|
@@ -604216,7 +604412,7 @@ print(json.dumps({"ok": False, "error": "No whisper backend available"}))
|
|
|
604216
604412
|
if (pyPath.includes("/") && !existsSync74(pyPath))
|
|
604217
604413
|
continue;
|
|
604218
604414
|
try {
|
|
604219
|
-
const output2 =
|
|
604415
|
+
const output2 = execSync33(`"${pyPath}" "${scriptFile}"`, {
|
|
604220
604416
|
encoding: "utf8",
|
|
604221
604417
|
timeout: 12e4,
|
|
604222
604418
|
env: asrPythonEnv({ PYTHONUNBUFFERED: "1" })
|
|
@@ -605619,25 +605815,25 @@ function isShellCommandLikelyMutatingFilesystem(command) {
|
|
|
605619
605815
|
}
|
|
605620
605816
|
function stripShellQuotedSegmentsForMutation(command) {
|
|
605621
605817
|
let out = "";
|
|
605622
|
-
let
|
|
605818
|
+
let quote = null;
|
|
605623
605819
|
let escaped = false;
|
|
605624
605820
|
for (let i2 = 0; i2 < command.length; i2++) {
|
|
605625
605821
|
const ch = command[i2];
|
|
605626
|
-
if (
|
|
605822
|
+
if (quote === "'") {
|
|
605627
605823
|
if (ch === "'")
|
|
605628
|
-
|
|
605824
|
+
quote = null;
|
|
605629
605825
|
out += " ";
|
|
605630
605826
|
continue;
|
|
605631
605827
|
}
|
|
605632
|
-
if (
|
|
605828
|
+
if (quote === '"') {
|
|
605633
605829
|
if (!escaped && ch === '"')
|
|
605634
|
-
|
|
605830
|
+
quote = null;
|
|
605635
605831
|
escaped = !escaped && ch === "\\";
|
|
605636
605832
|
out += " ";
|
|
605637
605833
|
continue;
|
|
605638
605834
|
}
|
|
605639
605835
|
if (ch === "'" || ch === '"') {
|
|
605640
|
-
|
|
605836
|
+
quote = ch;
|
|
605641
605837
|
out += " ";
|
|
605642
605838
|
continue;
|
|
605643
605839
|
}
|
|
@@ -605757,7 +605953,7 @@ var init_mutation_contract = __esm({
|
|
|
605757
605953
|
});
|
|
605758
605954
|
|
|
605759
605955
|
// packages/execution/dist/tools/worktree.js
|
|
605760
|
-
import { execSync as
|
|
605956
|
+
import { execSync as execSync34 } from "node:child_process";
|
|
605761
605957
|
import { existsSync as existsSync76, mkdirSync as mkdirSync47, rmSync as rmSync10 } from "node:fs";
|
|
605762
605958
|
import { join as join89, resolve as resolve45 } from "node:path";
|
|
605763
605959
|
function validateSlug(slug) {
|
|
@@ -605776,7 +605972,7 @@ function flattenSlug(slug) {
|
|
|
605776
605972
|
}
|
|
605777
605973
|
function isGitRepo(cwd4) {
|
|
605778
605974
|
try {
|
|
605779
|
-
|
|
605975
|
+
execSync34("git rev-parse --is-inside-work-tree", { cwd: cwd4, stdio: "pipe" });
|
|
605780
605976
|
return true;
|
|
605781
605977
|
} catch {
|
|
605782
605978
|
return false;
|
|
@@ -605784,14 +605980,14 @@ function isGitRepo(cwd4) {
|
|
|
605784
605980
|
}
|
|
605785
605981
|
function getCurrentBranch(cwd4) {
|
|
605786
605982
|
try {
|
|
605787
|
-
return
|
|
605983
|
+
return execSync34("git rev-parse --abbrev-ref HEAD", { cwd: cwd4, stdio: "pipe" }).toString().trim();
|
|
605788
605984
|
} catch {
|
|
605789
605985
|
return void 0;
|
|
605790
605986
|
}
|
|
605791
605987
|
}
|
|
605792
605988
|
function getCurrentCommit(cwd4) {
|
|
605793
605989
|
try {
|
|
605794
|
-
return
|
|
605990
|
+
return execSync34("git rev-parse --short HEAD", { cwd: cwd4, stdio: "pipe" }).toString().trim();
|
|
605795
605991
|
} catch {
|
|
605796
605992
|
return void 0;
|
|
605797
605993
|
}
|
|
@@ -605822,13 +606018,13 @@ function createWorktree(repoRoot, slug) {
|
|
|
605822
606018
|
}
|
|
605823
606019
|
mkdirSync47(worktreeBase, { recursive: true });
|
|
605824
606020
|
try {
|
|
605825
|
-
|
|
606021
|
+
execSync34(`git worktree add "${worktreePath}" -b "${branchName}"`, {
|
|
605826
606022
|
cwd: repoRoot,
|
|
605827
606023
|
stdio: "pipe"
|
|
605828
606024
|
});
|
|
605829
606025
|
} catch (err) {
|
|
605830
606026
|
try {
|
|
605831
|
-
|
|
606027
|
+
execSync34(`git worktree add "${worktreePath}" "${branchName}"`, {
|
|
605832
606028
|
cwd: repoRoot,
|
|
605833
606029
|
stdio: "pipe"
|
|
605834
606030
|
});
|
|
@@ -605850,7 +606046,7 @@ function createWorktree(repoRoot, slug) {
|
|
|
605850
606046
|
}
|
|
605851
606047
|
function worktreeHasChanges(worktreePath) {
|
|
605852
606048
|
try {
|
|
605853
|
-
const status =
|
|
606049
|
+
const status = execSync34("git status --porcelain", {
|
|
605854
606050
|
cwd: worktreePath,
|
|
605855
606051
|
stdio: "pipe"
|
|
605856
606052
|
}).toString().trim();
|
|
@@ -605871,20 +606067,20 @@ function removeWorktree(repoRoot, slug, force = false) {
|
|
|
605871
606067
|
return "Worktree has uncommitted changes. Use force=true to discard, or commit/stash first.";
|
|
605872
606068
|
}
|
|
605873
606069
|
try {
|
|
605874
|
-
|
|
606070
|
+
execSync34(`git worktree remove "${worktreePath}" ${force ? "--force" : ""}`, {
|
|
605875
606071
|
cwd: repoRoot,
|
|
605876
606072
|
stdio: "pipe"
|
|
605877
606073
|
});
|
|
605878
606074
|
} catch (err) {
|
|
605879
606075
|
try {
|
|
605880
606076
|
rmSync10(worktreePath, { recursive: true, force: true });
|
|
605881
|
-
|
|
606077
|
+
execSync34("git worktree prune", { cwd: repoRoot, stdio: "pipe" });
|
|
605882
606078
|
} catch {
|
|
605883
606079
|
return `Failed to remove worktree: ${err}`;
|
|
605884
606080
|
}
|
|
605885
606081
|
}
|
|
605886
606082
|
try {
|
|
605887
|
-
|
|
606083
|
+
execSync34(`git branch -D "${branchName}"`, { cwd: repoRoot, stdio: "pipe" });
|
|
605888
606084
|
} catch {
|
|
605889
606085
|
}
|
|
605890
606086
|
_sessions.delete(slug);
|
|
@@ -607147,10 +607343,10 @@ var init_client3 = __esm({
|
|
|
607147
607343
|
// packages/execution/dist/mcp/secret-store.js
|
|
607148
607344
|
import { existsSync as existsSync77, readFileSync as readFileSync55, writeFileSync as writeFileSync39, mkdirSync as mkdirSync48, chmodSync as chmodSync3, statSync as statSync31 } from "node:fs";
|
|
607149
607345
|
import { join as join90, dirname as dirname29 } from "node:path";
|
|
607150
|
-
import { homedir as
|
|
607346
|
+
import { homedir as homedir22 } from "node:os";
|
|
607151
607347
|
import { randomBytes as randomBytes19, createHash as createHash30 } from "node:crypto";
|
|
607152
607348
|
function secretsPath(scope, repoRoot) {
|
|
607153
|
-
return scope === "global" ? join90(
|
|
607349
|
+
return scope === "global" ? join90(homedir22(), ".omnius", "secrets.json") : join90(repoRoot, ".omnius", "secrets.json");
|
|
607154
607350
|
}
|
|
607155
607351
|
function readStore(path16) {
|
|
607156
607352
|
if (!existsSync77(path16))
|
|
@@ -608025,10 +608221,10 @@ var init_agent_tools = __esm({
|
|
|
608025
608221
|
// packages/execution/dist/mcp/manager.js
|
|
608026
608222
|
import { existsSync as existsSync78, readFileSync as readFileSync56, writeFileSync as writeFileSync40, mkdirSync as mkdirSync49 } from "node:fs";
|
|
608027
608223
|
import { join as join91, dirname as dirname30 } from "node:path";
|
|
608028
|
-
import { homedir as
|
|
608224
|
+
import { homedir as homedir23 } from "node:os";
|
|
608029
608225
|
function loadMcpConfig(repoRoot) {
|
|
608030
608226
|
const servers = {};
|
|
608031
|
-
const globalPath = join91(
|
|
608227
|
+
const globalPath = join91(homedir23(), ".omnius", "mcp.json");
|
|
608032
608228
|
if (existsSync78(globalPath)) {
|
|
608033
608229
|
try {
|
|
608034
608230
|
const global2 = JSON.parse(readFileSync56(globalPath, "utf8"));
|
|
@@ -608081,7 +608277,7 @@ function expandEnvVars(str, repoRoot) {
|
|
|
608081
608277
|
});
|
|
608082
608278
|
}
|
|
608083
608279
|
function saveMcpServerToConfig(repoRoot, serverName, config, scope = "project") {
|
|
608084
|
-
const path16 = scope === "global" ? join91(
|
|
608280
|
+
const path16 = scope === "global" ? join91(homedir23(), ".omnius", "mcp.json") : join91(repoRoot, ".omnius", "mcp.json");
|
|
608085
608281
|
let existing = { mcpServers: {} };
|
|
608086
608282
|
if (existsSync78(path16)) {
|
|
608087
608283
|
try {
|
|
@@ -608097,7 +608293,7 @@ function saveMcpServerToConfig(repoRoot, serverName, config, scope = "project")
|
|
|
608097
608293
|
return path16;
|
|
608098
608294
|
}
|
|
608099
608295
|
function removeMcpServerFromConfig(repoRoot, serverName, scope = "project") {
|
|
608100
|
-
const path16 = scope === "global" ? join91(
|
|
608296
|
+
const path16 = scope === "global" ? join91(homedir23(), ".omnius", "mcp.json") : join91(repoRoot, ".omnius", "mcp.json");
|
|
608101
608297
|
if (!existsSync78(path16))
|
|
608102
608298
|
return false;
|
|
608103
608299
|
let cfg;
|
|
@@ -608421,10 +608617,10 @@ var init_mcp = __esm({
|
|
|
608421
608617
|
// packages/execution/dist/plugins/plugin-system.js
|
|
608422
608618
|
import { existsSync as existsSync79, readdirSync as readdirSync25, readFileSync as readFileSync57 } from "node:fs";
|
|
608423
608619
|
import { join as join92 } from "node:path";
|
|
608424
|
-
import { homedir as
|
|
608620
|
+
import { homedir as homedir24 } from "node:os";
|
|
608425
608621
|
function discoverPlugins(repoRoot) {
|
|
608426
608622
|
const plugins = [];
|
|
608427
|
-
const globalDir = join92(
|
|
608623
|
+
const globalDir = join92(homedir24(), ".omnius", "plugins");
|
|
608428
608624
|
if (existsSync79(globalDir)) {
|
|
608429
608625
|
plugins.push(...loadPluginsFromDir(globalDir));
|
|
608430
608626
|
}
|
|
@@ -608856,7 +609052,7 @@ List cells or retry with exact current source.`,
|
|
|
608856
609052
|
});
|
|
608857
609053
|
|
|
608858
609054
|
// packages/execution/dist/tools/environment-snapshot.js
|
|
608859
|
-
import { execSync as
|
|
609055
|
+
import { execSync as execSync35 } from "node:child_process";
|
|
608860
609056
|
import { cpus as cpus2, totalmem as totalmem3, freemem as freemem2, hostname as hostname2, platform as platform6, arch as arch4, uptime } from "node:os";
|
|
608861
609057
|
import { statfsSync as statfsSync4 } from "node:fs";
|
|
608862
609058
|
function collectSnapshot(workingDir) {
|
|
@@ -608874,7 +609070,7 @@ function collectSnapshot(workingDir) {
|
|
|
608874
609070
|
}
|
|
608875
609071
|
let gpu = void 0;
|
|
608876
609072
|
try {
|
|
608877
|
-
const nvOut =
|
|
609073
|
+
const nvOut = execSync35("nvidia-smi --query-gpu=name,memory.total,memory.used,temperature.gpu --format=csv,noheader,nounits", { encoding: "utf-8", timeout: 3e3, stdio: ["pipe", "pipe", "pipe"] }).trim().split(",").map((s2) => s2.trim());
|
|
608878
609074
|
if (nvOut.length >= 3) {
|
|
608879
609075
|
gpu = {
|
|
608880
609076
|
name: nvOut[0],
|
|
@@ -608889,12 +609085,12 @@ function collectSnapshot(workingDir) {
|
|
|
608889
609085
|
let battery = void 0;
|
|
608890
609086
|
try {
|
|
608891
609087
|
if (platform6() === "linux") {
|
|
608892
|
-
const cap =
|
|
608893
|
-
const status =
|
|
609088
|
+
const cap = execSync35("cat /sys/class/power_supply/BAT0/capacity 2>/dev/null", { encoding: "utf-8", timeout: 1e3 }).trim();
|
|
609089
|
+
const status = execSync35("cat /sys/class/power_supply/BAT0/status 2>/dev/null", { encoding: "utf-8", timeout: 1e3 }).trim();
|
|
608894
609090
|
if (cap)
|
|
608895
609091
|
battery = { percent: parseInt(cap, 10), charging: status === "Charging" || status === "Full" };
|
|
608896
609092
|
} else if (platform6() === "darwin") {
|
|
608897
|
-
const pmOut =
|
|
609093
|
+
const pmOut = execSync35("pmset -g batt", { encoding: "utf-8", timeout: 2e3 });
|
|
608898
609094
|
const match = pmOut.match(/(\d+)%;\s*(charging|discharging|charged)/i);
|
|
608899
609095
|
if (match)
|
|
608900
609096
|
battery = { percent: parseInt(match[1], 10), charging: match[2].toLowerCase() !== "discharging" };
|
|
@@ -608918,8 +609114,8 @@ function collectSnapshot(workingDir) {
|
|
|
608918
609114
|
}
|
|
608919
609115
|
let processInfo = { total: 0, nodeCount: 0, omniusSpawned: 0, topCpu: [] };
|
|
608920
609116
|
try {
|
|
608921
|
-
const psLines =
|
|
608922
|
-
const total = parseInt(
|
|
609117
|
+
const psLines = execSync35("ps -eo pid,%cpu,args --sort=-%cpu --no-headers 2>/dev/null | head -50", { encoding: "utf-8", timeout: 3e3, stdio: ["pipe", "pipe", "pipe"] }).trim().split("\n");
|
|
609118
|
+
const total = parseInt(execSync35("ps aux | wc -l", { encoding: "utf-8", timeout: 2e3 }).trim(), 10);
|
|
608923
609119
|
let nodeCount = 0;
|
|
608924
609120
|
let omniusSpawned = 0;
|
|
608925
609121
|
const topCpu = [];
|
|
@@ -609002,7 +609198,7 @@ var init_environment_snapshot = __esm({
|
|
|
609002
609198
|
// packages/execution/dist/tools/video-understand.js
|
|
609003
609199
|
import { existsSync as existsSync81, mkdirSync as mkdirSync50, writeFileSync as writeFileSync42, readFileSync as readFileSync59, readdirSync as readdirSync26, unlinkSync as unlinkSync17, rmSync as rmSync11 } from "node:fs";
|
|
609004
609200
|
import { join as join93, basename as basename17, isAbsolute as isAbsolute8, resolve as resolve47 } from "node:path";
|
|
609005
|
-
import { homedir as
|
|
609201
|
+
import { homedir as homedir25 } from "node:os";
|
|
609006
609202
|
import { createHash as createHash31 } from "node:crypto";
|
|
609007
609203
|
function isYouTubeUrl2(url) {
|
|
609008
609204
|
return /(?:youtube\.com\/(?:watch|shorts|live|embed|v\/)|youtu\.be\/)/i.test(url);
|
|
@@ -609021,7 +609217,7 @@ async function ensureYtDlp2() {
|
|
|
609021
609217
|
if (existing)
|
|
609022
609218
|
return existing;
|
|
609023
609219
|
try {
|
|
609024
|
-
mkdirSync50(join93(
|
|
609220
|
+
mkdirSync50(join93(homedir25(), ".omnius", "runtimes", "media-tools"), { recursive: true });
|
|
609025
609221
|
const py = process.platform === "win32" ? "python" : "python3";
|
|
609026
609222
|
await execShellText(`${shellQuote2(py)} -m venv ${shellQuote2(YT_DLP_VENV2)} && ${shellQuote2(venvPython(YT_DLP_VENV2))} -m pip install -U pip yt-dlp`, { timeout: 18e4 });
|
|
609027
609223
|
return await resolveYtDlp2();
|
|
@@ -609138,7 +609334,7 @@ var init_video_understand = __esm({
|
|
|
609138
609334
|
init_audio_analyze();
|
|
609139
609335
|
init_process_async();
|
|
609140
609336
|
init_venv_paths();
|
|
609141
|
-
YT_DLP_VENV2 = join93(
|
|
609337
|
+
YT_DLP_VENV2 = join93(homedir25(), ".omnius", "runtimes", "media-tools", ".venv-ytdlp");
|
|
609142
609338
|
VideoUnderstandTool = class {
|
|
609143
609339
|
name = "video_understand";
|
|
609144
609340
|
description = "Analyze a video from URL or local file. Produces timestamped transcript aligned with keyframe descriptions. Supports YouTube URLs and direct video files. Pipeline: download → transcribe (Whisper) → extract keyframes (scene detection) → describe frames → align timestamps → save structured output.";
|
|
@@ -609521,7 +609717,7 @@ import { existsSync as existsSync82, readFileSync as readFileSync60, statSync as
|
|
|
609521
609717
|
import { spawn as spawn24 } from "node:child_process";
|
|
609522
609718
|
import { resolve as resolve48, dirname as dirname31, join as join94, basename as basename18 } from "node:path";
|
|
609523
609719
|
import { fileURLToPath as fileURLToPath13 } from "node:url";
|
|
609524
|
-
import { homedir as
|
|
609720
|
+
import { homedir as homedir26 } from "node:os";
|
|
609525
609721
|
function loadConfig2() {
|
|
609526
609722
|
if (!existsSync82(CONFIG_PATH))
|
|
609527
609723
|
return null;
|
|
@@ -609687,7 +609883,7 @@ var CONFIG_PATH, LAUNCH_TIMEOUT_MS, HEALTH_PROBE_TIMEOUT_MS, VIDEO_EXTENSIONS, s
|
|
|
609687
609883
|
var init_video_scan = __esm({
|
|
609688
609884
|
"packages/execution/dist/tools/video-scan.js"() {
|
|
609689
609885
|
"use strict";
|
|
609690
|
-
CONFIG_PATH = join94(
|
|
609886
|
+
CONFIG_PATH = join94(homedir26(), ".omnius", "video-scan.json");
|
|
609691
609887
|
LAUNCH_TIMEOUT_MS = 6e5;
|
|
609692
609888
|
HEALTH_PROBE_TIMEOUT_MS = 3e3;
|
|
609693
609889
|
VIDEO_EXTENSIONS = /* @__PURE__ */ new Set([".mp4", ".mov", ".webm", ".mkv", ".avi", ".m4v", ".gif"]);
|
|
@@ -610185,7 +610381,7 @@ var init_visual_trigger = __esm({
|
|
|
610185
610381
|
|
|
610186
610382
|
// packages/execution/dist/tools/live-media-loop.js
|
|
610187
610383
|
import { existsSync as existsSync84, mkdirSync as mkdirSync51, readFileSync as readFileSync61, rmSync as rmSync12, writeFileSync as writeFileSync43 } from "node:fs";
|
|
610188
|
-
import { homedir as
|
|
610384
|
+
import { homedir as homedir27, tmpdir as tmpdir19 } from "node:os";
|
|
610189
610385
|
import { basename as basename19, isAbsolute as isAbsolute10, join as join97, resolve as resolve49 } from "node:path";
|
|
610190
610386
|
function isAbortSignal(value2) {
|
|
610191
610387
|
return Boolean(value2 && typeof value2 === "object" && "aborted" in value2 && typeof value2.addEventListener === "function");
|
|
@@ -610883,7 +611079,7 @@ var init_live_media_loop = __esm({
|
|
|
610883
611079
|
init_transcribe_tool();
|
|
610884
611080
|
init_visual_memory();
|
|
610885
611081
|
init_visual_trigger();
|
|
610886
|
-
LIVE_MEDIA_ROOT = join97(
|
|
611082
|
+
LIVE_MEDIA_ROOT = join97(homedir27(), ".omnius", "runtimes", "live-media");
|
|
610887
611083
|
YOLO26_VENV = join97(LIVE_MEDIA_ROOT, ".venv-yolo26");
|
|
610888
611084
|
DEFAULT_YOLO26_MODEL = "yolo26n.pt";
|
|
610889
611085
|
YOLO26_SCALES = ["n", "s", "m", "l", "x"];
|
|
@@ -611299,7 +611495,7 @@ import { existsSync as existsSync85, readFileSync as readFileSync62 } from "node
|
|
|
611299
611495
|
import { spawn as spawn25 } from "node:child_process";
|
|
611300
611496
|
import { resolve as resolve50, dirname as dirname32, join as join98, basename as basename20 } from "node:path";
|
|
611301
611497
|
import { fileURLToPath as fileURLToPath15 } from "node:url";
|
|
611302
|
-
import { homedir as
|
|
611498
|
+
import { homedir as homedir28 } from "node:os";
|
|
611303
611499
|
function loadConfig3() {
|
|
611304
611500
|
if (!existsSync85(CONFIG_PATH2))
|
|
611305
611501
|
return null;
|
|
@@ -611444,7 +611640,7 @@ var CONFIG_PATH2, HEALTH_PROBE_TIMEOUT_MS2, LAUNCH_TIMEOUT_MS2, RUN_TIMEOUT_MS,
|
|
|
611444
611640
|
var init_lance = __esm({
|
|
611445
611641
|
"packages/execution/dist/tools/lance.js"() {
|
|
611446
611642
|
"use strict";
|
|
611447
|
-
CONFIG_PATH2 = join98(
|
|
611643
|
+
CONFIG_PATH2 = join98(homedir28(), ".omnius", "lance.json");
|
|
611448
611644
|
HEALTH_PROBE_TIMEOUT_MS2 = 3e3;
|
|
611449
611645
|
LAUNCH_TIMEOUT_MS2 = 12e4;
|
|
611450
611646
|
RUN_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
@@ -612170,10 +612366,10 @@ var init_buildRunner = __esm({
|
|
|
612170
612366
|
// packages/execution/dist/constraints.js
|
|
612171
612367
|
import { existsSync as existsSync88, readFileSync as readFileSync65, writeFileSync as writeFileSync45, mkdirSync as mkdirSync53 } from "node:fs";
|
|
612172
612368
|
import { join as join100 } from "node:path";
|
|
612173
|
-
import { homedir as
|
|
612369
|
+
import { homedir as homedir29 } from "node:os";
|
|
612174
612370
|
function loadConstraints(projectRoot) {
|
|
612175
612371
|
projectConstraints = loadFile(join100(projectRoot, ".omnius", "constraints.json"));
|
|
612176
|
-
globalConstraints = loadFile(join100(
|
|
612372
|
+
globalConstraints = loadFile(join100(homedir29(), ".omnius", "constraints.json"));
|
|
612177
612373
|
}
|
|
612178
612374
|
function loadFile(path16) {
|
|
612179
612375
|
try {
|
|
@@ -615542,7 +615738,7 @@ var init_manifest = __esm({
|
|
|
615542
615738
|
|
|
615543
615739
|
// packages/orchestrator/dist/plugins/discovery.js
|
|
615544
615740
|
import { existsSync as existsSync89, readdirSync as readdirSync27, readFileSync as readFileSync66 } from "node:fs";
|
|
615545
|
-
import { homedir as
|
|
615741
|
+
import { homedir as homedir30 } from "node:os";
|
|
615546
615742
|
import { join as join101, resolve as resolve51 } from "node:path";
|
|
615547
615743
|
function tryReadManifest(pluginDir, source) {
|
|
615548
615744
|
for (const name10 of MANIFEST_FILE_NAMES) {
|
|
@@ -615590,7 +615786,7 @@ function tryReadManifest(pluginDir, source) {
|
|
|
615590
615786
|
}
|
|
615591
615787
|
function discoverFromUserDir() {
|
|
615592
615788
|
const manifests = [];
|
|
615593
|
-
const userDir = resolve51(
|
|
615789
|
+
const userDir = resolve51(homedir30(), ".omnius", "plugins");
|
|
615594
615790
|
if (!existsSync89(userDir))
|
|
615595
615791
|
return manifests;
|
|
615596
615792
|
const entries2 = readdirSync27(userDir, { withFileTypes: true });
|
|
@@ -621089,23 +621285,23 @@ var init_completionFinalization = __esm({
|
|
|
621089
621285
|
|
|
621090
621286
|
// packages/orchestrator/dist/verificationCommand.js
|
|
621091
621287
|
function exactTrailingExitReporterPrimary(command) {
|
|
621092
|
-
let
|
|
621288
|
+
let quote = null;
|
|
621093
621289
|
let separator = -1;
|
|
621094
621290
|
for (let i2 = 0; i2 < command.length; i2++) {
|
|
621095
621291
|
const ch = command[i2];
|
|
621096
|
-
if (
|
|
621097
|
-
if (ch ===
|
|
621098
|
-
|
|
621292
|
+
if (quote) {
|
|
621293
|
+
if (ch === quote && command[i2 - 1] !== "\\")
|
|
621294
|
+
quote = null;
|
|
621099
621295
|
continue;
|
|
621100
621296
|
}
|
|
621101
621297
|
if (ch === "'" || ch === '"') {
|
|
621102
|
-
|
|
621298
|
+
quote = ch;
|
|
621103
621299
|
continue;
|
|
621104
621300
|
}
|
|
621105
621301
|
if (ch === ";")
|
|
621106
621302
|
separator = i2;
|
|
621107
621303
|
}
|
|
621108
|
-
if (
|
|
621304
|
+
if (quote || separator < 1)
|
|
621109
621305
|
return null;
|
|
621110
621306
|
const primary = command.slice(0, separator).trim();
|
|
621111
621307
|
const reporter = command.slice(separator + 1).trim();
|
|
@@ -621176,17 +621372,17 @@ function splitConjunctiveVerifyCommand(command) {
|
|
|
621176
621372
|
function splitTopLevelAnd(command) {
|
|
621177
621373
|
const parts = [];
|
|
621178
621374
|
let current = "";
|
|
621179
|
-
let
|
|
621375
|
+
let quote = null;
|
|
621180
621376
|
for (let i2 = 0; i2 < command.length; i2++) {
|
|
621181
621377
|
const ch = command[i2];
|
|
621182
|
-
if (
|
|
621378
|
+
if (quote) {
|
|
621183
621379
|
current += ch;
|
|
621184
|
-
if (ch ===
|
|
621185
|
-
|
|
621380
|
+
if (ch === quote && command[i2 - 1] !== "\\")
|
|
621381
|
+
quote = null;
|
|
621186
621382
|
continue;
|
|
621187
621383
|
}
|
|
621188
621384
|
if (ch === "'" || ch === '"') {
|
|
621189
|
-
|
|
621385
|
+
quote = ch;
|
|
621190
621386
|
current += ch;
|
|
621191
621387
|
continue;
|
|
621192
621388
|
}
|
|
@@ -621202,16 +621398,16 @@ function splitTopLevelAnd(command) {
|
|
|
621202
621398
|
return parts.filter(Boolean);
|
|
621203
621399
|
}
|
|
621204
621400
|
function hasUnsafeVerifierShellSyntax(command) {
|
|
621205
|
-
let
|
|
621401
|
+
let quote = null;
|
|
621206
621402
|
for (let i2 = 0; i2 < command.length; i2++) {
|
|
621207
621403
|
const ch = command[i2];
|
|
621208
|
-
if (
|
|
621209
|
-
if (ch ===
|
|
621210
|
-
|
|
621404
|
+
if (quote) {
|
|
621405
|
+
if (ch === quote && command[i2 - 1] !== "\\")
|
|
621406
|
+
quote = null;
|
|
621211
621407
|
continue;
|
|
621212
621408
|
}
|
|
621213
621409
|
if (ch === "'" || ch === '"') {
|
|
621214
|
-
|
|
621410
|
+
quote = ch;
|
|
621215
621411
|
continue;
|
|
621216
621412
|
}
|
|
621217
621413
|
if (ch === "`" || ch === "$" && command[i2 + 1] === "(") {
|
|
@@ -621227,16 +621423,16 @@ function hasUnsafeVerifierShellSyntax(command) {
|
|
|
621227
621423
|
return false;
|
|
621228
621424
|
}
|
|
621229
621425
|
function hasUnsafeVerifierSyntaxExceptPipeline(command) {
|
|
621230
|
-
let
|
|
621426
|
+
let quote = null;
|
|
621231
621427
|
for (let i2 = 0; i2 < command.length; i2++) {
|
|
621232
621428
|
const ch = command[i2];
|
|
621233
|
-
if (
|
|
621234
|
-
if (ch ===
|
|
621235
|
-
|
|
621429
|
+
if (quote) {
|
|
621430
|
+
if (ch === quote && command[i2 - 1] !== "\\")
|
|
621431
|
+
quote = null;
|
|
621236
621432
|
continue;
|
|
621237
621433
|
}
|
|
621238
621434
|
if (ch === "'" || ch === '"') {
|
|
621239
|
-
|
|
621435
|
+
quote = ch;
|
|
621240
621436
|
continue;
|
|
621241
621437
|
}
|
|
621242
621438
|
if (ch === "`" || ch === "$" && command[i2 + 1] === "(")
|
|
@@ -621254,17 +621450,17 @@ function hasUnsafeVerifierSyntaxExceptPipeline(command) {
|
|
|
621254
621450
|
function splitTopLevelPipe(command) {
|
|
621255
621451
|
const parts = [];
|
|
621256
621452
|
let current = "";
|
|
621257
|
-
let
|
|
621453
|
+
let quote = null;
|
|
621258
621454
|
for (let i2 = 0; i2 < command.length; i2++) {
|
|
621259
621455
|
const ch = command[i2];
|
|
621260
|
-
if (
|
|
621456
|
+
if (quote) {
|
|
621261
621457
|
current += ch;
|
|
621262
|
-
if (ch ===
|
|
621263
|
-
|
|
621458
|
+
if (ch === quote && command[i2 - 1] !== "\\")
|
|
621459
|
+
quote = null;
|
|
621264
621460
|
continue;
|
|
621265
621461
|
}
|
|
621266
621462
|
if (ch === "'" || ch === '"') {
|
|
621267
|
-
|
|
621463
|
+
quote = ch;
|
|
621268
621464
|
current += ch;
|
|
621269
621465
|
continue;
|
|
621270
621466
|
}
|
|
@@ -621352,16 +621548,16 @@ function canonicalVerificationIdentity(command, receipt2) {
|
|
|
621352
621548
|
return `${receipt2?.cwd ? `cwd=${receipt2.cwd};` : ""}${stage2}`;
|
|
621353
621549
|
}
|
|
621354
621550
|
function stripVerifierFallbackSuffix(command) {
|
|
621355
|
-
let
|
|
621551
|
+
let quote = null;
|
|
621356
621552
|
for (let i2 = 0; i2 < command.length - 1; i2++) {
|
|
621357
621553
|
const ch = command[i2];
|
|
621358
|
-
if (
|
|
621359
|
-
if (ch ===
|
|
621360
|
-
|
|
621554
|
+
if (quote) {
|
|
621555
|
+
if (ch === quote && command[i2 - 1] !== "\\")
|
|
621556
|
+
quote = null;
|
|
621361
621557
|
continue;
|
|
621362
621558
|
}
|
|
621363
621559
|
if (ch === "'" || ch === '"') {
|
|
621364
|
-
|
|
621560
|
+
quote = ch;
|
|
621365
621561
|
continue;
|
|
621366
621562
|
}
|
|
621367
621563
|
if (ch === "|" && command[i2 + 1] === "|") {
|
|
@@ -621393,20 +621589,20 @@ function stageHeadProgram(stage2) {
|
|
|
621393
621589
|
function commandIsPureReadOnlyPipeline(command) {
|
|
621394
621590
|
const stages = [];
|
|
621395
621591
|
let current = "";
|
|
621396
|
-
let
|
|
621592
|
+
let quote = null;
|
|
621397
621593
|
const raw = command.trim();
|
|
621398
621594
|
if (!raw)
|
|
621399
621595
|
return false;
|
|
621400
621596
|
for (let i2 = 0; i2 < raw.length; i2++) {
|
|
621401
621597
|
const ch = raw[i2];
|
|
621402
|
-
if (
|
|
621598
|
+
if (quote) {
|
|
621403
621599
|
current += ch;
|
|
621404
|
-
if (ch ===
|
|
621405
|
-
|
|
621600
|
+
if (ch === quote && raw[i2 - 1] !== "\\")
|
|
621601
|
+
quote = null;
|
|
621406
621602
|
continue;
|
|
621407
621603
|
}
|
|
621408
621604
|
if (ch === "'" || ch === '"') {
|
|
621409
|
-
|
|
621605
|
+
quote = ch;
|
|
621410
621606
|
current += ch;
|
|
621411
621607
|
continue;
|
|
621412
621608
|
}
|
|
@@ -621583,7 +621779,7 @@ __export(ollama_pool_cleanup_exports, {
|
|
|
621583
621779
|
import { execFile as execFile8 } from "node:child_process";
|
|
621584
621780
|
import { readdir as readdir6, readFile as fsReadFile, readlink } from "node:fs/promises";
|
|
621585
621781
|
import { readFileSync as readFileSync71 } from "node:fs";
|
|
621586
|
-
import { homedir as
|
|
621782
|
+
import { homedir as homedir31 } from "node:os";
|
|
621587
621783
|
import { basename as basename21, join as join105 } from "node:path";
|
|
621588
621784
|
async function scanOllamaProcesses(options2 = {}) {
|
|
621589
621785
|
const system = makeSystem(options2.system);
|
|
@@ -621823,7 +622019,7 @@ function signalOllamaProcess(system, proc, signal) {
|
|
|
621823
622019
|
}
|
|
621824
622020
|
function readConfiguredMainModel() {
|
|
621825
622021
|
try {
|
|
621826
|
-
const parsed = JSON.parse(readFileSync71(join105(
|
|
622022
|
+
const parsed = JSON.parse(readFileSync71(join105(homedir31(), ".omnius", "config.json"), "utf8"));
|
|
621827
622023
|
const model = String(parsed?.model ?? "").trim();
|
|
621828
622024
|
return model || null;
|
|
621829
622025
|
} catch {
|
|
@@ -622252,7 +622448,7 @@ var init_ollama_pool_cleanup = __esm({
|
|
|
622252
622448
|
// packages/orchestrator/dist/ollama-pool.js
|
|
622253
622449
|
import { spawn as spawn28, exec as exec2 } from "node:child_process";
|
|
622254
622450
|
import { existsSync as existsSync94, readFileSync as readFileSync72, readdirSync as readdirSync28, statfsSync as statfsSync5, statSync as statSync33 } from "node:fs";
|
|
622255
|
-
import { homedir as
|
|
622451
|
+
import { homedir as homedir32 } from "node:os";
|
|
622256
622452
|
import { join as join106 } from "node:path";
|
|
622257
622453
|
import { createServer as createServer3 } from "node:net";
|
|
622258
622454
|
import { EventEmitter as EventEmitter5 } from "node:events";
|
|
@@ -622266,7 +622462,7 @@ function discoverSystemOllamaModelStore() {
|
|
|
622266
622462
|
const candidates = [
|
|
622267
622463
|
"/usr/share/ollama/.ollama/models",
|
|
622268
622464
|
"/var/lib/ollama/.ollama/models",
|
|
622269
|
-
join106(
|
|
622465
|
+
join106(homedir32(), ".ollama", "models")
|
|
622270
622466
|
];
|
|
622271
622467
|
for (const p2 of candidates) {
|
|
622272
622468
|
if (isDirectory(p2))
|
|
@@ -622401,8 +622597,8 @@ async function isJetsonSystem() {
|
|
|
622401
622597
|
}
|
|
622402
622598
|
async function detectGpusViaJtop() {
|
|
622403
622599
|
try {
|
|
622404
|
-
const { execSync:
|
|
622405
|
-
const output2 =
|
|
622600
|
+
const { execSync: execSync39 } = await import("node:child_process");
|
|
622601
|
+
const output2 = execSync39("jtop -c 1 -j", {
|
|
622406
622602
|
encoding: "utf-8",
|
|
622407
622603
|
timeout: 3e3,
|
|
622408
622604
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -622521,7 +622717,7 @@ function recommendMaxParallelFromVram(minFreeMB) {
|
|
|
622521
622717
|
async function getHardwareSnapshot() {
|
|
622522
622718
|
const { totalmem: totalmem11, freemem: freemem10, cpus: cpus7 } = await import("node:os");
|
|
622523
622719
|
const gpus = await detectGpus();
|
|
622524
|
-
const diskPath = discoverSystemOllamaModelStore() ??
|
|
622720
|
+
const diskPath = discoverSystemOllamaModelStore() ?? homedir32();
|
|
622525
622721
|
const disk = snapshotDisk(diskPath);
|
|
622526
622722
|
const network = snapshotNetwork();
|
|
622527
622723
|
return {
|
|
@@ -629566,10 +629762,10 @@ var init_memory_consolidation = __esm({
|
|
|
629566
629762
|
|
|
629567
629763
|
// packages/orchestrator/dist/consolidation-runtime.js
|
|
629568
629764
|
import { existsSync as existsSync105, mkdirSync as mkdirSync61, readFileSync as readFileSync80, writeFileSync as writeFileSync51, renameSync as renameSync13 } from "node:fs";
|
|
629569
|
-
import { homedir as
|
|
629765
|
+
import { homedir as homedir33 } from "node:os";
|
|
629570
629766
|
import { join as join115, dirname as dirname42 } from "node:path";
|
|
629571
629767
|
function storePath2() {
|
|
629572
|
-
const home2 = process.env.OMNIUS_HOME || join115(
|
|
629768
|
+
const home2 = process.env.OMNIUS_HOME || join115(homedir33(), ".omnius");
|
|
629573
629769
|
return join115(home2, "agent-notes.json");
|
|
629574
629770
|
}
|
|
629575
629771
|
function load2() {
|
|
@@ -633803,7 +633999,7 @@ var init_context_dump_security = __esm({
|
|
|
633803
633999
|
|
|
633804
634000
|
// packages/orchestrator/dist/contextWindowDump.js
|
|
633805
634001
|
import { existsSync as existsSync108, mkdirSync as mkdirSync64, readdirSync as readdirSync33, readFileSync as readFileSync83, statSync as statSync40, unlinkSync as unlinkSync20, writeFileSync as writeFileSync54, appendFileSync as appendFileSync9, chmodSync as chmodSync4, closeSync as closeSync2, openSync as openSync2, readSync, renameSync as renameSync15 } from "node:fs";
|
|
633806
|
-
import { homedir as
|
|
634002
|
+
import { homedir as homedir34 } from "node:os";
|
|
633807
634003
|
import { join as join118, resolve as resolve57 } from "node:path";
|
|
633808
634004
|
import { createHash as createHash41 } from "node:crypto";
|
|
633809
634005
|
function contextWindowDumpDir(cwd4 = process.cwd()) {
|
|
@@ -634457,7 +634653,7 @@ function pruneOldDumpFiles(dir) {
|
|
|
634457
634653
|
function defaultContextWindowDumpLocations(cwd4 = process.cwd()) {
|
|
634458
634654
|
const locations = [
|
|
634459
634655
|
contextWindowDumpDir(cwd4),
|
|
634460
|
-
join118(
|
|
634656
|
+
join118(homedir34(), ".omnius", "context-window-dumps")
|
|
634461
634657
|
];
|
|
634462
634658
|
const envDir = process.env["OMNIUS_CONTEXT_WINDOW_DUMP_DIR"]?.trim();
|
|
634463
634659
|
if (envDir)
|
|
@@ -636386,7 +636582,7 @@ function braceBodies(command) {
|
|
|
636386
636582
|
const bodies = [];
|
|
636387
636583
|
let depth = 0;
|
|
636388
636584
|
let start2 = -1;
|
|
636389
|
-
let
|
|
636585
|
+
let quote = null;
|
|
636390
636586
|
let escaped = false;
|
|
636391
636587
|
for (let i2 = 0; i2 < command.length; i2++) {
|
|
636392
636588
|
const ch = command[i2];
|
|
@@ -636398,13 +636594,13 @@ function braceBodies(command) {
|
|
|
636398
636594
|
escaped = true;
|
|
636399
636595
|
continue;
|
|
636400
636596
|
}
|
|
636401
|
-
if (
|
|
636402
|
-
if (ch ===
|
|
636403
|
-
|
|
636597
|
+
if (quote) {
|
|
636598
|
+
if (ch === quote)
|
|
636599
|
+
quote = null;
|
|
636404
636600
|
continue;
|
|
636405
636601
|
}
|
|
636406
636602
|
if (ch === "'" || ch === '"') {
|
|
636407
|
-
|
|
636603
|
+
quote = ch;
|
|
636408
636604
|
continue;
|
|
636409
636605
|
}
|
|
636410
636606
|
if (ch === "{") {
|
|
@@ -641639,7 +641835,7 @@ __export(preflightSnapshot_exports, {
|
|
|
641639
641835
|
freeDiskBytes: () => freeDiskBytes
|
|
641640
641836
|
});
|
|
641641
641837
|
import { existsSync as existsSync111, readFileSync as readFileSync86, statSync as statSync43, statfsSync as statfsSync6 } from "node:fs";
|
|
641642
|
-
import { homedir as
|
|
641838
|
+
import { homedir as homedir35, platform as platform7, arch as arch5, totalmem as totalmem4, freemem as freemem3, hostname as hostname3 } from "node:os";
|
|
641643
641839
|
import { join as join120 } from "node:path";
|
|
641644
641840
|
import { createHash as createHash47 } from "node:crypto";
|
|
641645
641841
|
function capturePreflightSnapshot(workingDir) {
|
|
@@ -641806,7 +642002,7 @@ function captureToolchainVersions() {
|
|
|
641806
642002
|
}
|
|
641807
642003
|
function expandPath(p2) {
|
|
641808
642004
|
if (p2.startsWith("~/"))
|
|
641809
|
-
return join120(
|
|
642005
|
+
return join120(homedir35(), p2.slice(2));
|
|
641810
642006
|
return p2;
|
|
641811
642007
|
}
|
|
641812
642008
|
function sha2568(s2) {
|
|
@@ -641895,17 +642091,17 @@ function classifyShellIntent(cmd) {
|
|
|
641895
642091
|
function splitTopLevelShellStages(command) {
|
|
641896
642092
|
const stages = [];
|
|
641897
642093
|
let current = "";
|
|
641898
|
-
let
|
|
642094
|
+
let quote = null;
|
|
641899
642095
|
for (let i2 = 0; i2 < command.length; i2++) {
|
|
641900
642096
|
const ch = command[i2];
|
|
641901
|
-
if (
|
|
642097
|
+
if (quote) {
|
|
641902
642098
|
current += ch;
|
|
641903
|
-
if (ch ===
|
|
641904
|
-
|
|
642099
|
+
if (ch === quote && command[i2 - 1] !== "\\")
|
|
642100
|
+
quote = null;
|
|
641905
642101
|
continue;
|
|
641906
642102
|
}
|
|
641907
642103
|
if (ch === "'" || ch === '"') {
|
|
641908
|
-
|
|
642104
|
+
quote = ch;
|
|
641909
642105
|
current += ch;
|
|
641910
642106
|
continue;
|
|
641911
642107
|
}
|
|
@@ -642836,17 +643032,17 @@ import { homedir as _osHomedir } from "node:os";
|
|
|
642836
643032
|
import { z as z18 } from "zod";
|
|
642837
643033
|
function stripShellQuotedSegments(command) {
|
|
642838
643034
|
let out = "";
|
|
642839
|
-
let
|
|
643035
|
+
let quote = null;
|
|
642840
643036
|
let escaped = false;
|
|
642841
643037
|
for (let i2 = 0; i2 < command.length; i2++) {
|
|
642842
643038
|
const ch = command[i2];
|
|
642843
|
-
if (
|
|
643039
|
+
if (quote === "'") {
|
|
642844
643040
|
if (ch === "'")
|
|
642845
|
-
|
|
643041
|
+
quote = null;
|
|
642846
643042
|
out += " ";
|
|
642847
643043
|
continue;
|
|
642848
643044
|
}
|
|
642849
|
-
if (
|
|
643045
|
+
if (quote === '"') {
|
|
642850
643046
|
if (escaped) {
|
|
642851
643047
|
escaped = false;
|
|
642852
643048
|
out += " ";
|
|
@@ -642858,12 +643054,12 @@ function stripShellQuotedSegments(command) {
|
|
|
642858
643054
|
continue;
|
|
642859
643055
|
}
|
|
642860
643056
|
if (ch === '"')
|
|
642861
|
-
|
|
643057
|
+
quote = null;
|
|
642862
643058
|
out += " ";
|
|
642863
643059
|
continue;
|
|
642864
643060
|
}
|
|
642865
643061
|
if (ch === "'" || ch === '"') {
|
|
642866
|
-
|
|
643062
|
+
quote = ch;
|
|
642867
643063
|
out += " ";
|
|
642868
643064
|
continue;
|
|
642869
643065
|
}
|
|
@@ -675298,9 +675494,9 @@ var init_agent_task = __esm({
|
|
|
675298
675494
|
// packages/orchestrator/dist/task-recovery.js
|
|
675299
675495
|
import { existsSync as existsSync116, readFileSync as readFileSync90, writeFileSync as writeFileSync58, mkdirSync as mkdirSync68, readdirSync as readdirSync35, renameSync as renameSync16, unlinkSync as unlinkSync22 } from "node:fs";
|
|
675300
675496
|
import { join as join126 } from "node:path";
|
|
675301
|
-
import { homedir as
|
|
675497
|
+
import { homedir as homedir36 } from "node:os";
|
|
675302
675498
|
function sidecarDir() {
|
|
675303
|
-
return join126(
|
|
675499
|
+
return join126(homedir36(), ".omnius", "tasks");
|
|
675304
675500
|
}
|
|
675305
675501
|
function sidecarPath(taskId) {
|
|
675306
675502
|
const safe = taskId.replace(/[^a-zA-Z0-9_.-]/g, "_");
|
|
@@ -677214,7 +677410,7 @@ var init_missionSystem = __esm({
|
|
|
677214
677410
|
|
|
677215
677411
|
// packages/orchestrator/dist/context-references.js
|
|
677216
677412
|
import { readFileSync as readFileSync94, readdirSync as readdirSync36, statSync as statSync46 } from "node:fs";
|
|
677217
|
-
import { homedir as
|
|
677413
|
+
import { homedir as homedir37 } from "node:os";
|
|
677218
677414
|
import { join as join130, resolve as resolve61, relative as relative16, sep as sep8, extname as extname15 } from "node:path";
|
|
677219
677415
|
function estimateTokens8(text2) {
|
|
677220
677416
|
return Math.ceil(text2.length / CHARS_PER_TOKEN);
|
|
@@ -677249,7 +677445,7 @@ function removeReferenceTokens(message2, refs) {
|
|
|
677249
677445
|
}
|
|
677250
677446
|
function resolvePath4(cwd4, target, allowedRoot) {
|
|
677251
677447
|
const isAbsolute18 = target.startsWith("/") || target.startsWith("~");
|
|
677252
|
-
const expanded = isAbsolute18 ? target.replace(/^~/,
|
|
677448
|
+
const expanded = isAbsolute18 ? target.replace(/^~/, homedir37()) : join130(cwd4, target);
|
|
677253
677449
|
const resolved = resolve61(expanded);
|
|
677254
677450
|
if (allowedRoot) {
|
|
677255
677451
|
const allowed = resolve61(allowedRoot);
|
|
@@ -677260,7 +677456,7 @@ function resolvePath4(cwd4, target, allowedRoot) {
|
|
|
677260
677456
|
return resolved;
|
|
677261
677457
|
}
|
|
677262
677458
|
function ensureReferencePathAllowed(filePath) {
|
|
677263
|
-
const home2 = resolve61(
|
|
677459
|
+
const home2 = resolve61(homedir37());
|
|
677264
677460
|
for (const rel of SENSITIVE_HOME_FILES) {
|
|
677265
677461
|
const blocked = resolve61(join130(home2, rel));
|
|
677266
677462
|
if (filePath === blocked) {
|
|
@@ -680218,7 +680414,7 @@ __export(daemon_exports, {
|
|
|
680218
680414
|
import { spawn as spawn30 } from "node:child_process";
|
|
680219
680415
|
import { existsSync as existsSync120, readFileSync as readFileSync97, writeFileSync as writeFileSync63, mkdirSync as mkdirSync72, unlinkSync as unlinkSync23, openSync as openSync4, closeSync as closeSync4, writeSync as writeSync3, statSync as statSync47, renameSync as renameSync18 } from "node:fs";
|
|
680220
680416
|
import { join as join132 } from "node:path";
|
|
680221
|
-
import { homedir as
|
|
680417
|
+
import { homedir as homedir38 } from "node:os";
|
|
680222
680418
|
import { createServer as createNetServer } from "node:net";
|
|
680223
680419
|
import { fileURLToPath as fileURLToPath19 } from "node:url";
|
|
680224
680420
|
import { dirname as dirname46 } from "node:path";
|
|
@@ -680542,7 +680738,7 @@ async function repairManagedDaemonUnit(port2, preferredEntrypoint) {
|
|
|
680542
680738
|
const command = await resolveDaemonCommand(process.execPath, preferredEntrypoint);
|
|
680543
680739
|
if (!command) return false;
|
|
680544
680740
|
try {
|
|
680545
|
-
const configHome2 = process.env["XDG_CONFIG_HOME"] || join132(
|
|
680741
|
+
const configHome2 = process.env["XDG_CONFIG_HOME"] || join132(homedir38(), ".config");
|
|
680546
680742
|
const unitDir = join132(configHome2, "systemd", "user");
|
|
680547
680743
|
const unitPath = join132(unitDir, "omnius-daemon.service");
|
|
680548
680744
|
const logDir = join132(OMNIUS_DIR);
|
|
@@ -680975,8 +681171,8 @@ async function forceKillDaemon(port2) {
|
|
|
680975
681171
|
}
|
|
680976
681172
|
}
|
|
680977
681173
|
try {
|
|
680978
|
-
const { execSync:
|
|
680979
|
-
const out =
|
|
681174
|
+
const { execSync: execSync39 } = await import("node:child_process");
|
|
681175
|
+
const out = execSync39(
|
|
680980
681176
|
`lsof -ti :${p2} 2>/dev/null || fuser ${p2}/tcp 2>/dev/null || true`,
|
|
680981
681177
|
{ encoding: "utf8", timeout: 3e3 }
|
|
680982
681178
|
).trim();
|
|
@@ -681116,7 +681312,7 @@ var OMNIUS_DIR, PID_FILE, DEFAULT_PORT2, LOCK_INITIALIZATION_GRACE_MS, DAEMON_VE
|
|
|
681116
681312
|
var init_daemon = __esm({
|
|
681117
681313
|
"packages/cli/src/daemon.ts"() {
|
|
681118
681314
|
init_dist5();
|
|
681119
|
-
OMNIUS_DIR = process.env["OMNIUS_HOME"]?.trim() || join132(
|
|
681315
|
+
OMNIUS_DIR = process.env["OMNIUS_HOME"]?.trim() || join132(homedir38(), ".omnius");
|
|
681120
681316
|
PID_FILE = join132(OMNIUS_DIR, "daemon.pid");
|
|
681121
681317
|
DEFAULT_PORT2 = 11435;
|
|
681122
681318
|
LOCK_INITIALIZATION_GRACE_MS = 5e3;
|
|
@@ -681180,7 +681376,7 @@ import {
|
|
|
681180
681376
|
writeSync as writeSync4
|
|
681181
681377
|
} from "node:fs";
|
|
681182
681378
|
import { createRequire as createRequire5 } from "node:module";
|
|
681183
|
-
import { homedir as
|
|
681379
|
+
import { homedir as homedir39, tmpdir as tmpdir22 } from "node:os";
|
|
681184
681380
|
import { basename as basename24, dirname as dirname47, join as join133 } from "node:path";
|
|
681185
681381
|
import { fileURLToPath as fileURLToPath20 } from "node:url";
|
|
681186
681382
|
function trayUpdatePresentation(currentVersion, latestVersion, state3 = null) {
|
|
@@ -681239,7 +681435,7 @@ function trayVersionPresentation(health, update2) {
|
|
|
681239
681435
|
function uidSuffix() {
|
|
681240
681436
|
return typeof process.getuid === "function" ? String(process.getuid()) : "user";
|
|
681241
681437
|
}
|
|
681242
|
-
function resolveTrayPaths(env2 = process.env, platform12 = process.platform, home2 =
|
|
681438
|
+
function resolveTrayPaths(env2 = process.env, platform12 = process.platform, home2 = homedir39()) {
|
|
681243
681439
|
const runtimeBase = env2["XDG_RUNTIME_DIR"] || join133(tmpdir22(), `omnius-${uidSuffix()}`);
|
|
681244
681440
|
const stateBase = platform12 === "win32" ? env2["LOCALAPPDATA"] || join133(home2, "AppData", "Local") : env2["XDG_STATE_HOME"] || join133(home2, ".local", "state");
|
|
681245
681441
|
const configBase = platform12 === "win32" ? env2["APPDATA"] || join133(home2, "AppData", "Roaming") : env2["XDG_CONFIG_HOME"] || join133(home2, ".config");
|
|
@@ -683423,7 +683619,7 @@ __export(py_embed_exports, {
|
|
|
683423
683619
|
import { spawnSync as spawnSync10 } from "node:child_process";
|
|
683424
683620
|
import { existsSync as existsSync124, mkdirSync as mkdirSync76, readFileSync as readFileSync101, writeFileSync as writeFileSync66 } from "node:fs";
|
|
683425
683621
|
import { dirname as dirname48, join as join136 } from "node:path";
|
|
683426
|
-
import { homedir as
|
|
683622
|
+
import { homedir as homedir40 } from "node:os";
|
|
683427
683623
|
import { fileURLToPath as fileURLToPath22 } from "node:url";
|
|
683428
683624
|
function managedAsrStateFile(engineId) {
|
|
683429
683625
|
return join136(MANAGED_ASR_ROOT, engineId, "models.json");
|
|
@@ -683471,7 +683667,7 @@ function parseWorkerEvents(output2) {
|
|
|
683471
683667
|
return events;
|
|
683472
683668
|
}
|
|
683473
683669
|
function getVenvDir() {
|
|
683474
|
-
return join136(
|
|
683670
|
+
return join136(homedir40(), ".omnius", "venv");
|
|
683475
683671
|
}
|
|
683476
683672
|
function getVenvPython() {
|
|
683477
683673
|
const base3 = getVenvDir();
|
|
@@ -684162,8 +684358,8 @@ var MODULE_DIR, MANAGED_ASR_ROOT, MANAGED_ASR_MODEL_ROOT, WHISPER_MODEL_IDS2, NE
|
|
|
684162
684358
|
var init_py_embed = __esm({
|
|
684163
684359
|
"packages/cli/src/api/py-embed.ts"() {
|
|
684164
684360
|
MODULE_DIR = dirname48(fileURLToPath22(import.meta.url));
|
|
684165
|
-
MANAGED_ASR_ROOT = join136(
|
|
684166
|
-
MANAGED_ASR_MODEL_ROOT = join136(
|
|
684361
|
+
MANAGED_ASR_ROOT = join136(homedir40(), ".omnius", "runtimes", "asr");
|
|
684362
|
+
MANAGED_ASR_MODEL_ROOT = join136(homedir40(), ".omnius", "models", "asr");
|
|
684167
684363
|
WHISPER_MODEL_IDS2 = /* @__PURE__ */ new Set(["tiny", "base", "small", "medium", "large-v3"]);
|
|
684168
684364
|
NEMOTRON_MODEL_ID = "nemotron-speech-streaming-en-0.6b";
|
|
684169
684365
|
VOXTRAL_MODEL_IDS = /* @__PURE__ */ new Set([
|
|
@@ -684192,7 +684388,7 @@ import {
|
|
|
684192
684388
|
statSync as statSync50,
|
|
684193
684389
|
writeFileSync as writeFileSync67
|
|
684194
684390
|
} from "node:fs";
|
|
684195
|
-
import { homedir as
|
|
684391
|
+
import { homedir as homedir41 } from "node:os";
|
|
684196
684392
|
import { join as join137 } from "node:path";
|
|
684197
684393
|
import { Worker as Worker2 } from "node:worker_threads";
|
|
684198
684394
|
function normalizedKey2(engineId, modelId) {
|
|
@@ -684505,7 +684701,7 @@ var init_asr_model_downloads = __esm({
|
|
|
684505
684701
|
"packages/cli/src/api/asr-model-downloads.ts"() {
|
|
684506
684702
|
init_dist5();
|
|
684507
684703
|
init_py_embed();
|
|
684508
|
-
omniusHome = join137(
|
|
684704
|
+
omniusHome = join137(homedir41(), ".omnius");
|
|
684509
684705
|
statusRoot = join137(omniusHome, "runtimes", "asr", "downloads");
|
|
684510
684706
|
modelRoot = join137(omniusHome, "models", "asr");
|
|
684511
684707
|
activeDownloads = /* @__PURE__ */ new Map();
|
|
@@ -684536,7 +684732,7 @@ import {
|
|
|
684536
684732
|
readdirSync as readdirSync38
|
|
684537
684733
|
} from "node:fs";
|
|
684538
684734
|
import { join as join138, dirname as dirname49 } from "node:path";
|
|
684539
|
-
import { homedir as
|
|
684735
|
+
import { homedir as homedir42 } from "node:os";
|
|
684540
684736
|
import { fileURLToPath as fileURLToPath23 } from "node:url";
|
|
684541
684737
|
import { EventEmitter as EventEmitter6 } from "node:events";
|
|
684542
684738
|
import { createInterface as createInterface4 } from "node:readline";
|
|
@@ -684819,7 +685015,7 @@ async function transcribeFileViaWhisper(filePath, model) {
|
|
|
684819
685015
|
if (!script) return null;
|
|
684820
685016
|
const bin = process.platform === "win32" ? "Scripts" : "bin";
|
|
684821
685017
|
const exe = process.platform === "win32" ? "python.exe" : "python3";
|
|
684822
|
-
const venvPython3 = join138(
|
|
685018
|
+
const venvPython3 = join138(homedir42(), ".omnius", "venv", bin, exe);
|
|
684823
685019
|
if (!existsSync126(venvPython3)) return null;
|
|
684824
685020
|
return new Promise((resolve88) => {
|
|
684825
685021
|
const child2 = spawn34(venvPython3, [script], {
|
|
@@ -684899,7 +685095,7 @@ async function findLiveAsrScript(scriptName) {
|
|
|
684899
685095
|
}
|
|
684900
685096
|
} catch {
|
|
684901
685097
|
}
|
|
684902
|
-
const nvmBase = join138(
|
|
685098
|
+
const nvmBase = join138(homedir42(), ".nvm", "versions", "node");
|
|
684903
685099
|
if (existsSync126(nvmBase)) {
|
|
684904
685100
|
try {
|
|
684905
685101
|
for (const ver of readdirSync38(nvmBase)) {
|
|
@@ -684965,7 +685161,7 @@ function liveAsrUseTranscribeCli() {
|
|
|
684965
685161
|
async function selectTranscribeCliPython(tc) {
|
|
684966
685162
|
const bin = process.platform === "win32" ? "Scripts" : "bin";
|
|
684967
685163
|
const exe = process.platform === "win32" ? "python.exe" : "python3";
|
|
684968
|
-
const sharedPython = join138(
|
|
685164
|
+
const sharedPython = join138(homedir42(), ".omnius", "venv", bin, exe);
|
|
684969
685165
|
const selected = await resolveTranscribeCliPython({
|
|
684970
685166
|
preferredPython: process.env["OMNIUS_TRANSCRIBE_PYTHON"],
|
|
684971
685167
|
configuredPython: process.env["TRANSCRIBE_PYTHON"],
|
|
@@ -685078,7 +685274,7 @@ var init_listen = __esm({
|
|
|
685078
685274
|
init_typed_node_events();
|
|
685079
685275
|
init_async_process();
|
|
685080
685276
|
init_dist5();
|
|
685081
|
-
MANAGED_TRANSCRIBE_CLI_DIR2 = join138(
|
|
685277
|
+
MANAGED_TRANSCRIBE_CLI_DIR2 = join138(homedir42(), ".omnius", "runtimes", "asr", "transcribe-cli-node");
|
|
685082
685278
|
transcribeCliPackageDirs = /* @__PURE__ */ new Set();
|
|
685083
685279
|
transcribeCliPythonRepairAttempted = false;
|
|
685084
685280
|
AUDIO_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
@@ -685662,7 +685858,7 @@ ${text2}`.slice(-2e3);
|
|
|
685662
685858
|
}
|
|
685663
685859
|
} catch {
|
|
685664
685860
|
}
|
|
685665
|
-
const nvmBase = join138(
|
|
685861
|
+
const nvmBase = join138(homedir42(), ".nvm", "versions", "node");
|
|
685666
685862
|
if (existsSync126(nvmBase)) {
|
|
685667
685863
|
try {
|
|
685668
685864
|
const { readdirSync: readdirSync64 } = await import("node:fs");
|
|
@@ -690603,7 +690799,7 @@ reason=${decision2.reason} confidence=${decision2.confidence.toFixed(2)} source=
|
|
|
690603
690799
|
|
|
690604
690800
|
// packages/cli/src/tui/power-monitor.ts
|
|
690605
690801
|
import { closeSync as closeSync7, fstatSync, openSync as openSync7, readSync as readSync3 } from "node:fs";
|
|
690606
|
-
import { homedir as
|
|
690802
|
+
import { homedir as homedir43 } from "node:os";
|
|
690607
690803
|
function finiteNumber2(value2) {
|
|
690608
690804
|
if (typeof value2 === "number" && Number.isFinite(value2)) return value2;
|
|
690609
690805
|
if (typeof value2 === "string") {
|
|
@@ -690643,7 +690839,7 @@ function monitorPaths() {
|
|
|
690643
690839
|
process.env["OMNIUS_POWER_MONITOR_JSONL"],
|
|
690644
690840
|
process.env["POWER_MONITOR_JSONL"],
|
|
690645
690841
|
"/var/log/power-monitor/data.jsonl",
|
|
690646
|
-
`${
|
|
690842
|
+
`${homedir43()}/.local/share/power-monitor/data.jsonl`
|
|
690647
690843
|
].filter((path16) => Boolean(path16));
|
|
690648
690844
|
}
|
|
690649
690845
|
function readLastJsonRecord(path16) {
|
|
@@ -698193,9 +698389,9 @@ var init_secret_redactor = __esm({
|
|
|
698193
698389
|
);
|
|
698194
698390
|
result = result.replace(
|
|
698195
698391
|
_ENV_ASSIGN_RE,
|
|
698196
|
-
(match, name10,
|
|
698392
|
+
(match, name10, quote, value2) => {
|
|
698197
698393
|
if (this.isBypassed(name10)) return match;
|
|
698198
|
-
return `${name10}=${
|
|
698394
|
+
return `${name10}=${quote}${maskToken(value2)}${quote}`;
|
|
698199
698395
|
}
|
|
698200
698396
|
);
|
|
698201
698397
|
result = result.replace(
|
|
@@ -706326,10 +706522,10 @@ ${activitySummary}
|
|
|
706326
706522
|
// packages/cli/src/api/profiles.ts
|
|
706327
706523
|
import { existsSync as existsSync134, readFileSync as readFileSync110, writeFileSync as writeFileSync73, mkdirSync as mkdirSync84, readdirSync as readdirSync41, unlinkSync as unlinkSync28 } from "node:fs";
|
|
706328
706524
|
import { join as join145 } from "node:path";
|
|
706329
|
-
import { homedir as
|
|
706525
|
+
import { homedir as homedir44 } from "node:os";
|
|
706330
706526
|
import { createCipheriv as createCipheriv4, createDecipheriv as createDecipheriv4, randomBytes as randomBytes25, scryptSync as scryptSync3 } from "node:crypto";
|
|
706331
706527
|
function globalProfileDir() {
|
|
706332
|
-
return join145(
|
|
706528
|
+
return join145(homedir44(), ".omnius", "profiles");
|
|
706333
706529
|
}
|
|
706334
706530
|
function projectProfileDir(projectDir2) {
|
|
706335
706531
|
return join145(projectDir2 || process.cwd(), ".omnius", "profiles");
|
|
@@ -706946,7 +707142,7 @@ __export(omnius_directory_exports, {
|
|
|
706946
707142
|
});
|
|
706947
707143
|
import { appendFileSync as appendFileSync15, cpSync as cpSync2, existsSync as existsSync135, mkdirSync as mkdirSync85, readFileSync as readFileSync111, writeFileSync as writeFileSync74, readdirSync as readdirSync42, statSync as statSync54, unlinkSync as unlinkSync29, openSync as openSync9, closeSync as closeSync9, renameSync as renameSync20, watch as fsWatch3 } from "node:fs";
|
|
706948
707144
|
import { join as join146, relative as relative18, basename as basename27, dirname as dirname51, resolve as resolve67 } from "node:path";
|
|
706949
|
-
import { homedir as
|
|
707145
|
+
import { homedir as homedir45 } from "node:os";
|
|
706950
707146
|
import { createHash as createHash59 } from "node:crypto";
|
|
706951
707147
|
function isGitRoot(dir) {
|
|
706952
707148
|
const gitPath = join146(dir, ".git");
|
|
@@ -707150,7 +707346,7 @@ function saveProjectSettings(repoRoot, settings) {
|
|
|
707150
707346
|
writeFileSync74(join146(omniusPath, "settings.json"), JSON.stringify(merged, null, 2) + "\n", { encoding: "utf-8", mode: 384 });
|
|
707151
707347
|
}
|
|
707152
707348
|
function loadGlobalSettings() {
|
|
707153
|
-
const settingsPath = join146(
|
|
707349
|
+
const settingsPath = join146(homedir45(), ".omnius", "settings.json");
|
|
707154
707350
|
try {
|
|
707155
707351
|
if (existsSync135(settingsPath)) {
|
|
707156
707352
|
return JSON.parse(readFileSync111(settingsPath, "utf-8"));
|
|
@@ -707160,7 +707356,7 @@ function loadGlobalSettings() {
|
|
|
707160
707356
|
return {};
|
|
707161
707357
|
}
|
|
707162
707358
|
function saveGlobalSettings(settings) {
|
|
707163
|
-
const dir = join146(
|
|
707359
|
+
const dir = join146(homedir45(), ".omnius");
|
|
707164
707360
|
mkdirSync85(dir, { recursive: true });
|
|
707165
707361
|
const existing = loadGlobalSettings();
|
|
707166
707362
|
const merged = { ...existing, ...settings };
|
|
@@ -708335,7 +708531,7 @@ function saveSessionHistory(repoRoot, sessionId, contentLines, meta) {
|
|
|
708335
708531
|
}
|
|
708336
708532
|
try {
|
|
708337
708533
|
const mirrorId = `tui:${removed.id}`.replace(/[^a-zA-Z0-9_.-]/g, "_");
|
|
708338
|
-
unlinkSync29(join146(
|
|
708534
|
+
unlinkSync29(join146(homedir45(), ".omnius", "chat-sessions", `${mirrorId}.json`));
|
|
708339
708535
|
} catch {
|
|
708340
708536
|
}
|
|
708341
708537
|
}
|
|
@@ -708403,7 +708599,7 @@ function deleteSession(repoRoot, sessionId) {
|
|
|
708403
708599
|
const statePath2 = join146(sessDir, `${sessionId}${TUI_STATE_SUFFIX}`);
|
|
708404
708600
|
if (existsSync135(statePath2)) unlinkSync29(statePath2);
|
|
708405
708601
|
const mirrorId = `tui:${sessionId}`.replace(/[^a-zA-Z0-9_.-]/g, "_");
|
|
708406
|
-
const mirrorPath = join146(
|
|
708602
|
+
const mirrorPath = join146(homedir45(), ".omnius", "chat-sessions", `${mirrorId}.json`);
|
|
708407
708603
|
if (existsSync135(mirrorPath)) unlinkSync29(mirrorPath);
|
|
708408
708604
|
if (existsSync135(indexPath)) {
|
|
708409
708605
|
let index = JSON.parse(readFileSync111(indexPath, "utf-8"));
|
|
@@ -708501,7 +708697,7 @@ function findKeyFiles(repoRoot) {
|
|
|
708501
708697
|
function buildDirTree(root, maxDepth, prefix = "", depth = 0) {
|
|
708502
708698
|
if (depth > maxDepth) return "";
|
|
708503
708699
|
let result = "";
|
|
708504
|
-
const isHomeRoot = depth === 0 && root ===
|
|
708700
|
+
const isHomeRoot = depth === 0 && root === homedir45();
|
|
708505
708701
|
try {
|
|
708506
708702
|
const entries2 = readdirSync42(root, { withFileTypes: true }).filter((e2) => !e2.name.startsWith(".") || e2.name === ".github").filter((e2) => !SKIP_DIRS2.has(e2.name)).filter((e2) => !(isHomeRoot && HOME_SKIP_DIRS.has(e2.name))).sort((a2, b) => {
|
|
708507
708703
|
if (a2.isDirectory() && !b.isDirectory()) return -1;
|
|
@@ -708595,13 +708791,13 @@ function recordUsage(kind, value2, opts) {
|
|
|
708595
708791
|
}
|
|
708596
708792
|
saveUsageFile(filePath, data);
|
|
708597
708793
|
};
|
|
708598
|
-
update2(join146(
|
|
708794
|
+
update2(join146(homedir45(), ".omnius", USAGE_HISTORY_FILE));
|
|
708599
708795
|
if (opts?.repoRoot) {
|
|
708600
708796
|
update2(join146(opts.repoRoot, OMNIUS_DIR2, USAGE_HISTORY_FILE));
|
|
708601
708797
|
}
|
|
708602
708798
|
}
|
|
708603
708799
|
function loadUsageHistory(kind, repoRoot) {
|
|
708604
|
-
const globalPath = join146(
|
|
708800
|
+
const globalPath = join146(homedir45(), ".omnius", USAGE_HISTORY_FILE);
|
|
708605
708801
|
const globalData = loadUsageFile(globalPath);
|
|
708606
708802
|
const localData = repoRoot ? loadUsageFile(join146(repoRoot, OMNIUS_DIR2, USAGE_HISTORY_FILE)) : { records: [] };
|
|
708607
708803
|
const map2 = /* @__PURE__ */ new Map();
|
|
@@ -708632,7 +708828,7 @@ function deleteUsageRecord(kind, value2, repoRoot) {
|
|
|
708632
708828
|
saveUsageFile(filePath, data);
|
|
708633
708829
|
}
|
|
708634
708830
|
};
|
|
708635
|
-
remove(join146(
|
|
708831
|
+
remove(join146(homedir45(), ".omnius", USAGE_HISTORY_FILE));
|
|
708636
708832
|
if (repoRoot) {
|
|
708637
708833
|
remove(join146(repoRoot, OMNIUS_DIR2, USAGE_HISTORY_FILE));
|
|
708638
708834
|
}
|
|
@@ -710000,7 +710196,7 @@ __export(tui_tasks_renderer_exports, {
|
|
|
710000
710196
|
});
|
|
710001
710197
|
import { existsSync as existsSync139, readFileSync as readFileSync115, watch as fsWatch4 } from "node:fs";
|
|
710002
710198
|
import { join as join150 } from "node:path";
|
|
710003
|
-
import { homedir as
|
|
710199
|
+
import { homedir as homedir47 } from "node:os";
|
|
710004
710200
|
function setTasksRendererWriter(writer) {
|
|
710005
710201
|
chromeWrite = writer;
|
|
710006
710202
|
}
|
|
@@ -710023,7 +710219,7 @@ function panelEffectivelyVisible() {
|
|
|
710023
710219
|
return _enabled && !_scopeOverlayActive && !_scopeNeovimActive && !_scopePagerActive && _scopeMainViewActive;
|
|
710024
710220
|
}
|
|
710025
710221
|
function todoDir2() {
|
|
710026
|
-
return join150(
|
|
710222
|
+
return join150(homedir47(), ".omnius", "todos");
|
|
710027
710223
|
}
|
|
710028
710224
|
function todoPath2(sessionId) {
|
|
710029
710225
|
const safe = sessionId.replace(/[^a-zA-Z0-9_.-]/g, "_");
|
|
@@ -710894,7 +711090,7 @@ var init_braille_spinner = __esm({
|
|
|
710894
711090
|
// packages/cli/src/tui/project-context.ts
|
|
710895
711091
|
import { existsSync as existsSync140, readFileSync as readFileSync116, readdirSync as readdirSync43, mkdirSync as mkdirSync87, statSync as statSync56, writeFileSync as writeFileSync76 } from "node:fs";
|
|
710896
711092
|
import { dirname as dirname54, join as join151, basename as basename29, resolve as resolve69 } from "node:path";
|
|
710897
|
-
import { homedir as
|
|
711093
|
+
import { homedir as homedir48 } from "node:os";
|
|
710898
711094
|
function projectContextUrlSpanAt(text2, index) {
|
|
710899
711095
|
PROJECT_CONTEXT_URL_RE.lastIndex = 0;
|
|
710900
711096
|
for (const match of text2.matchAll(PROJECT_CONTEXT_URL_RE)) {
|
|
@@ -711046,7 +711242,7 @@ function buildWorkspaceMemorySubstrateCensus(repoRoot) {
|
|
|
711046
711242
|
const legacyMemoryDir = join151(repoRoot, ".omnius", "memory");
|
|
711047
711243
|
const projectMemory = countJsonMemoryEntries(projectMemoryDir);
|
|
711048
711244
|
const legacyMemory = legacyMemoryDir === projectMemoryDir ? { topics: 0, entries: 0 } : countJsonMemoryEntries(legacyMemoryDir);
|
|
711049
|
-
const globalMemory = countJsonMemoryEntries(join151(
|
|
711245
|
+
const globalMemory = countJsonMemoryEntries(join151(homedir48(), ".omnius", "memory"));
|
|
711050
711246
|
const reflectionCount = countReflectionBuffer(repoRoot);
|
|
711051
711247
|
const evidenceCount = countJsonlLines(join151(repoRoot, ".omnius", "evidence", "events.jsonl"));
|
|
711052
711248
|
const unifiedPresent = existsSync140(join151(repoRoot, OMNIUS_DIR2, "unified-memory.db"));
|
|
@@ -711104,7 +711300,7 @@ function loadMemoryContextBundle(repoRoot, task = "", taskEmbedding) {
|
|
|
711104
711300
|
collect(omniusMemDir, "project");
|
|
711105
711301
|
const legacyMemDir = join151(repoRoot, ".omnius", "memory");
|
|
711106
711302
|
if (legacyMemDir !== omniusMemDir) collect(legacyMemDir, "project");
|
|
711107
|
-
const globalMemDir = join151(
|
|
711303
|
+
const globalMemDir = join151(homedir48(), ".omnius", "memory");
|
|
711108
711304
|
collect(globalMemDir, "global");
|
|
711109
711305
|
const seen = /* @__PURE__ */ new Set();
|
|
711110
711306
|
const deduped = [];
|
|
@@ -719083,7 +719279,7 @@ __export(personaplex_exports, {
|
|
|
719083
719279
|
});
|
|
719084
719280
|
import { existsSync as existsSync141, writeFileSync as writeFileSync77, readFileSync as readFileSync117, mkdirSync as mkdirSync88, copyFileSync as copyFileSync5, readdirSync as readdirSync44, statSync as statSync57 } from "node:fs";
|
|
719085
719281
|
import { join as join152, dirname as dirname56 } from "node:path";
|
|
719086
|
-
import { homedir as
|
|
719282
|
+
import { homedir as homedir49 } from "node:os";
|
|
719087
719283
|
import { spawn as spawn38 } from "node:child_process";
|
|
719088
719284
|
import { fileURLToPath as fileURLToPath26 } from "node:url";
|
|
719089
719285
|
function personaplexPythonEnv(extra = {}) {
|
|
@@ -719679,7 +719875,7 @@ print('Converted')
|
|
|
719679
719875
|
let ollamaModel = process.env["HYBRID_LLM_MODEL"] || "";
|
|
719680
719876
|
if (!ollamaModel) {
|
|
719681
719877
|
try {
|
|
719682
|
-
const omniusConfig = JSON.parse(readFileSync117(join152(
|
|
719878
|
+
const omniusConfig = JSON.parse(readFileSync117(join152(homedir49(), ".omnius", "config.json"), "utf8"));
|
|
719683
719879
|
if (omniusConfig.model) ollamaModel = omniusConfig.model;
|
|
719684
719880
|
} catch {
|
|
719685
719881
|
}
|
|
@@ -719946,7 +720142,7 @@ function provisionShippedVoices(onInfo) {
|
|
|
719946
720142
|
return deployed;
|
|
719947
720143
|
}
|
|
719948
720144
|
function getHFVoicesDir() {
|
|
719949
|
-
const hfBase = join152(
|
|
720145
|
+
const hfBase = join152(homedir49(), ".cache", "huggingface", "hub", "models--nvidia--personaplex-7b-v1");
|
|
719950
720146
|
if (!existsSync141(hfBase)) return null;
|
|
719951
720147
|
try {
|
|
719952
720148
|
const snapshots = join152(hfBase, "snapshots");
|
|
@@ -719962,7 +720158,7 @@ function getHFVoicesDir() {
|
|
|
719962
720158
|
function patchFrontendVoiceList(onInfo) {
|
|
719963
720159
|
const log22 = onInfo ?? (() => {
|
|
719964
720160
|
});
|
|
719965
|
-
const hfBase = join152(
|
|
720161
|
+
const hfBase = join152(homedir49(), ".cache", "huggingface", "hub", "models--nvidia--personaplex-7b-v1");
|
|
719966
720162
|
if (!existsSync141(hfBase)) return;
|
|
719967
720163
|
try {
|
|
719968
720164
|
const snapshots = join152(hfBase, "snapshots");
|
|
@@ -720040,7 +720236,7 @@ var init_personaplex = __esm({
|
|
|
720040
720236
|
nf4: { repo: "cudabenchmarktest/personaplex-7b-nf4", file: "model-nf4.safetensors", sizeGB: 4.1, needsToken: false },
|
|
720041
720237
|
"nf4-distilled": { repo: "cudabenchmarktest/personaplex-7b-nf4-distilled", file: "student_best.pt", sizeGB: 16.7, needsToken: false }
|
|
720042
720238
|
};
|
|
720043
|
-
PERSONAPLEX_DIR = join152(
|
|
720239
|
+
PERSONAPLEX_DIR = join152(homedir49(), ".omnius", "voice", "personaplex");
|
|
720044
720240
|
PID_FILE2 = join152(PERSONAPLEX_DIR, "daemon.pid");
|
|
720045
720241
|
PORT_FILE = join152(PERSONAPLEX_DIR, "daemon.port");
|
|
720046
720242
|
LOG_FILE = join152(PERSONAPLEX_DIR, "daemon.log");
|
|
@@ -720092,7 +720288,7 @@ import { spawn as spawn39, exec as exec5 } from "node:child_process";
|
|
|
720092
720288
|
import { promisify as promisify8 } from "node:util";
|
|
720093
720289
|
import { existsSync as existsSync142, writeFileSync as writeFileSync78, readFileSync as readFileSync118, appendFileSync as appendFileSync16, mkdirSync as mkdirSync89, chmodSync as chmodSync7 } from "node:fs";
|
|
720094
720290
|
import { delimiter as pathDelimiter, join as join153 } from "node:path";
|
|
720095
|
-
import { freemem as freemem8, homedir as
|
|
720291
|
+
import { freemem as freemem8, homedir as homedir50, platform as platform9, totalmem as totalmem9 } from "node:os";
|
|
720096
720292
|
function wrapText2(value2, width) {
|
|
720097
720293
|
const words = value2.split(/\s+/).filter(Boolean);
|
|
720098
720294
|
const lines = [];
|
|
@@ -720576,7 +720772,7 @@ function detectAskpassHelper() {
|
|
|
720576
720772
|
return null;
|
|
720577
720773
|
}
|
|
720578
720774
|
function writeAskpassHelper() {
|
|
720579
|
-
const tmpDir = join153(
|
|
720775
|
+
const tmpDir = join153(homedir50(), ".omnius");
|
|
720580
720776
|
try {
|
|
720581
720777
|
mkdirSync89(tmpDir, { recursive: true });
|
|
720582
720778
|
} catch {
|
|
@@ -721804,7 +722000,7 @@ ${c3.cyan(OMNIUS_FIRST_RUN_BANNER)}
|
|
|
721804
722000
|
if (createModelfile.toLowerCase() !== "n") {
|
|
721805
722001
|
try {
|
|
721806
722002
|
const modelfileCandidates = expandedVariantContentCandidates(selectedVariant.tag, ctx3.numCtx);
|
|
721807
|
-
const modelDir3 = join153(
|
|
722003
|
+
const modelDir3 = join153(homedir50(), ".omnius", "models");
|
|
721808
722004
|
mkdirSync89(modelDir3, { recursive: true });
|
|
721809
722005
|
const modelfilePath = join153(modelDir3, `Modelfile.${customName}`);
|
|
721810
722006
|
process.stdout.write(` ${c3.dim("Creating model...")} `);
|
|
@@ -721865,7 +722061,7 @@ async function isModelAvailable(config) {
|
|
|
721865
722061
|
}
|
|
721866
722062
|
function isFirstRun() {
|
|
721867
722063
|
try {
|
|
721868
|
-
return !existsSync142(join153(
|
|
722064
|
+
return !existsSync142(join153(homedir50(), ".omnius", "config.json"));
|
|
721869
722065
|
} catch {
|
|
721870
722066
|
return true;
|
|
721871
722067
|
}
|
|
@@ -721923,7 +722119,7 @@ async function detectPkgManager() {
|
|
|
721923
722119
|
return null;
|
|
721924
722120
|
}
|
|
721925
722121
|
function getVenvDir2() {
|
|
721926
|
-
return join153(
|
|
722122
|
+
return join153(homedir50(), ".omnius", "venv");
|
|
721927
722123
|
}
|
|
721928
722124
|
async function hasVenvModule() {
|
|
721929
722125
|
try {
|
|
@@ -721970,7 +722166,7 @@ async function ensureVenv2(log22) {
|
|
|
721970
722166
|
}
|
|
721971
722167
|
log22("Creating Python venv for vision deps...");
|
|
721972
722168
|
try {
|
|
721973
|
-
mkdirSync89(join153(
|
|
722169
|
+
mkdirSync89(join153(homedir50(), ".omnius"), { recursive: true });
|
|
721974
722170
|
const pyCmd = hasCmd(pythonCmd) ? pythonCmd : "python3";
|
|
721975
722171
|
await runShellCommandAsync(`${pyCmd} -m venv --clear "${venvDir3}"`, { timeoutMs: 3e4 });
|
|
721976
722172
|
try {
|
|
@@ -722090,7 +722286,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
722090
722286
|
];
|
|
722091
722287
|
{
|
|
722092
722288
|
const pm2 = await detectPkgManager();
|
|
722093
|
-
const _visionMarkerDir = join153(
|
|
722289
|
+
const _visionMarkerDir = join153(homedir50(), ".omnius");
|
|
722094
722290
|
const _visionMarkerFile = join153(_visionMarkerDir, "vision-deps-installed.json");
|
|
722095
722291
|
let _visionPreviouslyInstalled = /* @__PURE__ */ new Set();
|
|
722096
722292
|
try {
|
|
@@ -722345,11 +722541,11 @@ function ensureCloudflaredBackground(onInfo) {
|
|
|
722345
722541
|
const cfArch = archMap[arch7] ?? "amd64";
|
|
722346
722542
|
try {
|
|
722347
722543
|
await runShellCommandAsync(
|
|
722348
|
-
`curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && mkdir -p "${
|
|
722544
|
+
`curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && mkdir -p "${homedir50()}/.local/bin" && mv /tmp/cloudflared "${homedir50()}/.local/bin/cloudflared"`,
|
|
722349
722545
|
{ timeoutMs: 6e4 }
|
|
722350
722546
|
);
|
|
722351
|
-
if (!process.env.PATH?.includes(`${
|
|
722352
|
-
process.env.PATH = `${
|
|
722547
|
+
if (!process.env.PATH?.includes(`${homedir50()}/.local/bin`)) {
|
|
722548
|
+
process.env.PATH = `${homedir50()}/.local/bin:${process.env.PATH}`;
|
|
722353
722549
|
}
|
|
722354
722550
|
if (hasCmd("cloudflared")) {
|
|
722355
722551
|
log22("cloudflared installed.");
|
|
@@ -722576,7 +722772,7 @@ async function createExpandedVariantNamedAsync(targetModel, baseModel, specs, si
|
|
|
722576
722772
|
const ctx3 = calculateExpandedVariantContextWindow(specs, sizeGB, kvBytesPerToken, archMax);
|
|
722577
722773
|
const modelfileCandidates = expandedVariantContentCandidates(baseModel, ctx3.numCtx);
|
|
722578
722774
|
try {
|
|
722579
|
-
const modelDir3 = join153(
|
|
722775
|
+
const modelDir3 = join153(homedir50(), ".omnius", "models");
|
|
722580
722776
|
mkdirSync89(modelDir3, { recursive: true });
|
|
722581
722777
|
const modelfilePath = join153(modelDir3, `Modelfile.${targetModel}`);
|
|
722582
722778
|
for (let i2 = 0; i2 < modelfileCandidates.length; i2++) {
|
|
@@ -722845,7 +723041,7 @@ async function ensureNeovim() {
|
|
|
722845
723041
|
const platform12 = process.platform;
|
|
722846
723042
|
const arch7 = process.arch;
|
|
722847
723043
|
if (platform12 === "linux") {
|
|
722848
|
-
const binDir = join153(
|
|
723044
|
+
const binDir = join153(homedir50(), ".local", "bin");
|
|
722849
723045
|
const nvimDest = join153(binDir, "nvim");
|
|
722850
723046
|
try {
|
|
722851
723047
|
mkdirSync89(binDir, { recursive: true });
|
|
@@ -722929,7 +723125,7 @@ async function ensureNeovim() {
|
|
|
722929
723125
|
}
|
|
722930
723126
|
function ensurePathInShellRc(binDir) {
|
|
722931
723127
|
const shell = process.env.SHELL ?? "";
|
|
722932
|
-
const rcFile = shell.includes("zsh") ? join153(
|
|
723128
|
+
const rcFile = shell.includes("zsh") ? join153(homedir50(), ".zshrc") : join153(homedir50(), ".bashrc");
|
|
722933
723129
|
try {
|
|
722934
723130
|
const rcContent = existsSync142(rcFile) ? readFileSync118(rcFile, "utf8") : "";
|
|
722935
723131
|
if (rcContent.includes(binDir)) return;
|
|
@@ -723132,7 +723328,7 @@ var init_registry4 = __esm({
|
|
|
723132
723328
|
|
|
723133
723329
|
// packages/cli/src/tui/media-routing.ts
|
|
723134
723330
|
import { existsSync as existsSync143 } from "node:fs";
|
|
723135
|
-
import { homedir as
|
|
723331
|
+
import { homedir as homedir51 } from "node:os";
|
|
723136
723332
|
function extractMediaReferences(text2) {
|
|
723137
723333
|
const masked = maskCode(text2);
|
|
723138
723334
|
const media = [];
|
|
@@ -723267,7 +723463,7 @@ function looksLikeLocalMedia(value2) {
|
|
|
723267
723463
|
return !!kind && (existsSync143(expanded) || value2.startsWith("~/") || value2.startsWith("/"));
|
|
723268
723464
|
}
|
|
723269
723465
|
function expandHome2(value2) {
|
|
723270
|
-
return value2.startsWith("~/") ? `${
|
|
723466
|
+
return value2.startsWith("~/") ? `${homedir51()}${value2.slice(1)}` : value2;
|
|
723271
723467
|
}
|
|
723272
723468
|
function decodeUri(value2) {
|
|
723273
723469
|
try {
|
|
@@ -727472,11 +727668,11 @@ import {
|
|
|
727472
727668
|
unlinkSync as unlinkSync32
|
|
727473
727669
|
} from "node:fs";
|
|
727474
727670
|
import { dirname as dirname57, join as join158 } from "node:path";
|
|
727475
|
-
import { homedir as
|
|
727671
|
+
import { homedir as homedir52 } from "node:os";
|
|
727476
727672
|
import { randomBytes as randomBytes26 } from "node:crypto";
|
|
727477
727673
|
function configHome() {
|
|
727478
727674
|
const fromEnv = process.env["OMNIUS_CONFIG_HOME"]?.trim();
|
|
727479
|
-
return fromEnv || join158(
|
|
727675
|
+
return fromEnv || join158(homedir52(), ".omnius");
|
|
727480
727676
|
}
|
|
727481
727677
|
function runtimeKeysFile() {
|
|
727482
727678
|
const fromEnv = process.env["OMNIUS_RUNTIME_KEYS_FILE"]?.trim();
|
|
@@ -728085,11 +728281,11 @@ import {
|
|
|
728085
728281
|
readdirSync as readdirSync47
|
|
728086
728282
|
} from "node:fs";
|
|
728087
728283
|
import { join as join160 } from "node:path";
|
|
728088
|
-
import { homedir as
|
|
728284
|
+
import { homedir as homedir53 } from "node:os";
|
|
728089
728285
|
import { randomUUID as randomUUID24 } from "node:crypto";
|
|
728090
728286
|
function cronDir() {
|
|
728091
728287
|
const override = process.env["OMNIUS_HOME"]?.trim();
|
|
728092
|
-
const base3 = override || join160(
|
|
728288
|
+
const base3 = override || join160(homedir53(), ".omnius");
|
|
728093
728289
|
return join160(base3, CRON_DIR_NAME);
|
|
728094
728290
|
}
|
|
728095
728291
|
function jobsFilePath() {
|
|
@@ -728632,10 +728828,10 @@ import {
|
|
|
728632
728828
|
readFileSync as readFileSync124
|
|
728633
728829
|
} from "node:fs";
|
|
728634
728830
|
import { join as join161 } from "node:path";
|
|
728635
|
-
import { homedir as
|
|
728831
|
+
import { homedir as homedir54 } from "node:os";
|
|
728636
728832
|
function cronDir2() {
|
|
728637
728833
|
const override = process.env["OMNIUS_HOME"]?.trim();
|
|
728638
|
-
const base3 = override || join161(
|
|
728834
|
+
const base3 = override || join161(homedir54(), ".omnius");
|
|
728639
728835
|
return join161(base3, CRON_DIR_NAME);
|
|
728640
728836
|
}
|
|
728641
728837
|
function lockFilePath() {
|
|
@@ -731351,7 +731547,7 @@ import {
|
|
|
731351
731547
|
rmSync as rmSync14
|
|
731352
731548
|
} from "node:fs";
|
|
731353
731549
|
import { basename as basename32, join as join164, dirname as dirname59, resolve as resolve73 } from "node:path";
|
|
731354
|
-
import { homedir as
|
|
731550
|
+
import { homedir as homedir55, tmpdir as tmpdir24, platform as platform11 } from "node:os";
|
|
731355
731551
|
import {
|
|
731356
731552
|
spawn as nodeSpawn
|
|
731357
731553
|
} from "node:child_process";
|
|
@@ -731539,7 +731735,7 @@ function consolidateVoiceDirs2() {
|
|
|
731539
731735
|
const globalVoice = voiceDir2();
|
|
731540
731736
|
let migrated = 0;
|
|
731541
731737
|
let cleaned = 0;
|
|
731542
|
-
const oldVoice = join164(
|
|
731738
|
+
const oldVoice = join164(homedir55(), ".open-agents", "voice");
|
|
731543
731739
|
if (existsSync155(oldVoice)) {
|
|
731544
731740
|
mergeDir2(join164(oldVoice, "clone-refs"), join164(globalVoice, "clone-refs"));
|
|
731545
731741
|
mergeDir2(join164(oldVoice, "models"), join164(globalVoice, "models"));
|
|
@@ -731560,7 +731756,7 @@ function consolidateVoiceDirs2() {
|
|
|
731560
731756
|
dir = dirname59(dir);
|
|
731561
731757
|
}
|
|
731562
731758
|
for (const root of COMMON_PROJECT_ROOTS) {
|
|
731563
|
-
const rootDir2 = join164(
|
|
731759
|
+
const rootDir2 = join164(homedir55(), root);
|
|
731564
731760
|
if (!existsSync155(rootDir2)) continue;
|
|
731565
731761
|
try {
|
|
731566
731762
|
for (const entry of readdirSync48(rootDir2, { withFileTypes: true })) {
|
|
@@ -733033,7 +733229,7 @@ except Exception as exc:
|
|
|
733033
733229
|
}
|
|
733034
733230
|
p2 = p2.replace(/\\ /g, " ");
|
|
733035
733231
|
if (p2.startsWith("~/") || p2 === "~") {
|
|
733036
|
-
p2 = join164(
|
|
733232
|
+
p2 = join164(homedir55(), p2.slice(1));
|
|
733037
733233
|
}
|
|
733038
733234
|
if (!existsSync155(p2)) {
|
|
733039
733235
|
return `File not found: ${p2}
|
|
@@ -738011,10 +738207,10 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
738011
738207
|
"Use the Web UI ‘key’ button to paste this token, or set Authorization: Bearer <key> in your client."
|
|
738012
738208
|
);
|
|
738013
738209
|
try {
|
|
738014
|
-
const { homedir:
|
|
738210
|
+
const { homedir: homedir70 } = await import("node:os");
|
|
738015
738211
|
const { mkdirSync: mkdirSync125, writeFileSync: writeFileSync109 } = await import("node:fs");
|
|
738016
738212
|
const { join: join202 } = await import("node:path");
|
|
738017
|
-
const dir = join202(
|
|
738213
|
+
const dir = join202(homedir70(), ".omnius");
|
|
738018
738214
|
mkdirSync125(dir, { recursive: true });
|
|
738019
738215
|
writeFileSync109(join202(dir, "api.key"), apiKey + "\n", "utf8");
|
|
738020
738216
|
} catch {
|
|
@@ -738027,10 +738223,10 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
738027
738223
|
}
|
|
738028
738224
|
const port3 = parseInt(process.env["OMNIUS_PORT"] || "11435", 10);
|
|
738029
738225
|
try {
|
|
738030
|
-
const { homedir:
|
|
738226
|
+
const { homedir: homedir70 } = await import("node:os");
|
|
738031
738227
|
const { mkdirSync: mkdirSync125, writeFileSync: writeFileSync109 } = await import("node:fs");
|
|
738032
738228
|
const { join: join202 } = await import("node:path");
|
|
738033
|
-
const dir = join202(
|
|
738229
|
+
const dir = join202(homedir70(), ".omnius");
|
|
738034
738230
|
mkdirSync125(dir, { recursive: true });
|
|
738035
738231
|
writeFileSync109(join202(dir, "access"), `${val2}
|
|
738036
738232
|
`, "utf8");
|
|
@@ -738131,10 +738327,10 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
738131
738327
|
"Use the Web UI ‘key’ button to paste this token, or set Authorization: Bearer <key> in your client."
|
|
738132
738328
|
);
|
|
738133
738329
|
try {
|
|
738134
|
-
const { homedir:
|
|
738330
|
+
const { homedir: homedir70 } = await import("node:os");
|
|
738135
738331
|
const { mkdirSync: mkdirSync125, writeFileSync: writeFileSync109 } = await import("node:fs");
|
|
738136
738332
|
const { join: join202 } = await import("node:path");
|
|
738137
|
-
const dir = join202(
|
|
738333
|
+
const dir = join202(homedir70(), ".omnius");
|
|
738138
738334
|
mkdirSync125(dir, { recursive: true });
|
|
738139
738335
|
writeFileSync109(join202(dir, "api.key"), apiKey + "\n", "utf8");
|
|
738140
738336
|
} catch {
|
|
@@ -738146,11 +738342,11 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
738146
738342
|
ctx3.saveSettings({ omniusAccess: val });
|
|
738147
738343
|
}
|
|
738148
738344
|
const port2 = parseInt(process.env["OMNIUS_PORT"] || "11435", 10);
|
|
738149
|
-
const { homedir:
|
|
738345
|
+
const { homedir: homedir69 } = await import("node:os");
|
|
738150
738346
|
const { mkdirSync: mkdirSync124, writeFileSync: writeFileSync108 } = await import("node:fs");
|
|
738151
738347
|
const { join: join201 } = await import("node:path");
|
|
738152
738348
|
try {
|
|
738153
|
-
const dir = join201(
|
|
738349
|
+
const dir = join201(homedir69(), ".omnius");
|
|
738154
738350
|
mkdirSync124(dir, { recursive: true });
|
|
738155
738351
|
writeFileSync108(join201(dir, "access"), `${val}
|
|
738156
738352
|
`, "utf8");
|
|
@@ -738668,7 +738864,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
738668
738864
|
);
|
|
738669
738865
|
}
|
|
738670
738866
|
} else if (sub2 === "name") {
|
|
738671
|
-
const { homedir:
|
|
738867
|
+
const { homedir: homedir69 } = __require("node:os");
|
|
738672
738868
|
const {
|
|
738673
738869
|
existsSync: ex,
|
|
738674
738870
|
readFileSync: rf,
|
|
@@ -738676,7 +738872,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
738676
738872
|
mkdirSync: mkd
|
|
738677
738873
|
} = __require("node:fs");
|
|
738678
738874
|
const namePath = __require("node:path").join(
|
|
738679
|
-
|
|
738875
|
+
homedir69(),
|
|
738680
738876
|
".omnius",
|
|
738681
738877
|
"agent-name"
|
|
738682
738878
|
);
|
|
@@ -741849,9 +742045,9 @@ sleep 1
|
|
|
741849
742045
|
let sponsorName = (config.header.message || "").replace(/^\/+/, "").trim();
|
|
741850
742046
|
if (!sponsorName || sponsorName.length < 2) {
|
|
741851
742047
|
try {
|
|
741852
|
-
const { homedir:
|
|
742048
|
+
const { homedir: homedir69 } = __require("os");
|
|
741853
742049
|
const namePath = __require("path").join(
|
|
741854
|
-
|
|
742050
|
+
homedir69(),
|
|
741855
742051
|
".omnius",
|
|
741856
742052
|
"agent-name"
|
|
741857
742053
|
);
|
|
@@ -748492,13 +748688,13 @@ async function handleVoiceMenu(ctx3, save3, hasLocal) {
|
|
|
748492
748688
|
mkdirSync: mkdirSync124,
|
|
748493
748689
|
existsSync: exists2
|
|
748494
748690
|
} = await import("node:fs");
|
|
748495
|
-
const { homedir:
|
|
748691
|
+
const { homedir: homedir69 } = await import("node:os");
|
|
748496
748692
|
const modelName = basename47(onnxDrop.path, ".onnx").replace(
|
|
748497
748693
|
/[^a-zA-Z0-9_-]/g,
|
|
748498
748694
|
"-"
|
|
748499
748695
|
);
|
|
748500
748696
|
const destDir = pathJoin(
|
|
748501
|
-
|
|
748697
|
+
homedir69(),
|
|
748502
748698
|
".omnius",
|
|
748503
748699
|
"voice",
|
|
748504
748700
|
"models",
|
|
@@ -749804,7 +750000,7 @@ function parseSponsorMediaArgs(rest) {
|
|
|
749804
750000
|
function shellLikeTokens(input) {
|
|
749805
750001
|
const tokens3 = [];
|
|
749806
750002
|
let current = "";
|
|
749807
|
-
let
|
|
750003
|
+
let quote = "";
|
|
749808
750004
|
let escaped = false;
|
|
749809
750005
|
for (const ch of input) {
|
|
749810
750006
|
if (escaped) {
|
|
@@ -749816,13 +750012,13 @@ function shellLikeTokens(input) {
|
|
|
749816
750012
|
escaped = true;
|
|
749817
750013
|
continue;
|
|
749818
750014
|
}
|
|
749819
|
-
if (
|
|
749820
|
-
if (ch ===
|
|
750015
|
+
if (quote) {
|
|
750016
|
+
if (ch === quote) quote = "";
|
|
749821
750017
|
else current += ch;
|
|
749822
750018
|
continue;
|
|
749823
750019
|
}
|
|
749824
750020
|
if (ch === "'" || ch === '"') {
|
|
749825
|
-
|
|
750021
|
+
quote = ch;
|
|
749826
750022
|
continue;
|
|
749827
750023
|
}
|
|
749828
750024
|
if (ch === " " || ch === " ") {
|
|
@@ -753547,12 +753743,12 @@ var init_commands = __esm({
|
|
|
753547
753743
|
if (val === "any" && !process.env["OMNIUS_API_KEY"]) {
|
|
753548
753744
|
try {
|
|
753549
753745
|
const { randomBytes: randomBytes31 } = await import("node:crypto");
|
|
753550
|
-
const { homedir:
|
|
753746
|
+
const { homedir: homedir69 } = await import("node:os");
|
|
753551
753747
|
const { mkdirSync: mkdirSync124, writeFileSync: writeFileSync108 } = await import("node:fs");
|
|
753552
753748
|
const { join: join201 } = await import("node:path");
|
|
753553
753749
|
const apiKey = randomBytes31(16).toString("hex");
|
|
753554
753750
|
process.env["OMNIUS_API_KEY"] = apiKey;
|
|
753555
|
-
const dir = join201(
|
|
753751
|
+
const dir = join201(homedir69(), ".omnius");
|
|
753556
753752
|
mkdirSync124(dir, { recursive: true });
|
|
753557
753753
|
writeFileSync108(join201(dir, "api.key"), apiKey + "\n", "utf8");
|
|
753558
753754
|
renderInfo(`Generated API key: ${c3.bold(c3.yellow(apiKey))}`);
|
|
@@ -753572,10 +753768,10 @@ var init_commands = __esm({
|
|
|
753572
753768
|
}
|
|
753573
753769
|
const port2 = parseInt(process.env["OMNIUS_PORT"] || "11435", 10);
|
|
753574
753770
|
try {
|
|
753575
|
-
const { homedir:
|
|
753771
|
+
const { homedir: homedir69 } = await import("node:os");
|
|
753576
753772
|
const { mkdirSync: mkdirSync124, writeFileSync: writeFileSync108 } = await import("node:fs");
|
|
753577
753773
|
const { join: join201 } = await import("node:path");
|
|
753578
|
-
const dir = join201(
|
|
753774
|
+
const dir = join201(homedir69(), ".omnius");
|
|
753579
753775
|
mkdirSync124(dir, { recursive: true });
|
|
753580
753776
|
writeFileSync108(join201(dir, "access"), `${val}
|
|
753581
753777
|
`, "utf8");
|
|
@@ -754022,9 +754218,9 @@ import {
|
|
|
754022
754218
|
appendFileSync as appendFileSync18
|
|
754023
754219
|
} from "node:fs";
|
|
754024
754220
|
import { join as join167, resolve as resolve75 } from "node:path";
|
|
754025
|
-
import { homedir as
|
|
754221
|
+
import { homedir as homedir57 } from "node:os";
|
|
754026
754222
|
function sessionsDir() {
|
|
754027
|
-
return join167(
|
|
754223
|
+
return join167(homedir57(), ".omnius", "chat-sessions");
|
|
754028
754224
|
}
|
|
754029
754225
|
function sessionPath(id2) {
|
|
754030
754226
|
const safe = id2.replace(/[^a-zA-Z0-9_.-]/g, "_");
|
|
@@ -768620,7 +768816,7 @@ import {
|
|
|
768620
768816
|
isAbsolute as isAbsolute17,
|
|
768621
768817
|
extname as extname22
|
|
768622
768818
|
} from "node:path";
|
|
768623
|
-
import { homedir as
|
|
768819
|
+
import { homedir as homedir58 } from "node:os";
|
|
768624
768820
|
import {
|
|
768625
768821
|
appendFile as appendFileAsync,
|
|
768626
768822
|
mkdir as mkdirAsync,
|
|
@@ -770530,14 +770726,14 @@ function telegramReplyOriginSummary(origin) {
|
|
|
770530
770726
|
}
|
|
770531
770727
|
function normalizeTelegramQuote(raw) {
|
|
770532
770728
|
if (!raw || typeof raw !== "object") return void 0;
|
|
770533
|
-
const
|
|
770534
|
-
const text2 = telegramOptionalString(
|
|
770535
|
-
const position = telegramOptionalNumber(
|
|
770729
|
+
const quote = raw;
|
|
770730
|
+
const text2 = telegramOptionalString(quote.text);
|
|
770731
|
+
const position = telegramOptionalNumber(quote.position);
|
|
770536
770732
|
if (!text2 && position === void 0) return void 0;
|
|
770537
770733
|
return { text: text2, position };
|
|
770538
770734
|
}
|
|
770539
770735
|
function normalizeTelegramReplyContext(message2) {
|
|
770540
|
-
const
|
|
770736
|
+
const quote = normalizeTelegramQuote(message2.quote);
|
|
770541
770737
|
const replyTo = message2.reply_to_message && typeof message2.reply_to_message === "object" ? message2.reply_to_message : void 0;
|
|
770542
770738
|
if (replyTo) {
|
|
770543
770739
|
const poll = normalizeTelegramPoll(replyTo.poll);
|
|
@@ -770553,8 +770749,8 @@ function normalizeTelegramReplyContext(message2) {
|
|
|
770553
770749
|
sender: normalizeTelegramReplySender(replyTo),
|
|
770554
770750
|
text: telegramReplyTextFromMessage(replyTo, poll),
|
|
770555
770751
|
caption: telegramOptionalString(replyTo.caption),
|
|
770556
|
-
quote:
|
|
770557
|
-
quotePosition:
|
|
770752
|
+
quote: quote?.text,
|
|
770753
|
+
quotePosition: quote?.position,
|
|
770558
770754
|
media,
|
|
770559
770755
|
poll,
|
|
770560
770756
|
checklistTaskId: telegramOptionalNumber(
|
|
@@ -770576,8 +770772,8 @@ function normalizeTelegramReplyContext(message2) {
|
|
|
770576
770772
|
sender: normalizeTelegramReplySender(externalReply),
|
|
770577
770773
|
text: telegramReplyTextFromMessage(externalReply, poll),
|
|
770578
770774
|
caption: telegramOptionalString(externalReply.caption),
|
|
770579
|
-
quote:
|
|
770580
|
-
quotePosition:
|
|
770775
|
+
quote: quote?.text,
|
|
770776
|
+
quotePosition: quote?.position,
|
|
770581
770777
|
media,
|
|
770582
770778
|
poll,
|
|
770583
770779
|
checklistTaskId: telegramOptionalNumber(
|
|
@@ -770587,13 +770783,13 @@ function normalizeTelegramReplyContext(message2) {
|
|
|
770587
770783
|
originSummary: telegramReplyOriginSummary(externalReply.origin)
|
|
770588
770784
|
};
|
|
770589
770785
|
}
|
|
770590
|
-
if (
|
|
770786
|
+
if (quote?.text) {
|
|
770591
770787
|
return {
|
|
770592
770788
|
kind: "quote",
|
|
770593
770789
|
source: "quote",
|
|
770594
770790
|
threadId: telegramOptionalNumber(message2.message_thread_id),
|
|
770595
|
-
quote:
|
|
770596
|
-
quotePosition:
|
|
770791
|
+
quote: quote.text,
|
|
770792
|
+
quotePosition: quote.position
|
|
770597
770793
|
};
|
|
770598
770794
|
}
|
|
770599
770795
|
const story = message2.reply_to_story && typeof message2.reply_to_story === "object" ? message2.reply_to_story : void 0;
|
|
@@ -779564,7 +779760,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`
|
|
|
779564
779760
|
}
|
|
779565
779761
|
if (me.result?.id) {
|
|
779566
779762
|
const botUserId = Number(me.result.id);
|
|
779567
|
-
const globalLockDir = process.env["OMNIUS_TELEGRAM_LOCK_DIR"] ? resolve79(process.env["OMNIUS_TELEGRAM_LOCK_DIR"]) : resolve79(
|
|
779763
|
+
const globalLockDir = process.env["OMNIUS_TELEGRAM_LOCK_DIR"] ? resolve79(process.env["OMNIUS_TELEGRAM_LOCK_DIR"]) : resolve79(homedir58(), ".omnius", "telegram-runner-state");
|
|
779568
779764
|
const lockDirs = /* @__PURE__ */ new Set([globalLockDir]);
|
|
779569
779765
|
if (this.repoRoot) {
|
|
779570
779766
|
lockDirs.add(
|
|
@@ -789256,7 +789452,7 @@ __export(projects_exports, {
|
|
|
789256
789452
|
unregisterProject: () => unregisterProject
|
|
789257
789453
|
});
|
|
789258
789454
|
import { readFileSync as readFileSync142, writeFileSync as writeFileSync96, mkdirSync as mkdirSync108, existsSync as existsSync171, statSync as statSync67, renameSync as renameSync25 } from "node:fs";
|
|
789259
|
-
import { homedir as
|
|
789455
|
+
import { homedir as homedir59 } from "node:os";
|
|
789260
789456
|
import { basename as basename44, join as join181, resolve as resolve80 } from "node:path";
|
|
789261
789457
|
import { randomUUID as randomUUID27 } from "node:crypto";
|
|
789262
789458
|
function readAll2() {
|
|
@@ -789368,7 +789564,7 @@ function _resetCurrentProject() {
|
|
|
789368
789564
|
var OMNIUS_DIR3, PROJECTS_FILE, CURRENT_FILE, currentRoot;
|
|
789369
789565
|
var init_projects = __esm({
|
|
789370
789566
|
"packages/cli/src/api/projects.ts"() {
|
|
789371
|
-
OMNIUS_DIR3 = join181(
|
|
789567
|
+
OMNIUS_DIR3 = join181(homedir59(), ".omnius");
|
|
789372
789568
|
PROJECTS_FILE = join181(OMNIUS_DIR3, "projects.json");
|
|
789373
789569
|
CURRENT_FILE = join181(OMNIUS_DIR3, "current-project");
|
|
789374
789570
|
currentRoot = null;
|
|
@@ -790289,7 +790485,7 @@ import {
|
|
|
790289
790485
|
writeFile as writeFileAsync2,
|
|
790290
790486
|
mkdir as mkdirAsync2
|
|
790291
790487
|
} from "node:fs/promises";
|
|
790292
|
-
import { homedir as
|
|
790488
|
+
import { homedir as homedir60 } from "node:os";
|
|
790293
790489
|
function refreshLocalOllamaModelCache() {
|
|
790294
790490
|
if (localOllamaProbeInFlight) return;
|
|
790295
790491
|
localOllamaProbeInFlight = (async () => {
|
|
@@ -792534,7 +792730,7 @@ function extractGeneratedAudioPath(output2, repoRoot) {
|
|
|
792534
792730
|
const match = output2.match(/(?:Sound|Music|TTS) generated:\s+([^\n\r]+)/i);
|
|
792535
792731
|
const raw = match?.[1]?.trim().replace(/^["']|["']$/g, "");
|
|
792536
792732
|
if (!raw) return null;
|
|
792537
|
-
return raw.startsWith("/") || raw.startsWith("~") ? raw.replace(/^~(?=\/)/,
|
|
792733
|
+
return raw.startsWith("/") || raw.startsWith("~") ? raw.replace(/^~(?=\/)/, homedir60()) : join183(repoRoot, raw);
|
|
792538
792734
|
}
|
|
792539
792735
|
async function playGeneratedAudioForToolResult(toolName, output2, repoRoot, writer) {
|
|
792540
792736
|
if (!toolName || !["generate_audio", "generate_tts", "audio_playback"].includes(toolName) || !output2)
|
|
@@ -796496,7 +796692,7 @@ This is an independent background session started from /background.`
|
|
|
796496
796692
|
);
|
|
796497
796693
|
return [hits, line];
|
|
796498
796694
|
}
|
|
796499
|
-
const HISTORY_DIR = join183(
|
|
796695
|
+
const HISTORY_DIR = join183(homedir60(), ".omnius");
|
|
796500
796696
|
const HISTORY_FILE = join183(HISTORY_DIR, "repl-history");
|
|
796501
796697
|
const MAX_HISTORY_LINES = 500;
|
|
796502
796698
|
let savedHistory = [];
|
|
@@ -799676,7 +799872,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
799676
799872
|
} catch {
|
|
799677
799873
|
}
|
|
799678
799874
|
try {
|
|
799679
|
-
const voiceDir3 = join183(
|
|
799875
|
+
const voiceDir3 = join183(homedir60(), ".omnius", "voice");
|
|
799680
799876
|
const voicePidFiles = ["luxtts-daemon.pid", "piper-daemon.pid"];
|
|
799681
799877
|
for (const pf of voicePidFiles) {
|
|
799682
799878
|
const pidPath = join183(voiceDir3, pf);
|
|
@@ -799822,14 +800018,14 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
799822
800018
|
const { isPersonaPlexRunning: isPersonaPlexRunning2 } = await Promise.resolve().then(() => (init_personaplex(), personaplex_exports));
|
|
799823
800019
|
if (await isPersonaPlexRunning2()) {
|
|
799824
800020
|
const ppPidFile = join183(
|
|
799825
|
-
|
|
800021
|
+
homedir60(),
|
|
799826
800022
|
".omnius",
|
|
799827
800023
|
"voice",
|
|
799828
800024
|
"personaplex",
|
|
799829
800025
|
"daemon.pid"
|
|
799830
800026
|
);
|
|
799831
800027
|
const ppPortFile = join183(
|
|
799832
|
-
|
|
800028
|
+
homedir60(),
|
|
799833
800029
|
".omnius",
|
|
799834
800030
|
"voice",
|
|
799835
800031
|
"personaplex",
|
|
@@ -802365,7 +802561,7 @@ __export(config_exports2, {
|
|
|
802365
802561
|
configCommand: () => configCommand
|
|
802366
802562
|
});
|
|
802367
802563
|
import { join as join185, resolve as resolve84 } from "node:path";
|
|
802368
|
-
import { homedir as
|
|
802564
|
+
import { homedir as homedir61 } from "node:os";
|
|
802369
802565
|
import { cwd as cwd3 } from "node:process";
|
|
802370
802566
|
function redactIfSensitive(key, value2) {
|
|
802371
802567
|
if (SENSITIVE_KEYS2.has(key) && typeof value2 === "string" && value2.length > 0) {
|
|
@@ -802485,7 +802681,7 @@ function handleShow(opts, config) {
|
|
|
802485
802681
|
}
|
|
802486
802682
|
}
|
|
802487
802683
|
printSection("Config File");
|
|
802488
|
-
printInfo(`~/.omnius/config.json (${join185(
|
|
802684
|
+
printInfo(`~/.omnius/config.json (${join185(homedir61(), ".omnius", "config.json")})`);
|
|
802489
802685
|
printSection("Priority Chain");
|
|
802490
802686
|
printInfo(" 1. CLI flags (--model, --backend-url, etc.)");
|
|
802491
802687
|
printInfo(" 2. Project .omnius/settings.json (--local)");
|
|
@@ -802688,7 +802884,7 @@ var init_access_policy = __esm({
|
|
|
802688
802884
|
// packages/cli/src/api/project-preferences.ts
|
|
802689
802885
|
import { createHash as createHash67 } from "node:crypto";
|
|
802690
802886
|
import { existsSync as existsSync175, mkdirSync as mkdirSync112, readFileSync as readFileSync146, renameSync as renameSync26, writeFileSync as writeFileSync100, unlinkSync as unlinkSync42 } from "node:fs";
|
|
802691
|
-
import { homedir as
|
|
802887
|
+
import { homedir as homedir62 } from "node:os";
|
|
802692
802888
|
import { join as join186, resolve as resolve85 } from "node:path";
|
|
802693
802889
|
import { randomUUID as randomUUID28 } from "node:crypto";
|
|
802694
802890
|
function projectKey(root) {
|
|
@@ -802768,7 +802964,7 @@ function deleteProjectPreferences(root) {
|
|
|
802768
802964
|
var OMNIUS_DIR4, PROJECTS_DIR, SCHEMA_VERSION, DEFAULT_PREFS;
|
|
802769
802965
|
var init_project_preferences = __esm({
|
|
802770
802966
|
"packages/cli/src/api/project-preferences.ts"() {
|
|
802771
|
-
OMNIUS_DIR4 = join186(
|
|
802967
|
+
OMNIUS_DIR4 = join186(homedir62(), ".omnius");
|
|
802772
802968
|
PROJECTS_DIR = join186(OMNIUS_DIR4, "projects");
|
|
802773
802969
|
SCHEMA_VERSION = 1;
|
|
802774
802970
|
DEFAULT_PREFS = {
|
|
@@ -802781,7 +802977,7 @@ var init_project_preferences = __esm({
|
|
|
802781
802977
|
// packages/cli/src/api/voxtral-tts-runtime.ts
|
|
802782
802978
|
import { spawn as spawn42, spawnSync as spawnSync12 } from "node:child_process";
|
|
802783
802979
|
import { existsSync as existsSync176, mkdirSync as mkdirSync113, readFileSync as readFileSync147, rmSync as rmSync20, writeFileSync as writeFileSync101 } from "node:fs";
|
|
802784
|
-
import { homedir as
|
|
802980
|
+
import { homedir as homedir63 } from "node:os";
|
|
802785
802981
|
import { join as join187 } from "node:path";
|
|
802786
802982
|
function readState() {
|
|
802787
802983
|
try {
|
|
@@ -803229,7 +803425,7 @@ var init_voxtral_tts_runtime = __esm({
|
|
|
803229
803425
|
capabilities: { textToSpeech: true, presetVoices: true, voiceCloning: false },
|
|
803230
803426
|
resources: { accelerator: "cuda", minimumGpuMemoryBytes: 16 * 1024 ** 3 }
|
|
803231
803427
|
};
|
|
803232
|
-
home = process.env["OMNIUS_HOME"]?.trim() || join187(
|
|
803428
|
+
home = process.env["OMNIUS_HOME"]?.trim() || join187(homedir63(), ".omnius");
|
|
803233
803429
|
runtimeRoot = join187(home, "runtimes", "tts", "voxtral-tts");
|
|
803234
803430
|
venv = join187(runtimeRoot, "venv");
|
|
803235
803431
|
python = join187(venv, "bin", "python");
|
|
@@ -804605,8 +804801,8 @@ __export(aiwg_exports, {
|
|
|
804605
804801
|
});
|
|
804606
804802
|
import { existsSync as existsSync181, readFileSync as readFileSync150, readdirSync as readdirSync61, statSync as statSync72 } from "node:fs";
|
|
804607
804803
|
import { join as join191 } from "node:path";
|
|
804608
|
-
import { homedir as
|
|
804609
|
-
import { execSync as
|
|
804804
|
+
import { homedir as homedir64 } from "node:os";
|
|
804805
|
+
import { execSync as execSync36 } from "node:child_process";
|
|
804610
804806
|
function resolveAiwgRoot() {
|
|
804611
804807
|
if (_cachedAiwgRoot !== void 0) return _cachedAiwgRoot;
|
|
804612
804808
|
const envRoot = process.env["OMNIUS_AIWG_ROOT"];
|
|
@@ -804614,13 +804810,13 @@ function resolveAiwgRoot() {
|
|
|
804614
804810
|
_cachedAiwgRoot = envRoot;
|
|
804615
804811
|
return envRoot;
|
|
804616
804812
|
}
|
|
804617
|
-
const shareDir = join191(
|
|
804813
|
+
const shareDir = join191(homedir64(), ".local", "share", "ai-writing-guide");
|
|
804618
804814
|
if (existsSync181(join191(shareDir, "agentic"))) {
|
|
804619
804815
|
_cachedAiwgRoot = shareDir;
|
|
804620
804816
|
return shareDir;
|
|
804621
804817
|
}
|
|
804622
804818
|
try {
|
|
804623
|
-
const globalRoot =
|
|
804819
|
+
const globalRoot = execSync36("npm root -g", {
|
|
804624
804820
|
encoding: "utf-8",
|
|
804625
804821
|
timeout: 5e3,
|
|
804626
804822
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -804643,8 +804839,8 @@ function resolveAiwgRoot() {
|
|
|
804643
804839
|
}
|
|
804644
804840
|
}
|
|
804645
804841
|
const versionDirs = [
|
|
804646
|
-
join191(
|
|
804647
|
-
join191(
|
|
804842
|
+
join191(homedir64(), ".nvm", "versions", "node"),
|
|
804843
|
+
join191(homedir64(), ".local", "share", "fnm", "node-versions")
|
|
804648
804844
|
];
|
|
804649
804845
|
for (const vdir of versionDirs) {
|
|
804650
804846
|
if (!existsSync181(vdir)) continue;
|
|
@@ -804662,7 +804858,7 @@ function resolveAiwgRoot() {
|
|
|
804662
804858
|
}
|
|
804663
804859
|
}
|
|
804664
804860
|
try {
|
|
804665
|
-
const whichAiwg =
|
|
804861
|
+
const whichAiwg = execSync36("which aiwg 2>/dev/null || where aiwg 2>nul", {
|
|
804666
804862
|
encoding: "utf-8",
|
|
804667
804863
|
timeout: 3e3,
|
|
804668
804864
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -805389,13 +805585,13 @@ __export(tor_fallback_exports, {
|
|
|
805389
805585
|
tunnelViaTor: () => tunnelViaTor
|
|
805390
805586
|
});
|
|
805391
805587
|
import { existsSync as existsSync182, readFileSync as readFileSync151 } from "node:fs";
|
|
805392
|
-
import { homedir as
|
|
805588
|
+
import { homedir as homedir65 } from "node:os";
|
|
805393
805589
|
import { join as join192 } from "node:path";
|
|
805394
805590
|
import { createConnection as createConnection3 } from "node:net";
|
|
805395
805591
|
function getLocalOnion() {
|
|
805396
805592
|
const candidates = [
|
|
805397
|
-
join192(
|
|
805398
|
-
join192(
|
|
805593
|
+
join192(homedir65(), "hidden_service_hostname"),
|
|
805594
|
+
join192(homedir65(), ".omnius", "tor", "hostname"),
|
|
805399
805595
|
"/var/lib/tor/hidden_service/hostname"
|
|
805400
805596
|
];
|
|
805401
805597
|
for (const p2 of candidates) {
|
|
@@ -805668,7 +805864,7 @@ import {
|
|
|
805668
805864
|
statSync as statSync73
|
|
805669
805865
|
} from "node:fs";
|
|
805670
805866
|
import { join as join194, resolve as pathResolve3 } from "node:path";
|
|
805671
|
-
import { homedir as
|
|
805867
|
+
import { homedir as homedir66 } from "node:os";
|
|
805672
805868
|
function keyUsageHint(secret) {
|
|
805673
805869
|
return {
|
|
805674
805870
|
auth_header: secret ? `Authorization: Bearer ${secret}` : "Authorization: Bearer <token>",
|
|
@@ -805900,7 +806096,7 @@ async function tryRouteV1(ctx3) {
|
|
|
805900
806096
|
return handleVisionDescribe(ctx3);
|
|
805901
806097
|
}
|
|
805902
806098
|
if (pathname === "/v1/ocr/advanced" && method === "POST") {
|
|
805903
|
-
return
|
|
806099
|
+
return handleCallTool(ctx3, "ocr_image_advanced");
|
|
805904
806100
|
}
|
|
805905
806101
|
if (pathname === "/v1/aims" || pathname.startsWith("/v1/aims/")) {
|
|
805906
806102
|
return tryAimsRoute(ctx3);
|
|
@@ -806024,7 +806220,7 @@ async function handleGetSkill(ctx3, name10) {
|
|
|
806024
806220
|
}
|
|
806025
806221
|
async function fallbackDiscoverSkills() {
|
|
806026
806222
|
return (_root) => {
|
|
806027
|
-
const roots = [join194(
|
|
806223
|
+
const roots = [join194(homedir66(), ".local", "share", "ai-writing-guide")];
|
|
806028
806224
|
const out = [];
|
|
806029
806225
|
for (const root of roots) {
|
|
806030
806226
|
if (!existsSync184(root)) continue;
|
|
@@ -807595,7 +807791,7 @@ async function handleNexusStatus(ctx3) {
|
|
|
807595
807791
|
try {
|
|
807596
807792
|
const statePaths = [
|
|
807597
807793
|
join194(process.cwd(), ".omnius", "nexus-peer-state.json"),
|
|
807598
|
-
join194(
|
|
807794
|
+
join194(homedir66(), ".omnius", "nexus-peer-cache.json")
|
|
807599
807795
|
];
|
|
807600
807796
|
const states2 = [];
|
|
807601
807797
|
for (const p2 of statePaths) {
|
|
@@ -807631,7 +807827,7 @@ async function handleNexusStatus(ctx3) {
|
|
|
807631
807827
|
}
|
|
807632
807828
|
function loadAgentName() {
|
|
807633
807829
|
try {
|
|
807634
|
-
const p2 = join194(
|
|
807830
|
+
const p2 = join194(homedir66(), ".omnius", "agent-name");
|
|
807635
807831
|
if (existsSync184(p2)) return readFileSync152(p2, "utf-8").trim();
|
|
807636
807832
|
} catch {
|
|
807637
807833
|
}
|
|
@@ -807641,8 +807837,8 @@ async function handleSponsors(ctx3) {
|
|
|
807641
807837
|
const { req: req3, res, url, requestId } = ctx3;
|
|
807642
807838
|
try {
|
|
807643
807839
|
const candidates = [
|
|
807644
|
-
join194(
|
|
807645
|
-
join194(
|
|
807840
|
+
join194(homedir66(), ".omnius", "sponsor-cache.json"),
|
|
807841
|
+
join194(homedir66(), ".omnius", "sponsors.json")
|
|
807646
807842
|
];
|
|
807647
807843
|
let sponsors = [];
|
|
807648
807844
|
for (const p2 of candidates) {
|
|
@@ -807942,9 +808138,9 @@ function resolveLocalPeerId() {
|
|
|
807942
808138
|
const projectScoped = scope === "project" || scope === "local" || projectScopeFlag === "1" || projectScopeFlag === "true" || projectScopeFlag === "yes";
|
|
807943
808139
|
const candidates = projectScoped ? [
|
|
807944
808140
|
join194(process.cwd(), ".omnius", "nexus", "status.json"),
|
|
807945
|
-
join194(
|
|
808141
|
+
join194(homedir66(), ".omnius", "nexus", "status.json")
|
|
807946
808142
|
] : [
|
|
807947
|
-
join194(
|
|
808143
|
+
join194(homedir66(), ".omnius", "nexus", "status.json"),
|
|
807948
808144
|
join194(process.cwd(), ".omnius", "nexus", "status.json")
|
|
807949
808145
|
];
|
|
807950
808146
|
for (const p2 of candidates) {
|
|
@@ -807952,7 +808148,7 @@ function resolveLocalPeerId() {
|
|
|
807952
808148
|
if (r2) return r2;
|
|
807953
808149
|
}
|
|
807954
808150
|
try {
|
|
807955
|
-
const regPath = join194(
|
|
808151
|
+
const regPath = join194(homedir66(), ".omnius", "nexus-registry.json");
|
|
807956
808152
|
if (existsSync184(regPath)) {
|
|
807957
808153
|
const reg = JSON.parse(readFileSync152(regPath, "utf-8"));
|
|
807958
808154
|
const entries2 = Array.isArray(reg?.dirs) ? reg.dirs : [];
|
|
@@ -807972,9 +808168,9 @@ function resolveLocalPeerId() {
|
|
|
807972
808168
|
}
|
|
807973
808169
|
let scanResult = null;
|
|
807974
808170
|
try {
|
|
807975
|
-
const { execSync:
|
|
807976
|
-
const cmd = `find "${
|
|
807977
|
-
const out =
|
|
808171
|
+
const { execSync: execSync39 } = __require("node:child_process");
|
|
808172
|
+
const cmd = `find "${homedir66()}" -maxdepth 4 -path '*/.omnius/nexus/status.json' -type f 2>/dev/null | head -50`;
|
|
808173
|
+
const out = execSync39(cmd, { encoding: "utf-8", timeout: 2e3 }).trim();
|
|
807978
808174
|
for (const line of out.split("\n")) {
|
|
807979
808175
|
const f2 = line.trim();
|
|
807980
808176
|
if (!f2) continue;
|
|
@@ -808004,8 +808200,8 @@ function locateTorScript(filename) {
|
|
|
808004
808200
|
if (existsSync184(p2)) return p2;
|
|
808005
808201
|
}
|
|
808006
808202
|
try {
|
|
808007
|
-
const { execSync:
|
|
808008
|
-
const root =
|
|
808203
|
+
const { execSync: execSync39 } = __require("node:child_process");
|
|
808204
|
+
const root = execSync39("npm root -g", {
|
|
808009
808205
|
encoding: "utf-8",
|
|
808010
808206
|
timeout: 5e3
|
|
808011
808207
|
}).trim();
|
|
@@ -808338,9 +808534,9 @@ async function handleRemoteProxy(ctx3) {
|
|
|
808338
808534
|
);
|
|
808339
808535
|
const nexusCandidates = tunnelProjectScope ? [
|
|
808340
808536
|
join194(process.cwd(), ".omnius", "nexus"),
|
|
808341
|
-
join194(
|
|
808537
|
+
join194(homedir66(), ".omnius", "nexus")
|
|
808342
808538
|
] : [
|
|
808343
|
-
join194(
|
|
808539
|
+
join194(homedir66(), ".omnius", "nexus"),
|
|
808344
808540
|
join194(process.cwd(), ".omnius", "nexus")
|
|
808345
808541
|
];
|
|
808346
808542
|
let nexusDirPath = null;
|
|
@@ -809250,10 +809446,11 @@ async function handleCallTool(ctx3, name10) {
|
|
|
809250
809446
|
);
|
|
809251
809447
|
return true;
|
|
809252
809448
|
}
|
|
809253
|
-
const defaultTimeout = name10 === "audio_analyze" && String(args["action"] ?? "").toLowerCase() === "classify" ? 9e4 : 3e4;
|
|
809449
|
+
const defaultTimeout = name10 === "audio_analyze" && String(args["action"] ?? "").toLowerCase() === "classify" ? 9e4 : name10 === "ocr_image_advanced" ? 3e5 : 3e4;
|
|
809450
|
+
const maxTimeout = name10 === "ocr_image_advanced" ? 6e5 : 12e4;
|
|
809254
809451
|
const executor = new ToolExecutor2({
|
|
809255
809452
|
workingDir,
|
|
809256
|
-
timeout: clampDirectToolNumber(body?.timeout_ms, defaultTimeout, 1e3,
|
|
809453
|
+
timeout: clampDirectToolNumber(body?.timeout_ms, defaultTimeout, 1e3, maxTimeout),
|
|
809257
809454
|
maxOutputSize: clampDirectToolNumber(
|
|
809258
809455
|
body?.max_output_chars,
|
|
809259
809456
|
1e5,
|
|
@@ -809677,7 +809874,7 @@ async function handleListAgentTypes(ctx3) {
|
|
|
809677
809874
|
}
|
|
809678
809875
|
async function handleListEngines(ctx3) {
|
|
809679
809876
|
const { res } = ctx3;
|
|
809680
|
-
const home2 =
|
|
809877
|
+
const home2 = homedir66();
|
|
809681
809878
|
sendJson2(res, 200, {
|
|
809682
809879
|
engines: [
|
|
809683
809880
|
{
|
|
@@ -809739,105 +809936,6 @@ async function handleVisionDescribe(ctx3) {
|
|
|
809739
809936
|
);
|
|
809740
809937
|
return true;
|
|
809741
809938
|
}
|
|
809742
|
-
async function handleAdvancedOcr(ctx3) {
|
|
809743
|
-
const { req: req3, res, url, requestId } = ctx3;
|
|
809744
|
-
try {
|
|
809745
|
-
const body = await parseJsonBodyStrict(req3);
|
|
809746
|
-
const imagePath = body?.imagePath;
|
|
809747
|
-
const visionModel = body?.visionModel;
|
|
809748
|
-
const prompt = body?.prompt;
|
|
809749
|
-
if (!imagePath || typeof imagePath !== "string") {
|
|
809750
|
-
sendProblem(
|
|
809751
|
-
res,
|
|
809752
|
-
problemDetails({
|
|
809753
|
-
type: P2.invalidRequest,
|
|
809754
|
-
status: 400,
|
|
809755
|
-
title: "Missing imagePath",
|
|
809756
|
-
detail: "Request body must include imagePath (string).",
|
|
809757
|
-
instance: requestId
|
|
809758
|
-
})
|
|
809759
|
-
);
|
|
809760
|
-
return true;
|
|
809761
|
-
}
|
|
809762
|
-
const execMod = await Promise.resolve().then(() => (init_dist5(), dist_exports2)).catch(() => null);
|
|
809763
|
-
const OcrImageAdvancedTool2 = execMod?.OcrImageAdvancedTool;
|
|
809764
|
-
const VisionTool2 = execMod?.VisionTool;
|
|
809765
|
-
if (!OcrImageAdvancedTool2) {
|
|
809766
|
-
sendProblem(
|
|
809767
|
-
res,
|
|
809768
|
-
problemDetails({
|
|
809769
|
-
type: P2.notImplemented,
|
|
809770
|
-
status: 501,
|
|
809771
|
-
title: "OCR tool unavailable",
|
|
809772
|
-
detail: "The advanced OCR tool could not be loaded.",
|
|
809773
|
-
instance: requestId
|
|
809774
|
-
})
|
|
809775
|
-
);
|
|
809776
|
-
return true;
|
|
809777
|
-
}
|
|
809778
|
-
const ocrTool = new OcrImageAdvancedTool2();
|
|
809779
|
-
const ocrResult = await ocrTool.execute({
|
|
809780
|
-
path: imagePath,
|
|
809781
|
-
maxVariants: 3,
|
|
809782
|
-
psmModes: [4, 6, 11],
|
|
809783
|
-
languages: "eng"
|
|
809784
|
-
});
|
|
809785
|
-
let visionDescription = "";
|
|
809786
|
-
let visionUsed = false;
|
|
809787
|
-
if (visionModel && VisionTool2) {
|
|
809788
|
-
try {
|
|
809789
|
-
const visionTool = new VisionTool2(process.cwd());
|
|
809790
|
-
const visionResult = await visionTool.execute({
|
|
809791
|
-
image: imagePath,
|
|
809792
|
-
action: "query",
|
|
809793
|
-
prompt: prompt || "Describe what you see in this image in detail. Include any text, UI elements, code, diagrams, or visual content.",
|
|
809794
|
-
model: visionModel
|
|
809795
|
-
});
|
|
809796
|
-
if (visionResult.success) {
|
|
809797
|
-
visionDescription = String(visionResult.llmContent || visionResult.output || "").trim();
|
|
809798
|
-
visionUsed = visionDescription.length > 0;
|
|
809799
|
-
}
|
|
809800
|
-
} catch {
|
|
809801
|
-
}
|
|
809802
|
-
}
|
|
809803
|
-
const parts = [];
|
|
809804
|
-
if (ocrResult.success && ocrResult.output) {
|
|
809805
|
-
parts.push(`[OCR Text from image]
|
|
809806
|
-
${ocrResult.output}`);
|
|
809807
|
-
}
|
|
809808
|
-
if (visionDescription) {
|
|
809809
|
-
parts.push(`[Vision analysis of image (model: ${visionModel})]
|
|
809810
|
-
${visionDescription}`);
|
|
809811
|
-
}
|
|
809812
|
-
if (parts.length === 0) {
|
|
809813
|
-
parts.push(`[Image at ${imagePath} — OCR found no text${visionModel ? ` and vision model (${visionModel}) returned no description` : ""}; treat as UNCOMPREHENDED]`);
|
|
809814
|
-
}
|
|
809815
|
-
const contextBlock = parts.join("\n\n");
|
|
809816
|
-
sendJson2(res, 200, {
|
|
809817
|
-
success: true,
|
|
809818
|
-
imagePath,
|
|
809819
|
-
ocrText: ocrResult.success ? ocrResult.output || "" : "",
|
|
809820
|
-
ocrError: ocrResult.success ? null : ocrResult.error || ocrResult.output,
|
|
809821
|
-
visionDescription,
|
|
809822
|
-
visionUsed,
|
|
809823
|
-
visionModel: visionModel || null,
|
|
809824
|
-
contextBlock
|
|
809825
|
-
});
|
|
809826
|
-
return true;
|
|
809827
|
-
} catch (err) {
|
|
809828
|
-
sendProblem(
|
|
809829
|
-
res,
|
|
809830
|
-
problemDetails({
|
|
809831
|
-
type: P2.internalError,
|
|
809832
|
-
status: 500,
|
|
809833
|
-
title: "Advanced OCR failed",
|
|
809834
|
-
detail: err instanceof Error ? err.message : String(err),
|
|
809835
|
-
instance: requestId
|
|
809836
|
-
})
|
|
809837
|
-
);
|
|
809838
|
-
return true;
|
|
809839
|
-
}
|
|
809840
|
-
}
|
|
809841
809939
|
async function tryAimsRoute(ctx3) {
|
|
809842
809940
|
const { pathname, method } = ctx3;
|
|
809843
809941
|
if (pathname === "/v1/aims" && method === "GET") return handleAimsRoot(ctx3);
|
|
@@ -809876,7 +809974,7 @@ async function tryAimsRoute(ctx3) {
|
|
|
809876
809974
|
return false;
|
|
809877
809975
|
}
|
|
809878
809976
|
function aimsDir() {
|
|
809879
|
-
return join194(
|
|
809977
|
+
return join194(homedir66(), ".omnius", "aims");
|
|
809880
809978
|
}
|
|
809881
809979
|
function readAimsFile(name10, fallback) {
|
|
809882
809980
|
try {
|
|
@@ -810341,7 +810439,7 @@ async function handleAimsSuppliers(ctx3) {
|
|
|
810341
810439
|
role: "LLM inference provider"
|
|
810342
810440
|
}
|
|
810343
810441
|
];
|
|
810344
|
-
const sponsorPaths = [join194(
|
|
810442
|
+
const sponsorPaths = [join194(homedir66(), ".omnius", "sponsor-cache.json")];
|
|
810345
810443
|
for (const p2 of sponsorPaths) {
|
|
810346
810444
|
if (!existsSync184(p2)) continue;
|
|
810347
810445
|
try {
|
|
@@ -823728,7 +823826,15 @@ function getOpenApiSpec() {
|
|
|
823728
823826
|
}
|
|
823729
823827
|
},
|
|
823730
823828
|
"/v1/vision/describe": { post: { summary: "Vision describe (deferred to PT-07)", tags: ["Vision"], responses: { 501: { description: "Not yet daemon-resident" } } } },
|
|
823731
|
-
"/v1/ocr/advanced": {
|
|
823829
|
+
"/v1/ocr/advanced": {
|
|
823830
|
+
post: {
|
|
823831
|
+
summary: "Alias of POST /v1/tools/ocr_image_advanced/call — managed multi-variant Tesseract OCR",
|
|
823832
|
+
tags: ["Tools", "Vision"],
|
|
823833
|
+
description: "Uses the identical advanced OCR tool exposed to agents: auto-provisions Tesseract, requested traineddata, and the managed Python pipeline. Body is the canonical direct-tool envelope; result.data contains the parsed OCR pipeline result.",
|
|
823834
|
+
requestBody: { required: true, content: { "application/json": { schema: { type: "object", required: ["args"], properties: { args: { type: "object", required: ["image"], properties: { image: { type: "string" }, language: { type: "string", example: "eng+fra" }, regions: { type: "boolean" }, region: { type: "string", example: "0,0,1200,180" }, psm: { type: "integer", enum: [4, 6, 11] }, output_dir: { type: "string" }, batch: { type: "boolean" }, debug: { type: "boolean" } } }, timeout_ms: { type: "integer", description: "Defaults to 300000ms; maximum 600000ms." }, max_output_chars: { type: "integer" }, profile: { type: "string" }, working_dir: { type: "string", description: "Admin scope only." } } } } } },
|
|
823835
|
+
responses: { 200: { description: "Direct-tool result envelope; consume result.data for structured OCR output." }, 400: { description: "Invalid direct-tool request or OCR arguments" }, 403: { description: "Tool scope/profile/working-directory denied" } }
|
|
823836
|
+
}
|
|
823837
|
+
},
|
|
823732
823838
|
"/v1/vision/embed": { post: { summary: "Create a vision embedding for uploaded or referenced media", tags: ["Vision"], responses: { 200: { description: "Vision embedding result" }, 400: { description: "Invalid media input" } } } },
|
|
823733
823839
|
"/v1/audio/embed": { post: { summary: "Create an audio embedding for uploaded or referenced audio", tags: ["Voice"], responses: { 200: { description: "Audio embedding result" }, 400: { description: "Invalid audio input" } } } },
|
|
823734
823840
|
"/v1/chat/attachments": { post: { summary: "Upload an attachment for a stateful chat", tags: ["Chat"], responses: { 200: { description: "Stored attachment metadata" }, 400: { description: "Invalid attachment" } } } },
|
|
@@ -824278,10 +824384,10 @@ var init_chat_followup = __esm({
|
|
|
824278
824384
|
});
|
|
824279
824385
|
|
|
824280
824386
|
// packages/cli/src/docker.ts
|
|
824281
|
-
import { execSync as
|
|
824387
|
+
import { execSync as execSync37, spawn as spawn44 } from "node:child_process";
|
|
824282
824388
|
import { existsSync as existsSync186, mkdirSync as mkdirSync121, writeFileSync as writeFileSync105 } from "node:fs";
|
|
824283
824389
|
import { join as join196, resolve as resolve86, dirname as dirname67 } from "node:path";
|
|
824284
|
-
import { homedir as
|
|
824390
|
+
import { homedir as homedir67 } from "node:os";
|
|
824285
824391
|
import { fileURLToPath as fileURLToPath31 } from "node:url";
|
|
824286
824392
|
function getDockerDir() {
|
|
824287
824393
|
try {
|
|
@@ -824299,7 +824405,7 @@ function getDockerDir() {
|
|
|
824299
824405
|
}
|
|
824300
824406
|
function isDockerAvailable() {
|
|
824301
824407
|
try {
|
|
824302
|
-
|
|
824408
|
+
execSync37("docker info", { stdio: "pipe", timeout: 1e4 });
|
|
824303
824409
|
return true;
|
|
824304
824410
|
} catch {
|
|
824305
824411
|
return false;
|
|
@@ -824307,7 +824413,7 @@ function isDockerAvailable() {
|
|
|
824307
824413
|
}
|
|
824308
824414
|
function isDockerInstalled() {
|
|
824309
824415
|
try {
|
|
824310
|
-
|
|
824416
|
+
execSync37("docker --version", { stdio: "pipe", timeout: 5e3 });
|
|
824311
824417
|
return true;
|
|
824312
824418
|
} catch {
|
|
824313
824419
|
return false;
|
|
@@ -824332,31 +824438,31 @@ async function ensureDocker() {
|
|
|
824332
824438
|
}
|
|
824333
824439
|
try {
|
|
824334
824440
|
console.log("[omnius-docker] Docker not found. Installing via get.docker.com...");
|
|
824335
|
-
|
|
824441
|
+
execSync37("curl -fsSL https://get.docker.com | sh", {
|
|
824336
824442
|
stdio: "inherit",
|
|
824337
824443
|
timeout: 3e5
|
|
824338
824444
|
});
|
|
824339
824445
|
const user = process.env["USER"] || process.env["LOGNAME"];
|
|
824340
824446
|
if (user) {
|
|
824341
824447
|
try {
|
|
824342
|
-
|
|
824448
|
+
execSync37(`sudo usermod -aG docker ${user}`, { stdio: "pipe" });
|
|
824343
824449
|
} catch {
|
|
824344
824450
|
}
|
|
824345
824451
|
}
|
|
824346
824452
|
try {
|
|
824347
|
-
|
|
824453
|
+
execSync37("sudo systemctl start docker", { stdio: "pipe", timeout: 15e3 });
|
|
824348
824454
|
} catch {
|
|
824349
824455
|
}
|
|
824350
824456
|
try {
|
|
824351
|
-
|
|
824352
|
-
const runtimes =
|
|
824457
|
+
execSync37("nvidia-smi", { stdio: "pipe", timeout: 5e3 });
|
|
824458
|
+
const runtimes = execSync37("docker info --format '{{json .Runtimes}}'", {
|
|
824353
824459
|
stdio: "pipe",
|
|
824354
824460
|
timeout: 5e3
|
|
824355
824461
|
}).toString();
|
|
824356
824462
|
if (!runtimes.includes("nvidia")) {
|
|
824357
824463
|
console.log("[omnius-docker] NVIDIA GPU detected. Installing nvidia-container-toolkit...");
|
|
824358
824464
|
try {
|
|
824359
|
-
|
|
824465
|
+
execSync37(`
|
|
824360
824466
|
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg 2>/dev/null
|
|
824361
824467
|
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
|
|
824362
824468
|
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 )
|
|
@@ -824386,7 +824492,7 @@ async function ensureDocker() {
|
|
|
824386
824492
|
}
|
|
824387
824493
|
async function ensureNvidiaToolkit() {
|
|
824388
824494
|
try {
|
|
824389
|
-
|
|
824495
|
+
execSync37("nvidia-smi --query-gpu=name --format=csv,noheader", { stdio: "pipe", timeout: 5e3 });
|
|
824390
824496
|
} catch {
|
|
824391
824497
|
return { ok: false, message: "No NVIDIA GPU detected (nvidia-smi not found)" };
|
|
824392
824498
|
}
|
|
@@ -824397,7 +824503,7 @@ async function ensureNvidiaToolkit() {
|
|
|
824397
824503
|
return { ok: false, message: "Auto-install only supported on Linux. Install manually: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html" };
|
|
824398
824504
|
}
|
|
824399
824505
|
try {
|
|
824400
|
-
|
|
824506
|
+
execSync37(`
|
|
824401
824507
|
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg 2>/dev/null
|
|
824402
824508
|
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
|
|
824403
824509
|
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 )
|
|
@@ -824411,7 +824517,7 @@ async function ensureNvidiaToolkit() {
|
|
|
824411
824517
|
}
|
|
824412
824518
|
function isOmniusImageBuilt() {
|
|
824413
824519
|
try {
|
|
824414
|
-
const out =
|
|
824520
|
+
const out = execSync37(`docker images -q ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG}`, {
|
|
824415
824521
|
stdio: "pipe",
|
|
824416
824522
|
timeout: 5e3
|
|
824417
824523
|
}).toString().trim();
|
|
@@ -824429,13 +824535,13 @@ async function ensureOmniusImage(force = false) {
|
|
|
824429
824535
|
if (existsSync186(join196(dockerDir, "Dockerfile"))) {
|
|
824430
824536
|
buildContext = dockerDir;
|
|
824431
824537
|
} else {
|
|
824432
|
-
buildContext = join196(
|
|
824538
|
+
buildContext = join196(homedir67(), ".omnius", "docker-build");
|
|
824433
824539
|
mkdirSync121(buildContext, { recursive: true });
|
|
824434
824540
|
writeDockerfiles(buildContext);
|
|
824435
824541
|
}
|
|
824436
824542
|
try {
|
|
824437
824543
|
console.log(`[omnius-docker] Building image ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG}...`);
|
|
824438
|
-
|
|
824544
|
+
execSync37(`docker build -t ${OMNIUS_IMAGE}:${OMNIUS_IMAGE_TAG} ${buildContext}`, {
|
|
824439
824545
|
stdio: "inherit",
|
|
824440
824546
|
timeout: 6e5
|
|
824441
824547
|
// 10 min
|
|
@@ -824509,11 +824615,11 @@ exec "$@"
|
|
|
824509
824615
|
}
|
|
824510
824616
|
function hasNvidiaGpu() {
|
|
824511
824617
|
try {
|
|
824512
|
-
|
|
824618
|
+
execSync37("nvidia-smi --query-gpu=name --format=csv,noheader", {
|
|
824513
824619
|
stdio: "pipe",
|
|
824514
824620
|
timeout: 5e3
|
|
824515
824621
|
});
|
|
824516
|
-
const runtimes =
|
|
824622
|
+
const runtimes = execSync37("docker info --format '{{json .Runtimes}}'", {
|
|
824517
824623
|
stdio: "pipe",
|
|
824518
824624
|
timeout: 5e3
|
|
824519
824625
|
}).toString();
|
|
@@ -824752,8 +824858,8 @@ import * as https3 from "node:https";
|
|
|
824752
824858
|
import { createRequire as createRequire10 } from "node:module";
|
|
824753
824859
|
import { fileURLToPath as fileURLToPath32 } from "node:url";
|
|
824754
824860
|
import { dirname as dirname68, join as join198, resolve as resolve87 } from "node:path";
|
|
824755
|
-
import { homedir as
|
|
824756
|
-
import { spawn as spawn45, execSync as
|
|
824861
|
+
import { homedir as homedir68 } from "node:os";
|
|
824862
|
+
import { spawn as spawn45, execSync as execSync38 } from "node:child_process";
|
|
824757
824863
|
import {
|
|
824758
824864
|
createReadStream as createReadStream2,
|
|
824759
824865
|
mkdirSync as mkdirSync122,
|
|
@@ -825259,7 +825365,7 @@ function isOriginAllowed(origin) {
|
|
|
825259
825365
|
if (!origin) return true;
|
|
825260
825366
|
let accessMode = (process.env["OMNIUS_ACCESS"] || "").toLowerCase().trim();
|
|
825261
825367
|
try {
|
|
825262
|
-
const accessFile = join198(
|
|
825368
|
+
const accessFile = join198(homedir68(), ".omnius", "access");
|
|
825263
825369
|
if (existsSync187(accessFile)) {
|
|
825264
825370
|
const persisted = readFileSync154(accessFile, "utf8").trim().toLowerCase();
|
|
825265
825371
|
if (persisted === "any" || persisted === "lan" || persisted === "loopback") {
|
|
@@ -827201,7 +827307,7 @@ function handleHelp(req3, res) {
|
|
|
827201
827307
|
"POST /v1/voice/tts": "Text-to-speech synthesis",
|
|
827202
827308
|
"POST /v1/voice/asr": "Automatic speech recognition",
|
|
827203
827309
|
"POST /v1/vision/describe": "Describe an image (vision pipeline)",
|
|
827204
|
-
"POST /v1/ocr/advanced": "
|
|
827310
|
+
"POST /v1/ocr/advanced": "Agent-equivalent managed advanced OCR (alias of /v1/tools/ocr_image_advanced/call)",
|
|
827205
827311
|
"POST /v1/media/av/analyze": "Grounded AV/audio comprehension of a media file"
|
|
827206
827312
|
}
|
|
827207
827313
|
},
|
|
@@ -828574,10 +828680,10 @@ ${task}` : task;
|
|
|
828574
828680
|
});
|
|
828575
828681
|
}
|
|
828576
828682
|
function updateStateFile() {
|
|
828577
|
-
return join198(
|
|
828683
|
+
return join198(homedir68(), ".omnius", "update-state.json");
|
|
828578
828684
|
}
|
|
828579
828685
|
function updateLogPath() {
|
|
828580
|
-
return join198(
|
|
828686
|
+
return join198(homedir68(), ".omnius", "update.log");
|
|
828581
828687
|
}
|
|
828582
828688
|
function readUpdateState2() {
|
|
828583
828689
|
try {
|
|
@@ -828590,7 +828696,7 @@ function readUpdateState2() {
|
|
|
828590
828696
|
}
|
|
828591
828697
|
function writeUpdateState2(state3) {
|
|
828592
828698
|
try {
|
|
828593
|
-
const dir = join198(
|
|
828699
|
+
const dir = join198(homedir68(), ".omnius");
|
|
828594
828700
|
mkdirSync122(dir, { recursive: true });
|
|
828595
828701
|
const finalPath = updateStateFile();
|
|
828596
828702
|
const tmpPath = `${finalPath}.tmp.${process.pid}`;
|
|
@@ -828695,7 +828801,7 @@ async function handleV1Update(req3, res, requestId) {
|
|
|
828695
828801
|
}
|
|
828696
828802
|
if (!npmBin) npmBin = isWin2 ? "npm.cmd" : "npm";
|
|
828697
828803
|
const pkgSpec = `omnius@${targetVersion}`;
|
|
828698
|
-
const dir = join198(
|
|
828804
|
+
const dir = join198(homedir68(), ".omnius");
|
|
828699
828805
|
fs14.mkdirSync(dir, { recursive: true });
|
|
828700
828806
|
const logFd = fs14.openSync(logPath3, "w");
|
|
828701
828807
|
const npmPrefix = dirname68(nodeDir);
|
|
@@ -829568,7 +829674,7 @@ function handleV1RunsDelete(res, id2) {
|
|
|
829568
829674
|
const containerName = `omnius-${id2}`;
|
|
829569
829675
|
if (job.sandbox === "container") {
|
|
829570
829676
|
try {
|
|
829571
|
-
|
|
829677
|
+
execSync38(`docker stop ${containerName}`, {
|
|
829572
829678
|
timeout: 5e3,
|
|
829573
829679
|
stdio: "ignore"
|
|
829574
829680
|
});
|
|
@@ -830757,7 +830863,7 @@ async function handleRequest(req3, res, ollamaUrl, verbose, runtimeDefaults = {}
|
|
|
830757
830863
|
}
|
|
830758
830864
|
if (pathname === "/v1/projects/scan" && method === "GET") {
|
|
830759
830865
|
const scanRoot = urlObj.searchParams.get("root");
|
|
830760
|
-
const base3 = scanRoot && scanRoot.trim() ? resolve87(scanRoot.trim()) :
|
|
830866
|
+
const base3 = scanRoot && scanRoot.trim() ? resolve87(scanRoot.trim()) : homedir68();
|
|
830761
830867
|
try {
|
|
830762
830868
|
let walk2 = function(dir, depth) {
|
|
830763
830869
|
if (depth > 6) return;
|
|
@@ -830815,7 +830921,7 @@ async function handleRequest(req3, res, ollamaUrl, verbose, runtimeDefaults = {}
|
|
|
830815
830921
|
}
|
|
830816
830922
|
if (pathname === "/v1/projects/scan" && method === "GET") {
|
|
830817
830923
|
const scanRoot = urlObj.searchParams.get("root");
|
|
830818
|
-
const base3 = scanRoot && scanRoot.trim() ? resolve87(scanRoot.trim()) :
|
|
830924
|
+
const base3 = scanRoot && scanRoot.trim() ? resolve87(scanRoot.trim()) : homedir68();
|
|
830819
830925
|
try {
|
|
830820
830926
|
let walk2 = function(dir, depth) {
|
|
830821
830927
|
if (depth > 6) return;
|
|
@@ -832545,7 +832651,7 @@ data: ${JSON.stringify(data)}
|
|
|
832545
832651
|
return;
|
|
832546
832652
|
}
|
|
832547
832653
|
try {
|
|
832548
|
-
const { execSync:
|
|
832654
|
+
const { execSync: execSync39 } = require4("node:child_process");
|
|
832549
832655
|
let audioPath = null;
|
|
832550
832656
|
const ttsCmds = [
|
|
832551
832657
|
`espeak "${text2}" -w /tmp/tts_${Date.now()}.wav 2>/dev/null`,
|
|
@@ -832554,7 +832660,7 @@ data: ${JSON.stringify(data)}
|
|
|
832554
832660
|
];
|
|
832555
832661
|
for (const cmd of ttsCmds) {
|
|
832556
832662
|
try {
|
|
832557
|
-
|
|
832663
|
+
execSync39(cmd, { stdio: "pipe" });
|
|
832558
832664
|
audioPath = "/tmp/tts_" + Date.now() + ".wav";
|
|
832559
832665
|
break;
|
|
832560
832666
|
} catch {
|
|
@@ -833953,7 +834059,7 @@ ${historyLines}
|
|
|
833953
834059
|
function getScheduleRoots() {
|
|
833954
834060
|
const rootsEnv = process.env["OMNIUS_SCHEDULE_ROOTS"] || "";
|
|
833955
834061
|
const roots = rootsEnv.split(rootsEnv.includes(";") ? ";" : ":").filter(Boolean);
|
|
833956
|
-
const defaults3 = [process.cwd(), join198(
|
|
834062
|
+
const defaults3 = [process.cwd(), join198(homedir68(), "Documents")];
|
|
833957
834063
|
const set = /* @__PURE__ */ new Set([...defaults3, ...roots]);
|
|
833958
834064
|
return [...set];
|
|
833959
834065
|
}
|
|
@@ -834488,7 +834594,7 @@ function fixupOrMigrateScheduled(mode, dryRun) {
|
|
|
834488
834594
|
try {
|
|
834489
834595
|
if (!f2.workingDir || !f2.task) continue;
|
|
834490
834596
|
const unitBase = `omnius-${f2.id}`;
|
|
834491
|
-
const unitDir = join198(
|
|
834597
|
+
const unitDir = join198(homedir68(), ".config", "systemd", "user");
|
|
834492
834598
|
const svc = join198(unitDir, `${unitBase}.service`);
|
|
834493
834599
|
const tim = join198(unitDir, `${unitBase}.timer`);
|
|
834494
834600
|
const omniusBin = findOmniusBinary4();
|
|
@@ -834837,7 +834943,7 @@ function startApiServer(options2 = {}) {
|
|
|
834837
834943
|
}
|
|
834838
834944
|
let runtimeAccessMode = resolveAccessMode(process.env["OMNIUS_ACCESS"], host2);
|
|
834839
834945
|
try {
|
|
834840
|
-
const accessFile = join198(
|
|
834946
|
+
const accessFile = join198(homedir68(), ".omnius", "access");
|
|
834841
834947
|
if (existsSync187(accessFile)) {
|
|
834842
834948
|
const persisted = readFileSync154(accessFile, "utf8").trim();
|
|
834843
834949
|
const resolved = resolveAccessMode(persisted, host2);
|
|
@@ -834909,7 +835015,7 @@ function startApiServer(options2 = {}) {
|
|
|
834909
835015
|
const previous = runtimeAccessMode;
|
|
834910
835016
|
runtimeAccessMode = requested;
|
|
834911
835017
|
try {
|
|
834912
|
-
const dir = join198(
|
|
835018
|
+
const dir = join198(homedir68(), ".omnius");
|
|
834913
835019
|
mkdirSync122(dir, { recursive: true });
|
|
834914
835020
|
writeFileSync106(
|
|
834915
835021
|
join198(dir, "access"),
|
|
@@ -837333,8 +837439,8 @@ function crashLog(label, err) {
|
|
|
837333
837439
|
try {
|
|
837334
837440
|
const { appendFileSync: appendFileSync24, mkdirSync: mkdirSync124 } = __require("node:fs");
|
|
837335
837441
|
const { join: join201 } = __require("node:path");
|
|
837336
|
-
const { homedir:
|
|
837337
|
-
const logDir = join201(
|
|
837442
|
+
const { homedir: homedir69 } = __require("node:os");
|
|
837443
|
+
const logDir = join201(homedir69(), ".omnius");
|
|
837338
837444
|
mkdirSync124(logDir, { recursive: true });
|
|
837339
837445
|
appendFileSync24(join201(logDir, "crash.log"), logLine);
|
|
837340
837446
|
} catch {
|