omnius 1.0.348 → 1.0.349
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 +435 -423
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -273173,11 +273173,11 @@ print("__SESSION__" + json.dumps(_session) + "__SESSION__")
|
|
|
273173
273173
|
* what was previously computed. */
|
|
273174
273174
|
async loadSessionInfo() {
|
|
273175
273175
|
try {
|
|
273176
|
-
const { readFileSync:
|
|
273176
|
+
const { readFileSync: readFileSync133, existsSync: existsSync164 } = await import("node:fs");
|
|
273177
273177
|
const sessionPath2 = join43(this.cwd, ".omnius", "rlm", "session.json");
|
|
273178
273178
|
if (!existsSync164(sessionPath2))
|
|
273179
273179
|
return null;
|
|
273180
|
-
return JSON.parse(
|
|
273180
|
+
return JSON.parse(readFileSync133(sessionPath2, "utf8"));
|
|
273181
273181
|
} catch {
|
|
273182
273182
|
return null;
|
|
273183
273183
|
}
|
|
@@ -273364,10 +273364,10 @@ var init_memory_metabolism = __esm({
|
|
|
273364
273364
|
const trajDir = join44(this.cwd, ".omnius", "rlm-trajectories");
|
|
273365
273365
|
let lessons = [];
|
|
273366
273366
|
try {
|
|
273367
|
-
const { readdirSync: readdirSync59, readFileSync:
|
|
273367
|
+
const { readdirSync: readdirSync59, readFileSync: readFileSync133 } = await import("node:fs");
|
|
273368
273368
|
const files = readdirSync59(trajDir).filter((f2) => f2.endsWith(".jsonl")).sort().reverse().slice(0, 3);
|
|
273369
273369
|
for (const file of files) {
|
|
273370
|
-
const lines =
|
|
273370
|
+
const lines = readFileSync133(join44(trajDir, file), "utf8").split("\n").filter((l2) => l2.trim());
|
|
273371
273371
|
for (const line of lines) {
|
|
273372
273372
|
try {
|
|
273373
273373
|
const entry = JSON.parse(line);
|
|
@@ -273751,14 +273751,14 @@ ${issues.map((i2) => ` - ${i2}`).join("\n")}` : " No issues found."),
|
|
|
273751
273751
|
* Optionally filter by task type for phase-aware context (FSM paper insight).
|
|
273752
273752
|
*/
|
|
273753
273753
|
getTopMemoriesSync(k = 5, taskType) {
|
|
273754
|
-
const { readFileSync:
|
|
273754
|
+
const { readFileSync: readFileSync133, existsSync: existsSync164 } = __require("node:fs");
|
|
273755
273755
|
const metaDir = join44(this.cwd, ".omnius", "memory", "metabolism");
|
|
273756
273756
|
const storeFile = join44(metaDir, "store.json");
|
|
273757
273757
|
if (!existsSync164(storeFile))
|
|
273758
273758
|
return "";
|
|
273759
273759
|
let store2 = [];
|
|
273760
273760
|
try {
|
|
273761
|
-
store2 = JSON.parse(
|
|
273761
|
+
store2 = JSON.parse(readFileSync133(storeFile, "utf8"));
|
|
273762
273762
|
} catch {
|
|
273763
273763
|
return "";
|
|
273764
273764
|
}
|
|
@@ -273780,14 +273780,14 @@ ${issues.map((i2) => ` - ${i2}`).join("\n")}` : " No issues found."),
|
|
|
273780
273780
|
/** Update memory scores based on task outcome. Called after task completion.
|
|
273781
273781
|
* Memories used in successful tasks get boosted. Memories present during failures get decayed. */
|
|
273782
273782
|
updateFromOutcomeSync(surfacedMemoryText, succeeded) {
|
|
273783
|
-
const { readFileSync:
|
|
273783
|
+
const { readFileSync: readFileSync133, writeFileSync: writeFileSync91, existsSync: existsSync164, mkdirSync: mkdirSync106 } = __require("node:fs");
|
|
273784
273784
|
const metaDir = join44(this.cwd, ".omnius", "memory", "metabolism");
|
|
273785
273785
|
const storeFile = join44(metaDir, "store.json");
|
|
273786
273786
|
if (!existsSync164(storeFile))
|
|
273787
273787
|
return;
|
|
273788
273788
|
let store2 = [];
|
|
273789
273789
|
try {
|
|
273790
|
-
store2 = JSON.parse(
|
|
273790
|
+
store2 = JSON.parse(readFileSync133(storeFile, "utf8"));
|
|
273791
273791
|
} catch {
|
|
273792
273792
|
return;
|
|
273793
273793
|
}
|
|
@@ -274234,13 +274234,13 @@ Recommendation: Strategy ${scored[0].index + 1} scores highest.`;
|
|
|
274234
274234
|
// Per EvoSkill (arXiv:2603.02766): retrieve relevant strategies from archive.
|
|
274235
274235
|
/** Retrieve top-K strategies for context injection. Returns "" if none. */
|
|
274236
274236
|
getRelevantStrategiesSync(k = 3, taskType) {
|
|
274237
|
-
const { readFileSync:
|
|
274237
|
+
const { readFileSync: readFileSync133, existsSync: existsSync164 } = __require("node:fs");
|
|
274238
274238
|
const archiveFile = join46(this.cwd, ".omnius", "arche", "variants.json");
|
|
274239
274239
|
if (!existsSync164(archiveFile))
|
|
274240
274240
|
return "";
|
|
274241
274241
|
let variants = [];
|
|
274242
274242
|
try {
|
|
274243
|
-
variants = JSON.parse(
|
|
274243
|
+
variants = JSON.parse(readFileSync133(archiveFile, "utf8"));
|
|
274244
274244
|
} catch {
|
|
274245
274245
|
return "";
|
|
274246
274246
|
}
|
|
@@ -274258,13 +274258,13 @@ Recommendation: Strategy ${scored[0].index + 1} scores highest.`;
|
|
|
274258
274258
|
}
|
|
274259
274259
|
/** Archive a strategy variant synchronously (for task completion path) */
|
|
274260
274260
|
archiveVariantSync(strategy, outcome, tags = []) {
|
|
274261
|
-
const { readFileSync:
|
|
274261
|
+
const { readFileSync: readFileSync133, writeFileSync: writeFileSync91, existsSync: existsSync164, mkdirSync: mkdirSync106 } = __require("node:fs");
|
|
274262
274262
|
const dir = join46(this.cwd, ".omnius", "arche");
|
|
274263
274263
|
const archiveFile = join46(dir, "variants.json");
|
|
274264
274264
|
let variants = [];
|
|
274265
274265
|
try {
|
|
274266
274266
|
if (existsSync164(archiveFile))
|
|
274267
|
-
variants = JSON.parse(
|
|
274267
|
+
variants = JSON.parse(readFileSync133(archiveFile, "utf8"));
|
|
274268
274268
|
} catch {
|
|
274269
274269
|
}
|
|
274270
274270
|
variants.push({
|
|
@@ -563673,9 +563673,9 @@ var init_reflectionBuffer = __esm({
|
|
|
563673
563673
|
this.persistPath = persistPath ?? null;
|
|
563674
563674
|
if (this.persistPath) {
|
|
563675
563675
|
try {
|
|
563676
|
-
const { readFileSync:
|
|
563676
|
+
const { readFileSync: readFileSync133, existsSync: existsSync164 } = __require("node:fs");
|
|
563677
563677
|
if (existsSync164(this.persistPath)) {
|
|
563678
|
-
this.state = JSON.parse(
|
|
563678
|
+
this.state = JSON.parse(readFileSync133(this.persistPath, "utf-8"));
|
|
563679
563679
|
return;
|
|
563680
563680
|
}
|
|
563681
563681
|
} catch {
|
|
@@ -567414,9 +567414,9 @@ var init_adversaryStream = __esm({
|
|
|
567414
567414
|
if (!this.persistPath)
|
|
567415
567415
|
return;
|
|
567416
567416
|
try {
|
|
567417
|
-
const { readFileSync:
|
|
567417
|
+
const { readFileSync: readFileSync133, existsSync: existsSync164 } = __require("node:fs");
|
|
567418
567418
|
if (existsSync164(this.persistPath)) {
|
|
567419
|
-
const data = JSON.parse(
|
|
567419
|
+
const data = JSON.parse(readFileSync133(this.persistPath, "utf-8"));
|
|
567420
567420
|
if (Array.isArray(data?.ledger))
|
|
567421
567421
|
this.ledger = data.ledger.slice(-100);
|
|
567422
567422
|
}
|
|
@@ -582853,8 +582853,8 @@ ${telegramPersonaHead}` : stripped
|
|
|
582853
582853
|
let recoveredTokens = 0;
|
|
582854
582854
|
for (const [filePath, entry] of entries) {
|
|
582855
582855
|
try {
|
|
582856
|
-
const { readFileSync:
|
|
582857
|
-
const content =
|
|
582856
|
+
const { readFileSync: readFileSync133 } = await import("node:fs");
|
|
582857
|
+
const content = readFileSync133(filePath, "utf8");
|
|
582858
582858
|
const tokenEst = Math.ceil(content.length / 4);
|
|
582859
582859
|
if (recoveredTokens + tokenEst > fileRecoveryBudget)
|
|
582860
582860
|
break;
|
|
@@ -584784,7 +584784,7 @@ ${result}`
|
|
|
584784
584784
|
let resizedBase64 = null;
|
|
584785
584785
|
try {
|
|
584786
584786
|
const { execSync: execSync63 } = await import("node:child_process");
|
|
584787
|
-
const { writeFileSync: writeFileSync91, readFileSync:
|
|
584787
|
+
const { writeFileSync: writeFileSync91, readFileSync: readFileSync133, unlinkSync: unlinkSync35 } = await import("node:fs");
|
|
584788
584788
|
const { join: join179 } = await import("node:path");
|
|
584789
584789
|
const { tmpdir: tmpdir24 } = await import("node:os");
|
|
584790
584790
|
const tmpIn = join179(tmpdir24(), `omnius_img_in_${Date.now()}.png`);
|
|
@@ -584794,7 +584794,7 @@ ${result}`
|
|
|
584794
584794
|
const escapedIn = tmpIn.replace(/\\/g, "\\\\");
|
|
584795
584795
|
const escapedOut = tmpOut.replace(/\\/g, "\\\\");
|
|
584796
584796
|
execSync63(`${pyBin} -c "from PIL import Image; img = Image.open('${escapedIn}'); img.thumbnail((512, 512), Image.LANCZOS); img = img.convert('RGB'); img.save('${escapedOut}', 'JPEG', quality=75)"`, { timeout: 1e4, stdio: "pipe" });
|
|
584797
|
-
const resizedBuf =
|
|
584797
|
+
const resizedBuf = readFileSync133(tmpOut);
|
|
584798
584798
|
resizedBase64 = `data:image/jpeg;base64,${resizedBuf.toString("base64")}`;
|
|
584799
584799
|
try {
|
|
584800
584800
|
unlinkSync35(tmpIn);
|
|
@@ -600005,7 +600005,7 @@ async function fetchOpenAIModels(baseUrl2, apiKey) {
|
|
|
600005
600005
|
async function fetchPeerModels(peerId, authKey) {
|
|
600006
600006
|
try {
|
|
600007
600007
|
const { NexusTool: NexusTool2 } = await Promise.resolve().then(() => (init_dist5(), dist_exports2));
|
|
600008
|
-
const { existsSync: existsSync164, readFileSync:
|
|
600008
|
+
const { existsSync: existsSync164, readFileSync: readFileSync133 } = await import("node:fs");
|
|
600009
600009
|
const { join: join179 } = await import("node:path");
|
|
600010
600010
|
const cwd4 = process.cwd();
|
|
600011
600011
|
const nexusTool = new NexusTool2(cwd4);
|
|
@@ -600014,7 +600014,7 @@ async function fetchPeerModels(peerId, authKey) {
|
|
|
600014
600014
|
try {
|
|
600015
600015
|
const statusPath = join179(nexusDir, "status.json");
|
|
600016
600016
|
if (existsSync164(statusPath)) {
|
|
600017
|
-
const status = JSON.parse(
|
|
600017
|
+
const status = JSON.parse(readFileSync133(statusPath, "utf8"));
|
|
600018
600018
|
if (status.peerId === peerId) isLocalPeer = true;
|
|
600019
600019
|
}
|
|
600020
600020
|
} catch {
|
|
@@ -600023,7 +600023,7 @@ async function fetchPeerModels(peerId, authKey) {
|
|
|
600023
600023
|
const pricingPath = join179(nexusDir, "pricing.json");
|
|
600024
600024
|
if (existsSync164(pricingPath)) {
|
|
600025
600025
|
try {
|
|
600026
|
-
const pricing = JSON.parse(
|
|
600026
|
+
const pricing = JSON.parse(readFileSync133(pricingPath, "utf8"));
|
|
600027
600027
|
const localModels = (pricing.models || []).map((m2) => ({
|
|
600028
600028
|
name: m2.model || "unknown",
|
|
600029
600029
|
size: m2.parameterSize || "",
|
|
@@ -600039,7 +600039,7 @@ async function fetchPeerModels(peerId, authKey) {
|
|
|
600039
600039
|
const cachePath2 = join179(nexusDir, "peer-models-cache.json");
|
|
600040
600040
|
if (existsSync164(cachePath2)) {
|
|
600041
600041
|
try {
|
|
600042
|
-
const cache8 = JSON.parse(
|
|
600042
|
+
const cache8 = JSON.parse(readFileSync133(cachePath2, "utf8"));
|
|
600043
600043
|
if (cache8.peerId === peerId && cache8.models?.length > 0) {
|
|
600044
600044
|
const age = Date.now() - new Date(cache8.cachedAt).getTime();
|
|
600045
600045
|
if (age < 5 * 60 * 1e3) {
|
|
@@ -600154,7 +600154,7 @@ async function fetchPeerModels(peerId, authKey) {
|
|
|
600154
600154
|
const pricingPath = join179(nexusDir, "pricing.json");
|
|
600155
600155
|
if (existsSync164(pricingPath)) {
|
|
600156
600156
|
try {
|
|
600157
|
-
const pricing = JSON.parse(
|
|
600157
|
+
const pricing = JSON.parse(readFileSync133(pricingPath, "utf8"));
|
|
600158
600158
|
return (pricing.models || []).map((m2) => ({
|
|
600159
600159
|
name: m2.model || "unknown",
|
|
600160
600160
|
size: m2.parameterSize || "",
|
|
@@ -611686,7 +611686,7 @@ __export(status_bar_exports, {
|
|
|
611686
611686
|
setTerminalTitle: () => setTerminalTitle,
|
|
611687
611687
|
unlockFooterRedraws: () => unlockFooterRedraws
|
|
611688
611688
|
});
|
|
611689
|
-
import {
|
|
611689
|
+
import { readFile as readFileAsync } from "node:fs/promises";
|
|
611690
611690
|
function headerButtonGlyphFg() {
|
|
611691
611691
|
const a2 = tuiAccent();
|
|
611692
611692
|
return a2 < 0 ? "\x1B[39m" : `\x1B[38;5;${a2}m`;
|
|
@@ -613364,7 +613364,7 @@ var init_status_bar = __esm({
|
|
|
613364
613364
|
if (nexusDir) {
|
|
613365
613365
|
try {
|
|
613366
613366
|
const metricsPath = nexusDir + "/remote-metrics.json";
|
|
613367
|
-
const raw =
|
|
613367
|
+
const raw = await readFileAsync(metricsPath, "utf8");
|
|
613368
613368
|
const cached = JSON.parse(raw);
|
|
613369
613369
|
if (cached && cached.ts && Date.now() - cached.ts < 6e4) {
|
|
613370
613370
|
const m2 = cached.data;
|
|
@@ -616992,7 +616992,7 @@ __export(personaplex_exports, {
|
|
|
616992
616992
|
startPersonaPlexDaemon: () => startPersonaPlexDaemon,
|
|
616993
616993
|
stopPersonaPlex: () => stopPersonaPlex
|
|
616994
616994
|
});
|
|
616995
|
-
import { existsSync as existsSync117, writeFileSync as writeFileSync60, readFileSync as
|
|
616995
|
+
import { existsSync as existsSync117, writeFileSync as writeFileSync60, readFileSync as readFileSync95, mkdirSync as mkdirSync70, copyFileSync as copyFileSync5, readdirSync as readdirSync39, statSync as statSync43 } from "node:fs";
|
|
616996
616996
|
import { join as join131, dirname as dirname42 } from "node:path";
|
|
616997
616997
|
import { homedir as homedir41 } from "node:os";
|
|
616998
616998
|
import { execSync as execSync52, spawn as spawn28 } from "node:child_process";
|
|
@@ -617031,7 +617031,7 @@ function selectWeightTier(vramGB) {
|
|
|
617031
617031
|
}
|
|
617032
617032
|
function detectJetson() {
|
|
617033
617033
|
try {
|
|
617034
|
-
const model =
|
|
617034
|
+
const model = readFileSync95("/proc/device-tree/model", "utf8").replace(/\0/g, "").trim();
|
|
617035
617035
|
if (/jetson|orin|tegra/i.test(model)) {
|
|
617036
617036
|
const memInfo = execSync52("grep MemTotal /proc/meminfo", { encoding: "utf8", timeout: 3e3, stdio: "pipe" });
|
|
617037
617037
|
const memKB = parseInt(memInfo.match(/(\d+)/)?.[1] ?? "0", 10);
|
|
@@ -617110,7 +617110,7 @@ function fileLink2(filePath, label) {
|
|
|
617110
617110
|
}
|
|
617111
617111
|
function isPersonaPlexRunning() {
|
|
617112
617112
|
if (!existsSync117(PID_FILE)) return false;
|
|
617113
|
-
const pid = parseInt(
|
|
617113
|
+
const pid = parseInt(readFileSync95(PID_FILE, "utf8").trim(), 10);
|
|
617114
617114
|
if (isNaN(pid) || pid <= 0) return false;
|
|
617115
617115
|
try {
|
|
617116
617116
|
process.kill(pid, 0);
|
|
@@ -617122,7 +617122,7 @@ function isPersonaPlexRunning() {
|
|
|
617122
617122
|
function getPersonaPlexWSUrl() {
|
|
617123
617123
|
if (!isPersonaPlexRunning()) return null;
|
|
617124
617124
|
if (!existsSync117(PORT_FILE)) return null;
|
|
617125
|
-
const port = parseInt(
|
|
617125
|
+
const port = parseInt(readFileSync95(PORT_FILE, "utf8").trim(), 10);
|
|
617126
617126
|
return isNaN(port) ? null : `wss://127.0.0.1:${port}`;
|
|
617127
617127
|
}
|
|
617128
617128
|
function isPersonaPlexInstalled() {
|
|
@@ -617132,7 +617132,7 @@ function getWeightTier() {
|
|
|
617132
617132
|
const detected = detectPersonaPlexCapability();
|
|
617133
617133
|
const tierFile = join131(PERSONAPLEX_DIR, "weight_tier");
|
|
617134
617134
|
if (existsSync117(tierFile)) {
|
|
617135
|
-
const saved =
|
|
617135
|
+
const saved = readFileSync95(tierFile, "utf8").trim();
|
|
617136
617136
|
if (saved in WEIGHT_REPOS) {
|
|
617137
617137
|
const vram = detected.vramGB;
|
|
617138
617138
|
if (saved === "nf4-distilled" && vram < 24) {
|
|
@@ -617264,7 +617264,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
617264
617264
|
}).trim();
|
|
617265
617265
|
const serverFile = join131(sitePackages, "server.py");
|
|
617266
617266
|
if (existsSync117(serverFile)) {
|
|
617267
|
-
let src2 =
|
|
617267
|
+
let src2 = readFileSync95(serverFile, "utf8");
|
|
617268
617268
|
if (src2.includes('int(request["seed"])')) {
|
|
617269
617269
|
src2 = src2.replace('int(request["seed"])', 'int(request.query["seed"])');
|
|
617270
617270
|
writeFileSync60(serverFile, src2);
|
|
@@ -617282,7 +617282,7 @@ async function installPersonaPlex(onInfo, weightTier) {
|
|
|
617282
617282
|
}).trim();
|
|
617283
617283
|
const loadersFile = join131(sitePackages, "models", "loaders.py");
|
|
617284
617284
|
if (existsSync117(loadersFile)) {
|
|
617285
|
-
let src2 =
|
|
617285
|
+
let src2 = readFileSync95(loadersFile, "utf8");
|
|
617286
617286
|
if (!src2.includes("_dequantize_2bit_state_dict")) {
|
|
617287
617287
|
const dequantPatch = `
|
|
617288
617288
|
import math
|
|
@@ -617387,28 +617387,28 @@ $2if filename.endswith(".safetensors"):`
|
|
|
617387
617387
|
}).trim();
|
|
617388
617388
|
const hybridDest = join131(sitePackages2, "hybrid_agent.py");
|
|
617389
617389
|
const serverDest = join131(sitePackages2, "server.py");
|
|
617390
|
-
if (!existsSync117(hybridDest) || !
|
|
617390
|
+
if (!existsSync117(hybridDest) || !readFileSync95(hybridDest, "utf8").includes("OMNIUS_API_BASE")) {
|
|
617391
617391
|
log22("Deploying hybrid_agent.py (Omnius API integration)...");
|
|
617392
617392
|
try {
|
|
617393
617393
|
await execAsync(
|
|
617394
617394
|
`curl -sL "https://raw.githubusercontent.com/robit-man/personaplex/main/personaplex-setup/moshi/moshi/hybrid_agent.py" -o "${hybridDest}"`,
|
|
617395
617395
|
{ timeout: 3e4 }
|
|
617396
617396
|
);
|
|
617397
|
-
if (existsSync117(hybridDest) &&
|
|
617397
|
+
if (existsSync117(hybridDest) && readFileSync95(hybridDest, "utf8").includes("OMNIUS_API_BASE")) {
|
|
617398
617398
|
log22("hybrid_agent.py deployed (Omnius API + Ollama fallback).");
|
|
617399
617399
|
}
|
|
617400
617400
|
} catch {
|
|
617401
617401
|
log22("hybrid_agent.py download failed — hybrid mode will be disabled.");
|
|
617402
617402
|
}
|
|
617403
617403
|
}
|
|
617404
|
-
if (!
|
|
617404
|
+
if (!readFileSync95(serverDest, "utf8").includes("hybrid_agent")) {
|
|
617405
617405
|
log22("Deploying patched server.py (hybrid mode + API endpoints)...");
|
|
617406
617406
|
try {
|
|
617407
617407
|
await execAsync(
|
|
617408
617408
|
`curl -sL "https://raw.githubusercontent.com/robit-man/personaplex/main/personaplex-setup/moshi/moshi/server.py" -o "${serverDest}"`,
|
|
617409
617409
|
{ timeout: 3e4 }
|
|
617410
617410
|
);
|
|
617411
|
-
if (
|
|
617411
|
+
if (readFileSync95(serverDest, "utf8").includes("hybrid_agent")) {
|
|
617412
617412
|
log22("server.py patched with hybrid intercept + REST APIs.");
|
|
617413
617413
|
}
|
|
617414
617414
|
} catch {
|
|
@@ -617598,7 +617598,7 @@ print('Converted')
|
|
|
617598
617598
|
let ollamaModel = process.env["HYBRID_LLM_MODEL"] || "";
|
|
617599
617599
|
if (!ollamaModel) {
|
|
617600
617600
|
try {
|
|
617601
|
-
const omniusConfig = JSON.parse(
|
|
617601
|
+
const omniusConfig = JSON.parse(readFileSync95(join131(homedir41(), ".omnius", "config.json"), "utf8"));
|
|
617602
617602
|
if (omniusConfig.model) ollamaModel = omniusConfig.model;
|
|
617603
617603
|
} catch {
|
|
617604
617604
|
}
|
|
@@ -617698,7 +617698,7 @@ print('Converted')
|
|
|
617698
617698
|
}
|
|
617699
617699
|
function stopPersonaPlex() {
|
|
617700
617700
|
if (!existsSync117(PID_FILE)) return;
|
|
617701
|
-
const pid = parseInt(
|
|
617701
|
+
const pid = parseInt(readFileSync95(PID_FILE, "utf8").trim(), 10);
|
|
617702
617702
|
if (isNaN(pid) || pid <= 0) return;
|
|
617703
617703
|
try {
|
|
617704
617704
|
if (process.platform === "win32") {
|
|
@@ -617895,7 +617895,7 @@ function patchFrontendVoiceList(onInfo) {
|
|
|
617895
617895
|
for (const f2 of readdirSync39(distDir)) {
|
|
617896
617896
|
if (!f2.startsWith("index-") || !f2.endsWith(".js")) continue;
|
|
617897
617897
|
const jsPath = join131(distDir, f2);
|
|
617898
|
-
let js =
|
|
617898
|
+
let js = readFileSync95(jsPath, "utf8");
|
|
617899
617899
|
const customVoices = [];
|
|
617900
617900
|
if (existsSync117(CUSTOM_VOICES_DIR)) {
|
|
617901
617901
|
for (const vf of readdirSync39(CUSTOM_VOICES_DIR)) {
|
|
@@ -618015,7 +618015,7 @@ __export(setup_exports, {
|
|
|
618015
618015
|
import * as readline from "node:readline";
|
|
618016
618016
|
import { execSync as execSync53, spawn as spawn29, exec as exec5 } from "node:child_process";
|
|
618017
618017
|
import { promisify as promisify7 } from "node:util";
|
|
618018
|
-
import { existsSync as existsSync118, writeFileSync as writeFileSync61, readFileSync as
|
|
618018
|
+
import { existsSync as existsSync118, writeFileSync as writeFileSync61, readFileSync as readFileSync96, appendFileSync as appendFileSync11, mkdirSync as mkdirSync71 } from "node:fs";
|
|
618019
618019
|
import { join as join132 } from "node:path";
|
|
618020
618020
|
import { homedir as homedir42, platform as platform5 } from "node:os";
|
|
618021
618021
|
function wrapText2(value2, width) {
|
|
@@ -618071,14 +618071,14 @@ function detectUnifiedMemory(hasDiscreteGpu = false) {
|
|
|
618071
618071
|
}
|
|
618072
618072
|
try {
|
|
618073
618073
|
if (existsSync118("/sys/devices/soc0/family")) {
|
|
618074
|
-
const family =
|
|
618074
|
+
const family = readFileSync96("/sys/devices/soc0/family", "utf8").trim().toLowerCase();
|
|
618075
618075
|
if (family.includes("tegra")) return true;
|
|
618076
618076
|
}
|
|
618077
618077
|
} catch {
|
|
618078
618078
|
}
|
|
618079
618079
|
try {
|
|
618080
618080
|
if (existsSync118("/proc/device-tree/model")) {
|
|
618081
|
-
const model =
|
|
618081
|
+
const model = readFileSync96("/proc/device-tree/model", "utf8").replace(/\0+$/, "").toLowerCase();
|
|
618082
618082
|
if (/jetson|tegra|orin|xavier|nano|raspberry|rockchip|rk\d{4}|mt\d{4}/.test(model)) {
|
|
618083
618083
|
return true;
|
|
618084
618084
|
}
|
|
@@ -620014,7 +620014,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
|
|
|
620014
620014
|
let _visionPreviouslyInstalled = /* @__PURE__ */ new Set();
|
|
620015
620015
|
try {
|
|
620016
620016
|
if (existsSync118(_visionMarkerFile)) {
|
|
620017
|
-
const _vm = JSON.parse(
|
|
620017
|
+
const _vm = JSON.parse(readFileSync96(_visionMarkerFile, "utf8"));
|
|
620018
620018
|
_visionPreviouslyInstalled = new Set(_vm.installed || []);
|
|
620019
620019
|
}
|
|
620020
620020
|
} catch {
|
|
@@ -620857,7 +620857,7 @@ function ensurePathInShellRc(binDir) {
|
|
|
620857
620857
|
const shell = process.env.SHELL ?? "";
|
|
620858
620858
|
const rcFile = shell.includes("zsh") ? join132(homedir42(), ".zshrc") : join132(homedir42(), ".bashrc");
|
|
620859
620859
|
try {
|
|
620860
|
-
const rcContent = existsSync118(rcFile) ?
|
|
620860
|
+
const rcContent = existsSync118(rcFile) ? readFileSync96(rcFile, "utf8") : "";
|
|
620861
620861
|
if (rcContent.includes(binDir)) return;
|
|
620862
620862
|
const exportLine = `
|
|
620863
620863
|
export PATH="${binDir}:$PATH" # Added by omnius for nvim
|
|
@@ -621637,7 +621637,7 @@ var init_platforms = __esm({
|
|
|
621637
621637
|
});
|
|
621638
621638
|
|
|
621639
621639
|
// packages/cli/src/tui/workspace-explorer.ts
|
|
621640
|
-
import { existsSync as existsSync120, readdirSync as readdirSync40, readFileSync as
|
|
621640
|
+
import { existsSync as existsSync120, readdirSync as readdirSync40, readFileSync as readFileSync97, statSync as statSync44 } from "node:fs";
|
|
621641
621641
|
import { basename as basename24, extname as extname17, join as join133, relative as relative13, resolve as resolve54 } from "node:path";
|
|
621642
621642
|
function exploreWorkspace(root, options2 = {}) {
|
|
621643
621643
|
const query = (options2.query ?? "").trim().toLowerCase();
|
|
@@ -621736,7 +621736,7 @@ function previewWorkspaceFile(root, relPath, options2 = {}) {
|
|
|
621736
621736
|
""
|
|
621737
621737
|
].join("\n");
|
|
621738
621738
|
}
|
|
621739
|
-
const content =
|
|
621739
|
+
const content = readFileSync97(full, "utf8");
|
|
621740
621740
|
const rawLines = content.split(/\r?\n/);
|
|
621741
621741
|
const visible = rawLines.slice(0, maxLines);
|
|
621742
621742
|
const gutter = String(Math.min(rawLines.length, maxLines)).length;
|
|
@@ -621912,7 +621912,7 @@ var init_pricing = __esm({
|
|
|
621912
621912
|
});
|
|
621913
621913
|
|
|
621914
621914
|
// packages/cli/src/insights/engine.ts
|
|
621915
|
-
import { readdirSync as readdirSync41, readFileSync as
|
|
621915
|
+
import { readdirSync as readdirSync41, readFileSync as readFileSync98, existsSync as existsSync121 } from "node:fs";
|
|
621916
621916
|
import { join as join134 } from "node:path";
|
|
621917
621917
|
function formatDuration5(seconds) {
|
|
621918
621918
|
if (seconds < 60) return `${Math.round(seconds)}s`;
|
|
@@ -621987,7 +621987,7 @@ var init_engine = __esm({
|
|
|
621987
621987
|
return readdirSync41(this.historyDir).filter((f2) => f2.endsWith(".json") && f2 !== "pending-task.json").map((f2) => {
|
|
621988
621988
|
try {
|
|
621989
621989
|
const data = JSON.parse(
|
|
621990
|
-
|
|
621990
|
+
readFileSync98(join134(this.historyDir, f2), "utf-8")
|
|
621991
621991
|
);
|
|
621992
621992
|
return data;
|
|
621993
621993
|
} catch {
|
|
@@ -622005,7 +622005,7 @@ var init_engine = __esm({
|
|
|
622005
622005
|
loadUsageStore() {
|
|
622006
622006
|
try {
|
|
622007
622007
|
if (existsSync121(this.usageFile)) {
|
|
622008
|
-
return JSON.parse(
|
|
622008
|
+
return JSON.parse(readFileSync98(this.usageFile, "utf-8"));
|
|
622009
622009
|
}
|
|
622010
622010
|
} catch {
|
|
622011
622011
|
}
|
|
@@ -624788,7 +624788,7 @@ var init_memory_menu = __esm({
|
|
|
624788
624788
|
});
|
|
624789
624789
|
|
|
624790
624790
|
// packages/cli/src/tui/audio-waveform.ts
|
|
624791
|
-
import { readFileSync as
|
|
624791
|
+
import { readFileSync as readFileSync99 } from "node:fs";
|
|
624792
624792
|
import { createRequire as createRequire5 } from "node:module";
|
|
624793
624793
|
function readAscii(buffer2, offset, length4) {
|
|
624794
624794
|
return buffer2.subarray(offset, offset + length4).toString("ascii");
|
|
@@ -624862,7 +624862,7 @@ function renderAudioWaveform(file, options2 = {}) {
|
|
|
624862
624862
|
} catch {
|
|
624863
624863
|
return null;
|
|
624864
624864
|
}
|
|
624865
|
-
const buffer2 =
|
|
624865
|
+
const buffer2 = readFileSync99(file);
|
|
624866
624866
|
const info = parseWav(buffer2);
|
|
624867
624867
|
if (!info) return null;
|
|
624868
624868
|
const frameCount = Math.floor(info.dataSize / info.frameSize);
|
|
@@ -625418,7 +625418,7 @@ __export(daemon_exports, {
|
|
|
625418
625418
|
stopDaemon: () => stopDaemon
|
|
625419
625419
|
});
|
|
625420
625420
|
import { spawn as spawn30 } from "node:child_process";
|
|
625421
|
-
import { existsSync as existsSync125, readFileSync as
|
|
625421
|
+
import { existsSync as existsSync125, readFileSync as readFileSync100, writeFileSync as writeFileSync62, mkdirSync as mkdirSync72, unlinkSync as unlinkSync24, openSync as openSync3, closeSync as closeSync3 } from "node:fs";
|
|
625422
625422
|
import { join as join137 } from "node:path";
|
|
625423
625423
|
import { homedir as homedir44 } from "node:os";
|
|
625424
625424
|
import { fileURLToPath as fileURLToPath17 } from "node:url";
|
|
@@ -625449,7 +625449,7 @@ function getLocalCliVersion() {
|
|
|
625449
625449
|
for (const rel of ["../package.json", "../../package.json", "./package.json", "../../../package.json"]) {
|
|
625450
625450
|
const p2 = join137(here, rel);
|
|
625451
625451
|
if (existsSync125(p2)) {
|
|
625452
|
-
const v = JSON.parse(
|
|
625452
|
+
const v = JSON.parse(readFileSync100(p2, "utf8"))?.version;
|
|
625453
625453
|
if (v) return String(v);
|
|
625454
625454
|
}
|
|
625455
625455
|
}
|
|
@@ -625488,7 +625488,7 @@ async function restartDaemon(port) {
|
|
|
625488
625488
|
function getDaemonPid() {
|
|
625489
625489
|
if (!existsSync125(PID_FILE2)) return null;
|
|
625490
625490
|
try {
|
|
625491
|
-
const pid = parseInt(
|
|
625491
|
+
const pid = parseInt(readFileSync100(PID_FILE2, "utf8").trim(), 10);
|
|
625492
625492
|
if (!pid || pid <= 0) return null;
|
|
625493
625493
|
process.kill(pid, 0);
|
|
625494
625494
|
return pid;
|
|
@@ -625503,7 +625503,7 @@ function getDaemonPid() {
|
|
|
625503
625503
|
function looksLikeNodeEntrypoint(path12) {
|
|
625504
625504
|
if (/\.(?:mjs|cjs|js)$/i.test(path12)) return true;
|
|
625505
625505
|
try {
|
|
625506
|
-
const firstBytes =
|
|
625506
|
+
const firstBytes = readFileSync100(path12, "utf8").slice(0, 200);
|
|
625507
625507
|
return /^#!.*\bnode\b/.test(firstBytes);
|
|
625508
625508
|
} catch {
|
|
625509
625509
|
return false;
|
|
@@ -625852,7 +625852,7 @@ var init_types5 = __esm({
|
|
|
625852
625852
|
|
|
625853
625853
|
// packages/cli/src/cron/store.ts
|
|
625854
625854
|
import {
|
|
625855
|
-
readFileSync as
|
|
625855
|
+
readFileSync as readFileSync101,
|
|
625856
625856
|
writeFileSync as writeFileSync63,
|
|
625857
625857
|
mkdirSync as mkdirSync73,
|
|
625858
625858
|
chmodSync as chmodSync3,
|
|
@@ -626039,7 +626039,7 @@ function loadJobs() {
|
|
|
626039
626039
|
const path12 = jobsFilePath();
|
|
626040
626040
|
if (!existsSync127(path12)) return [];
|
|
626041
626041
|
try {
|
|
626042
|
-
const data = JSON.parse(
|
|
626042
|
+
const data = JSON.parse(readFileSync101(path12, "utf-8"));
|
|
626043
626043
|
return data.jobs || [];
|
|
626044
626044
|
} catch {
|
|
626045
626045
|
return [];
|
|
@@ -626407,7 +626407,7 @@ import {
|
|
|
626407
626407
|
closeSync as closeSync5,
|
|
626408
626408
|
writeFileSync as writeFileSync64,
|
|
626409
626409
|
unlinkSync as unlinkSync26,
|
|
626410
|
-
readFileSync as
|
|
626410
|
+
readFileSync as readFileSync102
|
|
626411
626411
|
} from "node:fs";
|
|
626412
626412
|
import { join as join140 } from "node:path";
|
|
626413
626413
|
import { homedir as homedir46 } from "node:os";
|
|
@@ -626424,7 +626424,7 @@ function acquireTickLock() {
|
|
|
626424
626424
|
mkdirSync74(cronDir2(), { recursive: true });
|
|
626425
626425
|
try {
|
|
626426
626426
|
if (existsSync128(lockPath)) {
|
|
626427
|
-
const content =
|
|
626427
|
+
const content = readFileSync102(lockPath, "utf-8").trim();
|
|
626428
626428
|
if (content) {
|
|
626429
626429
|
const lock = JSON.parse(content);
|
|
626430
626430
|
const age = Date.now() - lock.acquiredAt;
|
|
@@ -626792,7 +626792,7 @@ __export(sponsor_wizard_exports, {
|
|
|
626792
626792
|
selectedModelsForEndpoint: () => selectedModelsForEndpoint,
|
|
626793
626793
|
showSponsorDashboard: () => showSponsorDashboard
|
|
626794
626794
|
});
|
|
626795
|
-
import { existsSync as existsSync129, readFileSync as
|
|
626795
|
+
import { existsSync as existsSync129, readFileSync as readFileSync103, writeFileSync as writeFileSync65, mkdirSync as mkdirSync75 } from "node:fs";
|
|
626796
626796
|
import { join as join141 } from "node:path";
|
|
626797
626797
|
function fmtTokens2(n2) {
|
|
626798
626798
|
if (n2 < 1e3) return String(Math.max(0, Math.floor(n2)));
|
|
@@ -626813,7 +626813,7 @@ function loadSponsorConfig(projectDir2) {
|
|
|
626813
626813
|
const p2 = configPath(projectDir2);
|
|
626814
626814
|
if (!existsSync129(p2)) return null;
|
|
626815
626815
|
try {
|
|
626816
|
-
return JSON.parse(
|
|
626816
|
+
return JSON.parse(readFileSync103(p2, "utf8"));
|
|
626817
626817
|
} catch {
|
|
626818
626818
|
return null;
|
|
626819
626819
|
}
|
|
@@ -628152,7 +628152,7 @@ __export(image_ascii_preview_exports, {
|
|
|
628152
628152
|
});
|
|
628153
628153
|
import { execFileSync as execFileSync9 } from "node:child_process";
|
|
628154
628154
|
import { createRequire as createRequire6 } from "node:module";
|
|
628155
|
-
import { existsSync as existsSync130, readFileSync as
|
|
628155
|
+
import { existsSync as existsSync130, readFileSync as readFileSync104, statSync as statSync46 } from "node:fs";
|
|
628156
628156
|
import { resolve as resolve56 } from "node:path";
|
|
628157
628157
|
function clamp8(n2, min, max) {
|
|
628158
628158
|
if (!Number.isFinite(n2)) return min;
|
|
@@ -628168,7 +628168,7 @@ function defaultAsciiPreviewSize(dimensions) {
|
|
|
628168
628168
|
}
|
|
628169
628169
|
function readImageDimensions2(imagePath) {
|
|
628170
628170
|
try {
|
|
628171
|
-
const buf =
|
|
628171
|
+
const buf = readFileSync104(imagePath);
|
|
628172
628172
|
if (buf.length >= 24 && buf.toString("ascii", 1, 4) === "PNG") {
|
|
628173
628173
|
return { width: buf.readUInt32BE(16), height: buf.readUInt32BE(20) };
|
|
628174
628174
|
}
|
|
@@ -628534,7 +628534,7 @@ import {
|
|
|
628534
628534
|
existsSync as existsSync131,
|
|
628535
628535
|
mkdirSync as mkdirSync76,
|
|
628536
628536
|
writeFileSync as writeFileSync66,
|
|
628537
|
-
readFileSync as
|
|
628537
|
+
readFileSync as readFileSync105,
|
|
628538
628538
|
unlinkSync as unlinkSync27,
|
|
628539
628539
|
readdirSync as readdirSync43,
|
|
628540
628540
|
statSync as statSync47,
|
|
@@ -630030,7 +630030,7 @@ except Exception as exc:
|
|
|
630030
630030
|
const destFilename = `clone-${srcName}-${ts}.${ext}`;
|
|
630031
630031
|
const destPath = join142(refsDir, destFilename);
|
|
630032
630032
|
try {
|
|
630033
|
-
const data =
|
|
630033
|
+
const data = readFileSync105(audioPath);
|
|
630034
630034
|
writeFileSync66(destPath, data);
|
|
630035
630035
|
} catch (err) {
|
|
630036
630036
|
return `Failed to copy audio file: ${err instanceof Error ? err.message : String(err)}`;
|
|
@@ -630105,7 +630105,7 @@ except Exception as exc:
|
|
|
630105
630105
|
const p2 = _VoiceEngine.cloneMetaFile();
|
|
630106
630106
|
if (!existsSync131(p2)) return {};
|
|
630107
630107
|
try {
|
|
630108
|
-
const raw = JSON.parse(
|
|
630108
|
+
const raw = JSON.parse(readFileSync105(p2, "utf8"));
|
|
630109
630109
|
if (typeof Object.values(raw)[0] === "string") {
|
|
630110
630110
|
const migrated = {};
|
|
630111
630111
|
for (const [k, v] of Object.entries(raw)) {
|
|
@@ -630988,7 +630988,7 @@ except Exception as exc:
|
|
|
630988
630988
|
}
|
|
630989
630989
|
loadMisottsStore() {
|
|
630990
630990
|
try {
|
|
630991
|
-
const raw = JSON.parse(
|
|
630991
|
+
const raw = JSON.parse(readFileSync105(misottsProfilesFile(), "utf-8"));
|
|
630992
630992
|
const profiles = {};
|
|
630993
630993
|
for (const [name10, settings] of Object.entries(raw.profiles ?? {})) {
|
|
630994
630994
|
profiles[name10] = normalizeMisottsSettings(settings);
|
|
@@ -631012,7 +631012,7 @@ except Exception as exc:
|
|
|
631012
631012
|
loadSupertonicStore() {
|
|
631013
631013
|
try {
|
|
631014
631014
|
const raw = JSON.parse(
|
|
631015
|
-
|
|
631015
|
+
readFileSync105(supertonicProfilesFile(), "utf-8")
|
|
631016
631016
|
);
|
|
631017
631017
|
const profiles = {};
|
|
631018
631018
|
for (const [name10, settings] of Object.entries(raw.profiles ?? {})) {
|
|
@@ -631182,7 +631182,7 @@ except Exception as exc:
|
|
|
631182
631182
|
const wavPath = await this.synthesizeSupertonicWav(text2, 1);
|
|
631183
631183
|
if (!wavPath) return null;
|
|
631184
631184
|
try {
|
|
631185
|
-
const data =
|
|
631185
|
+
const data = readFileSync105(wavPath);
|
|
631186
631186
|
unlinkSync27(wavPath);
|
|
631187
631187
|
return data;
|
|
631188
631188
|
} catch {
|
|
@@ -631352,7 +631352,7 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
631352
631352
|
if (!existsSync131(wavPath)) return;
|
|
631353
631353
|
if (volume !== 1) {
|
|
631354
631354
|
try {
|
|
631355
|
-
const wavData =
|
|
631355
|
+
const wavData = readFileSync105(wavPath);
|
|
631356
631356
|
if (wavData.length > 44) {
|
|
631357
631357
|
const header = wavData.subarray(0, 44);
|
|
631358
631358
|
const samples = new Int16Array(
|
|
@@ -631374,7 +631374,7 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
631374
631374
|
}
|
|
631375
631375
|
if (this.onPCMOutput) {
|
|
631376
631376
|
try {
|
|
631377
|
-
const wavData =
|
|
631377
|
+
const wavData = readFileSync105(wavPath);
|
|
631378
631378
|
if (wavData.length > 44) {
|
|
631379
631379
|
const pcm = Buffer.from(
|
|
631380
631380
|
wavData.buffer,
|
|
@@ -631432,7 +631432,7 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`
|
|
|
631432
631432
|
}
|
|
631433
631433
|
if (!existsSync131(wavPath)) return null;
|
|
631434
631434
|
try {
|
|
631435
|
-
const data =
|
|
631435
|
+
const data = readFileSync105(wavPath);
|
|
631436
631436
|
unlinkSync27(wavPath);
|
|
631437
631437
|
return data;
|
|
631438
631438
|
} catch {
|
|
@@ -632335,7 +632335,7 @@ if __name__ == '__main__':
|
|
|
632335
632335
|
async postProcessAndPlayLuxtts(wavPath, volume = 1, pitchFactor = 1, stereoDelayMs = 0.6) {
|
|
632336
632336
|
if (!existsSync131(wavPath)) return;
|
|
632337
632337
|
try {
|
|
632338
|
-
const wavData =
|
|
632338
|
+
const wavData = readFileSync105(wavPath);
|
|
632339
632339
|
if (wavData.length > 44) {
|
|
632340
632340
|
const sampleRate = wavData.readUInt32LE(24);
|
|
632341
632341
|
const samples = new Int16Array(
|
|
@@ -632366,7 +632366,7 @@ if __name__ == '__main__':
|
|
|
632366
632366
|
}
|
|
632367
632367
|
if (pitchFactor !== 1) {
|
|
632368
632368
|
try {
|
|
632369
|
-
const wavData =
|
|
632369
|
+
const wavData = readFileSync105(wavPath);
|
|
632370
632370
|
if (wavData.length > 44) {
|
|
632371
632371
|
const int16 = new Int16Array(
|
|
632372
632372
|
wavData.buffer,
|
|
@@ -632385,7 +632385,7 @@ if __name__ == '__main__':
|
|
|
632385
632385
|
}
|
|
632386
632386
|
if (this.onPCMOutput) {
|
|
632387
632387
|
try {
|
|
632388
|
-
const wavData =
|
|
632388
|
+
const wavData = readFileSync105(wavPath);
|
|
632389
632389
|
if (wavData.length > 44) {
|
|
632390
632390
|
const pcm = Buffer.from(
|
|
632391
632391
|
wavData.buffer,
|
|
@@ -632400,7 +632400,7 @@ if __name__ == '__main__':
|
|
|
632400
632400
|
}
|
|
632401
632401
|
if (stereoDelayMs > 0) {
|
|
632402
632402
|
try {
|
|
632403
|
-
const wavData =
|
|
632403
|
+
const wavData = readFileSync105(wavPath);
|
|
632404
632404
|
if (wavData.length > 44) {
|
|
632405
632405
|
const sampleRate = wavData.readUInt32LE(24);
|
|
632406
632406
|
const numChannels = wavData.readUInt16LE(22);
|
|
@@ -632467,7 +632467,7 @@ if __name__ == '__main__':
|
|
|
632467
632467
|
}
|
|
632468
632468
|
if (!existsSync131(wavPath)) return null;
|
|
632469
632469
|
try {
|
|
632470
|
-
const data =
|
|
632470
|
+
const data = readFileSync105(wavPath);
|
|
632471
632471
|
unlinkSync27(wavPath);
|
|
632472
632472
|
return data;
|
|
632473
632473
|
} catch {
|
|
@@ -632702,7 +632702,7 @@ if __name__ == "__main__":
|
|
|
632702
632702
|
async postProcessAndPlayMisotts(wavPath, volume = 1, pitchFactor = 1, stereoDelayMs = 0.6) {
|
|
632703
632703
|
if (!existsSync131(wavPath)) return;
|
|
632704
632704
|
try {
|
|
632705
|
-
const wavData =
|
|
632705
|
+
const wavData = readFileSync105(wavPath);
|
|
632706
632706
|
if (wavData.length > 44) {
|
|
632707
632707
|
const sampleRate = wavData.readUInt32LE(24);
|
|
632708
632708
|
const samples = new Int16Array(
|
|
@@ -632733,7 +632733,7 @@ if __name__ == "__main__":
|
|
|
632733
632733
|
}
|
|
632734
632734
|
if (pitchFactor !== 1) {
|
|
632735
632735
|
try {
|
|
632736
|
-
const wavData =
|
|
632736
|
+
const wavData = readFileSync105(wavPath);
|
|
632737
632737
|
if (wavData.length > 44) {
|
|
632738
632738
|
const int16 = new Int16Array(
|
|
632739
632739
|
wavData.buffer,
|
|
@@ -632752,7 +632752,7 @@ if __name__ == "__main__":
|
|
|
632752
632752
|
}
|
|
632753
632753
|
if (this.onPCMOutput) {
|
|
632754
632754
|
try {
|
|
632755
|
-
const wavData =
|
|
632755
|
+
const wavData = readFileSync105(wavPath);
|
|
632756
632756
|
if (wavData.length > 44) {
|
|
632757
632757
|
const pcm = Buffer.from(
|
|
632758
632758
|
wavData.buffer,
|
|
@@ -632767,7 +632767,7 @@ if __name__ == "__main__":
|
|
|
632767
632767
|
}
|
|
632768
632768
|
if (stereoDelayMs > 0) {
|
|
632769
632769
|
try {
|
|
632770
|
-
const wavData =
|
|
632770
|
+
const wavData = readFileSync105(wavPath);
|
|
632771
632771
|
if (wavData.length > 44) {
|
|
632772
632772
|
const sampleRate = wavData.readUInt32LE(24);
|
|
632773
632773
|
const numChannels = wavData.readUInt16LE(22);
|
|
@@ -632843,7 +632843,7 @@ if __name__ == "__main__":
|
|
|
632843
632843
|
}
|
|
632844
632844
|
if (!existsSync131(wavPath)) return null;
|
|
632845
632845
|
try {
|
|
632846
|
-
const data =
|
|
632846
|
+
const data = readFileSync105(wavPath);
|
|
632847
632847
|
unlinkSync27(wavPath);
|
|
632848
632848
|
return data;
|
|
632849
632849
|
} catch {
|
|
@@ -632864,7 +632864,7 @@ if __name__ == "__main__":
|
|
|
632864
632864
|
};
|
|
632865
632865
|
if (existsSync131(pkgPath)) {
|
|
632866
632866
|
try {
|
|
632867
|
-
const existing = JSON.parse(
|
|
632867
|
+
const existing = JSON.parse(readFileSync105(pkgPath, "utf8"));
|
|
632868
632868
|
if (!existing.dependencies?.["phonemizer"]) {
|
|
632869
632869
|
existing.dependencies = { ...existing.dependencies, ...expectedDeps };
|
|
632870
632870
|
writeFileSync66(pkgPath, JSON.stringify(existing, null, 2));
|
|
@@ -633024,7 +633024,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
|
|
|
633024
633024
|
if (!existsSync131(onnxPath) || !existsSync131(configPath2)) {
|
|
633025
633025
|
throw new Error(`Model files not found for ${this.modelId}`);
|
|
633026
633026
|
}
|
|
633027
|
-
this.config = JSON.parse(
|
|
633027
|
+
this.config = JSON.parse(readFileSync105(configPath2, "utf8"));
|
|
633028
633028
|
this.session = await this.ort.InferenceSession.create(onnxPath, {
|
|
633029
633029
|
executionProviders: ["cpu"],
|
|
633030
633030
|
graphOptimizationLevel: "all"
|
|
@@ -633184,7 +633184,7 @@ import { execSync as nodeExecSync, spawn as nodeSpawn2 } from "node:child_proces
|
|
|
633184
633184
|
import { createHash as createHash36 } from "node:crypto";
|
|
633185
633185
|
import {
|
|
633186
633186
|
existsSync as existsSync132,
|
|
633187
|
-
readFileSync as
|
|
633187
|
+
readFileSync as readFileSync106,
|
|
633188
633188
|
writeFileSync as writeFileSync67,
|
|
633189
633189
|
mkdirSync as mkdirSync77,
|
|
633190
633190
|
readdirSync as readdirSync44,
|
|
@@ -634498,10 +634498,10 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
634498
634498
|
if (!key) {
|
|
634499
634499
|
try {
|
|
634500
634500
|
const { homedir: homedir62 } = await import("node:os");
|
|
634501
|
-
const { readFileSync:
|
|
634501
|
+
const { readFileSync: readFileSync133, existsSync: existsSync164 } = await import("node:fs");
|
|
634502
634502
|
const { join: join179 } = await import("node:path");
|
|
634503
634503
|
const p2 = join179(homedir62(), ".omnius", "api.key");
|
|
634504
|
-
if (existsSync164(p2)) key =
|
|
634504
|
+
if (existsSync164(p2)) key = readFileSync133(p2, "utf8").trim();
|
|
634505
634505
|
} catch {
|
|
634506
634506
|
}
|
|
634507
634507
|
}
|
|
@@ -635353,7 +635353,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
635353
635353
|
try {
|
|
635354
635354
|
const pidFile = join143(nexus.getNexusDir(), "daemon.pid");
|
|
635355
635355
|
if (existsSync132(pidFile)) {
|
|
635356
|
-
const pid = parseInt(
|
|
635356
|
+
const pid = parseInt(readFileSync106(pidFile, "utf8").trim(), 10);
|
|
635357
635357
|
if (pid > 0 && !registry2.daemons.has("Nexus")) {
|
|
635358
635358
|
registry2.register({
|
|
635359
635359
|
name: "Nexus",
|
|
@@ -635776,7 +635776,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
635776
635776
|
renderWarning(`Tool not found: ${toolFile}`);
|
|
635777
635777
|
return "handled";
|
|
635778
635778
|
}
|
|
635779
|
-
content =
|
|
635779
|
+
content = readFileSync106(toolFile, "utf8");
|
|
635780
635780
|
metadata = { type: "tool", name: shareName };
|
|
635781
635781
|
} else if (shareType === "skill") {
|
|
635782
635782
|
const skillDir = join143(ctx3.repoRoot, ".omnius", "skills", shareName);
|
|
@@ -635785,7 +635785,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
635785
635785
|
renderWarning(`Skill not found: ${skillFile}`);
|
|
635786
635786
|
return "handled";
|
|
635787
635787
|
}
|
|
635788
|
-
content =
|
|
635788
|
+
content = readFileSync106(skillFile, "utf8");
|
|
635789
635789
|
metadata = { type: "skill", name: shareName };
|
|
635790
635790
|
} else {
|
|
635791
635791
|
renderWarning(
|
|
@@ -635858,7 +635858,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
635858
635858
|
"learning-cids.json"
|
|
635859
635859
|
);
|
|
635860
635860
|
if (existsSync132(regFile)) {
|
|
635861
|
-
const reg2 = JSON.parse(
|
|
635861
|
+
const reg2 = JSON.parse(readFileSync106(regFile, "utf8"));
|
|
635862
635862
|
const pinned = Object.values(reg2).some(
|
|
635863
635863
|
(e2) => e2.cid === importCid && e2.pinned
|
|
635864
635864
|
);
|
|
@@ -635976,7 +635976,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
635976
635976
|
).getNexusDir();
|
|
635977
635977
|
const statusFile = join143(nexusDir, "status.json");
|
|
635978
635978
|
if (existsSync132(statusFile)) {
|
|
635979
|
-
const status = JSON.parse(
|
|
635979
|
+
const status = JSON.parse(readFileSync106(statusFile, "utf8"));
|
|
635980
635980
|
if (status.peerId) {
|
|
635981
635981
|
lines.push(`
|
|
635982
635982
|
${c3.bold("Peer Info")}`);
|
|
@@ -636001,7 +636001,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
636001
636001
|
try {
|
|
636002
636002
|
const stateFile = join143(idDir, "self-state.json");
|
|
636003
636003
|
if (existsSync132(stateFile)) {
|
|
636004
|
-
const state = JSON.parse(
|
|
636004
|
+
const state = JSON.parse(readFileSync106(stateFile, "utf8"));
|
|
636005
636005
|
lines.push(
|
|
636006
636006
|
` Version: ${c3.bold("v" + (state.version ?? "?"))} Sessions: ${c3.bold(String(state.session_count ?? 0))}`
|
|
636007
636007
|
);
|
|
@@ -636016,7 +636016,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
636016
636016
|
}
|
|
636017
636017
|
const cidFile = join143(idDir, "cids.json");
|
|
636018
636018
|
if (existsSync132(cidFile)) {
|
|
636019
|
-
const cids = JSON.parse(
|
|
636019
|
+
const cids = JSON.parse(readFileSync106(cidFile, "utf8"));
|
|
636020
636020
|
const lastCid = Array.isArray(cids) ? cids[cids.length - 1] : cids.latest;
|
|
636021
636021
|
if (lastCid)
|
|
636022
636022
|
lines.push(
|
|
@@ -636041,7 +636041,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
636041
636041
|
"store.json"
|
|
636042
636042
|
);
|
|
636043
636043
|
if (existsSync132(metaFile2)) {
|
|
636044
|
-
const store2 = JSON.parse(
|
|
636044
|
+
const store2 = JSON.parse(readFileSync106(metaFile2, "utf8"));
|
|
636045
636045
|
const active = store2.filter((m2) => m2.type !== "quarantine");
|
|
636046
636046
|
const recoveries = active.filter(
|
|
636047
636047
|
(m2) => m2.content?.startsWith("[recovery]")
|
|
@@ -636282,7 +636282,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
636282
636282
|
return "handled";
|
|
636283
636283
|
}
|
|
636284
636284
|
} else {
|
|
636285
|
-
content =
|
|
636285
|
+
content = readFileSync106(resolvedPath, "utf8");
|
|
636286
636286
|
}
|
|
636287
636287
|
if (!content.trim()) {
|
|
636288
636288
|
renderWarning("No content extracted.");
|
|
@@ -636390,7 +636390,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
636390
636390
|
renderInfo("Fortemi bridge: not connected. Run /fortemi start");
|
|
636391
636391
|
return "handled";
|
|
636392
636392
|
}
|
|
636393
|
-
const bridge = JSON.parse(
|
|
636393
|
+
const bridge = JSON.parse(readFileSync106(bridgeFile, "utf8"));
|
|
636394
636394
|
let alive = false;
|
|
636395
636395
|
try {
|
|
636396
636396
|
process.kill(bridge.pid, 0);
|
|
@@ -636426,7 +636426,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
636426
636426
|
if (fortemiSubCmd === "stop") {
|
|
636427
636427
|
const bridgeFile = join143(ctx3.repoRoot, ".omnius", "fortemi-bridge.json");
|
|
636428
636428
|
if (existsSync132(bridgeFile)) {
|
|
636429
|
-
const bridge = JSON.parse(
|
|
636429
|
+
const bridge = JSON.parse(readFileSync106(bridgeFile, "utf8"));
|
|
636430
636430
|
try {
|
|
636431
636431
|
process.kill(bridge.pid, "SIGTERM");
|
|
636432
636432
|
} catch {
|
|
@@ -638431,7 +638431,7 @@ sleep 1
|
|
|
638431
638431
|
`daemon.pid exists: ${existsSync132(join143(checkedNexusDir, "daemon.pid"))}`
|
|
638432
638432
|
);
|
|
638433
638433
|
try {
|
|
638434
|
-
const _statusRaw =
|
|
638434
|
+
const _statusRaw = readFileSync106(
|
|
638435
638435
|
join143(checkedNexusDir, "status.json"),
|
|
638436
638436
|
"utf8"
|
|
638437
638437
|
);
|
|
@@ -638440,7 +638440,7 @@ sleep 1
|
|
|
638440
638440
|
_spLog(`status.json read error: ${e2}`);
|
|
638441
638441
|
}
|
|
638442
638442
|
try {
|
|
638443
|
-
const _errRaw =
|
|
638443
|
+
const _errRaw = readFileSync106(
|
|
638444
638444
|
join143(checkedNexusDir, "daemon.err"),
|
|
638445
638445
|
"utf8"
|
|
638446
638446
|
);
|
|
@@ -638475,7 +638475,7 @@ sleep 1
|
|
|
638475
638475
|
"agent-name"
|
|
638476
638476
|
);
|
|
638477
638477
|
if (existsSync132(namePath))
|
|
638478
|
-
sponsorName =
|
|
638478
|
+
sponsorName = readFileSync106(namePath, "utf8").trim();
|
|
638479
638479
|
} catch {
|
|
638480
638480
|
}
|
|
638481
638481
|
if (!sponsorName) sponsorName = "Omnius Sponsor";
|
|
@@ -638579,7 +638579,7 @@ sleep 1
|
|
|
638579
638579
|
);
|
|
638580
638580
|
if (existsSync132(nexusPidFile)) {
|
|
638581
638581
|
const nPid = parseInt(
|
|
638582
|
-
|
|
638582
|
+
readFileSync106(nexusPidFile, "utf8").trim(),
|
|
638583
638583
|
10
|
|
638584
638584
|
);
|
|
638585
638585
|
if (nPid > 0) {
|
|
@@ -639878,7 +639878,7 @@ sleep 1
|
|
|
639878
639878
|
if (existsSync132(projectSettingsPath)) {
|
|
639879
639879
|
try {
|
|
639880
639880
|
const projectJson = JSON.parse(
|
|
639881
|
-
|
|
639881
|
+
readFileSync106(projectSettingsPath, "utf8")
|
|
639882
639882
|
);
|
|
639883
639883
|
projectHasKey = typeof projectJson?.telegramKey === "string" && projectJson.telegramKey.length > 0;
|
|
639884
639884
|
} catch {
|
|
@@ -645056,7 +645056,7 @@ async function discoverSponsorMediaCandidates(ctx3, modality) {
|
|
|
645056
645056
|
"known-sponsors.json"
|
|
645057
645057
|
);
|
|
645058
645058
|
if (existsSync132(knownFile)) {
|
|
645059
|
-
const saved = JSON.parse(
|
|
645059
|
+
const saved = JSON.parse(readFileSync106(knownFile, "utf8"));
|
|
645060
645060
|
if (Array.isArray(saved)) rawSponsors.push(...saved);
|
|
645061
645061
|
}
|
|
645062
645062
|
} catch {
|
|
@@ -645206,7 +645206,7 @@ async function collectSponsorMediaStream(args) {
|
|
|
645206
645206
|
while (!done && Date.now() < deadline) {
|
|
645207
645207
|
await new Promise((resolve71) => setTimeout(resolve71, 250));
|
|
645208
645208
|
if (!existsSync132(args.streamFile)) continue;
|
|
645209
|
-
const raw =
|
|
645209
|
+
const raw = readFileSync106(args.streamFile, "utf8");
|
|
645210
645210
|
if (raw.length <= offset) continue;
|
|
645211
645211
|
pending2 += raw.slice(offset);
|
|
645212
645212
|
offset = raw.length;
|
|
@@ -645530,7 +645530,7 @@ async function handleSponsoredEndpoint(ctx3, local) {
|
|
|
645530
645530
|
try {
|
|
645531
645531
|
if (existsSync132(knownFile)) {
|
|
645532
645532
|
const saved = JSON.parse(
|
|
645533
|
-
|
|
645533
|
+
readFileSync106(knownFile, "utf8")
|
|
645534
645534
|
);
|
|
645535
645535
|
for (const s2 of saved) {
|
|
645536
645536
|
if (!sponsors.some((sp) => sp.url === s2.url)) {
|
|
@@ -645706,7 +645706,7 @@ async function handleSponsoredEndpoint(ctx3, local) {
|
|
|
645706
645706
|
const saveKey = selected.url || selected.peerId || selected.name;
|
|
645707
645707
|
try {
|
|
645708
645708
|
mkdirSync77(sponsorDir2, { recursive: true });
|
|
645709
|
-
const existing = existsSync132(knownFile) ? JSON.parse(
|
|
645709
|
+
const existing = existsSync132(knownFile) ? JSON.parse(readFileSync106(knownFile, "utf8")) : [];
|
|
645710
645710
|
const updated = existing.filter(
|
|
645711
645711
|
(s2) => (s2.url || s2.peerId || s2.name) !== saveKey
|
|
645712
645712
|
);
|
|
@@ -648823,7 +648823,7 @@ var init_commands = __esm({
|
|
|
648823
648823
|
});
|
|
648824
648824
|
|
|
648825
648825
|
// packages/cli/src/tui/project-context.ts
|
|
648826
|
-
import { existsSync as existsSync133, readFileSync as
|
|
648826
|
+
import { existsSync as existsSync133, readFileSync as readFileSync107, readdirSync as readdirSync45, mkdirSync as mkdirSync78, writeFileSync as writeFileSync68 } from "node:fs";
|
|
648827
648827
|
import { join as join144, basename as basename26 } from "node:path";
|
|
648828
648828
|
import { execSync as execSync56 } from "node:child_process";
|
|
648829
648829
|
import { homedir as homedir49 } from "node:os";
|
|
@@ -648875,7 +648875,7 @@ function loadProjectMap(repoRoot) {
|
|
|
648875
648875
|
const mapPath2 = join144(repoRoot, OMNIUS_DIR, "context", "project-map.md");
|
|
648876
648876
|
if (existsSync133(mapPath2)) {
|
|
648877
648877
|
try {
|
|
648878
|
-
const content =
|
|
648878
|
+
const content = readFileSync107(mapPath2, "utf-8");
|
|
648879
648879
|
return content;
|
|
648880
648880
|
} catch {
|
|
648881
648881
|
}
|
|
@@ -648924,7 +648924,7 @@ function countJsonMemoryEntries(dir) {
|
|
|
648924
648924
|
if (!file.endsWith(".json")) continue;
|
|
648925
648925
|
topics++;
|
|
648926
648926
|
try {
|
|
648927
|
-
const parsed = JSON.parse(
|
|
648927
|
+
const parsed = JSON.parse(readFileSync107(join144(dir, file), "utf8"));
|
|
648928
648928
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
648929
648929
|
entries += Object.keys(parsed).length;
|
|
648930
648930
|
}
|
|
@@ -648940,7 +648940,7 @@ function countReflectionBuffer(repoRoot) {
|
|
|
648940
648940
|
const path12 = join144(repoRoot, OMNIUS_DIR, "memory", "reflections.json");
|
|
648941
648941
|
if (!existsSync133(path12)) return 0;
|
|
648942
648942
|
try {
|
|
648943
|
-
const parsed = JSON.parse(
|
|
648943
|
+
const parsed = JSON.parse(readFileSync107(path12, "utf8"));
|
|
648944
648944
|
return Array.isArray(parsed.reflections) ? parsed.reflections.length : 0;
|
|
648945
648945
|
} catch {
|
|
648946
648946
|
return 0;
|
|
@@ -648949,7 +648949,7 @@ function countReflectionBuffer(repoRoot) {
|
|
|
648949
648949
|
function countJsonlLines(path12, maxBytes = 1e6) {
|
|
648950
648950
|
if (!existsSync133(path12)) return 0;
|
|
648951
648951
|
try {
|
|
648952
|
-
const text2 =
|
|
648952
|
+
const text2 = readFileSync107(path12, "utf8").slice(-maxBytes);
|
|
648953
648953
|
return text2.split(/\r?\n/).filter((line) => line.trim()).length;
|
|
648954
648954
|
} catch {
|
|
648955
648955
|
return 0;
|
|
@@ -648993,7 +648993,7 @@ function loadMemoryContextBundle(repoRoot, task = "", taskEmbedding) {
|
|
|
648993
648993
|
const files = readdirSync45(dir).filter((f2) => f2.endsWith(".json"));
|
|
648994
648994
|
for (const file of files.slice(0, 10)) {
|
|
648995
648995
|
try {
|
|
648996
|
-
const raw =
|
|
648996
|
+
const raw = readFileSync107(join144(dir, file), "utf-8");
|
|
648997
648997
|
const entries = JSON.parse(raw);
|
|
648998
648998
|
const topic = basename26(file, ".json");
|
|
648999
648999
|
for (const [k, v] of Object.entries(entries)) {
|
|
@@ -649482,7 +649482,7 @@ function loadCustomToolsContext(repoRoot) {
|
|
|
649482
649482
|
const registryPath = join144(repoRoot, ".omnius", "tools", "registry.json");
|
|
649483
649483
|
const indexPath = join144(repoRoot, ".omnius", "tools", "README.md");
|
|
649484
649484
|
if (!existsSync133(registryPath)) return "";
|
|
649485
|
-
const registry4 = JSON.parse(
|
|
649485
|
+
const registry4 = JSON.parse(readFileSync107(registryPath, "utf-8"));
|
|
649486
649486
|
const tools = (registry4.tools ?? []).filter((tool) => tool.qualityGate?.lastTest?.status === "passed").sort((a2, b) => {
|
|
649487
649487
|
const byRate = (b.analytics?.successRate ?? 0) - (a2.analytics?.successRate ?? 0);
|
|
649488
649488
|
if (byRate !== 0) return byRate;
|
|
@@ -649658,7 +649658,7 @@ var init_project_context = __esm({
|
|
|
649658
649658
|
});
|
|
649659
649659
|
|
|
649660
649660
|
// packages/cli/src/realtime.ts
|
|
649661
|
-
import { existsSync as existsSync134, readFileSync as
|
|
649661
|
+
import { existsSync as existsSync134, readFileSync as readFileSync108, readdirSync as readdirSync46 } from "node:fs";
|
|
649662
649662
|
import { basename as basename27, join as join145, resolve as resolve58 } from "node:path";
|
|
649663
649663
|
function clampInt2(value2, fallback, min, max) {
|
|
649664
649664
|
const n2 = typeof value2 === "number" ? value2 : Number.parseInt(String(value2 ?? ""), 10);
|
|
@@ -649680,7 +649680,7 @@ function firstReadable(candidates) {
|
|
|
649680
649680
|
for (const path12 of candidates) {
|
|
649681
649681
|
if (!existsSync134(path12)) continue;
|
|
649682
649682
|
try {
|
|
649683
|
-
return { path: path12, content:
|
|
649683
|
+
return { path: path12, content: readFileSync108(path12, "utf8") };
|
|
649684
649684
|
} catch {
|
|
649685
649685
|
return null;
|
|
649686
649686
|
}
|
|
@@ -649703,7 +649703,7 @@ function projectVoice(repoRoot) {
|
|
|
649703
649703
|
return ap - bp || a2.localeCompare(b);
|
|
649704
649704
|
});
|
|
649705
649705
|
const first2 = files[0];
|
|
649706
|
-
return first2 ? { path: join145(voiceDir3, first2), content:
|
|
649706
|
+
return first2 ? { path: join145(voiceDir3, first2), content: readFileSync108(join145(voiceDir3, first2), "utf8") } : null;
|
|
649707
649707
|
} catch {
|
|
649708
649708
|
return null;
|
|
649709
649709
|
}
|
|
@@ -649891,7 +649891,7 @@ __export(chat_session_exports, {
|
|
|
649891
649891
|
import { randomUUID as randomUUID18 } from "node:crypto";
|
|
649892
649892
|
import {
|
|
649893
649893
|
existsSync as existsSync135,
|
|
649894
|
-
readFileSync as
|
|
649894
|
+
readFileSync as readFileSync109,
|
|
649895
649895
|
readdirSync as readdirSync47,
|
|
649896
649896
|
writeFileSync as writeFileSync69,
|
|
649897
649897
|
renameSync as renameSync11,
|
|
@@ -650000,7 +650000,7 @@ function normalizeLoadedSession(parsed) {
|
|
|
650000
650000
|
}
|
|
650001
650001
|
function readSessionFile(fp) {
|
|
650002
650002
|
try {
|
|
650003
|
-
const parsed = JSON.parse(
|
|
650003
|
+
const parsed = JSON.parse(readFileSync109(fp, "utf-8"));
|
|
650004
650004
|
if (!parsed || typeof parsed !== "object" || !parsed.id) return null;
|
|
650005
650005
|
return normalizeLoadedSession(parsed);
|
|
650006
650006
|
} catch {
|
|
@@ -650033,7 +650033,7 @@ function loadPersistedSessions() {
|
|
|
650033
650033
|
if (!f2.endsWith(".json") || f2.includes(".tmp.")) continue;
|
|
650034
650034
|
const fp = join146(dir, f2);
|
|
650035
650035
|
try {
|
|
650036
|
-
const parsed = JSON.parse(
|
|
650036
|
+
const parsed = JSON.parse(readFileSync109(fp, "utf-8"));
|
|
650037
650037
|
if (f2.endsWith(".inflight.json")) {
|
|
650038
650038
|
if (parsed && parsed.pid && parsed.status === "running") {
|
|
650039
650039
|
try {
|
|
@@ -650075,7 +650075,7 @@ function buildSystemPrompt(cwd4) {
|
|
|
650075
650075
|
const diaryPath = join146(cwd4, ".omnius", "context", "session-diary.md");
|
|
650076
650076
|
if (existsSync135(diaryPath)) {
|
|
650077
650077
|
try {
|
|
650078
|
-
const diary =
|
|
650078
|
+
const diary = readFileSync109(diaryPath, "utf-8").slice(0, 1e3);
|
|
650079
650079
|
parts.push(`\\nPrevious session history:\\n${diary}`);
|
|
650080
650080
|
} catch {
|
|
650081
650081
|
}
|
|
@@ -650090,7 +650090,7 @@ function buildSystemPrompt(cwd4) {
|
|
|
650090
650090
|
);
|
|
650091
650091
|
for (const f2 of files.slice(0, 3)) {
|
|
650092
650092
|
try {
|
|
650093
|
-
const data = JSON.parse(
|
|
650093
|
+
const data = JSON.parse(readFileSync109(join146(memDir, f2), "utf-8"));
|
|
650094
650094
|
const entries = Object.entries(data).slice(0, 3);
|
|
650095
650095
|
if (entries.length > 0) {
|
|
650096
650096
|
parts.push(
|
|
@@ -650110,7 +650110,7 @@ function buildSystemPrompt(cwd4) {
|
|
|
650110
650110
|
const p2 = join146(cwd4, name10);
|
|
650111
650111
|
if (existsSync135(p2)) {
|
|
650112
650112
|
try {
|
|
650113
|
-
const content =
|
|
650113
|
+
const content = readFileSync109(p2, "utf-8").slice(0, 500);
|
|
650114
650114
|
parts.push(`\\nProject instructions (${name10}):\\n${content}`);
|
|
650115
650115
|
} catch {
|
|
650116
650116
|
}
|
|
@@ -650132,7 +650132,7 @@ function getSession2(sessionId, model, cwd4) {
|
|
|
650132
650132
|
try {
|
|
650133
650133
|
const fp = sessionPath(sessionId);
|
|
650134
650134
|
if (existsSync135(fp)) {
|
|
650135
|
-
const parsed = normalizeLoadedSession(JSON.parse(
|
|
650135
|
+
const parsed = normalizeLoadedSession(JSON.parse(readFileSync109(fp, "utf-8")));
|
|
650136
650136
|
if (parsed && parsed.id === sessionId) {
|
|
650137
650137
|
parsed.lastActivity = Date.now();
|
|
650138
650138
|
if (canonicalRoot && !parsed.projectRoot) parsed.projectRoot = canonicalRoot;
|
|
@@ -650319,7 +650319,7 @@ function drainCheckins(sessionId) {
|
|
|
650319
650319
|
const fp = checkinPath(sessionId);
|
|
650320
650320
|
if (!existsSync135(fp)) return [];
|
|
650321
650321
|
try {
|
|
650322
|
-
const raw =
|
|
650322
|
+
const raw = readFileSync109(fp, "utf-8");
|
|
650323
650323
|
try {
|
|
650324
650324
|
unlinkSync28(fp);
|
|
650325
650325
|
} catch {
|
|
@@ -650385,7 +650385,7 @@ function lookupSession(id) {
|
|
|
650385
650385
|
try {
|
|
650386
650386
|
const fp = sessionPath(id);
|
|
650387
650387
|
if (existsSync135(fp)) {
|
|
650388
|
-
const parsed = normalizeLoadedSession(JSON.parse(
|
|
650388
|
+
const parsed = normalizeLoadedSession(JSON.parse(readFileSync109(fp, "utf-8")));
|
|
650389
650389
|
if (parsed && parsed.id === id) {
|
|
650390
650390
|
sessions2.set(id, parsed);
|
|
650391
650391
|
return parsed;
|
|
@@ -650438,7 +650438,7 @@ function getInFlightChat(sessionId) {
|
|
|
650438
650438
|
try {
|
|
650439
650439
|
const p2 = inFlightPath(sessionId);
|
|
650440
650440
|
if (existsSync135(p2)) {
|
|
650441
|
-
const parsed = JSON.parse(
|
|
650441
|
+
const parsed = JSON.parse(readFileSync109(p2, "utf-8"));
|
|
650442
650442
|
if (parsed && parsed.sessionId === sessionId) {
|
|
650443
650443
|
return parsed;
|
|
650444
650444
|
}
|
|
@@ -651626,7 +651626,7 @@ __export(banner_exports, {
|
|
|
651626
651626
|
setBannerWriter: () => setBannerWriter,
|
|
651627
651627
|
setGridText: () => setGridText
|
|
651628
651628
|
});
|
|
651629
|
-
import { existsSync as existsSync137, readFileSync as
|
|
651629
|
+
import { existsSync as existsSync137, readFileSync as readFileSync110, writeFileSync as writeFileSync70, mkdirSync as mkdirSync81 } from "node:fs";
|
|
651630
651630
|
import { join as join148 } from "node:path";
|
|
651631
651631
|
function setBannerWriter(writer) {
|
|
651632
651632
|
chromeWrite3 = writer;
|
|
@@ -651768,7 +651768,7 @@ function loadBannerDesign(workDir, id) {
|
|
|
651768
651768
|
const file = join148(workDir, ".omnius", "banners", `${id}.json`);
|
|
651769
651769
|
if (!existsSync137(file)) return null;
|
|
651770
651770
|
try {
|
|
651771
|
-
return JSON.parse(
|
|
651771
|
+
return JSON.parse(readFileSync110(file, "utf8"));
|
|
651772
651772
|
} catch {
|
|
651773
651773
|
return null;
|
|
651774
651774
|
}
|
|
@@ -652098,13 +652098,13 @@ var init_banner = __esm({
|
|
|
652098
652098
|
});
|
|
652099
652099
|
|
|
652100
652100
|
// packages/cli/src/tui/carousel-descriptors.ts
|
|
652101
|
-
import { existsSync as existsSync138, readFileSync as
|
|
652101
|
+
import { existsSync as existsSync138, readFileSync as readFileSync111, writeFileSync as writeFileSync71, mkdirSync as mkdirSync82, readdirSync as readdirSync48 } from "node:fs";
|
|
652102
652102
|
import { join as join149, basename as basename30 } from "node:path";
|
|
652103
652103
|
function loadToolProfile(repoRoot) {
|
|
652104
652104
|
const filePath = join149(repoRoot, OMNIUS_DIR, "context", TOOL_PROFILE_FILE);
|
|
652105
652105
|
try {
|
|
652106
652106
|
if (!existsSync138(filePath)) return null;
|
|
652107
|
-
return JSON.parse(
|
|
652107
|
+
return JSON.parse(readFileSync111(filePath, "utf-8"));
|
|
652108
652108
|
} catch {
|
|
652109
652109
|
return null;
|
|
652110
652110
|
}
|
|
@@ -652170,7 +652170,7 @@ function loadCachedDescriptors(repoRoot) {
|
|
|
652170
652170
|
const filePath = join149(repoRoot, OMNIUS_DIR, "context", DESCRIPTOR_FILE);
|
|
652171
652171
|
try {
|
|
652172
652172
|
if (!existsSync138(filePath)) return null;
|
|
652173
|
-
const cached = JSON.parse(
|
|
652173
|
+
const cached = JSON.parse(readFileSync111(filePath, "utf-8"));
|
|
652174
652174
|
return cached.phrases.length > 0 ? cached.phrases : null;
|
|
652175
652175
|
} catch {
|
|
652176
652176
|
return null;
|
|
@@ -652234,7 +652234,7 @@ function extractFromPackageJson(repoRoot, tags) {
|
|
|
652234
652234
|
const pkgPath = join149(repoRoot, "package.json");
|
|
652235
652235
|
try {
|
|
652236
652236
|
if (!existsSync138(pkgPath)) return;
|
|
652237
|
-
const pkg = JSON.parse(
|
|
652237
|
+
const pkg = JSON.parse(readFileSync111(pkgPath, "utf-8"));
|
|
652238
652238
|
if (pkg.name && typeof pkg.name === "string") {
|
|
652239
652239
|
const parts = pkg.name.replace(/^@/, "").split("/");
|
|
652240
652240
|
for (const p2 of parts) tags.push(p2);
|
|
@@ -652305,7 +652305,7 @@ function extractFromMemory(repoRoot, tags) {
|
|
|
652305
652305
|
const topic = file.replace(/\.json$/, "").replace(/[-_]/g, " ");
|
|
652306
652306
|
tags.push(topic);
|
|
652307
652307
|
try {
|
|
652308
|
-
const data = JSON.parse(
|
|
652308
|
+
const data = JSON.parse(readFileSync111(join149(memoryDir, file), "utf-8"));
|
|
652309
652309
|
if (data && typeof data === "object") {
|
|
652310
652310
|
const keys = Object.keys(data).slice(0, 3);
|
|
652311
652311
|
for (const key of keys) {
|
|
@@ -653348,7 +653348,7 @@ var init_edit_history = __esm({
|
|
|
653348
653348
|
});
|
|
653349
653349
|
|
|
653350
653350
|
// packages/cli/src/tui/snr-engine.ts
|
|
653351
|
-
import { existsSync as existsSync139, readdirSync as readdirSync49, readFileSync as
|
|
653351
|
+
import { existsSync as existsSync139, readdirSync as readdirSync49, readFileSync as readFileSync112, writeFileSync as writeFileSync72, mkdirSync as mkdirSync84, rmSync as rmSync11 } from "node:fs";
|
|
653352
653352
|
import { join as join151, basename as basename31 } from "node:path";
|
|
653353
653353
|
function computeDPrime(signalScores, noiseScores) {
|
|
653354
653354
|
if (signalScores.length === 0 || noiseScores.length === 0) return 0;
|
|
@@ -653654,7 +653654,7 @@ Call task_complete with the JSON array when done.`,
|
|
|
653654
653654
|
const topic = basename31(f2, ".json");
|
|
653655
653655
|
if (topics.length > 0 && !topics.includes(topic)) continue;
|
|
653656
653656
|
try {
|
|
653657
|
-
const data = JSON.parse(
|
|
653657
|
+
const data = JSON.parse(readFileSync112(join151(dir, f2), "utf-8"));
|
|
653658
653658
|
for (const [key, val] of Object.entries(data)) {
|
|
653659
653659
|
const value2 = typeof val === "object" && val !== null && "value" in val ? String(val.value) : String(val);
|
|
653660
653660
|
entries.push({ topic, key, value: value2 });
|
|
@@ -653756,7 +653756,7 @@ Call task_complete with the JSON array when done.`,
|
|
|
653756
653756
|
const file = join151(memDir, `${topic}.json`);
|
|
653757
653757
|
if (!existsSync139(file)) continue;
|
|
653758
653758
|
try {
|
|
653759
|
-
const data = JSON.parse(
|
|
653759
|
+
const data = JSON.parse(readFileSync112(file, "utf-8"));
|
|
653760
653760
|
const moved = {};
|
|
653761
653761
|
for (const key of keys) {
|
|
653762
653762
|
if (key in data) {
|
|
@@ -653771,7 +653771,7 @@ Call task_complete with the JSON array when done.`,
|
|
|
653771
653771
|
let archiveData = {};
|
|
653772
653772
|
if (existsSync139(archiveFile)) {
|
|
653773
653773
|
try {
|
|
653774
|
-
archiveData = JSON.parse(
|
|
653774
|
+
archiveData = JSON.parse(readFileSync112(archiveFile, "utf-8"));
|
|
653775
653775
|
} catch {
|
|
653776
653776
|
}
|
|
653777
653777
|
}
|
|
@@ -653810,7 +653810,7 @@ Call task_complete with the JSON array when done.`,
|
|
|
653810
653810
|
});
|
|
653811
653811
|
|
|
653812
653812
|
// packages/cli/src/tui/promptLoader.ts
|
|
653813
|
-
import { readFileSync as
|
|
653813
|
+
import { readFileSync as readFileSync113, existsSync as existsSync140 } from "node:fs";
|
|
653814
653814
|
import { join as join152, dirname as dirname47 } from "node:path";
|
|
653815
653815
|
import { fileURLToPath as fileURLToPath18 } from "node:url";
|
|
653816
653816
|
function loadPrompt3(promptPath, vars) {
|
|
@@ -653820,7 +653820,7 @@ function loadPrompt3(promptPath, vars) {
|
|
|
653820
653820
|
if (!existsSync140(fullPath)) {
|
|
653821
653821
|
throw new Error(`Prompt file not found: ${fullPath}`);
|
|
653822
653822
|
}
|
|
653823
|
-
content =
|
|
653823
|
+
content = readFileSync113(fullPath, "utf-8");
|
|
653824
653824
|
cache7.set(promptPath, content);
|
|
653825
653825
|
}
|
|
653826
653826
|
if (!vars) return content;
|
|
@@ -653840,7 +653840,7 @@ var init_promptLoader3 = __esm({
|
|
|
653840
653840
|
});
|
|
653841
653841
|
|
|
653842
653842
|
// packages/cli/src/tui/dream-engine.ts
|
|
653843
|
-
import { mkdirSync as mkdirSync85, writeFileSync as writeFileSync73, readFileSync as
|
|
653843
|
+
import { mkdirSync as mkdirSync85, writeFileSync as writeFileSync73, readFileSync as readFileSync114, existsSync as existsSync141, readdirSync as readdirSync50 } from "node:fs";
|
|
653844
653844
|
import { join as join153, basename as basename32 } from "node:path";
|
|
653845
653845
|
import { execSync as execSync57 } from "node:child_process";
|
|
653846
653846
|
function setDreamWriteContent(fn) {
|
|
@@ -653857,7 +653857,7 @@ function loadAutoresearchMemory(repoRoot) {
|
|
|
653857
653857
|
const memoryPath = join153(repoRoot, ".omnius", "memory", "autoresearch.json");
|
|
653858
653858
|
if (!existsSync141(memoryPath)) return "";
|
|
653859
653859
|
try {
|
|
653860
|
-
const raw =
|
|
653860
|
+
const raw = readFileSync114(memoryPath, "utf-8");
|
|
653861
653861
|
const data = JSON.parse(raw);
|
|
653862
653862
|
const sections = [];
|
|
653863
653863
|
for (const key of AUTORESEARCH_MEMORY_KEYS) {
|
|
@@ -654091,7 +654091,7 @@ var init_dream_engine = __esm({
|
|
|
654091
654091
|
if (!existsSync141(targetPath)) {
|
|
654092
654092
|
return { success: false, output: "", error: `File not found: ${rawPath}`, durationMs: Date.now() - start2 };
|
|
654093
654093
|
}
|
|
654094
|
-
let content =
|
|
654094
|
+
let content = readFileSync114(targetPath, "utf-8");
|
|
654095
654095
|
if (!content.includes(oldStr)) {
|
|
654096
654096
|
return { success: false, output: "", error: "old_string not found in file", durationMs: Date.now() - start2 };
|
|
654097
654097
|
}
|
|
@@ -654179,7 +654179,7 @@ var init_dream_engine = __esm({
|
|
|
654179
654179
|
if (!existsSync141(targetPath)) {
|
|
654180
654180
|
return { success: false, output: "", error: `File not found: ${rawPath}`, durationMs: Date.now() - start2 };
|
|
654181
654181
|
}
|
|
654182
|
-
let content =
|
|
654182
|
+
let content = readFileSync114(targetPath, "utf-8");
|
|
654183
654183
|
if (!content.includes(oldStr)) {
|
|
654184
654184
|
return { success: false, output: "", error: "old_string not found in file", durationMs: Date.now() - start2 };
|
|
654185
654185
|
}
|
|
@@ -655139,7 +655139,7 @@ ${summary}` };
|
|
|
655139
655139
|
try {
|
|
655140
655140
|
let notes = [];
|
|
655141
655141
|
if (existsSync141(notesPath)) {
|
|
655142
|
-
notes = JSON.parse(
|
|
655142
|
+
notes = JSON.parse(readFileSync114(notesPath, "utf-8"));
|
|
655143
655143
|
}
|
|
655144
655144
|
if (action === "add") {
|
|
655145
655145
|
const note = {
|
|
@@ -655782,7 +655782,7 @@ var init_bless_engine = __esm({
|
|
|
655782
655782
|
});
|
|
655783
655783
|
|
|
655784
655784
|
// packages/cli/src/tui/dmn-engine.ts
|
|
655785
|
-
import { existsSync as existsSync142, readFileSync as
|
|
655785
|
+
import { existsSync as existsSync142, readFileSync as readFileSync115, writeFileSync as writeFileSync74, mkdirSync as mkdirSync86, readdirSync as readdirSync51, unlinkSync as unlinkSync29 } from "node:fs";
|
|
655786
655786
|
import { join as join154, basename as basename33 } from "node:path";
|
|
655787
655787
|
function buildDMNGatherPrompt(recentTaskSummaries, dueReminders, attentionItems, memoryTopics, capabilities, competence, reflectionBuffer) {
|
|
655788
655788
|
const competenceReport = competence.length > 0 ? competence.map((c8) => {
|
|
@@ -656540,7 +656540,7 @@ OUTPUT: Call task_complete with JSON:
|
|
|
656540
656540
|
const path12 = join154(this.stateDir, "state.json");
|
|
656541
656541
|
if (existsSync142(path12)) {
|
|
656542
656542
|
try {
|
|
656543
|
-
this.state = JSON.parse(
|
|
656543
|
+
this.state = JSON.parse(readFileSync115(path12, "utf-8"));
|
|
656544
656544
|
} catch {
|
|
656545
656545
|
}
|
|
656546
656546
|
}
|
|
@@ -656574,7 +656574,7 @@ OUTPUT: Call task_complete with JSON:
|
|
|
656574
656574
|
const latestByFingerprint = /* @__PURE__ */ new Map();
|
|
656575
656575
|
for (const file of files) {
|
|
656576
656576
|
try {
|
|
656577
|
-
const parsed = JSON.parse(
|
|
656577
|
+
const parsed = JSON.parse(readFileSync115(join154(this.historyDir, file), "utf-8"));
|
|
656578
656578
|
latestByFingerprint.set(this.fingerprintCycle(parsed), file);
|
|
656579
656579
|
} catch {
|
|
656580
656580
|
keep.add(file);
|
|
@@ -658374,7 +658374,7 @@ import { createCipheriv as createCipheriv5, createDecipheriv as createDecipheriv
|
|
|
658374
658374
|
import {
|
|
658375
658375
|
existsSync as existsSync143,
|
|
658376
658376
|
mkdirSync as mkdirSync87,
|
|
658377
|
-
readFileSync as
|
|
658377
|
+
readFileSync as readFileSync116,
|
|
658378
658378
|
statSync as statSync49,
|
|
658379
658379
|
unlinkSync as unlinkSync30,
|
|
658380
658380
|
writeFileSync as writeFileSync75
|
|
@@ -658604,7 +658604,7 @@ function scopedTool(base3, root, mode) {
|
|
|
658604
658604
|
);
|
|
658605
658605
|
if (!materialized.ok) return denied(materialized.error);
|
|
658606
658606
|
mkdirSync87(dirname48(guarded.path.abs), { recursive: true });
|
|
658607
|
-
writeFileSync75(guarded.path.abs,
|
|
658607
|
+
writeFileSync75(guarded.path.abs, readFileSync116(materialized.path));
|
|
658608
658608
|
materialized.cleanup?.();
|
|
658609
658609
|
restoredEditPath = guarded.path.abs;
|
|
658610
658610
|
}
|
|
@@ -658728,7 +658728,7 @@ function readManifest(root) {
|
|
|
658728
658728
|
ensureManifest(root);
|
|
658729
658729
|
try {
|
|
658730
658730
|
const parsed = JSON.parse(
|
|
658731
|
-
|
|
658731
|
+
readFileSync116(manifestPath(root), "utf8")
|
|
658732
658732
|
);
|
|
658733
658733
|
const objects = parsed.objects && typeof parsed.objects === "object" ? Object.fromEntries(
|
|
658734
658734
|
Object.entries(parsed.objects).filter(
|
|
@@ -658780,7 +658780,7 @@ function rememberCreated(root, absPath) {
|
|
|
658780
658780
|
}
|
|
658781
658781
|
}
|
|
658782
658782
|
mkdirSync87(join155(root, OBJECTS_DIR), { recursive: true });
|
|
658783
|
-
const data =
|
|
658783
|
+
const data = readFileSync116(guarded.path.abs);
|
|
658784
658784
|
const prefix = randomBytes25(48);
|
|
658785
658785
|
const key = randomBytes25(32);
|
|
658786
658786
|
const iv = randomBytes25(12);
|
|
@@ -658836,7 +658836,7 @@ function materializeTelegramCreativeArtifactForSend(root, rawPath) {
|
|
|
658836
658836
|
error: `Scoped artifact storage is missing for ${rel}.`
|
|
658837
658837
|
};
|
|
658838
658838
|
}
|
|
658839
|
-
const blob =
|
|
658839
|
+
const blob = readFileSync116(storedAbs);
|
|
658840
658840
|
if (blob.length < object.prefixBytes) {
|
|
658841
658841
|
return {
|
|
658842
658842
|
ok: false,
|
|
@@ -659634,7 +659634,7 @@ var init_soul_observations = __esm({
|
|
|
659634
659634
|
});
|
|
659635
659635
|
|
|
659636
659636
|
// packages/cli/src/tui/telegram-channel-dmn.ts
|
|
659637
|
-
import { existsSync as existsSync144, mkdirSync as mkdirSync88, readdirSync as readdirSync52, readFileSync as
|
|
659637
|
+
import { existsSync as existsSync144, mkdirSync as mkdirSync88, readdirSync as readdirSync52, readFileSync as readFileSync117, writeFileSync as writeFileSync76 } from "node:fs";
|
|
659638
659638
|
import { join as join156 } from "node:path";
|
|
659639
659639
|
import { createHash as createHash37 } from "node:crypto";
|
|
659640
659640
|
function safeFilePart(value2) {
|
|
@@ -660208,7 +660208,7 @@ function latestTelegramChannelDaydream(repoRoot, sessionKey) {
|
|
|
660208
660208
|
const files = readdirSync52(dir).filter((file) => file.endsWith(".json")).sort();
|
|
660209
660209
|
for (const file of files.reverse()) {
|
|
660210
660210
|
try {
|
|
660211
|
-
return JSON.parse(
|
|
660211
|
+
return JSON.parse(readFileSync117(join156(dir, file), "utf8"));
|
|
660212
660212
|
} catch {
|
|
660213
660213
|
}
|
|
660214
660214
|
}
|
|
@@ -661831,7 +661831,7 @@ __export(vision_ingress_exports, {
|
|
|
661831
661831
|
runVisionIngress: () => runVisionIngress
|
|
661832
661832
|
});
|
|
661833
661833
|
import { execFileSync as execFileSync10 } from "node:child_process";
|
|
661834
|
-
import { existsSync as existsSync145, readFileSync as
|
|
661834
|
+
import { existsSync as existsSync145, readFileSync as readFileSync118, unlinkSync as unlinkSync31 } from "node:fs";
|
|
661835
661835
|
import { join as join157 } from "node:path";
|
|
661836
661836
|
function isTesseractAvailable() {
|
|
661837
661837
|
try {
|
|
@@ -661886,7 +661886,7 @@ function advancedOcr(imagePath) {
|
|
|
661886
661886
|
], { timeout: 15e3, stdio: "pipe" });
|
|
661887
661887
|
const txtFile = `${outFile}.txt`;
|
|
661888
661888
|
if (existsSync145(txtFile)) {
|
|
661889
|
-
const text2 =
|
|
661889
|
+
const text2 = readFileSync118(txtFile, "utf-8").trim();
|
|
661890
661890
|
if (text2.length > 0) results.push(text2);
|
|
661891
661891
|
try {
|
|
661892
661892
|
unlinkSync31(txtFile);
|
|
@@ -661903,7 +661903,7 @@ function advancedOcr(imagePath) {
|
|
|
661903
661903
|
async function queryVisionModel(modelName, imagePath, prompt = "Describe what you see in this image in detail. Include any text, UI elements, code, diagrams, or visual content.") {
|
|
661904
661904
|
if (!isVisionModel(modelName)) return "";
|
|
661905
661905
|
if (!existsSync145(imagePath)) return "";
|
|
661906
|
-
const imageBuffer =
|
|
661906
|
+
const imageBuffer = readFileSync118(imagePath);
|
|
661907
661907
|
const base64Image = imageBuffer.toString("base64");
|
|
661908
661908
|
const broker = getModelBroker();
|
|
661909
661909
|
const decision2 = await broker.ensureModelLoadable({
|
|
@@ -662014,7 +662014,7 @@ import {
|
|
|
662014
662014
|
readdirSync as readdirSync53,
|
|
662015
662015
|
statSync as statSync50,
|
|
662016
662016
|
statfsSync as statfsSync7,
|
|
662017
|
-
readFileSync as
|
|
662017
|
+
readFileSync as readFileSync119,
|
|
662018
662018
|
writeFileSync as writeFileSync78,
|
|
662019
662019
|
appendFileSync as appendFileSync15
|
|
662020
662020
|
} from "node:fs";
|
|
@@ -668137,7 +668137,7 @@ ${mediaContext}` : ""
|
|
|
668137
668137
|
const path12 = this.telegramConversationPath(sessionKey);
|
|
668138
668138
|
if (!existsSync146(path12)) return;
|
|
668139
668139
|
try {
|
|
668140
|
-
const parsed = JSON.parse(
|
|
668140
|
+
const parsed = JSON.parse(readFileSync119(path12, "utf8"));
|
|
668141
668141
|
const loadedHistory = Array.isArray(parsed.history) ? parsed.history : [];
|
|
668142
668142
|
if (Array.isArray(parsed.history)) {
|
|
668143
668143
|
this.chatHistory.set(
|
|
@@ -668349,7 +668349,7 @@ ${mediaContext}` : ""
|
|
|
668349
668349
|
for (const file of readdirSync53(this.telegramConversationDir)) {
|
|
668350
668350
|
if (!file.endsWith(".json")) continue;
|
|
668351
668351
|
try {
|
|
668352
|
-
const raw =
|
|
668352
|
+
const raw = readFileSync119(
|
|
668353
668353
|
join158(this.telegramConversationDir, file),
|
|
668354
668354
|
"utf8"
|
|
668355
668355
|
);
|
|
@@ -672971,7 +672971,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`
|
|
|
672971
672971
|
const lockFile = join158(lockDir, `bot-${botUserId}.owner.lock`);
|
|
672972
672972
|
if (existsSync146(lockFile)) {
|
|
672973
672973
|
try {
|
|
672974
|
-
const prior = JSON.parse(
|
|
672974
|
+
const prior = JSON.parse(readFileSync119(lockFile, "utf8"));
|
|
672975
672975
|
const priorAlive = typeof prior.pid === "number" && prior.pid !== process.pid ? this.processIsAlive(prior.pid) : false;
|
|
672976
672976
|
if (priorAlive) {
|
|
672977
672977
|
throw new Error(
|
|
@@ -673004,7 +673004,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`
|
|
|
673004
673004
|
try {
|
|
673005
673005
|
if (!existsSync146(lockFile)) return;
|
|
673006
673006
|
try {
|
|
673007
|
-
const prior = JSON.parse(
|
|
673007
|
+
const prior = JSON.parse(readFileSync119(lockFile, "utf8"));
|
|
673008
673008
|
if (prior.pid !== process.pid) return;
|
|
673009
673009
|
} catch {
|
|
673010
673010
|
}
|
|
@@ -677918,7 +677918,7 @@ Scoped workspace: ${scopedRoot}`,
|
|
|
677918
677918
|
readTelegramToolButtonState(nonce) {
|
|
677919
677919
|
try {
|
|
677920
677920
|
const parsed = JSON.parse(
|
|
677921
|
-
|
|
677921
|
+
readFileSync119(this.telegramToolButtonPath(nonce), "utf-8")
|
|
677922
677922
|
);
|
|
677923
677923
|
if (!parsed || parsed.expiresAt < Date.now()) return null;
|
|
677924
677924
|
return parsed;
|
|
@@ -679271,7 +679271,7 @@ ${knownList}` : "Private-user telegram_send_file target must be this DM or a kno
|
|
|
679271
679271
|
const ingressResult = await runVisionIngress2(
|
|
679272
679272
|
{
|
|
679273
679273
|
path: localPath,
|
|
679274
|
-
buffer:
|
|
679274
|
+
buffer: readFileSync119(localPath),
|
|
679275
679275
|
mime: telegramImageMime(media)
|
|
679276
679276
|
},
|
|
679277
679277
|
this.agentConfig?.model ?? ""
|
|
@@ -679636,7 +679636,7 @@ ${text2}`.trim()
|
|
|
679636
679636
|
}
|
|
679637
679637
|
if (!existsSync146(media.value))
|
|
679638
679638
|
throw new Error(`File does not exist: ${media.value}`);
|
|
679639
|
-
const buffer2 =
|
|
679639
|
+
const buffer2 = readFileSync119(media.value);
|
|
679640
679640
|
const boundary = `----omnius-media-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
679641
679641
|
const filename = basename35(media.value);
|
|
679642
679642
|
const contentType = mimeForPath(media.value, media.kind);
|
|
@@ -679750,7 +679750,7 @@ Content-Type: ${contentType}\r
|
|
|
679750
679750
|
const sidecarPath2 = `${imagePath}.json`;
|
|
679751
679751
|
if (!existsSync146(sidecarPath2)) return null;
|
|
679752
679752
|
try {
|
|
679753
|
-
const raw =
|
|
679753
|
+
const raw = readFileSync119(sidecarPath2, "utf8");
|
|
679754
679754
|
const parsed = JSON.parse(raw);
|
|
679755
679755
|
if (!parsed || typeof parsed !== "object" || typeof parsed["original_prompt"] !== "string") {
|
|
679756
679756
|
return null;
|
|
@@ -679810,7 +679810,7 @@ Content-Type: ${contentType}\r
|
|
|
679810
679810
|
const sidecarPath2 = `${videoPath}.json`;
|
|
679811
679811
|
if (!existsSync146(sidecarPath2)) return null;
|
|
679812
679812
|
try {
|
|
679813
|
-
const raw =
|
|
679813
|
+
const raw = readFileSync119(sidecarPath2, "utf8");
|
|
679814
679814
|
const parsed = JSON.parse(raw);
|
|
679815
679815
|
if (!parsed || typeof parsed !== "object" || typeof parsed["original_prompt"] !== "string") {
|
|
679816
679816
|
return null;
|
|
@@ -679955,7 +679955,7 @@ Content-Type: ${contentType}\r
|
|
|
679955
679955
|
addField(field, pathOrFileId);
|
|
679956
679956
|
continue;
|
|
679957
679957
|
}
|
|
679958
|
-
const buffer2 =
|
|
679958
|
+
const buffer2 = readFileSync119(pathOrFileId);
|
|
679959
679959
|
const filename = basename35(pathOrFileId);
|
|
679960
679960
|
parts.push(Buffer.from(`--${boundary}\r
|
|
679961
679961
|
`));
|
|
@@ -681729,14 +681729,14 @@ __export(projects_exports, {
|
|
|
681729
681729
|
setCurrentProject: () => setCurrentProject,
|
|
681730
681730
|
unregisterProject: () => unregisterProject
|
|
681731
681731
|
});
|
|
681732
|
-
import { readFileSync as
|
|
681732
|
+
import { readFileSync as readFileSync120, writeFileSync as writeFileSync79, mkdirSync as mkdirSync90, existsSync as existsSync147, statSync as statSync51, renameSync as renameSync12 } from "node:fs";
|
|
681733
681733
|
import { homedir as homedir52 } from "node:os";
|
|
681734
681734
|
import { basename as basename36, join as join159, resolve as resolve63 } from "node:path";
|
|
681735
681735
|
import { randomUUID as randomUUID19 } from "node:crypto";
|
|
681736
681736
|
function readAll2() {
|
|
681737
681737
|
try {
|
|
681738
681738
|
if (!existsSync147(PROJECTS_FILE)) return { projects: [], schemaVersion: 1 };
|
|
681739
|
-
const raw =
|
|
681739
|
+
const raw = readFileSync120(PROJECTS_FILE, "utf8");
|
|
681740
681740
|
const parsed = JSON.parse(raw);
|
|
681741
681741
|
if (!parsed || !Array.isArray(parsed.projects)) return { projects: [], schemaVersion: 1 };
|
|
681742
681742
|
return { projects: parsed.projects, schemaVersion: 1 };
|
|
@@ -681813,7 +681813,7 @@ function getCurrentProject() {
|
|
|
681813
681813
|
if (!currentRoot) {
|
|
681814
681814
|
try {
|
|
681815
681815
|
if (existsSync147(CURRENT_FILE)) {
|
|
681816
|
-
const persisted =
|
|
681816
|
+
const persisted = readFileSync120(CURRENT_FILE, "utf8").trim();
|
|
681817
681817
|
if (persisted) currentRoot = persisted;
|
|
681818
681818
|
}
|
|
681819
681819
|
} catch {
|
|
@@ -682727,7 +682727,7 @@ var init_access_policy = __esm({
|
|
|
682727
682727
|
|
|
682728
682728
|
// packages/cli/src/api/project-preferences.ts
|
|
682729
682729
|
import { createHash as createHash41 } from "node:crypto";
|
|
682730
|
-
import { existsSync as existsSync148, mkdirSync as mkdirSync91, readFileSync as
|
|
682730
|
+
import { existsSync as existsSync148, mkdirSync as mkdirSync91, readFileSync as readFileSync121, renameSync as renameSync13, writeFileSync as writeFileSync80, unlinkSync as unlinkSync33 } from "node:fs";
|
|
682731
682731
|
import { homedir as homedir53 } from "node:os";
|
|
682732
682732
|
import { join as join160, resolve as resolve64 } from "node:path";
|
|
682733
682733
|
import { randomUUID as randomUUID20 } from "node:crypto";
|
|
@@ -682760,7 +682760,7 @@ function readProjectPreferences(root) {
|
|
|
682760
682760
|
try {
|
|
682761
682761
|
const file = prefsPath(root);
|
|
682762
682762
|
if (!existsSync148(file)) return { ...DEFAULT_PREFS };
|
|
682763
|
-
const raw =
|
|
682763
|
+
const raw = readFileSync121(file, "utf8");
|
|
682764
682764
|
const parsed = JSON.parse(raw);
|
|
682765
682765
|
if (!parsed || parsed.v !== SCHEMA_VERSION) return { ...DEFAULT_PREFS };
|
|
682766
682766
|
return { ...DEFAULT_PREFS, ...parsed, v: SCHEMA_VERSION };
|
|
@@ -682827,7 +682827,7 @@ __export(audit_log_exports, {
|
|
|
682827
682827
|
recordAudit: () => recordAudit,
|
|
682828
682828
|
sanitizeBody: () => sanitizeBody
|
|
682829
682829
|
});
|
|
682830
|
-
import { mkdirSync as mkdirSync92, appendFileSync as appendFileSync16, readFileSync as
|
|
682830
|
+
import { mkdirSync as mkdirSync92, appendFileSync as appendFileSync16, readFileSync as readFileSync122, existsSync as existsSync149 } from "node:fs";
|
|
682831
682831
|
import { join as join161 } from "node:path";
|
|
682832
682832
|
function initAuditLog(omniusDir) {
|
|
682833
682833
|
auditDir = join161(omniusDir, "audit");
|
|
@@ -682864,7 +682864,7 @@ function sanitizeBody(body, maxLen = 200) {
|
|
|
682864
682864
|
function queryAudit(opts) {
|
|
682865
682865
|
if (!initialized || !existsSync149(auditFile)) return [];
|
|
682866
682866
|
try {
|
|
682867
|
-
const raw =
|
|
682867
|
+
const raw = readFileSync122(auditFile, "utf-8");
|
|
682868
682868
|
const lines = raw.split("\n").filter(Boolean);
|
|
682869
682869
|
let records = lines.map((l2) => {
|
|
682870
682870
|
try {
|
|
@@ -683827,7 +683827,7 @@ var init_direct_tool_registry = __esm({
|
|
|
683827
683827
|
});
|
|
683828
683828
|
|
|
683829
683829
|
// packages/cli/src/api/external-tool-registry.ts
|
|
683830
|
-
import { existsSync as existsSync152, mkdirSync as mkdirSync95, readFileSync as
|
|
683830
|
+
import { existsSync as existsSync152, mkdirSync as mkdirSync95, readFileSync as readFileSync123, writeFileSync as writeFileSync81, renameSync as renameSync14 } from "node:fs";
|
|
683831
683831
|
import { join as join163 } from "node:path";
|
|
683832
683832
|
function externalToolStorePath(workingDir) {
|
|
683833
683833
|
return join163(workingDir, ".omnius", "external-tools.json");
|
|
@@ -683836,7 +683836,7 @@ function loadExternalTools(workingDir) {
|
|
|
683836
683836
|
const path12 = externalToolStorePath(workingDir);
|
|
683837
683837
|
if (!existsSync152(path12)) return [];
|
|
683838
683838
|
try {
|
|
683839
|
-
const parsed = JSON.parse(
|
|
683839
|
+
const parsed = JSON.parse(readFileSync123(path12, "utf-8"));
|
|
683840
683840
|
if (!parsed || !Array.isArray(parsed.tools)) return [];
|
|
683841
683841
|
return parsed.tools.filter(
|
|
683842
683842
|
(t2) => t2 && typeof t2.name === "string" && t2.transport != null
|
|
@@ -684175,7 +684175,7 @@ __export(aiwg_exports, {
|
|
|
684175
684175
|
resolveAiwgRoot: () => resolveAiwgRoot,
|
|
684176
684176
|
tryRouteAiwg: () => tryRouteAiwg
|
|
684177
684177
|
});
|
|
684178
|
-
import { existsSync as existsSync153, readFileSync as
|
|
684178
|
+
import { existsSync as existsSync153, readFileSync as readFileSync124, readdirSync as readdirSync54, statSync as statSync54 } from "node:fs";
|
|
684179
684179
|
import { join as join164 } from "node:path";
|
|
684180
684180
|
import { homedir as homedir54 } from "node:os";
|
|
684181
684181
|
import { execSync as execSync58 } from "node:child_process";
|
|
@@ -684246,7 +684246,7 @@ function resolveAiwgRoot() {
|
|
|
684246
684246
|
const pj = join164(cur, "package.json");
|
|
684247
684247
|
if (existsSync153(pj)) {
|
|
684248
684248
|
try {
|
|
684249
|
-
const pkg = JSON.parse(
|
|
684249
|
+
const pkg = JSON.parse(readFileSync124(pj, "utf-8"));
|
|
684250
684250
|
if (pkg.name === "aiwg") {
|
|
684251
684251
|
_cachedAiwgRoot = cur;
|
|
684252
684252
|
return cur;
|
|
@@ -684336,7 +684336,7 @@ function readFirstLineDescription(dir) {
|
|
|
684336
684336
|
const p2 = join164(dir, candidate);
|
|
684337
684337
|
if (!existsSync153(p2)) continue;
|
|
684338
684338
|
try {
|
|
684339
|
-
const txt =
|
|
684339
|
+
const txt = readFileSync124(p2, "utf-8");
|
|
684340
684340
|
const descMatch = txt.match(/^description:\s*(.+)$/m);
|
|
684341
684341
|
if (descMatch) return descMatch[1].trim().slice(0, 200);
|
|
684342
684342
|
for (const line of txt.split("\n")) {
|
|
@@ -684387,7 +684387,7 @@ function walkForItems(dir, out, depth) {
|
|
|
684387
684387
|
}
|
|
684388
684388
|
function parseItem(p2) {
|
|
684389
684389
|
try {
|
|
684390
|
-
const raw =
|
|
684390
|
+
const raw = readFileSync124(p2, "utf-8");
|
|
684391
684391
|
const header = raw.slice(0, 3e3);
|
|
684392
684392
|
const nameMatch = header.match(/^name:\s*(.+)$/m);
|
|
684393
684393
|
const descMatch = header.match(/^description:\s*(.+)$/m);
|
|
@@ -684426,7 +684426,7 @@ function deriveSource(p2) {
|
|
|
684426
684426
|
function loadAiwgItemContent(path12, maxBytes = 2e4) {
|
|
684427
684427
|
try {
|
|
684428
684428
|
if (!existsSync153(path12)) return null;
|
|
684429
|
-
const raw =
|
|
684429
|
+
const raw = readFileSync124(path12, "utf-8");
|
|
684430
684430
|
return raw.length > maxBytes ? raw.slice(0, maxBytes) + "\n\n...(truncated for context budget)" : raw;
|
|
684431
684431
|
} catch {
|
|
684432
684432
|
return null;
|
|
@@ -684962,7 +684962,7 @@ __export(runtime_keys_exports, {
|
|
|
684962
684962
|
mintKey: () => mintKey,
|
|
684963
684963
|
revokeByPrefix: () => revokeByPrefix
|
|
684964
684964
|
});
|
|
684965
|
-
import { existsSync as existsSync154, readFileSync as
|
|
684965
|
+
import { existsSync as existsSync154, readFileSync as readFileSync125, writeFileSync as writeFileSync82, mkdirSync as mkdirSync96, chmodSync as chmodSync4 } from "node:fs";
|
|
684966
684966
|
import { join as join165 } from "node:path";
|
|
684967
684967
|
import { homedir as homedir55 } from "node:os";
|
|
684968
684968
|
import { randomBytes as randomBytes27 } from "node:crypto";
|
|
@@ -684973,7 +684973,7 @@ function ensureDir2() {
|
|
|
684973
684973
|
function loadAll() {
|
|
684974
684974
|
if (!existsSync154(KEYS_FILE)) return [];
|
|
684975
684975
|
try {
|
|
684976
|
-
const raw =
|
|
684976
|
+
const raw = readFileSync125(KEYS_FILE, "utf-8");
|
|
684977
684977
|
const parsed = JSON.parse(raw);
|
|
684978
684978
|
if (!Array.isArray(parsed)) return [];
|
|
684979
684979
|
return parsed;
|
|
@@ -685059,7 +685059,7 @@ __export(tor_fallback_exports, {
|
|
|
685059
685059
|
torIsReachable: () => torIsReachable,
|
|
685060
685060
|
tunnelViaTor: () => tunnelViaTor
|
|
685061
685061
|
});
|
|
685062
|
-
import { existsSync as existsSync155, readFileSync as
|
|
685062
|
+
import { existsSync as existsSync155, readFileSync as readFileSync126 } from "node:fs";
|
|
685063
685063
|
import { homedir as homedir56 } from "node:os";
|
|
685064
685064
|
import { join as join166 } from "node:path";
|
|
685065
685065
|
import { createConnection as createConnection3 } from "node:net";
|
|
@@ -685072,7 +685072,7 @@ function getLocalOnion() {
|
|
|
685072
685072
|
for (const p2 of candidates) {
|
|
685073
685073
|
try {
|
|
685074
685074
|
if (existsSync155(p2)) {
|
|
685075
|
-
const v =
|
|
685075
|
+
const v = readFileSync126(p2, "utf-8").trim();
|
|
685076
685076
|
if (v && v.endsWith(".onion")) return v;
|
|
685077
685077
|
}
|
|
685078
685078
|
} catch {
|
|
@@ -685333,7 +685333,7 @@ var init_graphical_sudo = __esm({
|
|
|
685333
685333
|
});
|
|
685334
685334
|
|
|
685335
685335
|
// packages/cli/src/api/routes-v1.ts
|
|
685336
|
-
import { existsSync as existsSync157, mkdirSync as mkdirSync98, readFileSync as
|
|
685336
|
+
import { existsSync as existsSync157, mkdirSync as mkdirSync98, readFileSync as readFileSync127, readdirSync as readdirSync55, statSync as statSync55 } from "node:fs";
|
|
685337
685337
|
import { join as join168, resolve as pathResolve3 } from "node:path";
|
|
685338
685338
|
import { homedir as homedir57 } from "node:os";
|
|
685339
685339
|
async function tryRouteV1(ctx3) {
|
|
@@ -685610,7 +685610,7 @@ function walkForSkills(dir, out, depth) {
|
|
|
685610
685610
|
walkForSkills(p2, out, depth + 1);
|
|
685611
685611
|
} else if (e2.isFile() && e2.name === "SKILL.md") {
|
|
685612
685612
|
try {
|
|
685613
|
-
const content =
|
|
685613
|
+
const content = readFileSync127(p2, "utf-8").slice(0, 2e3);
|
|
685614
685614
|
const nameMatch = content.match(/^name:\s*(.+)$/m);
|
|
685615
685615
|
const descMatch = content.match(/^description:\s*(.+)$/m);
|
|
685616
685616
|
out.push({
|
|
@@ -686566,7 +686566,7 @@ async function handleFilesRead(ctx3) {
|
|
|
686566
686566
|
}));
|
|
686567
686567
|
return true;
|
|
686568
686568
|
}
|
|
686569
|
-
const content =
|
|
686569
|
+
const content = readFileSync127(resolved, "utf-8");
|
|
686570
686570
|
const offset = typeof body.offset === "number" && body.offset >= 0 ? body.offset : 0;
|
|
686571
686571
|
const limit = typeof body.limit === "number" && body.limit > 0 ? body.limit : content.length;
|
|
686572
686572
|
const slice2 = content.slice(offset, offset + limit);
|
|
@@ -686806,7 +686806,7 @@ async function handleNexusStatus(ctx3) {
|
|
|
686806
686806
|
for (const p2 of statePaths) {
|
|
686807
686807
|
if (!existsSync157(p2)) continue;
|
|
686808
686808
|
try {
|
|
686809
|
-
const raw =
|
|
686809
|
+
const raw = readFileSync127(p2, "utf-8");
|
|
686810
686810
|
states2.push({ source: p2, data: JSON.parse(raw) });
|
|
686811
686811
|
} catch (e2) {
|
|
686812
686812
|
states2.push({ source: p2, error: String(e2) });
|
|
@@ -686834,7 +686834,7 @@ async function handleNexusStatus(ctx3) {
|
|
|
686834
686834
|
function loadAgentName() {
|
|
686835
686835
|
try {
|
|
686836
686836
|
const p2 = join168(homedir57(), ".omnius", "agent-name");
|
|
686837
|
-
if (existsSync157(p2)) return
|
|
686837
|
+
if (existsSync157(p2)) return readFileSync127(p2, "utf-8").trim();
|
|
686838
686838
|
} catch {
|
|
686839
686839
|
}
|
|
686840
686840
|
return null;
|
|
@@ -686850,7 +686850,7 @@ async function handleSponsors(ctx3) {
|
|
|
686850
686850
|
for (const p2 of candidates) {
|
|
686851
686851
|
if (!existsSync157(p2)) continue;
|
|
686852
686852
|
try {
|
|
686853
|
-
const raw = JSON.parse(
|
|
686853
|
+
const raw = JSON.parse(readFileSync127(p2, "utf-8"));
|
|
686854
686854
|
if (Array.isArray(raw)) {
|
|
686855
686855
|
sponsors = raw;
|
|
686856
686856
|
break;
|
|
@@ -686930,7 +686930,7 @@ async function handleEvaluate(ctx3) {
|
|
|
686930
686930
|
}));
|
|
686931
686931
|
return true;
|
|
686932
686932
|
}
|
|
686933
|
-
const job = JSON.parse(
|
|
686933
|
+
const job = JSON.parse(readFileSync127(jobPath, "utf-8"));
|
|
686934
686934
|
sendJson2(res, 200, {
|
|
686935
686935
|
run_id: runId,
|
|
686936
686936
|
task: job.task,
|
|
@@ -687070,7 +687070,7 @@ async function handleMintKey(ctx3) {
|
|
|
687070
687070
|
function _readStatusFile(p2) {
|
|
687071
687071
|
if (!existsSync157(p2)) return null;
|
|
687072
687072
|
try {
|
|
687073
|
-
const data = JSON.parse(
|
|
687073
|
+
const data = JSON.parse(readFileSync127(p2, "utf-8"));
|
|
687074
687074
|
if (data?.connected && typeof data.peerId === "string" && data.peerId.length > 10) {
|
|
687075
687075
|
const pid = Number(data.pid);
|
|
687076
687076
|
if (pid > 0) {
|
|
@@ -687113,7 +687113,7 @@ function resolveLocalPeerId() {
|
|
|
687113
687113
|
try {
|
|
687114
687114
|
const regPath = join168(homedir57(), ".omnius", "nexus-registry.json");
|
|
687115
687115
|
if (existsSync157(regPath)) {
|
|
687116
|
-
const reg = JSON.parse(
|
|
687116
|
+
const reg = JSON.parse(readFileSync127(regPath, "utf-8"));
|
|
687117
687117
|
const entries = Array.isArray(reg?.dirs) ? reg.dirs : [];
|
|
687118
687118
|
for (const entry of entries) {
|
|
687119
687119
|
const dir = typeof entry === "string" ? entry : entry?.dir;
|
|
@@ -688625,7 +688625,7 @@ function aimsDir() {
|
|
|
688625
688625
|
function readAimsFile(name10, fallback) {
|
|
688626
688626
|
try {
|
|
688627
688627
|
const p2 = join168(aimsDir(), name10);
|
|
688628
|
-
if (existsSync157(p2)) return JSON.parse(
|
|
688628
|
+
if (existsSync157(p2)) return JSON.parse(readFileSync127(p2, "utf-8"));
|
|
688629
688629
|
} catch {
|
|
688630
688630
|
}
|
|
688631
688631
|
return fallback;
|
|
@@ -689002,7 +689002,7 @@ async function handleAimsSuppliers(ctx3) {
|
|
|
689002
689002
|
for (const p2 of sponsorPaths) {
|
|
689003
689003
|
if (!existsSync157(p2)) continue;
|
|
689004
689004
|
try {
|
|
689005
|
-
const raw = JSON.parse(
|
|
689005
|
+
const raw = JSON.parse(readFileSync127(p2, "utf-8"));
|
|
689006
689006
|
const list = Array.isArray(raw) ? raw : raw?.sponsors ?? [];
|
|
689007
689007
|
for (const s2 of list) {
|
|
689008
689008
|
suppliers.push({
|
|
@@ -700289,7 +700289,7 @@ var init_auth_oidc = __esm({
|
|
|
700289
700289
|
});
|
|
700290
700290
|
|
|
700291
700291
|
// packages/cli/src/api/usage-tracker.ts
|
|
700292
|
-
import { mkdirSync as mkdirSync99, readFileSync as
|
|
700292
|
+
import { mkdirSync as mkdirSync99, readFileSync as readFileSync128, writeFileSync as writeFileSync84, existsSync as existsSync158 } from "node:fs";
|
|
700293
700293
|
import { join as join169 } from "node:path";
|
|
700294
700294
|
function initUsageTracker(omniusDir) {
|
|
700295
700295
|
const dir = join169(omniusDir, "usage");
|
|
@@ -700297,7 +700297,7 @@ function initUsageTracker(omniusDir) {
|
|
|
700297
700297
|
usageFile = join169(dir, "token-usage.json");
|
|
700298
700298
|
try {
|
|
700299
700299
|
if (existsSync158(usageFile)) {
|
|
700300
|
-
store = JSON.parse(
|
|
700300
|
+
store = JSON.parse(readFileSync128(usageFile, "utf-8"));
|
|
700301
700301
|
}
|
|
700302
700302
|
} catch {
|
|
700303
700303
|
store = { providers: {}, lastSaved: "" };
|
|
@@ -700996,7 +700996,7 @@ import {
|
|
|
700996
700996
|
createReadStream as createReadStream2,
|
|
700997
700997
|
mkdirSync as mkdirSync101,
|
|
700998
700998
|
writeFileSync as writeFileSync86,
|
|
700999
|
-
readFileSync as
|
|
700999
|
+
readFileSync as readFileSync129,
|
|
701000
701000
|
readdirSync as readdirSync56,
|
|
701001
701001
|
existsSync as existsSync160,
|
|
701002
701002
|
watch as fsWatch4,
|
|
@@ -701028,7 +701028,7 @@ function getVersion3() {
|
|
|
701028
701028
|
for (const pkgPath of candidates) {
|
|
701029
701029
|
try {
|
|
701030
701030
|
if (!existsSync160(pkgPath)) continue;
|
|
701031
|
-
const pkg = JSON.parse(
|
|
701031
|
+
const pkg = JSON.parse(readFileSync129(pkgPath, "utf8"));
|
|
701032
701032
|
if (pkg.name === "omnius" || pkg.name === "@omnius/cli" || pkg.name === "@omnius/monorepo") {
|
|
701033
701033
|
return pkg.version ?? "0.0.0";
|
|
701034
701034
|
}
|
|
@@ -701444,7 +701444,7 @@ function isOriginAllowed(origin) {
|
|
|
701444
701444
|
try {
|
|
701445
701445
|
const accessFile = join172(homedir59(), ".omnius", "access");
|
|
701446
701446
|
if (existsSync160(accessFile)) {
|
|
701447
|
-
const persisted =
|
|
701447
|
+
const persisted = readFileSync129(accessFile, "utf8").trim().toLowerCase();
|
|
701448
701448
|
if (persisted === "any" || persisted === "lan" || persisted === "loopback") {
|
|
701449
701449
|
accessMode = persisted;
|
|
701450
701450
|
}
|
|
@@ -702296,7 +702296,7 @@ function loadJob(id) {
|
|
|
702296
702296
|
const file = join172(jobsDir(), `${id}.json`);
|
|
702297
702297
|
if (!existsSync160(file)) return null;
|
|
702298
702298
|
try {
|
|
702299
|
-
return JSON.parse(
|
|
702299
|
+
return JSON.parse(readFileSync129(file, "utf-8"));
|
|
702300
702300
|
} catch {
|
|
702301
702301
|
return null;
|
|
702302
702302
|
}
|
|
@@ -702309,7 +702309,7 @@ function listJobs2() {
|
|
|
702309
702309
|
for (const file of files) {
|
|
702310
702310
|
try {
|
|
702311
702311
|
jobs.push(
|
|
702312
|
-
JSON.parse(
|
|
702312
|
+
JSON.parse(readFileSync129(join172(dir, file), "utf-8"))
|
|
702313
702313
|
);
|
|
702314
702314
|
} catch {
|
|
702315
702315
|
}
|
|
@@ -702327,7 +702327,7 @@ function pruneOldJobs() {
|
|
|
702327
702327
|
if (!file.endsWith(".json")) continue;
|
|
702328
702328
|
const path12 = join172(dir, file);
|
|
702329
702329
|
try {
|
|
702330
|
-
const job = JSON.parse(
|
|
702330
|
+
const job = JSON.parse(readFileSync129(path12, "utf-8"));
|
|
702331
702331
|
if (job.status === "running") {
|
|
702332
702332
|
kept++;
|
|
702333
702333
|
continue;
|
|
@@ -704481,7 +704481,7 @@ function readUpdateState() {
|
|
|
704481
704481
|
try {
|
|
704482
704482
|
const p2 = updateStateFile();
|
|
704483
704483
|
if (!existsSync160(p2)) return null;
|
|
704484
|
-
return JSON.parse(
|
|
704484
|
+
return JSON.parse(readFileSync129(p2, "utf-8"));
|
|
704485
704485
|
} catch {
|
|
704486
704486
|
return null;
|
|
704487
704487
|
}
|
|
@@ -704786,7 +704786,7 @@ function handleV1UpdateStatus(res) {
|
|
|
704786
704786
|
let exitCode = null;
|
|
704787
704787
|
try {
|
|
704788
704788
|
if (existsSync160(logPath3)) {
|
|
704789
|
-
const raw =
|
|
704789
|
+
const raw = readFileSync129(logPath3, "utf-8");
|
|
704790
704790
|
const m2 = raw.match(/__EXIT_CODE=(\d+)/);
|
|
704791
704791
|
if (m2) exitCode = parseInt(m2[1], 10);
|
|
704792
704792
|
logTail = raw.slice(-2e3);
|
|
@@ -709266,7 +709266,7 @@ function listScheduledTasks() {
|
|
|
709266
709266
|
if (dir.endsWith(`${join172(".omnius", "scheduled")}`) || dir.includes(`${join172(".omnius", "scheduled")}`)) {
|
|
709267
709267
|
const file = join172(dir, "tasks.json");
|
|
709268
709268
|
try {
|
|
709269
|
-
const raw =
|
|
709269
|
+
const raw = readFileSync129(file, "utf-8");
|
|
709270
709270
|
const json = JSON.parse(raw);
|
|
709271
709271
|
const tasks = Array.isArray(json?.tasks) ? json.tasks : Array.isArray(json) ? json : [];
|
|
709272
709272
|
tasks.forEach((t2, i2) => {
|
|
@@ -709364,7 +709364,7 @@ function setScheduledEnabled(id, enabled2) {
|
|
|
709364
709364
|
const target = tasks.find((t2) => t2.id === id);
|
|
709365
709365
|
if (!target) return false;
|
|
709366
709366
|
try {
|
|
709367
|
-
const raw =
|
|
709367
|
+
const raw = readFileSync129(target.file, "utf-8");
|
|
709368
709368
|
const json = JSON.parse(raw);
|
|
709369
709369
|
const arr = Array.isArray(json?.tasks) ? json.tasks : Array.isArray(json) ? json : [];
|
|
709370
709370
|
if (!arr[target.index]) return false;
|
|
@@ -709397,7 +709397,7 @@ function deleteScheduledById(id) {
|
|
|
709397
709397
|
const target = tasks.find((t2) => t2.id === id);
|
|
709398
709398
|
if (!target) return false;
|
|
709399
709399
|
try {
|
|
709400
|
-
const raw =
|
|
709400
|
+
const raw = readFileSync129(target.file, "utf-8");
|
|
709401
709401
|
const json = JSON.parse(raw);
|
|
709402
709402
|
const arr = Array.isArray(json?.tasks) ? json.tasks : Array.isArray(json) ? json : [];
|
|
709403
709403
|
if (!arr[target.index]) return false;
|
|
@@ -709622,7 +709622,7 @@ function reconcileScheduledTasks(apply) {
|
|
|
709622
709622
|
try {
|
|
709623
709623
|
let json = { tasks: [] };
|
|
709624
709624
|
try {
|
|
709625
|
-
const raw =
|
|
709625
|
+
const raw = readFileSync129(file, "utf-8");
|
|
709626
709626
|
json = JSON.parse(raw);
|
|
709627
709627
|
} catch {
|
|
709628
709628
|
}
|
|
@@ -710001,7 +710001,7 @@ function startApiServer(options2 = {}) {
|
|
|
710001
710001
|
const sid = f2.replace(/\.json$/, "");
|
|
710002
710002
|
try {
|
|
710003
710003
|
const items = JSON.parse(
|
|
710004
|
-
|
|
710004
|
+
readFileSync129(join172(dir, f2), "utf-8")
|
|
710005
710005
|
);
|
|
710006
710006
|
if (Array.isArray(items)) {
|
|
710007
710007
|
cache8.set(sid, new Map(items.map((t2) => [t2.id, t2])));
|
|
@@ -710035,7 +710035,7 @@ function startApiServer(options2 = {}) {
|
|
|
710035
710035
|
}
|
|
710036
710036
|
return;
|
|
710037
710037
|
}
|
|
710038
|
-
next = JSON.parse(
|
|
710038
|
+
next = JSON.parse(readFileSync129(fp, "utf-8"));
|
|
710039
710039
|
if (!Array.isArray(next)) return;
|
|
710040
710040
|
} catch {
|
|
710041
710041
|
return;
|
|
@@ -710098,7 +710098,7 @@ function startApiServer(options2 = {}) {
|
|
|
710098
710098
|
if (!f2.endsWith(".json")) continue;
|
|
710099
710099
|
try {
|
|
710100
710100
|
const jobPath = join172(jobsDir3, f2);
|
|
710101
|
-
const job = JSON.parse(
|
|
710101
|
+
const job = JSON.parse(readFileSync129(jobPath, "utf-8"));
|
|
710102
710102
|
const jobTime = new Date(
|
|
710103
710103
|
job.startedAt ?? job.completedAt ?? 0
|
|
710104
710104
|
).getTime();
|
|
@@ -710120,8 +710120,8 @@ function startApiServer(options2 = {}) {
|
|
|
710120
710120
|
if (useTls) {
|
|
710121
710121
|
try {
|
|
710122
710122
|
tlsOpts = {
|
|
710123
|
-
cert:
|
|
710124
|
-
key:
|
|
710123
|
+
cert: readFileSync129(resolve66(tlsCert)),
|
|
710124
|
+
key: readFileSync129(resolve66(tlsKey))
|
|
710125
710125
|
};
|
|
710126
710126
|
} catch (e2) {
|
|
710127
710127
|
log22(`
|
|
@@ -710134,7 +710134,7 @@ function startApiServer(options2 = {}) {
|
|
|
710134
710134
|
try {
|
|
710135
710135
|
const accessFile = join172(homedir59(), ".omnius", "access");
|
|
710136
710136
|
if (existsSync160(accessFile)) {
|
|
710137
|
-
const persisted =
|
|
710137
|
+
const persisted = readFileSync129(accessFile, "utf8").trim();
|
|
710138
710138
|
const resolved = resolveAccessMode(persisted, host);
|
|
710139
710139
|
if (resolved) runtimeAccessMode = resolved;
|
|
710140
710140
|
}
|
|
@@ -710565,7 +710565,7 @@ function startApiServer(options2 = {}) {
|
|
|
710565
710565
|
for (const rel of ["../package.json", "../../package.json", "../../../package.json", "../../../../package.json"]) {
|
|
710566
710566
|
const p2 = join172(here, rel);
|
|
710567
710567
|
if (existsSync160(p2)) {
|
|
710568
|
-
const pkg = JSON.parse(
|
|
710568
|
+
const pkg = JSON.parse(readFileSync129(p2, "utf8"));
|
|
710569
710569
|
if (pkg.name === "omnius" || pkg.name === "@omnius/cli" || pkg.name === "@omnius/monorepo") {
|
|
710570
710570
|
return pkg.version ?? null;
|
|
710571
710571
|
}
|
|
@@ -711513,7 +711513,7 @@ __export(clipboard_media_exports, {
|
|
|
711513
711513
|
pasteClipboardImageToFile: () => pasteClipboardImageToFile
|
|
711514
711514
|
});
|
|
711515
711515
|
import { execFileSync as execFileSync11, execSync as execSync61 } from "node:child_process";
|
|
711516
|
-
import { mkdirSync as mkdirSync102, readFileSync as
|
|
711516
|
+
import { mkdirSync as mkdirSync102, readFileSync as readFileSync130, rmSync as rmSync13, writeFileSync as writeFileSync87 } from "node:fs";
|
|
711517
711517
|
import { join as join173 } from "node:path";
|
|
711518
711518
|
function pasteClipboardImageToFile(repoRoot) {
|
|
711519
711519
|
const image = readClipboardImage();
|
|
@@ -711530,7 +711530,7 @@ function readClipboardImage() {
|
|
|
711530
711530
|
execSync61("command -v pngpaste", { stdio: "ignore", timeout: 1e3 });
|
|
711531
711531
|
const tmp = `/tmp/omnius-clipboard-${Date.now()}.png`;
|
|
711532
711532
|
execFileSync11("pngpaste", [tmp], { timeout: 3e3 });
|
|
711533
|
-
const buffer2 =
|
|
711533
|
+
const buffer2 = readFileSync130(tmp);
|
|
711534
711534
|
try {
|
|
711535
711535
|
rmSync13(tmp);
|
|
711536
711536
|
} catch {
|
|
@@ -711589,7 +711589,7 @@ import { resolve as resolve67, join as join174, dirname as dirname52, extname as
|
|
|
711589
711589
|
import { createRequire as createRequire9 } from "node:module";
|
|
711590
711590
|
import { fileURLToPath as fileURLToPath21 } from "node:url";
|
|
711591
711591
|
import {
|
|
711592
|
-
readFileSync as
|
|
711592
|
+
readFileSync as readFileSync131,
|
|
711593
711593
|
writeFileSync as writeFileSync88,
|
|
711594
711594
|
appendFileSync as appendFileSync17,
|
|
711595
711595
|
rmSync as rmSync14,
|
|
@@ -711598,6 +711598,11 @@ import {
|
|
|
711598
711598
|
mkdirSync as mkdirSync103
|
|
711599
711599
|
} from "node:fs";
|
|
711600
711600
|
import { existsSync as existsSync161 } from "node:fs";
|
|
711601
|
+
import {
|
|
711602
|
+
readFile as readFileAsync2,
|
|
711603
|
+
writeFile as writeFileAsync2,
|
|
711604
|
+
mkdir as mkdirAsync
|
|
711605
|
+
} from "node:fs/promises";
|
|
711601
711606
|
import { execSync as execSync62 } from "node:child_process";
|
|
711602
711607
|
import { homedir as homedir60 } from "node:os";
|
|
711603
711608
|
function formatTimeAgo2(date) {
|
|
@@ -711765,13 +711770,14 @@ ${incompleteList}${more}
|
|
|
711765
711770
|
const scripts = pkg.scripts || {};
|
|
711766
711771
|
const checkScript = scripts["typecheck"] ? "typecheck" : scripts["build"] ? "build" : null;
|
|
711767
711772
|
if (checkScript) {
|
|
711768
|
-
const {
|
|
711773
|
+
const { exec: exec6 } = await import("node:child_process");
|
|
711774
|
+
const { promisify: promisify8 } = await import("node:util");
|
|
711769
711775
|
try {
|
|
711770
|
-
|
|
711776
|
+
await promisify8(exec6)(`npm run ${checkScript} --silent 2>&1`, {
|
|
711771
711777
|
cwd: cwd4,
|
|
711772
|
-
stdio: "pipe",
|
|
711773
711778
|
timeout: 12e4,
|
|
711774
|
-
encoding: "utf-8"
|
|
711779
|
+
encoding: "utf-8",
|
|
711780
|
+
maxBuffer: 10 * 1024 * 1024
|
|
711775
711781
|
});
|
|
711776
711782
|
} catch (e2) {
|
|
711777
711783
|
const out = ((e2?.stdout || "") + (e2?.stderr || "")).toString().slice(0, 2e3);
|
|
@@ -712979,7 +712985,7 @@ function gatherMemorySnippets(root) {
|
|
|
712979
712985
|
if (!existsSync161(dir)) continue;
|
|
712980
712986
|
try {
|
|
712981
712987
|
for (const f2 of readdirSync57(dir).filter((f3) => f3.endsWith(".json"))) {
|
|
712982
|
-
const data = JSON.parse(
|
|
712988
|
+
const data = JSON.parse(readFileSync131(join174(dir, f2), "utf-8"));
|
|
712983
712989
|
for (const val of Object.values(data)) {
|
|
712984
712990
|
const v = typeof val === "object" && val !== null && "value" in val ? String(val.value) : String(val);
|
|
712985
712991
|
if (v.length > 10) snippets.push(v);
|
|
@@ -713415,7 +713421,7 @@ ${metabolismMemories}
|
|
|
713415
713421
|
try {
|
|
713416
713422
|
const archeFile = join174(repoRoot, ".omnius", "arche", "variants.json");
|
|
713417
713423
|
if (existsSync161(archeFile)) {
|
|
713418
|
-
const variants = JSON.parse(
|
|
713424
|
+
const variants = JSON.parse(readFileSync131(archeFile, "utf8"));
|
|
713419
713425
|
if (variants.length > 0) {
|
|
713420
713426
|
let filtered = variants;
|
|
713421
713427
|
if (taskType) {
|
|
@@ -713530,8 +713536,8 @@ RULES:
|
|
|
713530
713536
|
const localCheckResp = (() => {
|
|
713531
713537
|
try {
|
|
713532
713538
|
return __require("node:child_process").execSync(
|
|
713533
|
-
"curl -s http://localhost:11434/api/tags 2>/dev/null",
|
|
713534
|
-
{ encoding: "utf8", timeout:
|
|
713539
|
+
"curl -s --max-time 1 http://localhost:11434/api/tags 2>/dev/null",
|
|
713540
|
+
{ encoding: "utf8", timeout: 1500 }
|
|
713535
713541
|
);
|
|
713536
713542
|
} catch {
|
|
713537
713543
|
return "";
|
|
@@ -713672,7 +713678,7 @@ RULES:
|
|
|
713672
713678
|
"self-state.json"
|
|
713673
713679
|
);
|
|
713674
713680
|
if (existsSync161(ikStateFile)) {
|
|
713675
|
-
const selfState = JSON.parse(
|
|
713681
|
+
const selfState = JSON.parse(readFileSync131(ikStateFile, "utf8"));
|
|
713676
713682
|
const lines = [
|
|
713677
713683
|
`[Identity State v${selfState.version}]`,
|
|
713678
713684
|
`Self: ${selfState.narrative_summary}`,
|
|
@@ -714010,7 +714016,7 @@ Review its full output via sub_agent(action='output', id='${id}')`
|
|
|
714010
714016
|
}
|
|
714011
714017
|
}
|
|
714012
714018
|
try {
|
|
714013
|
-
const { readdirSync: readdirSync59, readFileSync:
|
|
714019
|
+
const { readdirSync: readdirSync59, readFileSync: readFileSync133, existsSync: existsSync164 } = await import("node:fs");
|
|
714014
714020
|
const { join: pathJoin } = await import("node:path");
|
|
714015
714021
|
const chunksDir = pathJoin(cwd(), ".omnius", "todo-chunks");
|
|
714016
714022
|
if (existsSync164(chunksDir)) {
|
|
@@ -714020,7 +714026,7 @@ Review its full output via sub_agent(action='output', id='${id}')`
|
|
|
714020
714026
|
for (const f2 of files) {
|
|
714021
714027
|
try {
|
|
714022
714028
|
const data = JSON.parse(
|
|
714023
|
-
|
|
714029
|
+
readFileSync133(pathJoin(chunksDir, f2), "utf-8")
|
|
714024
714030
|
);
|
|
714025
714031
|
if (data._deleted) continue;
|
|
714026
714032
|
if ((data.functionalSummary || "").toLowerCase().includes(q) || (data.detailSummary || "").toLowerCase().includes(q) || (data.keyFiles || []).some(
|
|
@@ -714086,7 +714092,7 @@ ${lines.join("\n")}`
|
|
|
714086
714092
|
const expand2 = args.expand === true;
|
|
714087
714093
|
if (expand2 && id.startsWith("todo-ctx-")) {
|
|
714088
714094
|
try {
|
|
714089
|
-
const { readFileSync:
|
|
714095
|
+
const { readFileSync: readFileSync133, existsSync: existsSync164 } = await import("node:fs");
|
|
714090
714096
|
const { join: pathJoin } = await import("node:path");
|
|
714091
714097
|
const chunksDir = pathJoin(cwd(), ".omnius", "todo-chunks");
|
|
714092
714098
|
const todoIdSuffix = id.replace("todo-ctx-", "");
|
|
@@ -715102,136 +715108,139 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
|
|
|
715102
715108
|
runSelfImprovementCycle(repoRoot).catch(() => {
|
|
715103
715109
|
});
|
|
715104
715110
|
}
|
|
715105
|
-
|
|
715106
|
-
const ikDir = join174(repoRoot, ".omnius", "identity");
|
|
715107
|
-
const ikFile = join174(ikDir, "self-state.json");
|
|
715108
|
-
let ikState;
|
|
715109
|
-
if (existsSync161(ikFile)) {
|
|
715110
|
-
ikState = JSON.parse(readFileSync132(ikFile, "utf8"));
|
|
715111
|
-
} else {
|
|
715112
|
-
mkdirSync103(ikDir, { recursive: true });
|
|
715113
|
-
const machineId = Date.now().toString(36) + Math.random().toString(36).slice(2, 8);
|
|
715114
|
-
ikState = {
|
|
715115
|
-
self_id: `omnius-${machineId}`,
|
|
715116
|
-
version: 1,
|
|
715117
|
-
narrative_summary: "I am an AI coding agent powered by open-weight models. I help with software engineering tasks by reading code, making changes, and running tests.",
|
|
715118
|
-
active_commitments: [
|
|
715119
|
-
"assist the user effectively",
|
|
715120
|
-
"maintain code quality"
|
|
715121
|
-
],
|
|
715122
|
-
active_goals: [],
|
|
715123
|
-
open_contradictions: [],
|
|
715124
|
-
values_stack: [
|
|
715125
|
-
"correctness",
|
|
715126
|
-
"efficiency",
|
|
715127
|
-
"transparency",
|
|
715128
|
-
"user-alignment"
|
|
715129
|
-
],
|
|
715130
|
-
interaction_style: {
|
|
715131
|
-
tone: "collaborative",
|
|
715132
|
-
depth_default: "balanced",
|
|
715133
|
-
speech_style: "concise"
|
|
715134
|
-
},
|
|
715135
|
-
relationship_models: [],
|
|
715136
|
-
homeostasis: {
|
|
715137
|
-
uncertainty: 0.1,
|
|
715138
|
-
coherence: 1,
|
|
715139
|
-
goal_tension: 0,
|
|
715140
|
-
memory_trust: 0.9,
|
|
715141
|
-
boundary_breach: 0,
|
|
715142
|
-
latency_stress: 0
|
|
715143
|
-
},
|
|
715144
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
715145
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
715146
|
-
session_count: 0,
|
|
715147
|
-
version_history: [
|
|
715148
|
-
{
|
|
715149
|
-
version: 1,
|
|
715150
|
-
change: "Initial identity creation",
|
|
715151
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
715152
|
-
}
|
|
715153
|
-
]
|
|
715154
|
-
};
|
|
715155
|
-
}
|
|
715156
|
-
if (!ikState.stats)
|
|
715157
|
-
ikState.stats = {
|
|
715158
|
-
queries_served: 0,
|
|
715159
|
-
self_play_cycles: 0,
|
|
715160
|
-
learnings_published: 0,
|
|
715161
|
-
learnings_ingested: 0,
|
|
715162
|
-
reviews_given: 0,
|
|
715163
|
-
reviews_received: 0,
|
|
715164
|
-
avg_latency_ms: 0,
|
|
715165
|
-
tool_use_count: 0
|
|
715166
|
-
};
|
|
715167
|
-
if (!ikState.specializations) ikState.specializations = [];
|
|
715168
|
-
if (!ikState.completed_goals) ikState.completed_goals = [];
|
|
715169
|
-
if (!ikState.version_history) ikState.version_history = [];
|
|
715170
|
-
ikState.stats.queries_served++;
|
|
715171
|
-
const event = `Task completed: ${result.summary.slice(0, 200)}`;
|
|
715172
|
-
if (/success|pass|complete|done|fixed/i.test(event)) {
|
|
715173
|
-
ikState.homeostasis.uncertainty = Math.max(
|
|
715174
|
-
0,
|
|
715175
|
-
ikState.homeostasis.uncertainty - 0.01
|
|
715176
|
-
);
|
|
715177
|
-
ikState.homeostasis.coherence = Math.min(
|
|
715178
|
-
1,
|
|
715179
|
-
ikState.homeostasis.coherence + 5e-3
|
|
715180
|
-
);
|
|
715181
|
-
}
|
|
715182
|
-
if (result.durationMs) {
|
|
715183
|
-
const n2 = ikState.stats.queries_served;
|
|
715184
|
-
ikState.stats.avg_latency_ms = n2 > 1 ? Math.round(
|
|
715185
|
-
((ikState.stats.avg_latency_ms || 0) * (n2 - 1) + result.durationMs) / n2
|
|
715186
|
-
) : result.durationMs;
|
|
715187
|
-
ikState.homeostasis.latency_stress = result.durationMs > 3e4 ? Math.min(
|
|
715188
|
-
1,
|
|
715189
|
-
(ikState.homeostasis.latency_stress || 0) + 0.02
|
|
715190
|
-
) : Math.max(
|
|
715191
|
-
0,
|
|
715192
|
-
(ikState.homeostasis.latency_stress || 0) - 0.01
|
|
715193
|
-
);
|
|
715194
|
-
}
|
|
715195
|
-
if (result.toolCalls > 0) {
|
|
715196
|
-
const toolEvidence = result.summary || "";
|
|
715197
|
-
if (/web_search|web_fetch|searched|search.*web|fetched.*http|url/i.test(
|
|
715198
|
-
toolEvidence
|
|
715199
|
-
) && !ikState.specializations.includes("web-research")) {
|
|
715200
|
-
ikState.specializations.push("web-research");
|
|
715201
|
-
}
|
|
715202
|
-
if (/shell|grep_search|glob_find|executed.*command/i.test(
|
|
715203
|
-
toolEvidence
|
|
715204
|
-
) && !ikState.specializations.includes("code-execution")) {
|
|
715205
|
-
ikState.specializations.push("code-execution");
|
|
715206
|
-
}
|
|
715207
|
-
if (/file_write|file_edit|wrote.*file|edited.*file/i.test(
|
|
715208
|
-
toolEvidence
|
|
715209
|
-
) && !ikState.specializations.includes("file-operations")) {
|
|
715210
|
-
ikState.specializations.push("file-operations");
|
|
715211
|
-
}
|
|
715212
|
-
ikState.stats.tool_use_count = (ikState.stats.tool_use_count || 0) + result.toolCalls;
|
|
715213
|
-
}
|
|
715214
|
-
ikState.version = (ikState.version || 1) + 1;
|
|
715215
|
-
ikState.version_history.push({
|
|
715216
|
-
version: ikState.version,
|
|
715217
|
-
change: "query_served: " + cleanForStorage(result.summary).slice(0, 60),
|
|
715218
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
715219
|
-
});
|
|
715220
|
-
if (ikState.version_history.length > 200)
|
|
715221
|
-
ikState.version_history = ikState.version_history.slice(-200);
|
|
715222
|
-
if (ikState.version % 10 === 0) {
|
|
715223
|
-
const specList = (ikState.specializations || []).join(", ") || "general-purpose";
|
|
715224
|
-
ikState.narrative_summary = `Agent ${ikState.self_id || "omnius"} — ${ikState.stats.queries_served} queries served` + (ikState.specializations.length > 0 ? `, specializes in ${specList}` : "") + `. Coherence: ${(ikState.homeostasis.coherence || 0).toFixed(2)}, uncertainty: ${(ikState.homeostasis.uncertainty || 0).toFixed(2)}.`;
|
|
715225
|
-
}
|
|
715226
|
-
ikState.session_count = (ikState.session_count || 0) + 1;
|
|
715227
|
-
ikState.updated_at = (/* @__PURE__ */ new Date()).toISOString();
|
|
715228
|
-
writeFileSync88(ikFile, JSON.stringify(ikState, null, 2));
|
|
715229
|
-
} catch (ikErr) {
|
|
715111
|
+
void (async () => {
|
|
715230
715112
|
try {
|
|
715231
|
-
|
|
715232
|
-
|
|
715113
|
+
const ikDir = join174(repoRoot, ".omnius", "identity");
|
|
715114
|
+
const ikFile = join174(ikDir, "self-state.json");
|
|
715115
|
+
let ikState;
|
|
715116
|
+
if (existsSync161(ikFile)) {
|
|
715117
|
+
ikState = JSON.parse(await readFileAsync2(ikFile, "utf8"));
|
|
715118
|
+
} else {
|
|
715119
|
+
await mkdirAsync(ikDir, { recursive: true });
|
|
715120
|
+
const machineId = Date.now().toString(36) + Math.random().toString(36).slice(2, 8);
|
|
715121
|
+
ikState = {
|
|
715122
|
+
self_id: `omnius-${machineId}`,
|
|
715123
|
+
version: 1,
|
|
715124
|
+
narrative_summary: "I am an AI coding agent powered by open-weight models. I help with software engineering tasks by reading code, making changes, and running tests.",
|
|
715125
|
+
active_commitments: [
|
|
715126
|
+
"assist the user effectively",
|
|
715127
|
+
"maintain code quality"
|
|
715128
|
+
],
|
|
715129
|
+
active_goals: [],
|
|
715130
|
+
open_contradictions: [],
|
|
715131
|
+
values_stack: [
|
|
715132
|
+
"correctness",
|
|
715133
|
+
"efficiency",
|
|
715134
|
+
"transparency",
|
|
715135
|
+
"user-alignment"
|
|
715136
|
+
],
|
|
715137
|
+
interaction_style: {
|
|
715138
|
+
tone: "collaborative",
|
|
715139
|
+
depth_default: "balanced",
|
|
715140
|
+
speech_style: "concise"
|
|
715141
|
+
},
|
|
715142
|
+
relationship_models: [],
|
|
715143
|
+
homeostasis: {
|
|
715144
|
+
uncertainty: 0.1,
|
|
715145
|
+
coherence: 1,
|
|
715146
|
+
goal_tension: 0,
|
|
715147
|
+
memory_trust: 0.9,
|
|
715148
|
+
boundary_breach: 0,
|
|
715149
|
+
latency_stress: 0
|
|
715150
|
+
},
|
|
715151
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
715152
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
715153
|
+
session_count: 0,
|
|
715154
|
+
version_history: [
|
|
715155
|
+
{
|
|
715156
|
+
version: 1,
|
|
715157
|
+
change: "Initial identity creation",
|
|
715158
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
715159
|
+
}
|
|
715160
|
+
]
|
|
715161
|
+
};
|
|
715162
|
+
}
|
|
715163
|
+
if (!ikState.stats)
|
|
715164
|
+
ikState.stats = {
|
|
715165
|
+
queries_served: 0,
|
|
715166
|
+
self_play_cycles: 0,
|
|
715167
|
+
learnings_published: 0,
|
|
715168
|
+
learnings_ingested: 0,
|
|
715169
|
+
reviews_given: 0,
|
|
715170
|
+
reviews_received: 0,
|
|
715171
|
+
avg_latency_ms: 0,
|
|
715172
|
+
tool_use_count: 0
|
|
715173
|
+
};
|
|
715174
|
+
if (!ikState.specializations) ikState.specializations = [];
|
|
715175
|
+
if (!ikState.completed_goals) ikState.completed_goals = [];
|
|
715176
|
+
if (!ikState.version_history) ikState.version_history = [];
|
|
715177
|
+
ikState.stats.queries_served++;
|
|
715178
|
+
const event = `Task completed: ${result.summary.slice(0, 200)}`;
|
|
715179
|
+
if (/success|pass|complete|done|fixed/i.test(event)) {
|
|
715180
|
+
ikState.homeostasis.uncertainty = Math.max(
|
|
715181
|
+
0,
|
|
715182
|
+
ikState.homeostasis.uncertainty - 0.01
|
|
715183
|
+
);
|
|
715184
|
+
ikState.homeostasis.coherence = Math.min(
|
|
715185
|
+
1,
|
|
715186
|
+
ikState.homeostasis.coherence + 5e-3
|
|
715187
|
+
);
|
|
715188
|
+
}
|
|
715189
|
+
if (result.durationMs) {
|
|
715190
|
+
const n2 = ikState.stats.queries_served;
|
|
715191
|
+
ikState.stats.avg_latency_ms = n2 > 1 ? Math.round(
|
|
715192
|
+
((ikState.stats.avg_latency_ms || 0) * (n2 - 1) + result.durationMs) / n2
|
|
715193
|
+
) : result.durationMs;
|
|
715194
|
+
ikState.homeostasis.latency_stress = result.durationMs > 3e4 ? Math.min(
|
|
715195
|
+
1,
|
|
715196
|
+
(ikState.homeostasis.latency_stress || 0) + 0.02
|
|
715197
|
+
) : Math.max(
|
|
715198
|
+
0,
|
|
715199
|
+
(ikState.homeostasis.latency_stress || 0) - 0.01
|
|
715200
|
+
);
|
|
715201
|
+
}
|
|
715202
|
+
if (result.toolCalls > 0) {
|
|
715203
|
+
const toolEvidence = result.summary || "";
|
|
715204
|
+
if (/web_search|web_fetch|searched|search.*web|fetched.*http|url/i.test(
|
|
715205
|
+
toolEvidence
|
|
715206
|
+
) && !ikState.specializations.includes("web-research")) {
|
|
715207
|
+
ikState.specializations.push("web-research");
|
|
715208
|
+
}
|
|
715209
|
+
if (/shell|grep_search|glob_find|executed.*command/i.test(
|
|
715210
|
+
toolEvidence
|
|
715211
|
+
) && !ikState.specializations.includes("code-execution")) {
|
|
715212
|
+
ikState.specializations.push("code-execution");
|
|
715213
|
+
}
|
|
715214
|
+
if (/file_write|file_edit|wrote.*file|edited.*file/i.test(
|
|
715215
|
+
toolEvidence
|
|
715216
|
+
) && !ikState.specializations.includes("file-operations")) {
|
|
715217
|
+
ikState.specializations.push("file-operations");
|
|
715218
|
+
}
|
|
715219
|
+
ikState.stats.tool_use_count = (ikState.stats.tool_use_count || 0) + result.toolCalls;
|
|
715220
|
+
}
|
|
715221
|
+
ikState.version = (ikState.version || 1) + 1;
|
|
715222
|
+
ikState.version_history.push({
|
|
715223
|
+
version: ikState.version,
|
|
715224
|
+
change: "query_served: " + cleanForStorage(result.summary).slice(0, 60),
|
|
715225
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
715226
|
+
});
|
|
715227
|
+
if (ikState.version_history.length > 200)
|
|
715228
|
+
ikState.version_history = ikState.version_history.slice(-200);
|
|
715229
|
+
if (ikState.version % 10 === 0) {
|
|
715230
|
+
const specList = (ikState.specializations || []).join(", ") || "general-purpose";
|
|
715231
|
+
ikState.narrative_summary = `Agent ${ikState.self_id || "omnius"} — ${ikState.stats.queries_served} queries served` + (ikState.specializations.length > 0 ? `, specializes in ${specList}` : "") + `. Coherence: ${(ikState.homeostasis.coherence || 0).toFixed(2)}, uncertainty: ${(ikState.homeostasis.uncertainty || 0).toFixed(2)}.`;
|
|
715232
|
+
}
|
|
715233
|
+
ikState.session_count = (ikState.session_count || 0) + 1;
|
|
715234
|
+
ikState.updated_at = (/* @__PURE__ */ new Date()).toISOString();
|
|
715235
|
+
await writeFileAsync2(ikFile, JSON.stringify(ikState, null, 2));
|
|
715236
|
+
} catch (ikErr) {
|
|
715237
|
+
try {
|
|
715238
|
+
console.error("[IK-OBSERVE]", ikErr);
|
|
715239
|
+
} catch {
|
|
715240
|
+
}
|
|
715233
715241
|
}
|
|
715234
|
-
}
|
|
715242
|
+
})().catch(() => {
|
|
715243
|
+
});
|
|
715235
715244
|
if (voice?.enabled && result.summary) {
|
|
715236
715245
|
const alreadySpoken = voice._spokenStreamText;
|
|
715237
715246
|
voice._spokenStreamText = false;
|
|
@@ -715256,40 +715265,43 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
|
|
|
715256
715265
|
result.durationMs,
|
|
715257
715266
|
tokens
|
|
715258
715267
|
);
|
|
715259
|
-
|
|
715260
|
-
|
|
715261
|
-
|
|
715262
|
-
|
|
715263
|
-
|
|
715264
|
-
|
|
715265
|
-
|
|
715266
|
-
if (existsSync161(ikFile)) {
|
|
715267
|
-
const ikState = JSON.parse(readFileSync132(ikFile, "utf8"));
|
|
715268
|
-
if (!ikState.stats) ikState.stats = { queries_served: 0 };
|
|
715269
|
-
ikState.stats.queries_served = (ikState.stats.queries_served || 0) + 1;
|
|
715270
|
-
ikState.homeostasis.uncertainty = Math.min(
|
|
715271
|
-
1,
|
|
715272
|
-
ikState.homeostasis.uncertainty + 0.03
|
|
715273
|
-
);
|
|
715274
|
-
ikState.homeostasis.coherence = Math.max(
|
|
715275
|
-
0,
|
|
715276
|
-
ikState.homeostasis.coherence - 0.02
|
|
715268
|
+
void (async () => {
|
|
715269
|
+
try {
|
|
715270
|
+
const ikFile = join174(
|
|
715271
|
+
repoRoot,
|
|
715272
|
+
".omnius",
|
|
715273
|
+
"identity",
|
|
715274
|
+
"self-state.json"
|
|
715277
715275
|
);
|
|
715278
|
-
|
|
715279
|
-
|
|
715280
|
-
|
|
715281
|
-
|
|
715282
|
-
|
|
715283
|
-
|
|
715284
|
-
|
|
715285
|
-
|
|
715286
|
-
ikState.
|
|
715287
|
-
|
|
715288
|
-
|
|
715289
|
-
|
|
715276
|
+
if (existsSync161(ikFile)) {
|
|
715277
|
+
const ikState = JSON.parse(await readFileAsync2(ikFile, "utf8"));
|
|
715278
|
+
if (!ikState.stats) ikState.stats = { queries_served: 0 };
|
|
715279
|
+
ikState.stats.queries_served = (ikState.stats.queries_served || 0) + 1;
|
|
715280
|
+
ikState.homeostasis.uncertainty = Math.min(
|
|
715281
|
+
1,
|
|
715282
|
+
ikState.homeostasis.uncertainty + 0.03
|
|
715283
|
+
);
|
|
715284
|
+
ikState.homeostasis.coherence = Math.max(
|
|
715285
|
+
0,
|
|
715286
|
+
ikState.homeostasis.coherence - 0.02
|
|
715287
|
+
);
|
|
715288
|
+
ikState.version = (ikState.version || 1) + 1;
|
|
715289
|
+
if (!ikState.version_history) ikState.version_history = [];
|
|
715290
|
+
ikState.version_history.push({
|
|
715291
|
+
version: ikState.version,
|
|
715292
|
+
change: "query_failed: task incomplete",
|
|
715293
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
715294
|
+
});
|
|
715295
|
+
if (ikState.version_history.length > 200)
|
|
715296
|
+
ikState.version_history = ikState.version_history.slice(-200);
|
|
715297
|
+
ikState.session_count = (ikState.session_count || 0) + 1;
|
|
715298
|
+
ikState.updated_at = (/* @__PURE__ */ new Date()).toISOString();
|
|
715299
|
+
await writeFileAsync2(ikFile, JSON.stringify(ikState, null, 2));
|
|
715300
|
+
}
|
|
715301
|
+
} catch {
|
|
715290
715302
|
}
|
|
715291
|
-
}
|
|
715292
|
-
}
|
|
715303
|
+
})().catch(() => {
|
|
715304
|
+
});
|
|
715293
715305
|
if (voice?.enabled) {
|
|
715294
715306
|
const emoFinal2 = emotionEngine?.getState();
|
|
715295
715307
|
const emoCtxFinal2 = emoFinal2 ? {
|
|
@@ -715589,7 +715601,7 @@ async function startInteractive(config, repoPath2) {
|
|
|
715589
715601
|
const omniusDir = join174(repoRoot, ".omnius");
|
|
715590
715602
|
const nexusPidFile = join174(omniusDir, "nexus", "daemon.pid");
|
|
715591
715603
|
if (existsSync161(nexusPidFile)) {
|
|
715592
|
-
const pid = parseInt(
|
|
715604
|
+
const pid = parseInt(readFileSync131(nexusPidFile, "utf8").trim(), 10);
|
|
715593
715605
|
if (pid > 0) {
|
|
715594
715606
|
try {
|
|
715595
715607
|
process.kill(pid, 0);
|
|
@@ -716738,7 +716750,7 @@ This is an independent background session started from /background.`
|
|
|
716738
716750
|
try {
|
|
716739
716751
|
const titleFile = join174(repoRoot, ".omnius", "session-title");
|
|
716740
716752
|
if (existsSync161(titleFile))
|
|
716741
|
-
sessionTitle =
|
|
716753
|
+
sessionTitle = readFileSync131(titleFile, "utf8").trim() || null;
|
|
716742
716754
|
} catch {
|
|
716743
716755
|
}
|
|
716744
716756
|
let carouselRetired = isResumed;
|
|
@@ -716853,7 +716865,7 @@ This is an independent background session started from /background.`
|
|
|
716853
716865
|
let savedHistory = [];
|
|
716854
716866
|
try {
|
|
716855
716867
|
if (existsSync161(HISTORY_FILE)) {
|
|
716856
|
-
const raw =
|
|
716868
|
+
const raw = readFileSync131(HISTORY_FILE, "utf8").trim();
|
|
716857
716869
|
if (raw) savedHistory = raw.split("\n").reverse();
|
|
716858
716870
|
}
|
|
716859
716871
|
} catch {
|
|
@@ -717008,7 +717020,7 @@ This is an independent background session started from /background.`
|
|
|
717008
717020
|
mkdirSync103(HISTORY_DIR, { recursive: true });
|
|
717009
717021
|
appendFileSync17(HISTORY_FILE, line + "\n", "utf8");
|
|
717010
717022
|
if (Math.random() < 0.02) {
|
|
717011
|
-
const all2 =
|
|
717023
|
+
const all2 = readFileSync131(HISTORY_FILE, "utf8").trim().split("\n");
|
|
717012
717024
|
if (all2.length > MAX_HISTORY_LINES) {
|
|
717013
717025
|
writeFileSync88(
|
|
717014
717026
|
HISTORY_FILE,
|
|
@@ -717237,7 +717249,7 @@ This is an independent background session started from /background.`
|
|
|
717237
717249
|
const nexusPidFile = join174(autoNexus.getNexusDir(), "daemon.pid");
|
|
717238
717250
|
if (existsSync161(nexusPidFile)) {
|
|
717239
717251
|
const nPid = parseInt(
|
|
717240
|
-
|
|
717252
|
+
readFileSync131(nexusPidFile, "utf8").trim(),
|
|
717241
717253
|
10
|
|
717242
717254
|
);
|
|
717243
717255
|
if (nPid > 0 && !registry2.daemons.has("Nexus")) {
|
|
@@ -717419,7 +717431,7 @@ Log: ${nexusLogPath}`
|
|
|
717419
717431
|
let agName = "";
|
|
717420
717432
|
try {
|
|
717421
717433
|
if (existsSync161(globalNamePath))
|
|
717422
|
-
agName =
|
|
717434
|
+
agName = readFileSync131(globalNamePath, "utf8").trim();
|
|
717423
717435
|
} catch {
|
|
717424
717436
|
}
|
|
717425
717437
|
if (!agName) {
|
|
@@ -717460,7 +717472,7 @@ Log: ${nexusLogPath}`
|
|
|
717460
717472
|
try {
|
|
717461
717473
|
if (existsSync161(savedSponsorsPath)) {
|
|
717462
717474
|
savedSponsors = JSON.parse(
|
|
717463
|
-
|
|
717475
|
+
readFileSync131(savedSponsorsPath, "utf8")
|
|
717464
717476
|
);
|
|
717465
717477
|
const oneHourAgo = Date.now() - 36e5;
|
|
717466
717478
|
savedSponsors = savedSponsors.filter(
|
|
@@ -719600,7 +719612,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
719600
719612
|
try {
|
|
719601
719613
|
const nexusPidFile = join174(nexusTool.getNexusDir(), "daemon.pid");
|
|
719602
719614
|
if (existsSync161(nexusPidFile)) {
|
|
719603
|
-
const pid = parseInt(
|
|
719615
|
+
const pid = parseInt(readFileSync131(nexusPidFile, "utf8").trim(), 10);
|
|
719604
719616
|
if (pid > 0) {
|
|
719605
719617
|
registry2.register({
|
|
719606
719618
|
name: "Nexus",
|
|
@@ -719813,7 +719825,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
719813
719825
|
const nexusDir = join174(repoRoot, OMNIUS_DIR, "nexus");
|
|
719814
719826
|
const pidFile = join174(nexusDir, "daemon.pid");
|
|
719815
719827
|
if (existsSync161(pidFile)) {
|
|
719816
|
-
const pid = parseInt(
|
|
719828
|
+
const pid = parseInt(readFileSync131(pidFile, "utf8").trim(), 10);
|
|
719817
719829
|
if (pid > 0) {
|
|
719818
719830
|
try {
|
|
719819
719831
|
if (process.platform === "win32") {
|
|
@@ -719846,7 +719858,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
719846
719858
|
const pidPath = join174(voiceDir3, pf);
|
|
719847
719859
|
if (existsSync161(pidPath)) {
|
|
719848
719860
|
try {
|
|
719849
|
-
const pid = parseInt(
|
|
719861
|
+
const pid = parseInt(readFileSync131(pidPath, "utf8").trim(), 10);
|
|
719850
719862
|
if (pid > 0) {
|
|
719851
719863
|
if (process.platform === "win32") {
|
|
719852
719864
|
try {
|
|
@@ -720003,8 +720015,8 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
720003
720015
|
"daemon.port"
|
|
720004
720016
|
);
|
|
720005
720017
|
if (existsSync161(ppPidFile)) {
|
|
720006
|
-
const ppPid = parseInt(
|
|
720007
|
-
const ppPort = existsSync161(ppPortFile) ? parseInt(
|
|
720018
|
+
const ppPid = parseInt(readFileSync131(ppPidFile, "utf8").trim(), 10);
|
|
720019
|
+
const ppPort = existsSync161(ppPortFile) ? parseInt(readFileSync131(ppPortFile, "utf8").trim(), 10) : void 0;
|
|
720008
720020
|
if (ppPid > 0 && !registry2.daemons.has("PersonaPlex")) {
|
|
720009
720021
|
registry2.register({
|
|
720010
720022
|
name: "PersonaPlex",
|
|
@@ -720021,7 +720033,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
720021
720033
|
"daemon.pid"
|
|
720022
720034
|
);
|
|
720023
720035
|
if (existsSync161(nexusPidFile)) {
|
|
720024
|
-
const nPid = parseInt(
|
|
720036
|
+
const nPid = parseInt(readFileSync131(nexusPidFile, "utf8").trim(), 10);
|
|
720025
720037
|
if (nPid > 0 && !registry2.daemons.has("Nexus")) {
|
|
720026
720038
|
try {
|
|
720027
720039
|
process.kill(nPid, 0);
|
|
@@ -720462,7 +720474,7 @@ Execute this skill now. Follow the behavioral guidance above.`;
|
|
|
720462
720474
|
if (isImage) {
|
|
720463
720475
|
try {
|
|
720464
720476
|
const imgPath = resolve67(repoRoot, cleanPath);
|
|
720465
|
-
const imgBuffer =
|
|
720477
|
+
const imgBuffer = readFileSync131(imgPath);
|
|
720466
720478
|
const base642 = imgBuffer.toString("base64");
|
|
720467
720479
|
const ext = extname22(cleanPath).toLowerCase();
|
|
720468
720480
|
const mime = ext === ".png" ? "image/png" : ext === ".gif" ? "image/gif" : ext === ".webp" ? "image/webp" : "image/jpeg";
|
|
@@ -720695,7 +720707,7 @@ Read it with image_read or vision if more detail is needed. Describe what you se
|
|
|
720695
720707
|
if (isMarkdown && fullInput === input) {
|
|
720696
720708
|
try {
|
|
720697
720709
|
const mdPath = resolve67(repoRoot, cleanPath);
|
|
720698
|
-
const mdContent =
|
|
720710
|
+
const mdContent = readFileSync131(mdPath, "utf8");
|
|
720699
720711
|
const { parseMcpMarkdown: parseMcpMarkdown2 } = await Promise.resolve().then(() => (init_dist5(), dist_exports2));
|
|
720700
720712
|
const result = parseMcpMarkdown2(mdContent);
|
|
720701
720713
|
if (result.servers.length > 0) {
|
|
@@ -721336,7 +721348,7 @@ async function runWithTUI(task, config, repoPath2, callbacks) {
|
|
|
721336
721348
|
const ikFile = join174(ikDir, "self-state.json");
|
|
721337
721349
|
let ikState;
|
|
721338
721350
|
if (existsSync161(ikFile)) {
|
|
721339
|
-
ikState = JSON.parse(
|
|
721351
|
+
ikState = JSON.parse(readFileSync131(ikFile, "utf8"));
|
|
721340
721352
|
} else {
|
|
721341
721353
|
mkdirSync103(ikDir, { recursive: true });
|
|
721342
721354
|
ikState = {
|
|
@@ -721409,7 +721421,7 @@ async function runWithTUI(task, config, repoPath2, callbacks) {
|
|
|
721409
721421
|
let variants = [];
|
|
721410
721422
|
try {
|
|
721411
721423
|
if (existsSync161(archeFile))
|
|
721412
|
-
variants = JSON.parse(
|
|
721424
|
+
variants = JSON.parse(readFileSync131(archeFile, "utf8"));
|
|
721413
721425
|
} catch {
|
|
721414
721426
|
}
|
|
721415
721427
|
variants.push({
|
|
@@ -721437,7 +721449,7 @@ async function runWithTUI(task, config, repoPath2, callbacks) {
|
|
|
721437
721449
|
"store.json"
|
|
721438
721450
|
);
|
|
721439
721451
|
if (existsSync161(metaFile2)) {
|
|
721440
|
-
const store2 = JSON.parse(
|
|
721452
|
+
const store2 = JSON.parse(readFileSync131(metaFile2, "utf8"));
|
|
721441
721453
|
const surfaced = store2.filter(
|
|
721442
721454
|
(m2) => m2.type !== "quarantine" && m2.scores?.confidence > 0.15
|
|
721443
721455
|
).sort(
|
|
@@ -721540,7 +721552,7 @@ Rules:
|
|
|
721540
721552
|
let store2 = [];
|
|
721541
721553
|
try {
|
|
721542
721554
|
if (existsSync161(storeFile))
|
|
721543
|
-
store2 = JSON.parse(
|
|
721555
|
+
store2 = JSON.parse(readFileSync131(storeFile, "utf8"));
|
|
721544
721556
|
} catch {
|
|
721545
721557
|
}
|
|
721546
721558
|
store2.push({
|
|
@@ -721574,7 +721586,7 @@ Rules:
|
|
|
721574
721586
|
let cohereActive = false;
|
|
721575
721587
|
try {
|
|
721576
721588
|
if (existsSync161(cohereSettingsFile)) {
|
|
721577
|
-
const settings = JSON.parse(
|
|
721589
|
+
const settings = JSON.parse(readFileSync131(cohereSettingsFile, "utf8"));
|
|
721578
721590
|
cohereActive = settings.cohere === true;
|
|
721579
721591
|
}
|
|
721580
721592
|
} catch {
|
|
@@ -721588,7 +721600,7 @@ Rules:
|
|
|
721588
721600
|
"store.json"
|
|
721589
721601
|
);
|
|
721590
721602
|
if (existsSync161(metaFile2)) {
|
|
721591
|
-
const store2 = JSON.parse(
|
|
721603
|
+
const store2 = JSON.parse(readFileSync131(metaFile2, "utf8"));
|
|
721592
721604
|
const latest = store2.filter(
|
|
721593
721605
|
(m2) => m2.sourceTrace === "trajectory-extraction" || m2.sourceTrace === "llm-trajectory-extraction"
|
|
721594
721606
|
).slice(-1)[0];
|
|
@@ -721617,7 +721629,7 @@ Rules:
|
|
|
721617
721629
|
try {
|
|
721618
721630
|
const ikFile = join174(repoRoot, ".omnius", "identity", "self-state.json");
|
|
721619
721631
|
if (existsSync161(ikFile)) {
|
|
721620
|
-
const ikState = JSON.parse(
|
|
721632
|
+
const ikState = JSON.parse(readFileSync131(ikFile, "utf8"));
|
|
721621
721633
|
ikState.homeostasis.uncertainty = Math.min(
|
|
721622
721634
|
1,
|
|
721623
721635
|
ikState.homeostasis.uncertainty + 0.1
|
|
@@ -721638,7 +721650,7 @@ Rules:
|
|
|
721638
721650
|
"store.json"
|
|
721639
721651
|
);
|
|
721640
721652
|
if (existsSync161(metaFile2)) {
|
|
721641
|
-
const store2 = JSON.parse(
|
|
721653
|
+
const store2 = JSON.parse(readFileSync131(metaFile2, "utf8"));
|
|
721642
721654
|
const surfaced = store2.filter(
|
|
721643
721655
|
(m2) => m2.type !== "quarantine" && m2.scores?.confidence > 0.15
|
|
721644
721656
|
).sort(
|
|
@@ -721664,7 +721676,7 @@ Rules:
|
|
|
721664
721676
|
let variants = [];
|
|
721665
721677
|
try {
|
|
721666
721678
|
if (existsSync161(archeFile))
|
|
721667
|
-
variants = JSON.parse(
|
|
721679
|
+
variants = JSON.parse(readFileSync131(archeFile, "utf8"));
|
|
721668
721680
|
} catch {
|
|
721669
721681
|
}
|
|
721670
721682
|
variants.push({
|
|
@@ -721793,7 +721805,7 @@ import { spawn as spawn34 } from "node:child_process";
|
|
|
721793
721805
|
import {
|
|
721794
721806
|
mkdirSync as mkdirSync104,
|
|
721795
721807
|
writeFileSync as writeFileSync89,
|
|
721796
|
-
readFileSync as
|
|
721808
|
+
readFileSync as readFileSync132,
|
|
721797
721809
|
readdirSync as readdirSync58,
|
|
721798
721810
|
existsSync as existsSync162
|
|
721799
721811
|
} from "node:fs";
|
|
@@ -721970,7 +721982,7 @@ function statusCommand(jobId, repoPath2) {
|
|
|
721970
721982
|
console.log(`Available jobs: omnius jobs`);
|
|
721971
721983
|
process.exit(1);
|
|
721972
721984
|
}
|
|
721973
|
-
const job = JSON.parse(
|
|
721985
|
+
const job = JSON.parse(readFileSync132(file, "utf-8"));
|
|
721974
721986
|
const runtime = job.completedAt ? `${((new Date(job.completedAt).getTime() - new Date(job.startedAt).getTime()) / 1e3).toFixed(0)}s` : `${((Date.now() - new Date(job.startedAt).getTime()) / 1e3).toFixed(0)}s`;
|
|
721975
721987
|
const icon = job.status === "completed" ? "✓" : job.status === "failed" ? "✗" : "●";
|
|
721976
721988
|
console.log(`${icon} ${job.id} [${job.status}] ${runtime}`);
|
|
@@ -721992,7 +722004,7 @@ function jobsCommand(repoPath2) {
|
|
|
721992
722004
|
console.log("Jobs:");
|
|
721993
722005
|
for (const file of files) {
|
|
721994
722006
|
try {
|
|
721995
|
-
const job = JSON.parse(
|
|
722007
|
+
const job = JSON.parse(readFileSync132(join175(dir, file), "utf-8"));
|
|
721996
722008
|
const icon = job.status === "completed" ? "✓" : job.status === "failed" ? "✗" : "●";
|
|
721997
722009
|
const runtime = job.completedAt ? `${((new Date(job.completedAt).getTime() - new Date(job.startedAt).getTime()) / 1e3).toFixed(0)}s` : `${((Date.now() - new Date(job.startedAt).getTime()) / 1e3).toFixed(0)}s`;
|
|
721998
722010
|
const cleanListTask = cleanForStorage(job.task) || job.task;
|