omnius 1.0.446 → 1.0.448
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 +350 -137
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -272845,11 +272845,11 @@ var require_out = __commonJS({
|
|
|
272845
272845
|
async.read(path12, getSettings(optionsOrSettingsOrCallback), callback);
|
|
272846
272846
|
}
|
|
272847
272847
|
exports.stat = stat9;
|
|
272848
|
-
function
|
|
272848
|
+
function statSync67(path12, optionsOrSettings) {
|
|
272849
272849
|
const settings = getSettings(optionsOrSettings);
|
|
272850
272850
|
return sync.read(path12, settings);
|
|
272851
272851
|
}
|
|
272852
|
-
exports.statSync =
|
|
272852
|
+
exports.statSync = statSync67;
|
|
272853
272853
|
function getSettings(settingsOrOptions = {}) {
|
|
272854
272854
|
if (settingsOrOptions instanceof settings_1.default) {
|
|
272855
272855
|
return settingsOrOptions;
|
|
@@ -310276,7 +310276,7 @@ ${lanes.join("\n")}
|
|
|
310276
310276
|
return process.memoryUsage().heapUsed;
|
|
310277
310277
|
},
|
|
310278
310278
|
getFileSize(path12) {
|
|
310279
|
-
const stat9 =
|
|
310279
|
+
const stat9 = statSync67(path12);
|
|
310280
310280
|
if (stat9 == null ? void 0 : stat9.isFile()) {
|
|
310281
310281
|
return stat9.size;
|
|
310282
310282
|
}
|
|
@@ -310320,7 +310320,7 @@ ${lanes.join("\n")}
|
|
|
310320
310320
|
}
|
|
310321
310321
|
};
|
|
310322
310322
|
return nodeSystem;
|
|
310323
|
-
function
|
|
310323
|
+
function statSync67(path12) {
|
|
310324
310324
|
try {
|
|
310325
310325
|
return _fs.statSync(path12, statSyncOptions);
|
|
310326
310326
|
} catch {
|
|
@@ -310379,7 +310379,7 @@ ${lanes.join("\n")}
|
|
|
310379
310379
|
activeSession.post("Profiler.stop", (err, { profile }) => {
|
|
310380
310380
|
var _a2;
|
|
310381
310381
|
if (!err) {
|
|
310382
|
-
if ((_a2 =
|
|
310382
|
+
if ((_a2 = statSync67(profilePath)) == null ? void 0 : _a2.isDirectory()) {
|
|
310383
310383
|
profilePath = _path.join(profilePath, `${(/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`);
|
|
310384
310384
|
}
|
|
310385
310385
|
try {
|
|
@@ -310499,7 +310499,7 @@ ${lanes.join("\n")}
|
|
|
310499
310499
|
let stat9;
|
|
310500
310500
|
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
|
|
310501
310501
|
const name10 = combinePaths(path12, entry);
|
|
310502
|
-
stat9 =
|
|
310502
|
+
stat9 = statSync67(name10);
|
|
310503
310503
|
if (!stat9) {
|
|
310504
310504
|
continue;
|
|
310505
310505
|
}
|
|
@@ -310523,7 +310523,7 @@ ${lanes.join("\n")}
|
|
|
310523
310523
|
return matchFiles(path12, extensions, excludes, includes, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
|
|
310524
310524
|
}
|
|
310525
310525
|
function fileSystemEntryExists(path12, entryKind) {
|
|
310526
|
-
const stat9 =
|
|
310526
|
+
const stat9 = statSync67(path12);
|
|
310527
310527
|
if (!stat9) {
|
|
310528
310528
|
return false;
|
|
310529
310529
|
}
|
|
@@ -310565,7 +310565,7 @@ ${lanes.join("\n")}
|
|
|
310565
310565
|
}
|
|
310566
310566
|
function getModifiedTime3(path12) {
|
|
310567
310567
|
var _a2;
|
|
310568
|
-
return (_a2 =
|
|
310568
|
+
return (_a2 = statSync67(path12)) == null ? void 0 : _a2.mtime;
|
|
310569
310569
|
}
|
|
310570
310570
|
function setModifiedTime(path12, time) {
|
|
310571
310571
|
try {
|
|
@@ -573005,6 +573005,7 @@ context_fabric: included=${included.length} dropped=${dropped.length} truncated=
|
|
|
573005
573005
|
});
|
|
573006
573006
|
|
|
573007
573007
|
// packages/orchestrator/dist/evidenceLedger.js
|
|
573008
|
+
import { statSync as statSync36 } from "node:fs";
|
|
573008
573009
|
function buildExtract(content) {
|
|
573009
573010
|
const lines = content.split("\n");
|
|
573010
573011
|
if (lines.length <= SMALL_LINES && content.length <= SMALL_CHARS) {
|
|
@@ -573075,13 +573076,15 @@ var init_evidenceLedger = __esm({
|
|
|
573075
573076
|
fidelity: keepNew ? built.fidelity : existing.fidelity,
|
|
573076
573077
|
ranges: mergeRanges([...existing.ranges, range]),
|
|
573077
573078
|
lastReadTurn: turn,
|
|
573078
|
-
stale: false
|
|
573079
|
+
stale: false,
|
|
573080
|
+
mtimeMs: input.mtimeMs ?? existing.mtimeMs
|
|
573079
573081
|
});
|
|
573080
573082
|
return;
|
|
573081
573083
|
}
|
|
573082
573084
|
this.entries.set(path12, {
|
|
573083
573085
|
path: path12,
|
|
573084
573086
|
readVersion: fileVersion,
|
|
573087
|
+
mtimeMs: input.mtimeMs ?? 0,
|
|
573085
573088
|
lastReadTurn: turn,
|
|
573086
573089
|
ranges: [range],
|
|
573087
573090
|
content: built.text,
|
|
@@ -573102,6 +573105,33 @@ var init_evidenceLedger = __esm({
|
|
|
573102
573105
|
const e2 = this.entries.get(path12);
|
|
573103
573106
|
return !!e2 && !e2.stale;
|
|
573104
573107
|
}
|
|
573108
|
+
/**
|
|
573109
|
+
* Validate evidence freshness against the real filesystem via stat().
|
|
573110
|
+
* If the file's mtime has changed since we last read it (external mutation
|
|
573111
|
+
* like a manual chmod, device reconnect, or human edit), mark as stale.
|
|
573112
|
+
* Returns true if evidence was valid, false if became stale or stat failed.
|
|
573113
|
+
*/
|
|
573114
|
+
validateFreshness(path12) {
|
|
573115
|
+
const e2 = this.entries.get(path12);
|
|
573116
|
+
if (!e2)
|
|
573117
|
+
return false;
|
|
573118
|
+
if (e2.stale)
|
|
573119
|
+
return false;
|
|
573120
|
+
if (e2.mtimeMs <= 0)
|
|
573121
|
+
return true;
|
|
573122
|
+
try {
|
|
573123
|
+
const st = statSync36(path12, { throwIfNoEntry: false });
|
|
573124
|
+
if (!st)
|
|
573125
|
+
return true;
|
|
573126
|
+
if (st.mtimeMs > e2.mtimeMs) {
|
|
573127
|
+
e2.stale = true;
|
|
573128
|
+
return false;
|
|
573129
|
+
}
|
|
573130
|
+
return true;
|
|
573131
|
+
} catch {
|
|
573132
|
+
return true;
|
|
573133
|
+
}
|
|
573134
|
+
}
|
|
573105
573135
|
get(path12) {
|
|
573106
573136
|
return this.entries.get(path12);
|
|
573107
573137
|
}
|
|
@@ -573150,7 +573180,7 @@ var init_evidenceLedger = __esm({
|
|
|
573150
573180
|
});
|
|
573151
573181
|
|
|
573152
573182
|
// packages/orchestrator/dist/contextWindowDump.js
|
|
573153
|
-
import { existsSync as existsSync100, mkdirSync as mkdirSync58, readdirSync as readdirSync32, readFileSync as readFileSync78, statSync as
|
|
573183
|
+
import { existsSync as existsSync100, mkdirSync as mkdirSync58, readdirSync as readdirSync32, readFileSync as readFileSync78, statSync as statSync37, unlinkSync as unlinkSync17, writeFileSync as writeFileSync48, appendFileSync as appendFileSync9 } from "node:fs";
|
|
573154
573184
|
import { homedir as homedir35 } from "node:os";
|
|
573155
573185
|
import { join as join111, resolve as resolve51 } from "node:path";
|
|
573156
573186
|
import { createHash as createHash28 } from "node:crypto";
|
|
@@ -573394,7 +573424,7 @@ function pruneOldDumpFiles(dir) {
|
|
|
573394
573424
|
try {
|
|
573395
573425
|
const files = readdirSync32(dir).filter((file) => file.endsWith(".json") && file !== "latest.json").map((file) => {
|
|
573396
573426
|
const path12 = join111(dir, file);
|
|
573397
|
-
return { path: path12, mtimeMs:
|
|
573427
|
+
return { path: path12, mtimeMs: statSync37(path12).mtimeMs };
|
|
573398
573428
|
}).sort((a2, b) => b.mtimeMs - a2.mtimeMs);
|
|
573399
573429
|
for (const file of files.slice(maxFiles))
|
|
573400
573430
|
unlinkSync17(file.path);
|
|
@@ -573762,7 +573792,7 @@ var init_adversaryStream = __esm({
|
|
|
573762
573792
|
});
|
|
573763
573793
|
|
|
573764
573794
|
// packages/orchestrator/dist/debugArtifactLibrary.js
|
|
573765
|
-
import { appendFileSync as appendFileSync10, existsSync as existsSync101, mkdirSync as mkdirSync59, readFileSync as readFileSync79, statSync as
|
|
573795
|
+
import { appendFileSync as appendFileSync10, existsSync as existsSync101, mkdirSync as mkdirSync59, readFileSync as readFileSync79, statSync as statSync38, writeFileSync as writeFileSync49 } from "node:fs";
|
|
573766
573796
|
import { createHash as createHash29 } from "node:crypto";
|
|
573767
573797
|
import { basename as basename23, join as join112, relative as relative10, resolve as resolve52 } from "node:path";
|
|
573768
573798
|
function debugArtifactRoot(cwd4 = process.cwd(), stateDir) {
|
|
@@ -573841,6 +573871,7 @@ function recordDebugToolEvent(input) {
|
|
|
573841
573871
|
...input.focusSupervisor ? { focusSupervisor: input.focusSupervisor } : {},
|
|
573842
573872
|
...input.focusDecision ? { focusDecision: input.focusDecision } : {},
|
|
573843
573873
|
...input.repeatShortCircuit !== void 0 ? { repeatShortCircuit: input.repeatShortCircuit } : {},
|
|
573874
|
+
...input.runtimeAuthored !== void 0 ? { runtimeAuthored: input.runtimeAuthored } : {},
|
|
573844
573875
|
...input.runtimeGuidance ? { runtimeGuidancePreview: trim(input.runtimeGuidance, 1200) } : {},
|
|
573845
573876
|
diagnoses,
|
|
573846
573877
|
summary: summarizeToolEvent(input.toolName, input.success, diagnoses, command),
|
|
@@ -574353,7 +574384,7 @@ function readJson2(path12) {
|
|
|
574353
574384
|
}
|
|
574354
574385
|
function pathExists(path12) {
|
|
574355
574386
|
try {
|
|
574356
|
-
|
|
574387
|
+
statSync38(path12);
|
|
574357
574388
|
return true;
|
|
574358
574389
|
} catch {
|
|
574359
574390
|
return false;
|
|
@@ -574413,6 +574444,11 @@ function resolveFocusSupervisorMode(configured, envValue = process.env["OMNIUS_F
|
|
|
574413
574444
|
}
|
|
574414
574445
|
function violatesDirective(directive, input) {
|
|
574415
574446
|
if (input.toolName === "task_complete") {
|
|
574447
|
+
const summary = String(input.args?.["summary"] ?? input.args?.["message"] ?? input.args?.["reason"] ?? "");
|
|
574448
|
+
const reportsConcreteBlocker = /\b(blocked|blocker|incomplete|unable|cannot|can't|failed|failure|stopped|cached failure|no safe progress|unrecoverable)\b/i.test(summary);
|
|
574449
|
+
if (reportsConcreteBlocker && (directive.requiredNextAction === "read_authoritative_target" || directive.requiredNextAction === "report_blocked" || directive.requiredNextAction === "report_incomplete")) {
|
|
574450
|
+
return false;
|
|
574451
|
+
}
|
|
574416
574452
|
return directive.requiredNextAction !== "report_blocked" && directive.requiredNextAction !== "report_incomplete" && directive.requiredNextAction !== "use_cached_evidence";
|
|
574417
574453
|
}
|
|
574418
574454
|
if (input.toolName === "ask_user")
|
|
@@ -574453,16 +574489,26 @@ function isEvidenceGatheringTool(toolName) {
|
|
|
574453
574489
|
].includes(toolName);
|
|
574454
574490
|
}
|
|
574455
574491
|
function isEditTool(toolName) {
|
|
574456
|
-
return [
|
|
574457
|
-
"file_write",
|
|
574458
|
-
"file_edit",
|
|
574459
|
-
"file_patch",
|
|
574460
|
-
"batch_edit"
|
|
574461
|
-
].includes(toolName);
|
|
574492
|
+
return ["file_write", "file_edit", "file_patch", "batch_edit"].includes(toolName);
|
|
574462
574493
|
}
|
|
574463
574494
|
function isReportTool(toolName) {
|
|
574464
574495
|
return toolName === "task_complete" || toolName === "ask_user";
|
|
574465
574496
|
}
|
|
574497
|
+
function compactCachedEvidence(text2) {
|
|
574498
|
+
const value2 = text2 || "";
|
|
574499
|
+
const lineCount = value2 ? value2.split("\n").length : 0;
|
|
574500
|
+
const sha = value2.match(/sha256=([a-f0-9]{8,64})/i)?.[1];
|
|
574501
|
+
const header = value2.match(/\[FILE CONTEXT \|[^\]]+\]/)?.[0];
|
|
574502
|
+
const preview = value2.split("\n").map((line) => line.trim()).find((line) => line.length > 0 && !line.startsWith("[trust_tier:") && line !== "---") ?? "";
|
|
574503
|
+
return [
|
|
574504
|
+
"Cached evidence is already available in the active context/tool cache; full payload omitted from this block to avoid context bloat.",
|
|
574505
|
+
`cached_size=${lineCount} lines, ${value2.length} chars`,
|
|
574506
|
+
sha ? `cached_sha256=${sha.slice(0, 16)}` : "",
|
|
574507
|
+
header ? `cached_header=${header.slice(0, 220)}` : "",
|
|
574508
|
+
preview && preview !== header ? `cached_preview=${preview.slice(0, 220)}` : "",
|
|
574509
|
+
"Use the cached evidence now, or request a distinct offset/limit/query if genuinely needed."
|
|
574510
|
+
].filter(Boolean).join("\n");
|
|
574511
|
+
}
|
|
574466
574512
|
function actionFamily(toolName, args) {
|
|
574467
574513
|
if (isEditTool(toolName)) {
|
|
574468
574514
|
const path12 = primaryPath(args);
|
|
@@ -574583,7 +574629,9 @@ function quickHash(input) {
|
|
|
574583
574629
|
return hash.toString(16).padStart(8, "0");
|
|
574584
574630
|
}
|
|
574585
574631
|
function uniqueLimited(values) {
|
|
574586
|
-
const uniqueValues = [
|
|
574632
|
+
const uniqueValues = [
|
|
574633
|
+
...new Set(values.filter((value2) => value2.trim().length > 0))
|
|
574634
|
+
];
|
|
574587
574635
|
if (uniqueValues.length <= MAX_FORBIDDEN_FAMILIES)
|
|
574588
574636
|
return uniqueValues;
|
|
574589
574637
|
return uniqueValues.slice(-MAX_FORBIDDEN_FAMILIES);
|
|
@@ -574606,6 +574654,7 @@ var init_focusSupervisor = __esm({
|
|
|
574606
574654
|
lastContext = null;
|
|
574607
574655
|
failureFamilies = /* @__PURE__ */ new Map();
|
|
574608
574656
|
ignoredDirectiveStreak = 0;
|
|
574657
|
+
lastIgnoredDirectiveTurn = null;
|
|
574609
574658
|
constructor(options2 = {}) {
|
|
574610
574659
|
this.mode = options2.mode ?? "auto";
|
|
574611
574660
|
this.modelTier = options2.modelTier ?? "large";
|
|
@@ -574650,12 +574699,54 @@ var init_focusSupervisor = __esm({
|
|
|
574650
574699
|
this.lastContext = input.context ?? this.lastContext;
|
|
574651
574700
|
if (!this.enabled)
|
|
574652
574701
|
return this.pass();
|
|
574702
|
+
if (input.context && this.lastContext && this.ignoredDirectiveStreak > 0) {
|
|
574703
|
+
const oldP = this.lastContext.pressureRatio ?? 0;
|
|
574704
|
+
const newP = input.context.pressureRatio ?? 0;
|
|
574705
|
+
const oldS = this.lastContext.signalToNoiseRatio;
|
|
574706
|
+
const newS = input.context.signalToNoiseRatio;
|
|
574707
|
+
const pressureShift = oldP > 0 ? Math.abs(newP - oldP) / oldP : 0;
|
|
574708
|
+
const snrShift = oldS !== null && oldS !== void 0 && oldS > 0 ? Math.abs((newS ?? 0) - oldS) / oldS : 0;
|
|
574709
|
+
if (pressureShift > 0.2 || snrShift > 0.2) {
|
|
574710
|
+
this.ignoredDirectiveStreak = 0;
|
|
574711
|
+
}
|
|
574712
|
+
}
|
|
574653
574713
|
const family = actionFamily(input.toolName, input.args);
|
|
574654
574714
|
const prior = this.directive;
|
|
574655
574715
|
if (prior && violatesDirective(prior, input)) {
|
|
574716
|
+
const strict = this.shouldStrictlyIntervene(input.context);
|
|
574717
|
+
const sameTurnAsDirective = input.turn <= prior.createdTurn;
|
|
574718
|
+
const alreadyCountedThisTurn = this.lastIgnoredDirectiveTurn === input.turn;
|
|
574719
|
+
if (sameTurnAsDirective || alreadyCountedThisTurn) {
|
|
574720
|
+
if (strict) {
|
|
574721
|
+
const reason = sameTurnAsDirective ? `queued tool call was emitted in the same turn that created directive ${prior.id}; it could not have observed the directive` : `another tool call in turn ${input.turn} already counted against directive ${prior.id}`;
|
|
574722
|
+
return this.block(prior, [
|
|
574723
|
+
"[FOCUS SUPERVISOR BLOCK]",
|
|
574724
|
+
`${reason}.`,
|
|
574725
|
+
`Required next action: ${prior.requiredNextAction}.`,
|
|
574726
|
+
`Blocked action family: ${family}.`,
|
|
574727
|
+
"This block is not counted as a new ignored directive."
|
|
574728
|
+
].join("\n"), false);
|
|
574729
|
+
}
|
|
574730
|
+
return this.pass();
|
|
574731
|
+
}
|
|
574656
574732
|
prior.ignoredCount++;
|
|
574657
574733
|
this.ignoredDirectiveStreak++;
|
|
574658
|
-
|
|
574734
|
+
this.lastIgnoredDirectiveTurn = input.turn;
|
|
574735
|
+
if ((prior.requiredNextAction === "read_authoritative_target" || prior.requiredNextAction === "use_cached_evidence") && input.cachedResult && (input.duplicateHitCount ?? 0) >= Math.max(1, this.repeatGateMax - 1)) {
|
|
574736
|
+
const deadlockDirective = this.setDirective({
|
|
574737
|
+
turn: input.turn,
|
|
574738
|
+
state: "terminal_incomplete",
|
|
574739
|
+
reason: `read target is repeat-gated (${input.duplicateHitCount} hits); directive ${prior.id} cannot be satisfied without fresh reads; report blocked with evidence`,
|
|
574740
|
+
requiredNextAction: "report_incomplete",
|
|
574741
|
+
forbiddenActionFamilies: []
|
|
574742
|
+
});
|
|
574743
|
+
return this.block(deadlockDirective, [
|
|
574744
|
+
"[FOCUS SUPERVISOR: DEADLOCK]",
|
|
574745
|
+
`Directive ${prior.id} (${prior.requiredNextAction}) requires reading evidence that is repeat-gated (${input.duplicateHitCount} identical reads).`,
|
|
574746
|
+
"The model cannot satisfy this directive because the repeat gate blocks re-reads, and other actions are forbidden by the current directive.",
|
|
574747
|
+
"Report incomplete/blocked with the concrete evidence you have, and describe what additional access would break the deadlock."
|
|
574748
|
+
].join("\n"), false);
|
|
574749
|
+
}
|
|
574659
574750
|
if (strict && prior.ignoredCount >= 1) {
|
|
574660
574751
|
const terminal = this.ignoredDirectiveStreak >= TERMINAL_INCOMPLETE_IGNORE_THRESHOLD;
|
|
574661
574752
|
const ignoredManyTimes = this.ignoredDirectiveStreak >= 3;
|
|
@@ -574669,6 +574760,7 @@ var init_focusSupervisor = __esm({
|
|
|
574669
574760
|
family
|
|
574670
574761
|
])
|
|
574671
574762
|
});
|
|
574763
|
+
this.lastIgnoredDirectiveTurn = input.turn;
|
|
574672
574764
|
return this.block(directive, [
|
|
574673
574765
|
`[FOCUS SUPERVISOR BLOCK] The previous directive was ignored: ${prior.reason}`,
|
|
574674
574766
|
`Required next action: ${directive.requiredNextAction}.`,
|
|
@@ -574708,7 +574800,7 @@ var init_focusSupervisor = __esm({
|
|
|
574708
574800
|
`This ${input.toolName} action family has already produced evidence and should not be re-executed unchanged.`,
|
|
574709
574801
|
`Required next action: ${directive.requiredNextAction}.`,
|
|
574710
574802
|
"",
|
|
574711
|
-
input.cachedResult
|
|
574803
|
+
compactCachedEvidence(input.cachedResult)
|
|
574712
574804
|
].join("\n"), !input.cachedResultFailed);
|
|
574713
574805
|
}
|
|
574714
574806
|
return this.inject(directive, `[FOCUS SUPERVISOR] ${directive.reason}. Required next action: ${directive.requiredNextAction}.`);
|
|
@@ -574736,6 +574828,11 @@ var init_focusSupervisor = __esm({
|
|
|
574736
574828
|
this.clearSatisfiedDirective("mutation landed", input.turn);
|
|
574737
574829
|
return;
|
|
574738
574830
|
}
|
|
574831
|
+
if (input.runtimeAuthored) {
|
|
574832
|
+
this.lastDecision = "runtime_authored_not_satisfied";
|
|
574833
|
+
this.lastReason = "runtime-authored control result did not execute the requested tool";
|
|
574834
|
+
return;
|
|
574835
|
+
}
|
|
574739
574836
|
if (input.toolName === "todo_write" && input.success) {
|
|
574740
574837
|
if (input.noop) {
|
|
574741
574838
|
this.lastDecision = "todo_noop_not_satisfied";
|
|
@@ -574745,6 +574842,11 @@ var init_focusSupervisor = __esm({
|
|
|
574745
574842
|
this.clearSatisfiedDirective("todo plan updated", input.turn);
|
|
574746
574843
|
return;
|
|
574747
574844
|
}
|
|
574845
|
+
if (input.success && input.noop) {
|
|
574846
|
+
this.lastDecision = "noop_not_satisfied";
|
|
574847
|
+
this.lastReason = "cached/no-op tool result did not perform the required recovery action";
|
|
574848
|
+
return;
|
|
574849
|
+
}
|
|
574748
574850
|
if (input.toolName === "file_read" && input.success) {
|
|
574749
574851
|
if (this.directive?.requiredNextAction === "read_authoritative_target" || this.directive?.requiredNextAction === "use_cached_evidence") {
|
|
574750
574852
|
this.clearSatisfiedDirective("authoritative evidence refreshed", input.turn);
|
|
@@ -574848,6 +574950,8 @@ var init_focusSupervisor = __esm({
|
|
|
574848
574950
|
this.directive = directive;
|
|
574849
574951
|
this.state = directive.state;
|
|
574850
574952
|
this.lastReason = directive.reason;
|
|
574953
|
+
if (!stable)
|
|
574954
|
+
this.lastIgnoredDirectiveTurn = null;
|
|
574851
574955
|
return directive;
|
|
574852
574956
|
}
|
|
574853
574957
|
clearSatisfiedDirective(reason, _turn) {
|
|
@@ -574858,14 +574962,24 @@ var init_focusSupervisor = __esm({
|
|
|
574858
574962
|
this.directive = null;
|
|
574859
574963
|
this.state = "observe";
|
|
574860
574964
|
this.ignoredDirectiveStreak = 0;
|
|
574965
|
+
this.lastIgnoredDirectiveTurn = null;
|
|
574861
574966
|
}
|
|
574862
574967
|
pass() {
|
|
574863
|
-
return {
|
|
574968
|
+
return {
|
|
574969
|
+
kind: "pass",
|
|
574970
|
+
state: this.state,
|
|
574971
|
+
...this.directive ? { directive: this.directive } : {}
|
|
574972
|
+
};
|
|
574864
574973
|
}
|
|
574865
574974
|
inject(directive, message2) {
|
|
574866
574975
|
this.lastDecision = "inject_guidance";
|
|
574867
574976
|
this.lastReason = directive.reason;
|
|
574868
|
-
return {
|
|
574977
|
+
return {
|
|
574978
|
+
kind: "inject_guidance",
|
|
574979
|
+
state: directive.state,
|
|
574980
|
+
directive,
|
|
574981
|
+
message: message2
|
|
574982
|
+
};
|
|
574869
574983
|
}
|
|
574870
574984
|
block(directive, message2, success) {
|
|
574871
574985
|
this.lastDecision = "block_tool_call";
|
|
@@ -575874,7 +575988,7 @@ __export(preflightSnapshot_exports, {
|
|
|
575874
575988
|
formatPreflightStatus: () => formatPreflightStatus,
|
|
575875
575989
|
freeDiskBytes: () => freeDiskBytes
|
|
575876
575990
|
});
|
|
575877
|
-
import { existsSync as existsSync102, readFileSync as readFileSync80, statSync as
|
|
575991
|
+
import { existsSync as existsSync102, readFileSync as readFileSync80, statSync as statSync39, statfsSync as statfsSync6 } from "node:fs";
|
|
575878
575992
|
import { homedir as homedir36, platform as platform4, arch as arch2, totalmem as totalmem4, freemem as freemem3, hostname as hostname3 } from "node:os";
|
|
575879
575993
|
import { join as join113 } from "node:path";
|
|
575880
575994
|
import { createHash as createHash30 } from "node:crypto";
|
|
@@ -576050,7 +576164,7 @@ function sha2564(s2) {
|
|
|
576050
576164
|
}
|
|
576051
576165
|
function freeDiskBytes(path12 = "/tmp") {
|
|
576052
576166
|
try {
|
|
576053
|
-
const st =
|
|
576167
|
+
const st = statSync39(path12);
|
|
576054
576168
|
if (!st.isDirectory())
|
|
576055
576169
|
return -1;
|
|
576056
576170
|
const fs11 = statfsSync6(path12);
|
|
@@ -576094,7 +576208,7 @@ __export(postActionVerifier_exports, {
|
|
|
576094
576208
|
classifyShellIntent: () => classifyShellIntent,
|
|
576095
576209
|
verifyShellOutcome: () => verifyShellOutcome
|
|
576096
576210
|
});
|
|
576097
|
-
import { existsSync as existsSync103, readFileSync as readFileSync81, readdirSync as readdirSync33, statSync as
|
|
576211
|
+
import { existsSync as existsSync103, readFileSync as readFileSync81, readdirSync as readdirSync33, statSync as statSync40 } from "node:fs";
|
|
576098
576212
|
import { join as join114 } from "node:path";
|
|
576099
576213
|
function classifyShellIntent(cmd) {
|
|
576100
576214
|
const stripped = cmd.replace(/^cd\s+\S+\s*&&\s*/, "").trim();
|
|
@@ -576307,7 +576421,7 @@ function listNpmInstalled(installRootAbs) {
|
|
|
576307
576421
|
continue;
|
|
576308
576422
|
const sub2 = join114(installRootAbs, name10);
|
|
576309
576423
|
try {
|
|
576310
|
-
if (!
|
|
576424
|
+
if (!statSync40(sub2).isDirectory())
|
|
576311
576425
|
continue;
|
|
576312
576426
|
} catch {
|
|
576313
576427
|
continue;
|
|
@@ -576379,7 +576493,7 @@ function mostRecentFileMtimeMs(root, maxDepth) {
|
|
|
576379
576493
|
const full = join114(dir, name10);
|
|
576380
576494
|
let st;
|
|
576381
576495
|
try {
|
|
576382
|
-
st =
|
|
576496
|
+
st = statSync40(full);
|
|
576383
576497
|
} catch {
|
|
576384
576498
|
continue;
|
|
576385
576499
|
}
|
|
@@ -577236,19 +577350,62 @@ function detectTaskMode(task) {
|
|
|
577236
577350
|
}
|
|
577237
577351
|
return false;
|
|
577238
577352
|
}
|
|
577239
|
-
function slimSystemPromptForTaskMode(prompt) {
|
|
577240
|
-
const
|
|
577241
|
-
|
|
577242
|
-
|
|
577243
|
-
|
|
577244
|
-
|
|
577245
|
-
|
|
577246
|
-
|
|
577353
|
+
function slimSystemPromptForTaskMode(prompt, task) {
|
|
577354
|
+
const taskLower = (task ?? "").toLowerCase();
|
|
577355
|
+
const taskMentions = (...keywords2) => keywords2.some((k) => taskLower.includes(k));
|
|
577356
|
+
const SECTION_RULES = [
|
|
577357
|
+
{
|
|
577358
|
+
header: /^##\s*Interactive\s*\/\s*Long-?Running Sessions\s*$/im,
|
|
577359
|
+
keywords: []
|
|
577360
|
+
},
|
|
577361
|
+
{ header: /^##\s*Document Generation Strategy\s*$/im, keywords: [] },
|
|
577362
|
+
{
|
|
577363
|
+
header: /^##\s*Calculations\s*[—-]\s*Always Execute, Never Guess\s*$/im,
|
|
577364
|
+
keywords: []
|
|
577365
|
+
},
|
|
577366
|
+
{
|
|
577367
|
+
header: /^##\s*Knowledge Gaps\s*[—-]\s*Search, Don't Hallucinate\s*$/im,
|
|
577368
|
+
keywords: []
|
|
577369
|
+
},
|
|
577370
|
+
{ header: /^##\s*Self-Awareness( & Introspection)?\s*$/im, keywords: [] },
|
|
577371
|
+
{
|
|
577372
|
+
header: /^##\s*Debugging\s*[—-]\s*Observe Before Reasoning\s*$/im,
|
|
577373
|
+
keywords: []
|
|
577374
|
+
},
|
|
577375
|
+
// Feature-heavy sections — stripped unless task is relevant
|
|
577376
|
+
{
|
|
577377
|
+
header: /^##\s*Nexus P2P Networking\b.*$/im,
|
|
577378
|
+
keywords: ["nexus", "p2p", "peer", "wallet", "payment", "invoke", "mesh"]
|
|
577379
|
+
},
|
|
577380
|
+
{
|
|
577381
|
+
header: /^##\s*Temporal Agency\b.*$/im,
|
|
577382
|
+
keywords: ["cron", "schedule", "reminder", "agenda", "temporal"]
|
|
577383
|
+
},
|
|
577384
|
+
{ header: /^##\s*Skills \(AIWG\)\s*$/im, keywords: ["skill", "aiwg"] },
|
|
577385
|
+
{ header: /^##\s*Slash Commands\b.*$/im, keywords: ["slash", "command"] },
|
|
577386
|
+
{
|
|
577387
|
+
header: /^##\s*Priority Ingress\b.*$/im,
|
|
577388
|
+
keywords: ["priority", "delegate", "ingress", "classify"]
|
|
577389
|
+
},
|
|
577390
|
+
{
|
|
577391
|
+
header: /^##\s*Custom Tools\b.*$/im,
|
|
577392
|
+
keywords: ["create_tool", "custom tool", "workflow", "reusable"]
|
|
577393
|
+
},
|
|
577394
|
+
{
|
|
577395
|
+
header: /^##\s*RLM Context Operating System\b.*$/im,
|
|
577396
|
+
keywords: ["rlm", "repl", "recursive", "llm_query"]
|
|
577397
|
+
},
|
|
577398
|
+
{
|
|
577399
|
+
header: /^##\s*Desktop Automation\s*&?\s*Vision\b.*$/im,
|
|
577400
|
+
keywords: ["desktop", "click", "screenshot", "xdotool", "browser", "ui"]
|
|
577401
|
+
}
|
|
577247
577402
|
];
|
|
577248
577403
|
const CHAT_MODE_BLOCK = /^\*\*CHAT MODE\*\*[\s\S]*?(?=\*\*TASK MODE\*\*)/im;
|
|
577249
577404
|
let out = prompt;
|
|
577250
|
-
for (const
|
|
577251
|
-
|
|
577405
|
+
for (const rule of SECTION_RULES) {
|
|
577406
|
+
if (rule.keywords.length > 0 && taskMentions(...rule.keywords))
|
|
577407
|
+
continue;
|
|
577408
|
+
out = out.replace(new RegExp(rule.header.source + "[\\s\\S]*?(?=^##\\s|\\Z)", "im"), "");
|
|
577252
577409
|
}
|
|
577253
577410
|
out = out.replace(CHAT_MODE_BLOCK, "");
|
|
577254
577411
|
out = out.replace(/^\*\*TASK MODE\*\*[^\n]*\n/im, "");
|
|
@@ -578351,7 +578508,12 @@ ${parts.join("\n")}
|
|
|
578351
578508
|
_workboardHasEditEvidence(card) {
|
|
578352
578509
|
if (!card)
|
|
578353
578510
|
return false;
|
|
578354
|
-
const editTools = /* @__PURE__ */ new Set([
|
|
578511
|
+
const editTools = /* @__PURE__ */ new Set([
|
|
578512
|
+
"file_write",
|
|
578513
|
+
"file_edit",
|
|
578514
|
+
"batch_edit",
|
|
578515
|
+
"file_patch"
|
|
578516
|
+
]);
|
|
578355
578517
|
return card.evidence.some((e2) => {
|
|
578356
578518
|
if (typeof e2.tool === "string" && editTools.has(e2.tool))
|
|
578357
578519
|
return true;
|
|
@@ -578983,7 +579145,10 @@ ${parts.join("\n")}
|
|
|
578983
579145
|
const selected = /* @__PURE__ */ new Map();
|
|
578984
579146
|
let selectedBy = "none";
|
|
578985
579147
|
try {
|
|
578986
|
-
const embeddings = await generateEmbeddingBatch([
|
|
579148
|
+
const embeddings = await generateEmbeddingBatch([
|
|
579149
|
+
taskGoal,
|
|
579150
|
+
...candidates.map((pattern) => this._failurePatternText(pattern))
|
|
579151
|
+
], { baseUrl: this._embeddingBaseUrl(), timeoutMs: 12e3 });
|
|
578987
579152
|
const query = embeddings[0]?.vector;
|
|
578988
579153
|
const minScore = Number.parseFloat(process.env["OMNIUS_FAILURE_PATTERN_SIM_MIN"] ?? "0.58");
|
|
578989
579154
|
if (query) {
|
|
@@ -579190,7 +579355,7 @@ ${parts.join("\n")}
|
|
|
579190
579355
|
const pressureCue = pressureCheck(task);
|
|
579191
579356
|
const rawPrompt = getSystemPromptForTier(this.options.modelTier);
|
|
579192
579357
|
const taskModeOn = detectTaskMode(task);
|
|
579193
|
-
const slimmedPrompt = taskModeOn ? slimSystemPromptForTaskMode(rawPrompt) : rawPrompt;
|
|
579358
|
+
const slimmedPrompt = taskModeOn ? slimSystemPromptForTaskMode(rawPrompt, task) : rawPrompt;
|
|
579194
579359
|
const basePrompt = slimmedPrompt + pressureCue;
|
|
579195
579360
|
if (taskModeOn) {
|
|
579196
579361
|
this.emit({
|
|
@@ -582141,7 +582306,9 @@ ${contentPreview}
|
|
|
582141
582306
|
return true;
|
|
582142
582307
|
if (/\bperl\s+-[A-Za-z]*i[A-Za-z]*\b/.test(cmd))
|
|
582143
582308
|
return true;
|
|
582144
|
-
if (/\b(?:cp|mv|rm|mkdir|rmdir|touch|truncate|ln|install)\b/i.test(cmd))
|
|
582309
|
+
if (/\b(?:cp|mv|rm|mkdir|rmdir|touch|truncate|ln|install|chmod|chown|chgrp|setfacl)\b/i.test(cmd))
|
|
582310
|
+
return true;
|
|
582311
|
+
if (/\b(?:udevadm|mount|umount|modprobe|insmod)\b/i.test(cmd))
|
|
582145
582312
|
return true;
|
|
582146
582313
|
if (/\b(?:python3?|node|ruby|deno|bun)\b[\s\S]{0,240}\b(?:writeFile|writeFileSync|openSync|mkdirSync|renameSync|unlinkSync|rmSync)\b/i.test(cmd))
|
|
582147
582314
|
return true;
|
|
@@ -582416,6 +582583,32 @@ ${sections.join("\n")}` : sections.join("\n");
|
|
|
582416
582583
|
`Do NOT repeat this exact call. If you believe state changed, perform the concrete change first, then retry with distinct evidence.`
|
|
582417
582584
|
].join("\n");
|
|
582418
582585
|
}
|
|
582586
|
+
_buildRepeatCachedEvidenceNotice(toolName, args, hits, cachedResult) {
|
|
582587
|
+
const argPreview = JSON.stringify(args ?? {}).slice(0, 200);
|
|
582588
|
+
const target = this.extractPrimaryToolPath(args) || argPreview;
|
|
582589
|
+
const summary = this._summarizeCachedToolResult(cachedResult);
|
|
582590
|
+
return [
|
|
582591
|
+
"[REPEAT GATE - cached evidence not re-sent]",
|
|
582592
|
+
`Exact repeat #${hits} of ${toolName}(${argPreview}).`,
|
|
582593
|
+
`target=${target}`,
|
|
582594
|
+
"This call was not executed again, and the cached payload was not re-emitted because repeating it bloats the model context.",
|
|
582595
|
+
summary,
|
|
582596
|
+
"",
|
|
582597
|
+
"Required next action: use the active evidence frame/tool cache and take a concrete next step: edit/write, run verification, update todos with changed state, or task_complete with evidence.",
|
|
582598
|
+
"If you need different information, use a distinct offset/limit/query. For broad multi-file discovery, use file_explore, grep_search, fanout_explore, or full_sub_agent instead of repeating this call."
|
|
582599
|
+
].join("\n");
|
|
582600
|
+
}
|
|
582601
|
+
_summarizeCachedToolResult(output) {
|
|
582602
|
+
const text2 = output || "";
|
|
582603
|
+
const lineCount = text2 ? text2.split("\n").length : 0;
|
|
582604
|
+
const sha = text2.match(/sha256=([a-f0-9]{8,64})/i)?.[1];
|
|
582605
|
+
const header = text2.match(/\[FILE CONTEXT \|[^\]]+\]/)?.[0];
|
|
582606
|
+
return [
|
|
582607
|
+
`cached_size=${lineCount} lines, ${text2.length} chars`,
|
|
582608
|
+
sha ? `cached_sha256=${sha.slice(0, 16)}` : "",
|
|
582609
|
+
header ? `cached_header=${header.slice(0, 220)}` : ""
|
|
582610
|
+
].filter(Boolean).join("\n");
|
|
582611
|
+
}
|
|
582419
582612
|
_renderKnowledgeBlock(recentToolResults) {
|
|
582420
582613
|
if (recentToolResults.size === 0)
|
|
582421
582614
|
return null;
|
|
@@ -582536,7 +582729,8 @@ ${sections.join("\n")}` : sections.join("\n");
|
|
|
582536
582729
|
try {
|
|
582537
582730
|
const memMod = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
|
582538
582731
|
if (typeof memMod.contextItemsFromMessages === "function") {
|
|
582539
|
-
|
|
582732
|
+
const msgsForCtx = input.messages.filter((m2) => m2.role !== "system");
|
|
582733
|
+
helperItems = this._normalizeExternalContextItems(await memMod.contextItemsFromMessages(msgsForCtx.slice(-12)));
|
|
582540
582734
|
}
|
|
582541
582735
|
} catch {
|
|
582542
582736
|
helperItems = [];
|
|
@@ -582794,7 +582988,7 @@ ${chunk.content}`, {
|
|
|
582794
582988
|
this._contextLedger.prune(turn);
|
|
582795
582989
|
const goalBlock = [
|
|
582796
582990
|
this._renderRuntimeRootBlock(),
|
|
582797
|
-
this._taskState.goal ? `Active task:
|
|
582991
|
+
this._taskState.goal ? `Active task: (see user message above — the goal block defers to the user message as the authoritative source)` : null
|
|
582798
582992
|
].filter(Boolean).join("\n\n");
|
|
582799
582993
|
const filesystemBlock = this._renderFilesystemStateBlock(turn);
|
|
582800
582994
|
const todoBlock = this._renderTodoStateBlock(turn);
|
|
@@ -587752,15 +587946,30 @@ Read the current file if needed, make a different concrete edit, or move to veri
|
|
|
587752
587946
|
const _repeatGateMax = this._resolveRepeatGateMax();
|
|
587753
587947
|
const isFailedShellRepeat = tc.name === "shell" && typeof _existingFp?.result === "string" && _existingFp.result.includes("status: failure");
|
|
587754
587948
|
const repeatGateEligible = isReadLike || tc.name === "memory_write" || isFailedShellRepeat;
|
|
587949
|
+
if (isReadLike && this._evidenceLedger) {
|
|
587950
|
+
const readArgs = tc.arguments;
|
|
587951
|
+
const readPath2 = String(readArgs?.["path"] ?? readArgs?.["file"] ?? "");
|
|
587952
|
+
if (readPath2) {
|
|
587953
|
+
const wasFresh = this._evidenceLedger.validateFreshness(readPath2);
|
|
587954
|
+
if (!wasFresh) {
|
|
587955
|
+
recentToolResults.delete(toolFingerprint);
|
|
587956
|
+
dedupHitCount.delete(toolFingerprint);
|
|
587957
|
+
this._recentFailures = (this._recentFailures ?? []).filter((f2) => f2.fingerprint !== toolFingerprint);
|
|
587958
|
+
repeatShortCircuit = null;
|
|
587959
|
+
this.emit({
|
|
587960
|
+
type: "status",
|
|
587961
|
+
content: `[EXTERNAL MUTATION] ${readPath2} mtime changed since last read — cache invalidated, fresh read allowed`,
|
|
587962
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
587963
|
+
});
|
|
587964
|
+
}
|
|
587965
|
+
}
|
|
587966
|
+
}
|
|
587755
587967
|
if (repeatGateEligible && _existingFp !== void 0 && _repeatGateMax > 0) {
|
|
587756
587968
|
if (criticDecision.hitNumber >= _repeatGateMax) {
|
|
587757
587969
|
if (isReadLike) {
|
|
587758
|
-
const cachedResult = this.sanitizeCachedToolResult(tc.name, _existingFp.result);
|
|
587759
587970
|
repeatShortCircuit = {
|
|
587760
587971
|
success: true,
|
|
587761
|
-
output:
|
|
587762
|
-
|
|
587763
|
-
` + cachedResult,
|
|
587972
|
+
output: this._buildRepeatCachedEvidenceNotice(tc.name, tc.arguments ?? {}, criticDecision.hitNumber, this.sanitizeCachedToolResult(tc.name, _existingFp.result)),
|
|
587764
587973
|
runtimeAuthored: true,
|
|
587765
587974
|
noop: true
|
|
587766
587975
|
};
|
|
@@ -587789,7 +587998,7 @@ ${cachedResult}`,
|
|
|
587789
587998
|
runtimeAuthored: true
|
|
587790
587999
|
} : {
|
|
587791
588000
|
success: true,
|
|
587792
|
-
output: cachedResult,
|
|
588001
|
+
output: this._buildRepeatCachedEvidenceNotice(tc.name, tc.arguments ?? {}, criticDecision.hitNumber, cachedResult),
|
|
587793
588002
|
runtimeAuthored: true,
|
|
587794
588003
|
noop: true
|
|
587795
588004
|
};
|
|
@@ -587838,7 +588047,8 @@ ${cachedResult}`,
|
|
|
587838
588047
|
success: focusDecision.success,
|
|
587839
588048
|
output: focusDecision.message,
|
|
587840
588049
|
error: focusDecision.success ? void 0 : focusDecision.message,
|
|
587841
|
-
runtimeAuthored: true
|
|
588050
|
+
runtimeAuthored: true,
|
|
588051
|
+
noop: true
|
|
587842
588052
|
};
|
|
587843
588053
|
}
|
|
587844
588054
|
}
|
|
@@ -588159,6 +588369,7 @@ Respond with EXACTLY this structure before your next tool call:
|
|
|
588159
588369
|
content: result.output,
|
|
588160
588370
|
range: { start: start3, end },
|
|
588161
588371
|
fileVersion: this._worldFacts.files.get(p2)?.writeCount ?? 0,
|
|
588372
|
+
mtimeMs: Date.now(),
|
|
588162
588373
|
turn
|
|
588163
588374
|
});
|
|
588164
588375
|
}
|
|
@@ -589140,7 +589351,7 @@ Respond with EXACTLY this structure before your next tool call:
|
|
|
589140
589351
|
}
|
|
589141
589352
|
}
|
|
589142
589353
|
}
|
|
589143
|
-
if (criticGuidance) {
|
|
589354
|
+
if (criticGuidance && !repeatShortCircuit) {
|
|
589144
589355
|
output += `
|
|
589145
589356
|
|
|
589146
589357
|
${criticGuidance}`;
|
|
@@ -589325,7 +589536,8 @@ Evidence: ${evidencePreview}`.slice(0, 500);
|
|
|
589325
589536
|
error: result.error ?? "",
|
|
589326
589537
|
mutated: realFileMutation || shellFilesystemMutation,
|
|
589327
589538
|
isReadLike,
|
|
589328
|
-
noop: tc.name === "todo_write" ? this._isTodoWriteNoopResult(result) : result.noop
|
|
589539
|
+
noop: tc.name === "todo_write" ? this._isTodoWriteNoopResult(result) : result.noop,
|
|
589540
|
+
runtimeAuthored: result.runtimeAuthored === true
|
|
589329
589541
|
});
|
|
589330
589542
|
const focusSnapshotAfter = this._focusSupervisor?.snapshot();
|
|
589331
589543
|
focusAfterToolResult = focusSnapshotAfter ?? void 0;
|
|
@@ -589368,6 +589580,7 @@ Evidence: ${evidencePreview}`.slice(0, 500);
|
|
|
589368
589580
|
requiredNextAction: focusDecision.directive.requiredNextAction
|
|
589369
589581
|
},
|
|
589370
589582
|
repeatShortCircuit: Boolean(repeatShortCircuit),
|
|
589583
|
+
runtimeAuthored: result.runtimeAuthored === true,
|
|
589371
589584
|
runtimeGuidance: runtimeSystemGuidance
|
|
589372
589585
|
});
|
|
589373
589586
|
} catch {
|
|
@@ -591843,7 +592056,7 @@ ${marker}` : marker);
|
|
|
591843
592056
|
].filter(Boolean).join("\n"));
|
|
591844
592057
|
}
|
|
591845
592058
|
shouldBypassDiscoveryCompaction(output) {
|
|
591846
|
-
return output.includes("[IMAGE_BASE64:") || output.includes("[BRANCH-EXTRACT]") || output.includes("[
|
|
592059
|
+
return output.includes("[IMAGE_BASE64:") || output.includes("[BRANCH-EXTRACT]") || output.includes("[REPEAT GATE - cached evidence not re-sent]") || output.includes("[Tool output truncated") || output.includes(TRIAGE_ENVELOPE_MARKER);
|
|
591847
592060
|
}
|
|
591848
592061
|
countTextLines(text2) {
|
|
591849
592062
|
if (!text2)
|
|
@@ -596895,7 +597108,7 @@ var init_constraint_learner = __esm({
|
|
|
596895
597108
|
});
|
|
596896
597109
|
|
|
596897
597110
|
// packages/orchestrator/dist/nexusBackend.js
|
|
596898
|
-
import { existsSync as existsSync104, statSync as
|
|
597111
|
+
import { existsSync as existsSync104, statSync as statSync41, openSync, readSync, closeSync, unlinkSync as unlinkSync18, writeFileSync as writeFileSync50 } from "node:fs";
|
|
596899
597112
|
import { watch as fsWatch } from "node:fs";
|
|
596900
597113
|
import { join as join115 } from "node:path";
|
|
596901
597114
|
import { tmpdir as tmpdir21 } from "node:os";
|
|
@@ -597256,7 +597469,7 @@ ${suffix}` } : m2);
|
|
|
597256
597469
|
finish();
|
|
597257
597470
|
}, 50);
|
|
597258
597471
|
});
|
|
597259
|
-
const stat9 =
|
|
597472
|
+
const stat9 = statSync41(streamFile, { throwIfNoEntry: false });
|
|
597260
597473
|
if (!stat9 || stat9.size <= position)
|
|
597261
597474
|
continue;
|
|
597262
597475
|
const fd = openSync(streamFile, "r");
|
|
@@ -602159,7 +602372,7 @@ var init_missionSystem = __esm({
|
|
|
602159
602372
|
});
|
|
602160
602373
|
|
|
602161
602374
|
// packages/orchestrator/dist/context-references.js
|
|
602162
|
-
import { readFileSync as readFileSync88, readdirSync as readdirSync35, statSync as
|
|
602375
|
+
import { readFileSync as readFileSync88, readdirSync as readdirSync35, statSync as statSync42 } from "node:fs";
|
|
602163
602376
|
import { homedir as homedir38 } from "node:os";
|
|
602164
602377
|
import { join as join123, resolve as resolve53, relative as relative11, sep as sep3, extname as extname13 } from "node:path";
|
|
602165
602378
|
function estimateTokens6(text2) {
|
|
@@ -602306,7 +602519,7 @@ function buildFolderListing(dirPath, cwd4, limit = 200) {
|
|
|
602306
602519
|
continue;
|
|
602307
602520
|
const full = join123(current, entry);
|
|
602308
602521
|
try {
|
|
602309
|
-
if (
|
|
602522
|
+
if (statSync42(full).isDirectory()) {
|
|
602310
602523
|
dirs.push(entry);
|
|
602311
602524
|
} else {
|
|
602312
602525
|
files.push(entry);
|
|
@@ -602330,7 +602543,7 @@ function buildFolderListing(dirPath, cwd4, limit = 200) {
|
|
|
602330
602543
|
const full = join123(current, f2);
|
|
602331
602544
|
let meta = "?";
|
|
602332
602545
|
try {
|
|
602333
|
-
const st =
|
|
602546
|
+
const st = statSync42(full);
|
|
602334
602547
|
if (st.isFile()) {
|
|
602335
602548
|
const size = st.size;
|
|
602336
602549
|
if (isBinaryFile(full)) {
|
|
@@ -602369,7 +602582,7 @@ function expandFileReference(ref, cwd4, allowedRoot) {
|
|
|
602369
602582
|
} catch (err) {
|
|
602370
602583
|
return [`${ref.raw}: ${err.message}`, null];
|
|
602371
602584
|
}
|
|
602372
|
-
if (!
|
|
602585
|
+
if (!statSync42(filePath, { throwIfNoEntry: false })?.isFile()) {
|
|
602373
602586
|
return [`${ref.raw}: file not found`, null];
|
|
602374
602587
|
}
|
|
602375
602588
|
if (isBinaryFile(filePath)) {
|
|
@@ -602402,7 +602615,7 @@ function expandFolderReference(ref, cwd4, allowedRoot) {
|
|
|
602402
602615
|
} catch (err) {
|
|
602403
602616
|
return [`${ref.raw}: ${err.message}`, null];
|
|
602404
602617
|
}
|
|
602405
|
-
if (!
|
|
602618
|
+
if (!statSync42(dirPath, { throwIfNoEntry: false })?.isDirectory()) {
|
|
602406
602619
|
return [`${ref.raw}: folder not found`, null];
|
|
602407
602620
|
}
|
|
602408
602621
|
const listing = buildFolderListing(dirPath, cwd4);
|
|
@@ -603529,7 +603742,7 @@ __export(memory_maintenance_exports, {
|
|
|
603529
603742
|
startIdleMemoryMaintenance: () => startIdleMemoryMaintenance
|
|
603530
603743
|
});
|
|
603531
603744
|
import { spawn as spawn27 } from "node:child_process";
|
|
603532
|
-
import { createWriteStream, existsSync as existsSync109, mkdirSync as mkdirSync66, readFileSync as readFileSync89, statSync as
|
|
603745
|
+
import { createWriteStream, existsSync as existsSync109, mkdirSync as mkdirSync66, readFileSync as readFileSync89, statSync as statSync43, writeFileSync as writeFileSync56 } from "node:fs";
|
|
603533
603746
|
import { fileURLToPath as fileURLToPath15 } from "node:url";
|
|
603534
603747
|
import { join as join124 } from "node:path";
|
|
603535
603748
|
function startIdleMemoryMaintenance(options2) {
|
|
@@ -603762,7 +603975,7 @@ function writeLastRunAt(repoRoot, value2) {
|
|
|
603762
603975
|
function readLatestSummary(repoRoot) {
|
|
603763
603976
|
const ledgerPath = join124(repoRoot, ".omnius", "memory-maintenance", "runs.jsonl");
|
|
603764
603977
|
try {
|
|
603765
|
-
if (!existsSync109(ledgerPath) ||
|
|
603978
|
+
if (!existsSync109(ledgerPath) || statSync43(ledgerPath).size === 0) return null;
|
|
603766
603979
|
const lines = readFileSync89(ledgerPath, "utf8").split(/\r?\n/).filter(Boolean);
|
|
603767
603980
|
const last2 = lines.at(-1);
|
|
603768
603981
|
if (!last2) return null;
|
|
@@ -604040,7 +604253,7 @@ __export(image_ascii_preview_exports, {
|
|
|
604040
604253
|
isLowInformationAsciiPreview: () => isLowInformationAsciiPreview
|
|
604041
604254
|
});
|
|
604042
604255
|
import { createRequire as createRequire5 } from "node:module";
|
|
604043
|
-
import { existsSync as existsSync110, readFileSync as readFileSync90, statSync as
|
|
604256
|
+
import { existsSync as existsSync110, readFileSync as readFileSync90, statSync as statSync44 } from "node:fs";
|
|
604044
604257
|
import { resolve as resolve54 } from "node:path";
|
|
604045
604258
|
function clamp7(n2, min, max) {
|
|
604046
604259
|
if (!Number.isFinite(n2)) return min;
|
|
@@ -604320,7 +604533,7 @@ async function buildImageAsciiPreview(inputPath, options2 = {}) {
|
|
|
604320
604533
|
const imagePath = resolve54(inputPath);
|
|
604321
604534
|
if (!existsSync110(imagePath)) return null;
|
|
604322
604535
|
try {
|
|
604323
|
-
if (!
|
|
604536
|
+
if (!statSync44(imagePath).isFile()) return null;
|
|
604324
604537
|
} catch {
|
|
604325
604538
|
return null;
|
|
604326
604539
|
}
|
|
@@ -606415,7 +606628,7 @@ transcribe-cli error: ${transcribeCliError}` : "";
|
|
|
606415
606628
|
|
|
606416
606629
|
// packages/cli/src/tui/camera-streamer.ts
|
|
606417
606630
|
import { spawn as spawn30 } from "node:child_process";
|
|
606418
|
-
import { existsSync as existsSync113, mkdirSync as mkdirSync70, statSync as
|
|
606631
|
+
import { existsSync as existsSync113, mkdirSync as mkdirSync70, statSync as statSync45, unlinkSync as unlinkSync20 } from "node:fs";
|
|
606419
606632
|
import { join as join128 } from "node:path";
|
|
606420
606633
|
function streamFps(configured) {
|
|
606421
606634
|
const raw = configured ?? Number(process.env["OMNIUS_LIVE_STREAM_FPS"] ?? "");
|
|
@@ -606479,7 +606692,7 @@ var init_camera_streamer = __esm({
|
|
|
606479
606692
|
const stream = this.streams.get(source);
|
|
606480
606693
|
if (!stream || !existsSync113(stream.framePath)) return null;
|
|
606481
606694
|
try {
|
|
606482
|
-
const stats =
|
|
606695
|
+
const stats = statSync45(stream.framePath);
|
|
606483
606696
|
if (!stats.isFile() || stats.size <= 0) return null;
|
|
606484
606697
|
return { path: stream.framePath, mtimeMs: stats.mtimeMs };
|
|
606485
606698
|
} catch {
|
|
@@ -606627,7 +606840,7 @@ var init_camera_streamer = __esm({
|
|
|
606627
606840
|
});
|
|
606628
606841
|
|
|
606629
606842
|
// packages/cli/src/tui/live-vlm.ts
|
|
606630
|
-
import { existsSync as existsSync114, readFileSync as readFileSync93, statSync as
|
|
606843
|
+
import { existsSync as existsSync114, readFileSync as readFileSync93, statSync as statSync46 } from "node:fs";
|
|
606631
606844
|
var DEFAULT_LIVE_VLM_MODEL, MAX_IMAGE_BYTES, VLM_SYSTEM_PROMPT, LiveVlmEngine;
|
|
606632
606845
|
var init_live_vlm = __esm({
|
|
606633
606846
|
"packages/cli/src/tui/live-vlm.ts"() {
|
|
@@ -606749,7 +606962,7 @@ var init_live_vlm = __esm({
|
|
|
606749
606962
|
if (Date.now() - this.lastFailureAt < 2e4) return null;
|
|
606750
606963
|
if (!existsSync114(framePath)) return null;
|
|
606751
606964
|
try {
|
|
606752
|
-
if (
|
|
606965
|
+
if (statSync46(framePath).size > MAX_IMAGE_BYTES) return null;
|
|
606753
606966
|
} catch {
|
|
606754
606967
|
return null;
|
|
606755
606968
|
}
|
|
@@ -621963,7 +622176,7 @@ import { EventEmitter as EventEmitter8 } from "node:events";
|
|
|
621963
622176
|
import { randomBytes as randomBytes22, timingSafeEqual } from "node:crypto";
|
|
621964
622177
|
import { URL as URL2 } from "node:url";
|
|
621965
622178
|
import { loadavg as loadavg2, cpus as cpus4, totalmem as totalmem7, freemem as freemem6 } from "node:os";
|
|
621966
|
-
import { existsSync as existsSync119, readFileSync as readFileSync98, writeFileSync as writeFileSync61, unlinkSync as unlinkSync21, mkdirSync as mkdirSync73, readdirSync as readdirSync39, statSync as
|
|
622179
|
+
import { existsSync as existsSync119, readFileSync as readFileSync98, writeFileSync as writeFileSync61, unlinkSync as unlinkSync21, mkdirSync as mkdirSync73, readdirSync as readdirSync39, statSync as statSync47, statfsSync as statfsSync7 } from "node:fs";
|
|
621967
622180
|
import { join as join133 } from "node:path";
|
|
621968
622181
|
function cleanForwardHeaders(raw, targetHost) {
|
|
621969
622182
|
const out = {};
|
|
@@ -623835,7 +624048,7 @@ ${this.formatConnectionInfo()}`);
|
|
|
623835
624048
|
let recentActive = 0;
|
|
623836
624049
|
for (const f2 of files.slice(-10)) {
|
|
623837
624050
|
try {
|
|
623838
|
-
const st =
|
|
624051
|
+
const st = statSync47(join133(invocDir, f2));
|
|
623839
624052
|
if (now2 - st.mtimeMs < 1e4) recentActive++;
|
|
623840
624053
|
} catch {
|
|
623841
624054
|
}
|
|
@@ -625831,7 +626044,7 @@ __export(omnius_directory_exports, {
|
|
|
625831
626044
|
writeIndexMeta: () => writeIndexMeta,
|
|
625832
626045
|
writeTaskHandoff: () => writeTaskHandoff2
|
|
625833
626046
|
});
|
|
625834
|
-
import { appendFileSync as appendFileSync14, cpSync as cpSync2, existsSync as existsSync122, mkdirSync as mkdirSync76, readFileSync as readFileSync101, writeFileSync as writeFileSync64, readdirSync as readdirSync41, statSync as
|
|
626047
|
+
import { appendFileSync as appendFileSync14, cpSync as cpSync2, existsSync as existsSync122, mkdirSync as mkdirSync76, readFileSync as readFileSync101, writeFileSync as writeFileSync64, readdirSync as readdirSync41, statSync as statSync48, unlinkSync as unlinkSync23, openSync as openSync2, closeSync as closeSync2, renameSync as renameSync11, watch as fsWatch2 } from "node:fs";
|
|
625835
626048
|
import { join as join136, relative as relative14, basename as basename26, dirname as dirname40, resolve as resolve58 } from "node:path";
|
|
625836
626049
|
import { homedir as homedir42 } from "node:os";
|
|
625837
626050
|
import { createHash as createHash39 } from "node:crypto";
|
|
@@ -625839,7 +626052,7 @@ function isGitRoot(dir) {
|
|
|
625839
626052
|
const gitPath = join136(dir, ".git");
|
|
625840
626053
|
if (!existsSync122(gitPath)) return false;
|
|
625841
626054
|
try {
|
|
625842
|
-
const stat9 =
|
|
626055
|
+
const stat9 = statSync48(gitPath);
|
|
625843
626056
|
if (stat9.isFile()) {
|
|
625844
626057
|
return readFileSync101(gitPath, "utf-8").trim().startsWith("gitdir:");
|
|
625845
626058
|
}
|
|
@@ -626191,7 +626404,7 @@ function loadRecentSessions(repoRoot, limit = 5) {
|
|
|
626191
626404
|
if (!existsSync122(historyDir)) return [];
|
|
626192
626405
|
try {
|
|
626193
626406
|
const files = readdirSync41(historyDir).filter((f2) => f2.endsWith(".json") && f2 !== "pending-task.json").map((f2) => {
|
|
626194
|
-
const stat9 =
|
|
626407
|
+
const stat9 = statSync48(join136(historyDir, f2));
|
|
626195
626408
|
return { file: f2, mtime: stat9.mtimeMs };
|
|
626196
626409
|
}).sort((a2, b) => b.mtime - a2.mtime).slice(0, limit);
|
|
626197
626410
|
return files.map((f2) => {
|
|
@@ -626452,7 +626665,7 @@ function mergeSessionContextEntry(previous, incoming) {
|
|
|
626452
626665
|
function pruneContextLedger(ledgerPath) {
|
|
626453
626666
|
try {
|
|
626454
626667
|
if (!existsSync122(ledgerPath)) return;
|
|
626455
|
-
const st =
|
|
626668
|
+
const st = statSync48(ledgerPath);
|
|
626456
626669
|
if (st.size <= MAX_CONTEXT_LEDGER_BYTES) return;
|
|
626457
626670
|
const lines = readFileSync101(ledgerPath, "utf-8").split(/\r?\n/).filter((line) => line.trim().length > 0);
|
|
626458
626671
|
if (lines.length <= MAX_CONTEXT_LEDGER_LINES) return;
|
|
@@ -626726,7 +626939,7 @@ function selectActiveTaskAnchor(repoRoot) {
|
|
|
626726
626939
|
const runId = ledger.runId || name10.replace(/\.json$/, "");
|
|
626727
626940
|
const workboard = readRestoreWorkboard(repoRoot, runId);
|
|
626728
626941
|
const score = scoreRestoreLedger(ledger, workboard);
|
|
626729
|
-
const mtimeMs =
|
|
626942
|
+
const mtimeMs = statSync48(filePath).mtimeMs;
|
|
626730
626943
|
return { ledger: { ...ledger, runId }, workboard, score, mtimeMs };
|
|
626731
626944
|
}).filter((item) => Boolean(item));
|
|
626732
626945
|
candidates.sort((a2, b) => b.score - a2.score || b.mtimeMs - a2.mtimeMs);
|
|
@@ -627421,14 +627634,14 @@ var init_session_summary = __esm({
|
|
|
627421
627634
|
|
|
627422
627635
|
// packages/cli/src/tui/cad-model-viewer.ts
|
|
627423
627636
|
import { createServer as createServer7 } from "node:http";
|
|
627424
|
-
import { existsSync as existsSync123, readFileSync as readFileSync102, statSync as
|
|
627637
|
+
import { existsSync as existsSync123, readFileSync as readFileSync102, statSync as statSync49 } from "node:fs";
|
|
627425
627638
|
import { basename as basename27, extname as extname16, resolve as resolve59 } from "node:path";
|
|
627426
627639
|
function getCurrentCadModelViewer() {
|
|
627427
627640
|
return currentViewer;
|
|
627428
627641
|
}
|
|
627429
627642
|
async function startCadModelViewer(filePath) {
|
|
627430
627643
|
const resolved = filePath ? resolve59(filePath) : void 0;
|
|
627431
|
-
if (resolved && (!existsSync123(resolved) || !
|
|
627644
|
+
if (resolved && (!existsSync123(resolved) || !statSync49(resolved).isFile())) {
|
|
627432
627645
|
throw new Error(`3D model file not found: ${resolved}`);
|
|
627433
627646
|
}
|
|
627434
627647
|
if (currentViewer) {
|
|
@@ -635014,7 +635227,7 @@ __export(personaplex_exports, {
|
|
|
635014
635227
|
startPersonaPlexDaemon: () => startPersonaPlexDaemon,
|
|
635015
635228
|
stopPersonaPlex: () => stopPersonaPlex
|
|
635016
635229
|
});
|
|
635017
|
-
import { existsSync as existsSync127, writeFileSync as writeFileSync66, readFileSync as readFileSync106, mkdirSync as mkdirSync78, copyFileSync as copyFileSync5, readdirSync as readdirSync42, statSync as
|
|
635230
|
+
import { existsSync as existsSync127, writeFileSync as writeFileSync66, readFileSync as readFileSync106, mkdirSync as mkdirSync78, copyFileSync as copyFileSync5, readdirSync as readdirSync42, statSync as statSync50 } from "node:fs";
|
|
635018
635231
|
import { join as join141, dirname as dirname43 } from "node:path";
|
|
635019
635232
|
import { homedir as homedir45 } from "node:os";
|
|
635020
635233
|
import { spawn as spawn33 } from "node:child_process";
|
|
@@ -635549,7 +635762,7 @@ print('Converted')
|
|
|
635549
635762
|
}
|
|
635550
635763
|
if (existsSync127(cachedBf16)) {
|
|
635551
635764
|
extraArgs.push("--moshi-weight", cachedBf16);
|
|
635552
|
-
log22(`Using distilled weights: ${(
|
|
635765
|
+
log22(`Using distilled weights: ${(statSync50(cachedBf16).size / 1024 ** 3).toFixed(1)}GB`);
|
|
635553
635766
|
} else {
|
|
635554
635767
|
extraArgs.push("--moshi-weight", weightPath);
|
|
635555
635768
|
}
|
|
@@ -635580,7 +635793,7 @@ print('Converted')
|
|
|
635580
635793
|
);
|
|
635581
635794
|
if (existsSync127(cachedBf16)) {
|
|
635582
635795
|
extraArgs.push("--moshi-weight", cachedBf16);
|
|
635583
|
-
log22(`Using dequantized cache: ${(
|
|
635796
|
+
log22(`Using dequantized cache: ${(statSync50(cachedBf16).size / 1024 ** 3).toFixed(1)}GB`);
|
|
635584
635797
|
}
|
|
635585
635798
|
} catch (e2) {
|
|
635586
635799
|
log22(`Dequantization failed — server will try to load original weights`);
|
|
@@ -639648,7 +639861,7 @@ var init_platforms = __esm({
|
|
|
639648
639861
|
});
|
|
639649
639862
|
|
|
639650
639863
|
// packages/cli/src/tui/workspace-explorer.ts
|
|
639651
|
-
import { existsSync as existsSync130, readdirSync as readdirSync43, readFileSync as readFileSync108, statSync as
|
|
639864
|
+
import { existsSync as existsSync130, readdirSync as readdirSync43, readFileSync as readFileSync108, statSync as statSync51 } from "node:fs";
|
|
639652
639865
|
import { basename as basename28, extname as extname17, join as join143, relative as relative15, resolve as resolve60 } from "node:path";
|
|
639653
639866
|
function exploreWorkspace(root, options2 = {}) {
|
|
639654
639867
|
const query = (options2.query ?? "").trim().toLowerCase();
|
|
@@ -639685,7 +639898,7 @@ function exploreWorkspace(root, options2 = {}) {
|
|
|
639685
639898
|
const rel = relative15(root, full).replace(/\\/g, "/");
|
|
639686
639899
|
if (query && !rel.toLowerCase().includes(query)) continue;
|
|
639687
639900
|
try {
|
|
639688
|
-
const st =
|
|
639901
|
+
const st = statSync51(full);
|
|
639689
639902
|
entries.push({
|
|
639690
639903
|
path: rel,
|
|
639691
639904
|
sizeBytes: st.size,
|
|
@@ -639737,7 +639950,7 @@ function previewWorkspaceFile(root, relPath, options2 = {}) {
|
|
|
639737
639950
|
throw new Error("File path escapes workspace root");
|
|
639738
639951
|
}
|
|
639739
639952
|
if (!existsSync130(full)) throw new Error(`File not found: ${relPath}`);
|
|
639740
|
-
const st =
|
|
639953
|
+
const st = statSync51(full);
|
|
639741
639954
|
if (!st.isFile()) throw new Error(`Not a file: ${relPath}`);
|
|
639742
639955
|
if (st.size > maxBytes) {
|
|
639743
639956
|
return [
|
|
@@ -643921,7 +644134,7 @@ __export(kg_prune_exports, {
|
|
|
643921
644134
|
pruneKnowledgeGraph: () => pruneKnowledgeGraph,
|
|
643922
644135
|
pruneKnowledgeGraphWithInference: () => pruneKnowledgeGraphWithInference
|
|
643923
644136
|
});
|
|
643924
|
-
import { existsSync as existsSync137, statSync as
|
|
644137
|
+
import { existsSync as existsSync137, statSync as statSync53 } from "node:fs";
|
|
643925
644138
|
import { join as join149 } from "node:path";
|
|
643926
644139
|
function stateDirFor(workingDir) {
|
|
643927
644140
|
return join149(workingDir, ".omnius");
|
|
@@ -643941,13 +644154,13 @@ function knowledgeGraphStats(workingDir) {
|
|
|
643941
644154
|
};
|
|
643942
644155
|
if (stats.exists) {
|
|
643943
644156
|
try {
|
|
643944
|
-
stats.sizeBytes =
|
|
644157
|
+
stats.sizeBytes = statSync53(dbPath).size;
|
|
643945
644158
|
} catch {
|
|
643946
644159
|
}
|
|
643947
644160
|
}
|
|
643948
644161
|
if (existsSync137(archivePath)) {
|
|
643949
644162
|
try {
|
|
643950
|
-
stats.archiveSizeBytes =
|
|
644163
|
+
stats.archiveSizeBytes = statSync53(archivePath).size;
|
|
643951
644164
|
} catch {
|
|
643952
644165
|
}
|
|
643953
644166
|
}
|
|
@@ -646499,7 +646712,7 @@ import {
|
|
|
646499
646712
|
readFileSync as readFileSync115,
|
|
646500
646713
|
unlinkSync as unlinkSync29,
|
|
646501
646714
|
readdirSync as readdirSync46,
|
|
646502
|
-
statSync as
|
|
646715
|
+
statSync as statSync54,
|
|
646503
646716
|
copyFileSync as copyFileSync6,
|
|
646504
646717
|
rmSync as rmSync11
|
|
646505
646718
|
} from "node:fs";
|
|
@@ -646633,7 +646846,7 @@ function mergeDir2(src2, dst) {
|
|
|
646633
646846
|
if (entry.isDirectory()) {
|
|
646634
646847
|
mergeDir2(s2, d2);
|
|
646635
646848
|
} else if (entry.isFile()) {
|
|
646636
|
-
if (!existsSync141(d2) ||
|
|
646849
|
+
if (!existsSync141(d2) || statSync54(s2).mtimeMs > statSync54(d2).mtimeMs) {
|
|
646637
646850
|
copyFileSync6(s2, d2);
|
|
646638
646851
|
}
|
|
646639
646852
|
}
|
|
@@ -648116,7 +648329,7 @@ except Exception as exc:
|
|
|
648116
648329
|
const p2 = join153(dir, f2);
|
|
648117
648330
|
let size = 0;
|
|
648118
648331
|
try {
|
|
648119
|
-
size =
|
|
648332
|
+
size = statSync54(p2).size;
|
|
648120
648333
|
} catch {
|
|
648121
648334
|
}
|
|
648122
648335
|
const entry = meta[f2];
|
|
@@ -651095,7 +651308,7 @@ import {
|
|
|
651095
651308
|
mkdirSync as mkdirSync85,
|
|
651096
651309
|
readdirSync as readdirSync47,
|
|
651097
651310
|
lstatSync as lstatSync2,
|
|
651098
|
-
statSync as
|
|
651311
|
+
statSync as statSync55,
|
|
651099
651312
|
rmSync as rmSync12,
|
|
651100
651313
|
appendFileSync as appendFileSync16,
|
|
651101
651314
|
writeSync as writeSync2
|
|
@@ -653904,7 +654117,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
653904
654117
|
ipfsFiles = files.length;
|
|
653905
654118
|
for (const f2 of files) {
|
|
653906
654119
|
try {
|
|
653907
|
-
ipfsBytes +=
|
|
654120
|
+
ipfsBytes += statSync55(join154(ipfsLocalDir, f2)).size;
|
|
653908
654121
|
} catch {
|
|
653909
654122
|
}
|
|
653910
654123
|
}
|
|
@@ -653917,7 +654130,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
653917
654130
|
else {
|
|
653918
654131
|
heliaBlocks++;
|
|
653919
654132
|
try {
|
|
653920
|
-
heliaBytes +=
|
|
654133
|
+
heliaBytes += statSync55(join154(dir, entry.name)).size;
|
|
653921
654134
|
} catch {
|
|
653922
654135
|
}
|
|
653923
654136
|
}
|
|
@@ -654060,7 +654273,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
654060
654273
|
lines.push(`
|
|
654061
654274
|
${c3.bold("Structured Memory (SQLite)")}`);
|
|
654062
654275
|
lines.push(
|
|
654063
|
-
` Memories: ${c3.bold(String(count))} DB: ${c3.dim(formatFileSize(
|
|
654276
|
+
` Memories: ${c3.bold(String(count))} DB: ${c3.dim(formatFileSize(statSync55(dbPath).size))}`
|
|
654064
654277
|
);
|
|
654065
654278
|
cDb(db);
|
|
654066
654279
|
}
|
|
@@ -654092,7 +654305,7 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
654092
654305
|
walkStorage(full, subCat);
|
|
654093
654306
|
} else {
|
|
654094
654307
|
try {
|
|
654095
|
-
const sz =
|
|
654308
|
+
const sz = statSync55(full).size;
|
|
654096
654309
|
totalBytes += sz;
|
|
654097
654310
|
if (!categories[category])
|
|
654098
654311
|
categories[category] = { files: 0, bytes: 0 };
|
|
@@ -661252,7 +661465,7 @@ async function showCohereDashboard(ctx3) {
|
|
|
661252
661465
|
const snapItems = snaps.slice(0, 20).map((f2) => ({
|
|
661253
661466
|
key: f2,
|
|
661254
661467
|
label: f2.replace(".json", ""),
|
|
661255
|
-
detail: `${formatFileSize(
|
|
661468
|
+
detail: `${formatFileSize(statSync55(join154(snapDir, f2)).size)}`
|
|
661256
661469
|
}));
|
|
661257
661470
|
if (snapItems.length > 0) {
|
|
661258
661471
|
await tuiSelect({
|
|
@@ -667896,7 +668109,7 @@ var init_commands = __esm({
|
|
|
667896
668109
|
});
|
|
667897
668110
|
|
|
667898
668111
|
// packages/cli/src/tui/project-context.ts
|
|
667899
|
-
import { existsSync as existsSync143, readFileSync as readFileSync117, readdirSync as readdirSync48, mkdirSync as mkdirSync86, statSync as
|
|
668112
|
+
import { existsSync as existsSync143, readFileSync as readFileSync117, readdirSync as readdirSync48, mkdirSync as mkdirSync86, statSync as statSync56, writeFileSync as writeFileSync74 } from "node:fs";
|
|
667900
668113
|
import { dirname as dirname47, join as join155, basename as basename30, resolve as resolve63 } from "node:path";
|
|
667901
668114
|
import { homedir as homedir53 } from "node:os";
|
|
667902
668115
|
function projectContextUrlSpanAt(text2, index) {
|
|
@@ -668558,7 +668771,7 @@ function safeReadDir(dir) {
|
|
|
668558
668771
|
}
|
|
668559
668772
|
function isDirectory2(path12) {
|
|
668560
668773
|
try {
|
|
668561
|
-
return
|
|
668774
|
+
return statSync56(path12).isDirectory();
|
|
668562
668775
|
} catch {
|
|
668563
668776
|
return false;
|
|
668564
668777
|
}
|
|
@@ -678078,7 +678291,7 @@ import {
|
|
|
678078
678291
|
existsSync as existsSync153,
|
|
678079
678292
|
mkdirSync as mkdirSync94,
|
|
678080
678293
|
readFileSync as readFileSync126,
|
|
678081
|
-
statSync as
|
|
678294
|
+
statSync as statSync57,
|
|
678082
678295
|
unlinkSync as unlinkSync32,
|
|
678083
678296
|
writeFileSync as writeFileSync81
|
|
678084
678297
|
} from "node:fs";
|
|
@@ -678591,7 +678804,7 @@ function materializeTelegramCreativeArtifactForSend(root, rawPath) {
|
|
|
678591
678804
|
}
|
|
678592
678805
|
function safeStatFile(path12) {
|
|
678593
678806
|
try {
|
|
678594
|
-
return
|
|
678807
|
+
return statSync57(path12).isFile();
|
|
678595
678808
|
} catch {
|
|
678596
678809
|
return false;
|
|
678597
678810
|
}
|
|
@@ -678863,7 +679076,7 @@ ${(result.error || result.output || "").slice(0, 1200)}`,
|
|
|
678863
679076
|
for (const fn of cleanup) fn();
|
|
678864
679077
|
}
|
|
678865
679078
|
rememberCreated(this.root, guarded.path.abs);
|
|
678866
|
-
const sizeKB = Math.round(
|
|
679079
|
+
const sizeKB = Math.round(statSync57(guarded.path.abs).size / 1024);
|
|
678867
679080
|
this.emitProgress(start2, {
|
|
678868
679081
|
stage: "save",
|
|
678869
679082
|
message: `Saved scoped audio file (${sizeKB}KB)`
|
|
@@ -682256,7 +682469,7 @@ import {
|
|
|
682256
682469
|
existsSync as existsSync156,
|
|
682257
682470
|
unlinkSync as unlinkSync35,
|
|
682258
682471
|
readdirSync as readdirSync56,
|
|
682259
|
-
statSync as
|
|
682472
|
+
statSync as statSync58,
|
|
682260
682473
|
readFileSync as readFileSync129,
|
|
682261
682474
|
writeFileSync as writeFileSync83,
|
|
682262
682475
|
appendFileSync as appendFileSync19
|
|
@@ -687210,7 +687423,7 @@ Model: <code>${escapeTelegramHTML(model.id)}</code>`
|
|
|
687210
687423
|
}
|
|
687211
687424
|
let sent = 0;
|
|
687212
687425
|
for (const path12 of paths) {
|
|
687213
|
-
if (!existsSync156(path12) || !
|
|
687426
|
+
if (!existsSync156(path12) || !statSync58(path12).isFile()) continue;
|
|
687214
687427
|
const kind = classifyMedia(path12) ?? "document";
|
|
687215
687428
|
const messageId = await this.sendMediaReference(
|
|
687216
687429
|
msg.chatId,
|
|
@@ -699539,7 +699752,7 @@ ${knownList}` : "Private-user telegram_send_file target must be this DM or a kno
|
|
|
699539
699752
|
const abs = isAbsolute14(trimmed) ? resolve68(trimmed) : resolve68(base3, trimmed);
|
|
699540
699753
|
if (!existsSync156(abs))
|
|
699541
699754
|
return { ok: false, error: `File does not exist: ${trimmed}` };
|
|
699542
|
-
if (!
|
|
699755
|
+
if (!statSync58(abs).isFile())
|
|
699543
699756
|
return { ok: false, error: `Path is not a file: ${trimmed}` };
|
|
699544
699757
|
return { ok: true, path: abs };
|
|
699545
699758
|
}
|
|
@@ -700053,7 +700266,7 @@ ${text2}`.trim()
|
|
|
700053
700266
|
}
|
|
700054
700267
|
async sendTelegramFileToChat(chatId, path12, options2) {
|
|
700055
700268
|
const abs = resolve68(path12);
|
|
700056
|
-
if (!existsSync156(abs) || !
|
|
700269
|
+
if (!existsSync156(abs) || !statSync58(abs).isFile()) {
|
|
700057
700270
|
throw new Error(`File does not exist or is not a regular file: ${path12}`);
|
|
700058
700271
|
}
|
|
700059
700272
|
return this.sendMediaReferenceStrict(
|
|
@@ -700323,7 +700536,7 @@ Content-Type: ${contentType}\r
|
|
|
700323
700536
|
for (const path12 of paths) {
|
|
700324
700537
|
const abs = resolve68(path12);
|
|
700325
700538
|
if (subAgent.deliveredArtifacts.includes(abs)) continue;
|
|
700326
|
-
if (!existsSync156(abs) || !
|
|
700539
|
+
if (!existsSync156(abs) || !statSync58(abs).isFile()) continue;
|
|
700327
700540
|
subAgent.deliveredArtifacts.push(abs);
|
|
700328
700541
|
await this.sendMediaReference(
|
|
700329
700542
|
msg.chatId,
|
|
@@ -700365,7 +700578,7 @@ Content-Type: ${contentType}\r
|
|
|
700365
700578
|
abs
|
|
700366
700579
|
);
|
|
700367
700580
|
if (!materialized.ok) continue;
|
|
700368
|
-
if (!existsSync156(materialized.path) || !
|
|
700581
|
+
if (!existsSync156(materialized.path) || !statSync58(materialized.path).isFile()) {
|
|
700369
700582
|
materialized.cleanup?.();
|
|
700370
700583
|
continue;
|
|
700371
700584
|
}
|
|
@@ -702553,7 +702766,7 @@ __export(projects_exports, {
|
|
|
702553
702766
|
setCurrentProject: () => setCurrentProject,
|
|
702554
702767
|
unregisterProject: () => unregisterProject
|
|
702555
702768
|
});
|
|
702556
|
-
import { readFileSync as readFileSync130, writeFileSync as writeFileSync84, mkdirSync as mkdirSync97, existsSync as existsSync157, statSync as
|
|
702769
|
+
import { readFileSync as readFileSync130, writeFileSync as writeFileSync84, mkdirSync as mkdirSync97, existsSync as existsSync157, statSync as statSync59, renameSync as renameSync14 } from "node:fs";
|
|
702557
702770
|
import { homedir as homedir56 } from "node:os";
|
|
702558
702771
|
import { basename as basename41, join as join169, resolve as resolve69 } from "node:path";
|
|
702559
702772
|
import { randomUUID as randomUUID19 } from "node:crypto";
|
|
@@ -702579,7 +702792,7 @@ function listProjects() {
|
|
|
702579
702792
|
const alive = [];
|
|
702580
702793
|
for (const p2 of projects) {
|
|
702581
702794
|
try {
|
|
702582
|
-
if (
|
|
702795
|
+
if (statSync59(p2.root).isDirectory()) alive.push(p2);
|
|
702583
702796
|
} catch {
|
|
702584
702797
|
}
|
|
702585
702798
|
}
|
|
@@ -703725,7 +703938,7 @@ var init_audit_log = __esm({
|
|
|
703725
703938
|
|
|
703726
703939
|
// packages/cli/src/api/disk-task-output.ts
|
|
703727
703940
|
import { open } from "node:fs/promises";
|
|
703728
|
-
import { existsSync as existsSync160, mkdirSync as mkdirSync100, statSync as
|
|
703941
|
+
import { existsSync as existsSync160, mkdirSync as mkdirSync100, statSync as statSync60 } from "node:fs";
|
|
703729
703942
|
import { dirname as dirname51 } from "node:path";
|
|
703730
703943
|
import * as fsConstants from "node:constants";
|
|
703731
703944
|
var O_NOFOLLOW2, O_APPEND2, O_CREAT2, O_WRONLY2, OPEN_FLAGS_WRITE, OPEN_MODE, DiskTaskOutput;
|
|
@@ -703824,7 +704037,7 @@ var init_disk_task_output = __esm({
|
|
|
703824
704037
|
if (!existsSync160(this.path)) {
|
|
703825
704038
|
return { content: "", nextOffset: offset, eof: true, size: 0 };
|
|
703826
704039
|
}
|
|
703827
|
-
const st =
|
|
704040
|
+
const st = statSync60(this.path);
|
|
703828
704041
|
if (offset >= st.size) {
|
|
703829
704042
|
return { content: "", nextOffset: offset, eof: true, size: st.size };
|
|
703830
704043
|
}
|
|
@@ -704012,7 +704225,7 @@ data: ${JSON.stringify(ev)}
|
|
|
704012
704225
|
});
|
|
704013
704226
|
|
|
704014
704227
|
// packages/cli/src/api/routes-media.ts
|
|
704015
|
-
import { existsSync as existsSync161, mkdirSync as mkdirSync101, statSync as
|
|
704228
|
+
import { existsSync as existsSync161, mkdirSync as mkdirSync101, statSync as statSync61, copyFileSync as copyFileSync7, createReadStream } from "node:fs";
|
|
704016
704229
|
import { basename as basename42, join as join172, resolve as pathResolve2 } from "node:path";
|
|
704017
704230
|
function mediaWorkDir() {
|
|
704018
704231
|
return join172(omniusHomeDir(), "media", "_work");
|
|
@@ -704313,7 +704526,7 @@ async function runGeneration(ctx3, kind, buildTool, buildArgs) {
|
|
|
704313
704526
|
const published = publishToGallery(srcPath, kind);
|
|
704314
704527
|
const size = (() => {
|
|
704315
704528
|
try {
|
|
704316
|
-
return
|
|
704529
|
+
return statSync61(published.path).size;
|
|
704317
704530
|
} catch {
|
|
704318
704531
|
return 0;
|
|
704319
704532
|
}
|
|
@@ -704420,7 +704633,7 @@ function handleFile(ctx3) {
|
|
|
704420
704633
|
const ext = full.slice(full.lastIndexOf(".")).toLowerCase();
|
|
704421
704634
|
ctx3.res.writeHead(200, {
|
|
704422
704635
|
"Content-Type": MIME_BY_EXT[ext] || "application/octet-stream",
|
|
704423
|
-
"Content-Length":
|
|
704636
|
+
"Content-Length": statSync61(full).size,
|
|
704424
704637
|
"Cache-Control": "private, max-age=3600"
|
|
704425
704638
|
});
|
|
704426
704639
|
createReadStream(full).pipe(ctx3.res);
|
|
@@ -705009,7 +705222,7 @@ __export(aiwg_exports, {
|
|
|
705009
705222
|
resolveAiwgRoot: () => resolveAiwgRoot,
|
|
705010
705223
|
tryRouteAiwg: () => tryRouteAiwg
|
|
705011
705224
|
});
|
|
705012
|
-
import { existsSync as existsSync163, readFileSync as readFileSync134, readdirSync as readdirSync57, statSync as
|
|
705225
|
+
import { existsSync as existsSync163, readFileSync as readFileSync134, readdirSync as readdirSync57, statSync as statSync62 } from "node:fs";
|
|
705013
705226
|
import { join as join174 } from "node:path";
|
|
705014
705227
|
import { homedir as homedir58 } from "node:os";
|
|
705015
705228
|
import { execSync as execSync38 } from "node:child_process";
|
|
@@ -705111,7 +705324,7 @@ function listAiwgFrameworks() {
|
|
|
705111
705324
|
for (const name10 of readdirSync57(frameworksDir)) {
|
|
705112
705325
|
const p2 = join174(frameworksDir, name10);
|
|
705113
705326
|
try {
|
|
705114
|
-
const st =
|
|
705327
|
+
const st = statSync62(p2);
|
|
705115
705328
|
if (!st.isDirectory()) continue;
|
|
705116
705329
|
const agg = aggregateDir(p2);
|
|
705117
705330
|
out.push({
|
|
@@ -705148,7 +705361,7 @@ function aggregateDir(dir, depth = 0) {
|
|
|
705148
705361
|
out.commands += sub2.commands;
|
|
705149
705362
|
} else if (e2.isFile()) {
|
|
705150
705363
|
try {
|
|
705151
|
-
const st =
|
|
705364
|
+
const st = statSync62(p2);
|
|
705152
705365
|
out.files++;
|
|
705153
705366
|
out.bytes += st.size;
|
|
705154
705367
|
if (e2.name.endsWith(".md")) {
|
|
@@ -705282,7 +705495,7 @@ function listAiwgAddons() {
|
|
|
705282
705495
|
for (const name10 of readdirSync57(addonsDir)) {
|
|
705283
705496
|
const p2 = join174(addonsDir, name10);
|
|
705284
705497
|
try {
|
|
705285
|
-
const st =
|
|
705498
|
+
const st = statSync62(p2);
|
|
705286
705499
|
if (!st.isDirectory()) continue;
|
|
705287
705500
|
const agg = aggregateDir(p2);
|
|
705288
705501
|
out.push({
|
|
@@ -706167,7 +706380,7 @@ var init_graphical_sudo = __esm({
|
|
|
706167
706380
|
});
|
|
706168
706381
|
|
|
706169
706382
|
// packages/cli/src/api/routes-v1.ts
|
|
706170
|
-
import { existsSync as existsSync167, mkdirSync as mkdirSync105, readFileSync as readFileSync137, readdirSync as readdirSync58, statSync as
|
|
706383
|
+
import { existsSync as existsSync167, mkdirSync as mkdirSync105, readFileSync as readFileSync137, readdirSync as readdirSync58, statSync as statSync63 } from "node:fs";
|
|
706171
706384
|
import { join as join178, resolve as pathResolve3 } from "node:path";
|
|
706172
706385
|
import { homedir as homedir61 } from "node:os";
|
|
706173
706386
|
async function tryRouteV1(ctx3) {
|
|
@@ -707385,7 +707598,7 @@ async function handleFilesRead(ctx3) {
|
|
|
707385
707598
|
}));
|
|
707386
707599
|
return true;
|
|
707387
707600
|
}
|
|
707388
|
-
const st =
|
|
707601
|
+
const st = statSync63(resolved);
|
|
707389
707602
|
if (st.isDirectory()) {
|
|
707390
707603
|
sendProblem(res, problemDetails({
|
|
707391
707604
|
type: P2.invalidRequest,
|
|
@@ -722575,7 +722788,7 @@ import {
|
|
|
722575
722788
|
watch as fsWatch4,
|
|
722576
722789
|
renameSync as renameSync17,
|
|
722577
722790
|
unlinkSync as unlinkSync37,
|
|
722578
|
-
statSync as
|
|
722791
|
+
statSync as statSync64,
|
|
722579
722792
|
openSync as openSync6,
|
|
722580
722793
|
readSync as readSync2,
|
|
722581
722794
|
closeSync as closeSync6
|
|
@@ -722935,7 +723148,7 @@ function fileEntryMetadata(dir, entry) {
|
|
|
722935
723148
|
kind: fileKindForPath(entry.name)
|
|
722936
723149
|
};
|
|
722937
723150
|
try {
|
|
722938
|
-
const st =
|
|
723151
|
+
const st = statSync64(target);
|
|
722939
723152
|
meta["size"] = st.size;
|
|
722940
723153
|
meta["mtime"] = new Date(st.mtimeMs).toISOString();
|
|
722941
723154
|
} catch {
|
|
@@ -722947,7 +723160,7 @@ function contentDispositionName(filePath) {
|
|
|
722947
723160
|
return name10.replace(/["\r\n]/g, "");
|
|
722948
723161
|
}
|
|
722949
723162
|
function streamWorkspaceFile(req3, res, target) {
|
|
722950
|
-
const st =
|
|
723163
|
+
const st = statSync64(target);
|
|
722951
723164
|
if (!st.isFile()) {
|
|
722952
723165
|
jsonResponse(res, 400, { error: "Path is not a file", path: target });
|
|
722953
723166
|
return;
|
|
@@ -726944,7 +727157,7 @@ function handleV1RunsById(res, id2) {
|
|
|
726944
727157
|
const enriched = { ...job };
|
|
726945
727158
|
if (outputFile && existsSync170(outputFile)) {
|
|
726946
727159
|
try {
|
|
726947
|
-
const size =
|
|
727160
|
+
const size = statSync64(outputFile).size;
|
|
726948
727161
|
const tailSize = Math.min(size, 4096);
|
|
726949
727162
|
const buffer2 = Buffer.alloc(tailSize);
|
|
726950
727163
|
const fd = openSync6(outputFile, "r");
|
|
@@ -727592,7 +727805,7 @@ async function handleRequest(req3, res, ollamaUrl, verbose, runtimeDefaults = {}
|
|
|
727592
727805
|
const dir = path12.dirname(cssEntry);
|
|
727593
727806
|
const fullPath = path12.join(dir, entry.path);
|
|
727594
727807
|
if (fs11.existsSync(fullPath)) {
|
|
727595
|
-
const stat9 =
|
|
727808
|
+
const stat9 = statSync64(fullPath);
|
|
727596
727809
|
res.writeHead(200, {
|
|
727597
727810
|
"Content-Type": entry.ct,
|
|
727598
727811
|
"Content-Length": String(stat9.size),
|
|
@@ -728144,17 +728357,17 @@ async function handleRequest(req3, res, ollamaUrl, verbose, runtimeDefaults = {}
|
|
|
728144
728357
|
const child = join182(dir, e2.name);
|
|
728145
728358
|
const omniusDir = join182(child, ".omnius");
|
|
728146
728359
|
try {
|
|
728147
|
-
if (
|
|
728360
|
+
if (statSync64(omniusDir).isDirectory()) {
|
|
728148
728361
|
const name10 = e2.name;
|
|
728149
728362
|
const prefsFile = join182(omniusDir, "config.json");
|
|
728150
728363
|
let lastSeen = 0;
|
|
728151
728364
|
try {
|
|
728152
|
-
lastSeen =
|
|
728365
|
+
lastSeen = statSync64(prefsFile).mtimeMs;
|
|
728153
728366
|
} catch {
|
|
728154
728367
|
}
|
|
728155
728368
|
if (!lastSeen) {
|
|
728156
728369
|
try {
|
|
728157
|
-
lastSeen =
|
|
728370
|
+
lastSeen = statSync64(omniusDir).mtimeMs;
|
|
728158
728371
|
} catch {
|
|
728159
728372
|
}
|
|
728160
728373
|
}
|
|
@@ -728203,17 +728416,17 @@ async function handleRequest(req3, res, ollamaUrl, verbose, runtimeDefaults = {}
|
|
|
728203
728416
|
const child = join182(dir, e2.name);
|
|
728204
728417
|
const omniusDir = join182(child, ".omnius");
|
|
728205
728418
|
try {
|
|
728206
|
-
if (
|
|
728419
|
+
if (statSync64(omniusDir).isDirectory()) {
|
|
728207
728420
|
const name10 = e2.name;
|
|
728208
728421
|
const prefsFile = join182(omniusDir, "config.json");
|
|
728209
728422
|
let lastSeen = 0;
|
|
728210
728423
|
try {
|
|
728211
|
-
lastSeen =
|
|
728424
|
+
lastSeen = statSync64(prefsFile).mtimeMs;
|
|
728212
728425
|
} catch {
|
|
728213
728426
|
}
|
|
728214
728427
|
if (!lastSeen) {
|
|
728215
728428
|
try {
|
|
728216
|
-
lastSeen =
|
|
728429
|
+
lastSeen = statSync64(omniusDir).mtimeMs;
|
|
728217
728430
|
} catch {
|
|
728218
728431
|
}
|
|
728219
728432
|
}
|
|
@@ -733234,7 +733447,7 @@ import {
|
|
|
733234
733447
|
appendFileSync as appendFileSync21,
|
|
733235
733448
|
rmSync as rmSync16,
|
|
733236
733449
|
readdirSync as readdirSync60,
|
|
733237
|
-
statSync as
|
|
733450
|
+
statSync as statSync65,
|
|
733238
733451
|
mkdirSync as mkdirSync110
|
|
733239
733452
|
} from "node:fs";
|
|
733240
733453
|
import { existsSync as existsSync171 } from "node:fs";
|
|
@@ -738623,7 +738836,7 @@ This is an independent background session started from /background.`
|
|
|
738623
738836
|
if (!entry.startsWith(partialName)) continue;
|
|
738624
738837
|
const full = join184(searchDir, entry);
|
|
738625
738838
|
try {
|
|
738626
|
-
const st =
|
|
738839
|
+
const st = statSync65(full);
|
|
738627
738840
|
const suffix = st.isDirectory() ? "/" : "";
|
|
738628
738841
|
const display = isAbsolute15 ? full : full.startsWith(repoRoot + sep5) ? full.slice(repoRoot.length + 1) : full;
|
|
738629
738842
|
completions.push(display + suffix);
|
|
@@ -741287,11 +741500,11 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
741287
741500
|
}
|
|
741288
741501
|
if (name10 === "voice_list_files") {
|
|
741289
741502
|
const baseDir = String(args?.dir ?? ".");
|
|
741290
|
-
const { readdirSync: readdirSync62, statSync:
|
|
741503
|
+
const { readdirSync: readdirSync62, statSync: statSync67 } = __require("node:fs");
|
|
741291
741504
|
const { join: join189, resolve: resolve77 } = __require("node:path");
|
|
741292
741505
|
const base3 = baseDir.startsWith("/") ? baseDir : resolve77(join189(repoRoot, baseDir));
|
|
741293
741506
|
const items = readdirSync62(base3).slice(0, 200).map((f2) => {
|
|
741294
|
-
const s2 =
|
|
741507
|
+
const s2 = statSync67(join189(base3, f2));
|
|
741295
741508
|
return { name: f2, dir: s2.isDirectory(), size: s2.size };
|
|
741296
741509
|
});
|
|
741297
741510
|
return JSON.stringify({ dir: base3, items }, null, 2);
|
|
@@ -744075,7 +744288,7 @@ __export(index_repo_exports, {
|
|
|
744075
744288
|
indexRepoCommand: () => indexRepoCommand
|
|
744076
744289
|
});
|
|
744077
744290
|
import { resolve as resolve75 } from "node:path";
|
|
744078
|
-
import { existsSync as existsSync173, statSync as
|
|
744291
|
+
import { existsSync as existsSync173, statSync as statSync66 } from "node:fs";
|
|
744079
744292
|
import { cwd as cwd2 } from "node:process";
|
|
744080
744293
|
async function indexRepoCommand(opts, _config3) {
|
|
744081
744294
|
const repoRoot = resolve75(opts.repoPath ?? cwd2());
|
|
@@ -744085,7 +744298,7 @@ async function indexRepoCommand(opts, _config3) {
|
|
|
744085
744298
|
printError(`Path does not exist: ${repoRoot}`);
|
|
744086
744299
|
process.exit(1);
|
|
744087
744300
|
}
|
|
744088
|
-
const stat9 =
|
|
744301
|
+
const stat9 = statSync66(repoRoot);
|
|
744089
744302
|
if (!stat9.isDirectory()) {
|
|
744090
744303
|
printError(`Path is not a directory: ${repoRoot}`);
|
|
744091
744304
|
process.exit(1);
|