omnius 1.0.519 → 1.0.521
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 +272 -142
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -155623,7 +155623,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
155623
155623
|
"../node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
|
|
155624
155624
|
"use strict";
|
|
155625
155625
|
var { writeFile: writeFile27, readFile: readFile25, mkdir: mkdir23 } = __require("node:fs/promises");
|
|
155626
|
-
var { dirname:
|
|
155626
|
+
var { dirname: dirname57, resolve: resolve79 } = __require("node:path");
|
|
155627
155627
|
var { setTimeout: setTimeout3, clearTimeout: clearTimeout3 } = __require("node:timers");
|
|
155628
155628
|
var { InvalidArgumentError, UndiciError } = require_errors2();
|
|
155629
155629
|
var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
|
|
@@ -155854,7 +155854,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
155854
155854
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
155855
155855
|
}
|
|
155856
155856
|
const resolvedPath = resolve79(path15);
|
|
155857
|
-
await mkdir23(
|
|
155857
|
+
await mkdir23(dirname57(resolvedPath), { recursive: true });
|
|
155858
155858
|
const data = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
|
|
155859
155859
|
hash,
|
|
155860
155860
|
snapshot
|
|
@@ -269516,15 +269516,15 @@ var init_ls = __esm({
|
|
|
269516
269516
|
});
|
|
269517
269517
|
|
|
269518
269518
|
// ../node_modules/@helia/unixfs/dist/src/commands/mkdir.js
|
|
269519
|
-
async function mkdir6(parentCid,
|
|
269520
|
-
if (
|
|
269519
|
+
async function mkdir6(parentCid, dirname57, blockstore, options2 = {}) {
|
|
269520
|
+
if (dirname57.includes("/")) {
|
|
269521
269521
|
throw new InvalidParametersError4("Path must not have slashes");
|
|
269522
269522
|
}
|
|
269523
269523
|
const entry = await exporter2(parentCid, blockstore, options2);
|
|
269524
269524
|
if (entry.type !== "directory") {
|
|
269525
269525
|
throw new NotADirectoryError(`${parentCid.toString()} was not a UnixFS directory`);
|
|
269526
269526
|
}
|
|
269527
|
-
log16("creating %s",
|
|
269527
|
+
log16("creating %s", dirname57);
|
|
269528
269528
|
const metadata = new UnixFS({
|
|
269529
269529
|
type: "directory",
|
|
269530
269530
|
mode: options2.mode,
|
|
@@ -269540,9 +269540,9 @@ async function mkdir6(parentCid, dirname56, blockstore, options2 = {}) {
|
|
|
269540
269540
|
await blockstore.put(emptyDirCid, buf);
|
|
269541
269541
|
const [directory, pblink] = await Promise.all([
|
|
269542
269542
|
cidToDirectory(parentCid, blockstore, options2),
|
|
269543
|
-
cidToPBLink(emptyDirCid,
|
|
269543
|
+
cidToPBLink(emptyDirCid, dirname57, blockstore, options2)
|
|
269544
269544
|
]);
|
|
269545
|
-
log16("adding empty dir called %s to %c",
|
|
269545
|
+
log16("adding empty dir called %s to %c", dirname57, parentCid);
|
|
269546
269546
|
const result = await addLink(directory, pblink, blockstore, {
|
|
269547
269547
|
...options2,
|
|
269548
269548
|
allowOverwriting: options2.force
|
|
@@ -270041,8 +270041,8 @@ var init_unixfs2 = __esm({
|
|
|
270041
270041
|
async *ls(cid, options2 = {}) {
|
|
270042
270042
|
yield* ls(cid, this.components.blockstore, options2);
|
|
270043
270043
|
}
|
|
270044
|
-
async mkdir(cid,
|
|
270045
|
-
return mkdir6(cid,
|
|
270044
|
+
async mkdir(cid, dirname57, options2 = {}) {
|
|
270045
|
+
return mkdir6(cid, dirname57, this.components.blockstore, options2);
|
|
270046
270046
|
}
|
|
270047
270047
|
async rm(cid, path15, options2 = {}) {
|
|
270048
270048
|
return rm3(cid, path15, this.components.blockstore, options2);
|
|
@@ -273439,8 +273439,8 @@ var require_pattern = __commonJS({
|
|
|
273439
273439
|
}
|
|
273440
273440
|
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
273441
273441
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
273442
|
-
const
|
|
273443
|
-
return endsWithSlashGlobStar(pattern) || isStaticPattern(
|
|
273442
|
+
const basename45 = path15.basename(pattern);
|
|
273443
|
+
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename45);
|
|
273444
273444
|
}
|
|
273445
273445
|
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
273446
273446
|
function expandPatternsWithBraceExpansion(patterns) {
|
|
@@ -439859,9 +439859,9 @@ ${lanes.join("\n")}
|
|
|
439859
439859
|
/*ignoreCase*/
|
|
439860
439860
|
false
|
|
439861
439861
|
)) {
|
|
439862
|
-
const
|
|
439863
|
-
if (
|
|
439864
|
-
const name10 = removeSuffix(removePrefix(
|
|
439862
|
+
const basename45 = getBaseFileName(a2.fileName);
|
|
439863
|
+
if (basename45 === "lib.d.ts" || basename45 === "lib.es6.d.ts") return 0;
|
|
439864
|
+
const name10 = removeSuffix(removePrefix(basename45, "lib."), ".d.ts");
|
|
439865
439865
|
const index = libs.indexOf(name10);
|
|
439866
439866
|
if (index !== -1) return index + 1;
|
|
439867
439867
|
}
|
|
@@ -503787,8 +503787,8 @@ ${options2.prefix}` : "\n" : options2.prefix
|
|
|
503787
503787
|
}
|
|
503788
503788
|
};
|
|
503789
503789
|
for (const file of files) {
|
|
503790
|
-
const
|
|
503791
|
-
if (
|
|
503790
|
+
const basename45 = getBaseFileName(file);
|
|
503791
|
+
if (basename45 === "package.json" || basename45 === "bower.json") {
|
|
503792
503792
|
createProjectWatcher(
|
|
503793
503793
|
file,
|
|
503794
503794
|
"FileWatcher"
|
|
@@ -507472,8 +507472,8 @@ All files are: ${JSON.stringify(names)}`,
|
|
|
507472
507472
|
var _a2;
|
|
507473
507473
|
const fileOrDirectoryPath = removeIgnoredPath(this.toPath(fileOrDirectory));
|
|
507474
507474
|
if (!fileOrDirectoryPath) return;
|
|
507475
|
-
const
|
|
507476
|
-
if (((_a2 = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a2.size) && (
|
|
507475
|
+
const basename45 = getBaseFileName(fileOrDirectoryPath);
|
|
507476
|
+
if (((_a2 = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a2.size) && (basename45 === "package.json" || basename45 === "node_modules")) {
|
|
507477
507477
|
result.affectedModuleSpecifierCacheProjects.forEach((project) => {
|
|
507478
507478
|
var _a22;
|
|
507479
507479
|
(_a22 = project.getModuleSpecifierCache()) == null ? void 0 : _a22.clear();
|
|
@@ -516354,7 +516354,7 @@ var require_path_browserify = __commonJS({
|
|
|
516354
516354
|
_makeLong: function _makeLong(path15) {
|
|
516355
516355
|
return path15;
|
|
516356
516356
|
},
|
|
516357
|
-
dirname: function
|
|
516357
|
+
dirname: function dirname57(path15) {
|
|
516358
516358
|
assertPath(path15);
|
|
516359
516359
|
if (path15.length === 0) return ".";
|
|
516360
516360
|
var code8 = path15.charCodeAt(0);
|
|
@@ -516376,7 +516376,7 @@ var require_path_browserify = __commonJS({
|
|
|
516376
516376
|
if (hasRoot && end === 1) return "//";
|
|
516377
516377
|
return path15.slice(0, end);
|
|
516378
516378
|
},
|
|
516379
|
-
basename: function
|
|
516379
|
+
basename: function basename45(path15, ext) {
|
|
516380
516380
|
if (ext !== void 0 && typeof ext !== "string") throw new TypeError('"ext" argument must be a string');
|
|
516381
516381
|
assertPath(path15);
|
|
516382
516382
|
var start2 = 0;
|
|
@@ -566866,6 +566866,9 @@ var init_ollama_pool = __esm({
|
|
|
566866
566866
|
return this.buildSlot(pick, resolvedAgentId);
|
|
566867
566867
|
}
|
|
566868
566868
|
if (placementMode === "constrained") {
|
|
566869
|
+
if (optsWithAgent.queuePolicy === "skip") {
|
|
566870
|
+
throw new Error("No GPU slot immediately available. All slots occupied.");
|
|
566871
|
+
}
|
|
566869
566872
|
return this.acquireQueued(optsWithAgent, resolvedAgentId);
|
|
566870
566873
|
}
|
|
566871
566874
|
const spawned = placementMode === "elastic" ? await this.maybeSpawnInstance(optsWithAgent.model) : null;
|
|
@@ -566875,6 +566878,9 @@ var init_ollama_pool = __esm({
|
|
|
566875
566878
|
this.recordAffinity(resolvedAgentId, spawned.state.id);
|
|
566876
566879
|
return this.buildSlot(spawned, resolvedAgentId);
|
|
566877
566880
|
}
|
|
566881
|
+
if (optsWithAgent.queuePolicy === "skip") {
|
|
566882
|
+
throw new Error("No GPU slot immediately available. All slots occupied.");
|
|
566883
|
+
}
|
|
566878
566884
|
return this.acquireQueued(optsWithAgent, resolvedAgentId);
|
|
566879
566885
|
}
|
|
566880
566886
|
/** Synchronous routing decision; returns the instance or null if every one is saturated. */
|
|
@@ -566936,7 +566942,8 @@ var init_ollama_pool = __esm({
|
|
|
566936
566942
|
return this.buildSlot(pick, agentId);
|
|
566937
566943
|
}
|
|
566938
566944
|
await new Promise((resolve79, reject) => {
|
|
566939
|
-
const
|
|
566945
|
+
const timeoutMs = Number.isFinite(opts.queueTimeoutMs) && (opts.queueTimeoutMs ?? 0) > 0 ? Math.floor(opts.queueTimeoutMs) : 3e4;
|
|
566946
|
+
const timer = setTimeout(() => reject(new Error(`No GPU slot available after ${(timeoutMs / 1e3).toFixed(0)}s. All slots occupied.`)), timeoutMs);
|
|
566940
566947
|
this.slotWaiters.push(() => {
|
|
566941
566948
|
clearTimeout(timer);
|
|
566942
566949
|
resolve79();
|
|
@@ -576161,8 +576168,8 @@ var init_adversaryStream = __esm({
|
|
|
576161
576168
|
return;
|
|
576162
576169
|
try {
|
|
576163
576170
|
const { writeFileSync: writeFileSync97, mkdirSync: mkdirSync114, existsSync: existsSync174 } = __require("node:fs");
|
|
576164
|
-
const { dirname:
|
|
576165
|
-
const dir =
|
|
576171
|
+
const { dirname: dirname57 } = __require("node:path");
|
|
576172
|
+
const dir = dirname57(this.persistPath);
|
|
576166
576173
|
if (!existsSync174(dir))
|
|
576167
576174
|
mkdirSync114(dir, { recursive: true });
|
|
576168
576175
|
writeFileSync97(this.persistPath, JSON.stringify({ ledger: this.ledger }, null, 2));
|
|
@@ -603790,7 +603797,9 @@ ${description}`
|
|
|
603790
603797
|
body["num_ctx"] = reqNumCtx;
|
|
603791
603798
|
}
|
|
603792
603799
|
let poolSlot = shouldUseOllamaPoolForBaseUrl(this.baseUrl) ? await getOllamaPool({ baseInstanceUrl: this.baseUrl }).acquire({
|
|
603793
|
-
model: this.model
|
|
603800
|
+
model: this.model,
|
|
603801
|
+
queuePolicy: request.poolQueuePolicy,
|
|
603802
|
+
queueTimeoutMs: request.poolQueueTimeoutMs
|
|
603794
603803
|
}) : null;
|
|
603795
603804
|
let requestBaseUrl = poolSlot?.baseUrl ?? this.baseUrl;
|
|
603796
603805
|
let poolSuccess = false;
|
|
@@ -604185,7 +604194,9 @@ ${description}`
|
|
|
604185
604194
|
body["num_ctx"] = reqNumCtx;
|
|
604186
604195
|
}
|
|
604187
604196
|
let poolSlot = shouldUseOllamaPoolForBaseUrl(this.baseUrl) ? await getOllamaPool({ baseInstanceUrl: this.baseUrl }).acquire({
|
|
604188
|
-
model: this.model
|
|
604197
|
+
model: this.model,
|
|
604198
|
+
queuePolicy: request.poolQueuePolicy,
|
|
604199
|
+
queueTimeoutMs: request.poolQueueTimeoutMs
|
|
604189
604200
|
}) : null;
|
|
604190
604201
|
let requestBaseUrl = poolSlot?.baseUrl ?? this.baseUrl;
|
|
604191
604202
|
let poolSuccess = false;
|
|
@@ -614251,10 +614262,10 @@ transcribe-cli error: ${transcribeCliError}` : "";
|
|
|
614251
614262
|
wordTimestamps: false
|
|
614252
614263
|
});
|
|
614253
614264
|
if (outputDir2) {
|
|
614254
|
-
const { basename:
|
|
614265
|
+
const { basename: basename45 } = await import("node:path");
|
|
614255
614266
|
const transcriptDir = join127(outputDir2, ".omnius", "transcripts");
|
|
614256
614267
|
mkdirSync69(transcriptDir, { recursive: true });
|
|
614257
|
-
const outFile = join127(transcriptDir, `${
|
|
614268
|
+
const outFile = join127(transcriptDir, `${basename45(filePath)}.txt`);
|
|
614258
614269
|
writeFileSync58(outFile, result.text, "utf-8");
|
|
614259
614270
|
}
|
|
614260
614271
|
return {
|
|
@@ -614270,10 +614281,10 @@ transcribe-cli error: ${transcribeCliError}` : "";
|
|
|
614270
614281
|
const fb = await transcribeFileViaWhisper(filePath, this.config.model);
|
|
614271
614282
|
if (fb) {
|
|
614272
614283
|
if (outputDir2) {
|
|
614273
|
-
const { basename:
|
|
614284
|
+
const { basename: basename45 } = await import("node:path");
|
|
614274
614285
|
const transcriptDir = join127(outputDir2, ".omnius", "transcripts");
|
|
614275
614286
|
mkdirSync69(transcriptDir, { recursive: true });
|
|
614276
|
-
const outFile = join127(transcriptDir, `${
|
|
614287
|
+
const outFile = join127(transcriptDir, `${basename45(filePath)}.txt`);
|
|
614277
614288
|
writeFileSync58(outFile, fb.text, "utf-8");
|
|
614278
614289
|
}
|
|
614279
614290
|
return fb;
|
|
@@ -639497,6 +639508,7 @@ __export(status_bar_exports, {
|
|
|
639497
639508
|
setTerminalTitle: () => setTerminalTitle,
|
|
639498
639509
|
unlockFooterRedraws: () => unlockFooterRedraws
|
|
639499
639510
|
});
|
|
639511
|
+
import { basename as basename29, dirname as dirname44 } from "node:path";
|
|
639500
639512
|
import { readFile as readFileAsync } from "node:fs/promises";
|
|
639501
639513
|
function headerButtonGlyphFg() {
|
|
639502
639514
|
const a2 = tuiAccent();
|
|
@@ -639846,7 +639858,7 @@ var init_status_bar = __esm({
|
|
|
639846
639858
|
_toolCalls = 0;
|
|
639847
639859
|
_turns = 0;
|
|
639848
639860
|
/** Debug data panel overlay state. */
|
|
639849
|
-
/** Bottom-row page: -1 = compact metrics, 0-
|
|
639861
|
+
/** Bottom-row page: -1 = compact metrics, 0-4 = token, model, SNR, cost, cwd. */
|
|
639850
639862
|
_debugPanelPage = -1;
|
|
639851
639863
|
active = false;
|
|
639852
639864
|
scrollRegionTop = 1;
|
|
@@ -639992,6 +640004,9 @@ var init_status_bar = __esm({
|
|
|
639992
640004
|
_enhanceState = "idle";
|
|
639993
640005
|
/** Gradient phase for the live stage indicator sweep (spec §3). */
|
|
639994
640006
|
_stagePhase = 0;
|
|
640007
|
+
static FOOTER_DEBUG_LAST_PAGE = 4;
|
|
640008
|
+
static FOOTER_ANIMATION_INTERVAL_MS = 100;
|
|
640009
|
+
_footerAnimationTimer = null;
|
|
639995
640010
|
/** The pre-expansion seed text, restored when the user rejects the expansion. */
|
|
639996
640011
|
_enhanceOriginal = null;
|
|
639997
640012
|
/** Transient press-flash target for visual click feedback. */
|
|
@@ -640934,6 +640949,25 @@ var init_status_bar = __esm({
|
|
|
640934
640949
|
}
|
|
640935
640950
|
if (this.active) this.refreshHeaderPanels();
|
|
640936
640951
|
}
|
|
640952
|
+
startFooterAnimationTimer() {
|
|
640953
|
+
if (this._footerAnimationTimer) return;
|
|
640954
|
+
this._footerAnimationTimer = setInterval(() => {
|
|
640955
|
+
if (!this.active || this._resizing || _globalFooterLock || isOverlayActive()) {
|
|
640956
|
+
return;
|
|
640957
|
+
}
|
|
640958
|
+
this.advanceStagePhase();
|
|
640959
|
+
this.renderFooterPreserveCursor();
|
|
640960
|
+
}, _StatusBar.FOOTER_ANIMATION_INTERVAL_MS);
|
|
640961
|
+
this._footerAnimationTimer.unref?.();
|
|
640962
|
+
}
|
|
640963
|
+
stopFooterAnimationTimer() {
|
|
640964
|
+
if (!this._footerAnimationTimer) return;
|
|
640965
|
+
clearInterval(this._footerAnimationTimer);
|
|
640966
|
+
this._footerAnimationTimer = null;
|
|
640967
|
+
}
|
|
640968
|
+
advanceStagePhase() {
|
|
640969
|
+
this._stagePhase = (this._stagePhase + 6) % 360;
|
|
640970
|
+
}
|
|
640937
640971
|
/**
|
|
640938
640972
|
* Ensure the monitoring timer is running when the registry has entries
|
|
640939
640973
|
* and the braille spinner is not active. Refreshes the buffer line
|
|
@@ -641509,6 +641543,7 @@ var init_status_bar = __esm({
|
|
|
641509
641543
|
this.applyScrollRegion(true);
|
|
641510
641544
|
this.fillContentArea();
|
|
641511
641545
|
this.renderFooterAndPositionInput();
|
|
641546
|
+
this.startFooterAnimationTimer();
|
|
641512
641547
|
this.refreshHeaderContent();
|
|
641513
641548
|
this.hookStdin();
|
|
641514
641549
|
setTermTitleWriter((data) => this.writeChrome(data));
|
|
@@ -641521,6 +641556,7 @@ var init_status_bar = __esm({
|
|
|
641521
641556
|
setTermTitleWriter(null);
|
|
641522
641557
|
this.active = false;
|
|
641523
641558
|
this._resizing = false;
|
|
641559
|
+
this.stopFooterAnimationTimer();
|
|
641524
641560
|
if (this._resizeTimer) {
|
|
641525
641561
|
clearTimeout(this._resizeTimer);
|
|
641526
641562
|
this._resizeTimer = null;
|
|
@@ -643372,6 +643408,27 @@ ${CONTENT_BG_SEQ}`);
|
|
|
643372
643408
|
if (n2 < 100) return n2.toFixed(1);
|
|
643373
643409
|
return Math.round(n2).toLocaleString();
|
|
643374
643410
|
}
|
|
643411
|
+
static compactPathForFooter(rawPath, maxWidth) {
|
|
643412
|
+
const limit = Math.max(8, Math.floor(maxWidth));
|
|
643413
|
+
const cleanPath = rawPath.replace(/[\x00-\x1F\x7F]/g, "?");
|
|
643414
|
+
const home = process.env["HOME"];
|
|
643415
|
+
const value2 = home && (cleanPath === home || cleanPath.startsWith(`${home}/`)) ? `~${cleanPath.slice(home.length)}` : cleanPath;
|
|
643416
|
+
if (value2.length <= limit) return value2;
|
|
643417
|
+
if (limit <= 6) return value2.slice(-limit);
|
|
643418
|
+
const marker = "...";
|
|
643419
|
+
const leaf = basename29(value2);
|
|
643420
|
+
const parentLeaf = basename29(dirname44(value2));
|
|
643421
|
+
const suffix = parentLeaf && parentLeaf !== "." && parentLeaf !== leaf ? `${parentLeaf}/${leaf}` : leaf;
|
|
643422
|
+
if (suffix.length + marker.length + 1 <= limit) {
|
|
643423
|
+
return `${marker}/${suffix}`;
|
|
643424
|
+
}
|
|
643425
|
+
const tailWidth = Math.max(1, limit - marker.length);
|
|
643426
|
+
return `${marker}${value2.slice(-tailWidth)}`;
|
|
643427
|
+
}
|
|
643428
|
+
buildDirectoryMetricsPage(maxPathWidth) {
|
|
643429
|
+
const cwd4 = _StatusBar.compactPathForFooter(process.cwd(), maxPathWidth);
|
|
643430
|
+
return `\x1B[38;5;117mcwd\x1B[0m \x1B[38;5;183m${cwd4}\x1B[0m`;
|
|
643431
|
+
}
|
|
643375
643432
|
/** Build the metrics line string with adaptive compaction */
|
|
643376
643433
|
/**
|
|
643377
643434
|
* Live stage indicator block (spec: tui-stage-indicator-spec.md).
|
|
@@ -643386,7 +643443,6 @@ ${CONTENT_BG_SEQ}`);
|
|
|
643386
643443
|
Math.max(12, Math.min(needed, maxWidth))
|
|
643387
643444
|
);
|
|
643388
643445
|
const truecolor = supportsTruecolor();
|
|
643389
|
-
this._stagePhase = (this._stagePhase + 6) % 360;
|
|
643390
643446
|
const block = renderStageBlock(
|
|
643391
643447
|
stage2,
|
|
643392
643448
|
detail,
|
|
@@ -643467,15 +643523,19 @@ ${CONTENT_BG_SEQ}`);
|
|
|
643467
643523
|
const recStr = this._recording ? " \x1B[38;5;210m● REC\x1B[0m" : "";
|
|
643468
643524
|
pages.push(costStr + recStr);
|
|
643469
643525
|
}
|
|
643470
|
-
|
|
643526
|
+
const pathWidth = Math.max(12, Math.min(96, Math.floor(termWidth * 0.45)));
|
|
643527
|
+
pages.push(this.buildDirectoryMetricsPage(pathWidth));
|
|
643528
|
+
while (pages.length <= _StatusBar.FOOTER_DEBUG_LAST_PAGE) {
|
|
643529
|
+
pages.push("--");
|
|
643530
|
+
}
|
|
643471
643531
|
const idx = Math.min(this._debugPanelPage, pages.length - 1);
|
|
643472
643532
|
rightSide = pages[idx] ?? "--";
|
|
643473
643533
|
pageLabel = "";
|
|
643474
643534
|
}
|
|
643475
643535
|
rightSide = rightSide ? rightSide + " " : "";
|
|
643476
|
-
const pageTotal =
|
|
643477
|
-
const pageIdx = this._debugPanelPage + 2;
|
|
643478
|
-
const indicator = `\x1B[38;5;240m[${pageIdx
|
|
643536
|
+
const pageTotal = _StatusBar.FOOTER_DEBUG_LAST_PAGE + 2;
|
|
643537
|
+
const pageIdx = Math.max(1, Math.min(pageTotal, this._debugPanelPage + 2));
|
|
643538
|
+
const indicator = `\x1B[38;5;240m[${pageIdx}/${pageTotal}]\x1B[0m `;
|
|
643479
643539
|
const fullRight = pageLabel + rightSide + indicator + arrow;
|
|
643480
643540
|
const rightW = stripAnsi(fullRight).length;
|
|
643481
643541
|
const stageBlock = this.buildStageBlock(
|
|
@@ -643500,9 +643560,9 @@ ${CONTENT_BG_SEQ}`);
|
|
|
643500
643560
|
if (m2 > 0) return `${m2}m ${s2}s`;
|
|
643501
643561
|
return `${s2}s`;
|
|
643502
643562
|
}
|
|
643503
|
-
/** Cycle to next bottom-row page (-1→0→1→2→3→-1) */
|
|
643563
|
+
/** Cycle to next bottom-row page (-1→0→1→2→3→4→-1) */
|
|
643504
643564
|
cycleDebugPanelPage() {
|
|
643505
|
-
this._debugPanelPage = this._debugPanelPage >=
|
|
643565
|
+
this._debugPanelPage = this._debugPanelPage >= _StatusBar.FOOTER_DEBUG_LAST_PAGE ? -1 : this._debugPanelPage + 1;
|
|
643506
643566
|
}
|
|
643507
643567
|
// -------------------------------------------------------------------------
|
|
643508
643568
|
// Private
|
|
@@ -645387,7 +645447,7 @@ __export(personaplex_exports, {
|
|
|
645387
645447
|
stopPersonaPlex: () => stopPersonaPlex
|
|
645388
645448
|
});
|
|
645389
645449
|
import { existsSync as existsSync128, writeFileSync as writeFileSync67, readFileSync as readFileSync107, mkdirSync as mkdirSync79, copyFileSync as copyFileSync5, readdirSync as readdirSync43, statSync as statSync51 } from "node:fs";
|
|
645390
|
-
import { join as join142, dirname as
|
|
645450
|
+
import { join as join142, dirname as dirname45 } from "node:path";
|
|
645391
645451
|
import { homedir as homedir46 } from "node:os";
|
|
645392
645452
|
import { spawn as spawn33 } from "node:child_process";
|
|
645393
645453
|
import { fileURLToPath as fileURLToPath19 } from "node:url";
|
|
@@ -646197,7 +646257,7 @@ function getShippedVoicesDir() {
|
|
|
646197
646257
|
// repo root
|
|
646198
646258
|
];
|
|
646199
646259
|
try {
|
|
646200
|
-
const modDir =
|
|
646260
|
+
const modDir = dirname45(fileURLToPath19(import.meta.url));
|
|
646201
646261
|
candidates.push(join142(modDir, "..", "..", "..", "voices", "personaplex"));
|
|
646202
646262
|
candidates.push(join142(modDir, "..", "..", "..", "..", "voices", "personaplex"));
|
|
646203
646263
|
} catch {
|
|
@@ -650021,7 +650081,7 @@ var init_platforms = __esm({
|
|
|
650021
650081
|
|
|
650022
650082
|
// packages/cli/src/tui/workspace-explorer.ts
|
|
650023
650083
|
import { existsSync as existsSync131, readdirSync as readdirSync44, readFileSync as readFileSync109, statSync as statSync52 } from "node:fs";
|
|
650024
|
-
import { basename as
|
|
650084
|
+
import { basename as basename30, extname as extname17, join as join144, relative as relative16, resolve as resolve62 } from "node:path";
|
|
650025
650085
|
function exploreWorkspace(root, options2 = {}) {
|
|
650026
650086
|
const query = (options2.query ?? "").trim().toLowerCase();
|
|
650027
650087
|
const maxResults = options2.maxResults ?? 80;
|
|
@@ -650138,7 +650198,7 @@ function classifyWorkspaceFile(path15) {
|
|
|
650138
650198
|
if (lower.includes(".test.") || lower.includes(".spec.") || lower.includes("/tests/")) return "test";
|
|
650139
650199
|
if (SOURCE_EXT.has(ext)) return "source";
|
|
650140
650200
|
if (DOC_EXT2.has(ext)) return "doc";
|
|
650141
|
-
if (CONFIG_EXT.has(ext) ||
|
|
650201
|
+
if (CONFIG_EXT.has(ext) || basename30(lower).startsWith("dockerfile")) return "config";
|
|
650142
650202
|
if (ASSET_EXT.has(ext)) return "asset";
|
|
650143
650203
|
return "other";
|
|
650144
650204
|
}
|
|
@@ -650150,7 +650210,7 @@ function scoreWorkspaceFile(entry, query) {
|
|
|
650150
650210
|
if (entry.path.startsWith("packages/cli/src/")) score += 5;
|
|
650151
650211
|
if (query) {
|
|
650152
650212
|
const lower = entry.path.toLowerCase();
|
|
650153
|
-
const name10 =
|
|
650213
|
+
const name10 = basename30(lower);
|
|
650154
650214
|
if (name10.startsWith(query)) score += 20;
|
|
650155
650215
|
if (lower.includes(`/${query}`)) score += 12;
|
|
650156
650216
|
if (lower.includes(query)) score += 8;
|
|
@@ -653805,7 +653865,7 @@ import { existsSync as existsSync136, readFileSync as readFileSync112, writeFile
|
|
|
653805
653865
|
import { join as join148 } from "node:path";
|
|
653806
653866
|
import { homedir as homedir49 } from "node:os";
|
|
653807
653867
|
import { fileURLToPath as fileURLToPath20 } from "node:url";
|
|
653808
|
-
import { dirname as
|
|
653868
|
+
import { dirname as dirname46 } from "node:path";
|
|
653809
653869
|
function getDaemonPort() {
|
|
653810
653870
|
const env2 = process.env["OMNIUS_HOST"];
|
|
653811
653871
|
if (env2) {
|
|
@@ -653828,7 +653888,7 @@ async function isDaemonRunning(port) {
|
|
|
653828
653888
|
}
|
|
653829
653889
|
function getLocalCliVersion() {
|
|
653830
653890
|
try {
|
|
653831
|
-
const here =
|
|
653891
|
+
const here = dirname46(fileURLToPath20(import.meta.url));
|
|
653832
653892
|
for (const rel of ["../package.json", "../../package.json", "./package.json", "../../../package.json"]) {
|
|
653833
653893
|
const p2 = join148(here, rel);
|
|
653834
653894
|
if (existsSync136(p2)) {
|
|
@@ -653912,7 +653972,7 @@ async function resolveDaemonCommand(nodeExe) {
|
|
|
653912
653972
|
if (first2) candidates.push(first2);
|
|
653913
653973
|
} catch {
|
|
653914
653974
|
}
|
|
653915
|
-
const thisDir =
|
|
653975
|
+
const thisDir = dirname46(fileURLToPath20(import.meta.url));
|
|
653916
653976
|
candidates.push(join148(thisDir, "index.js"));
|
|
653917
653977
|
const seen = /* @__PURE__ */ new Set();
|
|
653918
653978
|
for (const candidate of candidates) {
|
|
@@ -656875,7 +656935,7 @@ import {
|
|
|
656875
656935
|
copyFileSync as copyFileSync6,
|
|
656876
656936
|
rmSync as rmSync11
|
|
656877
656937
|
} from "node:fs";
|
|
656878
|
-
import { join as join154, dirname as
|
|
656938
|
+
import { join as join154, dirname as dirname47, resolve as resolve64 } from "node:path";
|
|
656879
656939
|
import { homedir as homedir52, tmpdir as tmpdir23, platform as platform7 } from "node:os";
|
|
656880
656940
|
import {
|
|
656881
656941
|
spawn as nodeSpawn
|
|
@@ -657035,7 +657095,7 @@ function consolidateVoiceDirs2() {
|
|
|
657035
657095
|
const c10 = join154(dir, ".omnius", "voice");
|
|
657036
657096
|
if (existsSync142(c10) && c10 !== globalVoice) candidates.add(c10);
|
|
657037
657097
|
prev = dir;
|
|
657038
|
-
dir =
|
|
657098
|
+
dir = dirname47(dir);
|
|
657039
657099
|
}
|
|
657040
657100
|
for (const root of COMMON_PROJECT_ROOTS) {
|
|
657041
657101
|
const rootDir = join154(homedir52(), root);
|
|
@@ -657230,7 +657290,7 @@ function insertTagAfterOpeningClause(text2, tag) {
|
|
|
657230
657290
|
function writeDetectTorchScript(targetPath) {
|
|
657231
657291
|
if (existsSync142(targetPath)) return;
|
|
657232
657292
|
try {
|
|
657233
|
-
mkdirSync85(
|
|
657293
|
+
mkdirSync85(dirname47(targetPath), { recursive: true });
|
|
657234
657294
|
} catch {
|
|
657235
657295
|
}
|
|
657236
657296
|
const script = `#!/usr/bin/env python3
|
|
@@ -661472,7 +661532,7 @@ import {
|
|
|
661472
661532
|
appendFileSync as appendFileSync16,
|
|
661473
661533
|
writeSync as writeSync2
|
|
661474
661534
|
} from "node:fs";
|
|
661475
|
-
import { basename as
|
|
661535
|
+
import { basename as basename31, dirname as dirname48, relative as relative17, join as join155 } from "node:path";
|
|
661476
661536
|
function omniusPinnedDependencyVersion(name10) {
|
|
661477
661537
|
const spec = OMNIUS_PINNED_DEPENDENCY_SPECS[name10];
|
|
661478
661538
|
if (!spec) return null;
|
|
@@ -661904,12 +661964,12 @@ async function ensureVoiceDeps(ctx3) {
|
|
|
661904
661964
|
}
|
|
661905
661965
|
}
|
|
661906
661966
|
if (typeof mod3.getVenvPython === "function") {
|
|
661907
|
-
const { dirname:
|
|
661967
|
+
const { dirname: dirname57 } = await import("node:path");
|
|
661908
661968
|
const { existsSync: existsSync174 } = await import("node:fs");
|
|
661909
661969
|
const venvPy = mod3.getVenvPython();
|
|
661910
661970
|
if (existsSync174(venvPy)) {
|
|
661911
661971
|
process.env.TRANSCRIBE_PYTHON = venvPy;
|
|
661912
|
-
const venvBin =
|
|
661972
|
+
const venvBin = dirname57(venvPy);
|
|
661913
661973
|
const sep6 = process.platform === "win32" ? ";" : ":";
|
|
661914
661974
|
const cur = process.env.PATH || "";
|
|
661915
661975
|
if (!cur.split(sep6).includes(venvBin)) {
|
|
@@ -673253,14 +673313,14 @@ async function handleVoiceMenu(ctx3, save3, hasLocal) {
|
|
|
673253
673313
|
if (!jsonDrop.confirmed || !jsonDrop.path) {
|
|
673254
673314
|
continue;
|
|
673255
673315
|
}
|
|
673256
|
-
const { basename:
|
|
673316
|
+
const { basename: basename45, join: pathJoin } = await import("node:path");
|
|
673257
673317
|
const {
|
|
673258
673318
|
copyFileSync: copyFileSync8,
|
|
673259
673319
|
mkdirSync: mkdirSync114,
|
|
673260
673320
|
existsSync: exists2
|
|
673261
673321
|
} = await import("node:fs");
|
|
673262
673322
|
const { homedir: homedir66 } = await import("node:os");
|
|
673263
|
-
const modelName =
|
|
673323
|
+
const modelName = basename45(onnxDrop.path, ".onnx").replace(
|
|
673264
673324
|
/[^a-zA-Z0-9_-]/g,
|
|
673265
673325
|
"-"
|
|
673266
673326
|
);
|
|
@@ -673780,7 +673840,7 @@ async function handleVoiceList(ctx3, focusFilename) {
|
|
|
673780
673840
|
copyFileSync: cpf,
|
|
673781
673841
|
mkdirSync: mkd
|
|
673782
673842
|
} = __require("node:fs");
|
|
673783
|
-
const { basename:
|
|
673843
|
+
const { basename: basename45, join: pjoin } = __require("node:path");
|
|
673784
673844
|
if (!fe(src2)) {
|
|
673785
673845
|
renderError(`File not found: ${src2}`);
|
|
673786
673846
|
helpers.render();
|
|
@@ -673793,7 +673853,7 @@ async function handleVoiceList(ctx3, focusFilename) {
|
|
|
673793
673853
|
"clone-refs"
|
|
673794
673854
|
);
|
|
673795
673855
|
mkd(refsDir, { recursive: true });
|
|
673796
|
-
const destName =
|
|
673856
|
+
const destName = basename45(src2);
|
|
673797
673857
|
const dest = pjoin(refsDir, destName);
|
|
673798
673858
|
cpf(src2, dest);
|
|
673799
673859
|
renderInfo(`Imported "${destName}" → ${dest}`);
|
|
@@ -674766,9 +674826,9 @@ async function collectSponsorMediaStream(args) {
|
|
|
674766
674826
|
if (sha !== artifact.sha256)
|
|
674767
674827
|
return { ok: false, error: `Artifact hash mismatch for ${artifactId}` };
|
|
674768
674828
|
}
|
|
674769
|
-
const safeName3 =
|
|
674829
|
+
const safeName3 = basename31(artifact.filename).replace(/[^\w.-]/g, "_") || `artifact${defaultExtensionForMime(artifact.mime)}`;
|
|
674770
674830
|
const outputPath3 = join155(args.outputRoot, safeName3);
|
|
674771
|
-
mkdirSync86(
|
|
674831
|
+
mkdirSync86(dirname48(outputPath3), { recursive: true });
|
|
674772
674832
|
writeFileSync74(outputPath3, bytes);
|
|
674773
674833
|
return { ok: true, path: outputPath3, metadata };
|
|
674774
674834
|
}
|
|
@@ -675261,14 +675321,14 @@ async function handlePeerEndpoint(peerId, authKey, ctx3, local, advertisedModels
|
|
|
675261
675321
|
if (models.length > 0) {
|
|
675262
675322
|
try {
|
|
675263
675323
|
const { writeFileSync: writeFileSync97, mkdirSync: mkdirSync114 } = await import("node:fs");
|
|
675264
|
-
const { join: join190, dirname:
|
|
675324
|
+
const { join: join190, dirname: dirname57 } = await import("node:path");
|
|
675265
675325
|
const cachePath2 = join190(
|
|
675266
675326
|
ctx3.repoRoot || process.cwd(),
|
|
675267
675327
|
".omnius",
|
|
675268
675328
|
"nexus",
|
|
675269
675329
|
"peer-models-cache.json"
|
|
675270
675330
|
);
|
|
675271
|
-
mkdirSync114(
|
|
675331
|
+
mkdirSync114(dirname57(cachePath2), { recursive: true });
|
|
675272
675332
|
writeFileSync97(
|
|
675273
675333
|
cachePath2,
|
|
675274
675334
|
JSON.stringify(
|
|
@@ -675344,14 +675404,14 @@ async function handlePeerEndpoint(peerId, authKey, ctx3, local, advertisedModels
|
|
|
675344
675404
|
);
|
|
675345
675405
|
try {
|
|
675346
675406
|
const { writeFileSync: writeFileSync97, mkdirSync: mkdirSync114 } = await import("node:fs");
|
|
675347
|
-
const { join: join190, dirname:
|
|
675407
|
+
const { join: join190, dirname: dirname57 } = await import("node:path");
|
|
675348
675408
|
const cachePath2 = join190(
|
|
675349
675409
|
ctx3.repoRoot || process.cwd(),
|
|
675350
675410
|
".omnius",
|
|
675351
675411
|
"nexus",
|
|
675352
675412
|
"peer-models-cache.json"
|
|
675353
675413
|
);
|
|
675354
|
-
mkdirSync114(
|
|
675414
|
+
mkdirSync114(dirname57(cachePath2), { recursive: true });
|
|
675355
675415
|
writeFileSync97(
|
|
675356
675416
|
cachePath2,
|
|
675357
675417
|
JSON.stringify(
|
|
@@ -676367,10 +676427,10 @@ async function handleUpdate(subcommand, ctx3) {
|
|
|
676367
676427
|
try {
|
|
676368
676428
|
const { createRequire: createRequire11 } = await import("node:module");
|
|
676369
676429
|
const { fileURLToPath: fileURLToPath26 } = await import("node:url");
|
|
676370
|
-
const { dirname:
|
|
676430
|
+
const { dirname: dirname57, join: join190 } = await import("node:path");
|
|
676371
676431
|
const { existsSync: existsSync174 } = await import("node:fs");
|
|
676372
676432
|
const req3 = createRequire11(import.meta.url);
|
|
676373
|
-
const thisDir =
|
|
676433
|
+
const thisDir = dirname57(fileURLToPath26(import.meta.url));
|
|
676374
676434
|
const candidates = [
|
|
676375
676435
|
join190(thisDir, "..", "package.json"),
|
|
676376
676436
|
join190(thisDir, "..", "..", "package.json"),
|
|
@@ -678270,7 +678330,7 @@ var init_commands = __esm({
|
|
|
678270
678330
|
|
|
678271
678331
|
// packages/cli/src/realtime.ts
|
|
678272
678332
|
import { existsSync as existsSync144, readFileSync as readFileSync118, readdirSync as readdirSync49 } from "node:fs";
|
|
678273
|
-
import { basename as
|
|
678333
|
+
import { basename as basename32, join as join156, resolve as resolve65 } from "node:path";
|
|
678274
678334
|
function clampInt2(value2, fallback, min, max) {
|
|
678275
678335
|
const n2 = typeof value2 === "number" ? value2 : Number.parseInt(String(value2 ?? ""), 10);
|
|
678276
678336
|
if (!Number.isFinite(n2)) return fallback;
|
|
@@ -678353,14 +678413,14 @@ function buildRealtimeSystemPrompt(opts) {
|
|
|
678353
678413
|
"- Do not mention ASR, TTS, prompts, realtime mode, hidden reasoning, tools, or policy unless the caller explicitly asks.",
|
|
678354
678414
|
"- If a request needs work outside this text-only exchange, say the next handoff in one short sentence."
|
|
678355
678415
|
].join("\n"),
|
|
678356
|
-
soul ? `Project SOUL.md (${
|
|
678416
|
+
soul ? `Project SOUL.md (${basename32(soul.path)}), compacted for realtime:
|
|
678357
678417
|
${blockText2(soul.content, soulLimit)}` : [
|
|
678358
678418
|
"No project SOUL.md found. Default soul:",
|
|
678359
678419
|
"- pragmatic, direct, concrete",
|
|
678360
678420
|
"- low-fluff, human-paced, evidence-aware",
|
|
678361
678421
|
"- truthful about uncertainty without overexplaining"
|
|
678362
678422
|
].join("\n"),
|
|
678363
|
-
voice ? `Project voice profile (${
|
|
678423
|
+
voice ? `Project voice profile (${basename32(voice.path)}), compacted for realtime:
|
|
678364
678424
|
${blockText2(voice.content, voiceLimit)}` : [
|
|
678365
678425
|
"Default realtime voice:",
|
|
678366
678426
|
"- conversational, brief, and proportional",
|
|
@@ -679099,7 +679159,7 @@ __export(visual_identity_association_exports, {
|
|
|
679099
679159
|
formatVisualIdentityAssociationContext: () => formatVisualIdentityAssociationContext,
|
|
679100
679160
|
stageVisualIdentityAssertion: () => stageVisualIdentityAssertion
|
|
679101
679161
|
});
|
|
679102
|
-
import { basename as
|
|
679162
|
+
import { basename as basename33 } from "node:path";
|
|
679103
679163
|
function normalizePersonName(name10) {
|
|
679104
679164
|
return name10.trim().toLowerCase().replace(/\s+/g, " ");
|
|
679105
679165
|
}
|
|
@@ -679451,7 +679511,7 @@ async function associateVisualIdentityFromImage(options2) {
|
|
|
679451
679511
|
relation: "same_person_candidate",
|
|
679452
679512
|
confidence: match.confidence,
|
|
679453
679513
|
assertedBy: { id: "visual_memory", displayName: "visual_memory", isBot: true },
|
|
679454
|
-
note: `Prior enrolled visual-memory face match for ${
|
|
679514
|
+
note: `Prior enrolled visual-memory face match for ${basename33(options2.imagePath)}`
|
|
679455
679515
|
}],
|
|
679456
679516
|
deferredReason: "interactive_project_memory_blocked"
|
|
679457
679517
|
}
|
|
@@ -679518,7 +679578,7 @@ async function associateVisualIdentityFromImage(options2) {
|
|
|
679518
679578
|
relation: "same_person_candidate",
|
|
679519
679579
|
confidence: match.confidence,
|
|
679520
679580
|
assertedBy: { id: "visual_memory", displayName: "visual_memory", isBot: true },
|
|
679521
|
-
note: `Prior enrolled visual-memory face match for ${
|
|
679581
|
+
note: `Prior enrolled visual-memory face match for ${basename33(options2.imagePath)}`
|
|
679522
679582
|
}]
|
|
679523
679583
|
});
|
|
679524
679584
|
if (result2.episodeId) committedEpisodeIds.push(result2.episodeId);
|
|
@@ -679563,7 +679623,7 @@ async function associateVisualIdentityFromImage(options2) {
|
|
|
679563
679623
|
relation: "depicts",
|
|
679564
679624
|
confidence: item.confidence,
|
|
679565
679625
|
assertedBy: item.sender || options2.sender,
|
|
679566
|
-
note: item.note || `Applied explicit pending identity assertion to ${
|
|
679626
|
+
note: item.note || `Applied explicit pending identity assertion to ${basename33(options2.imagePath)}`
|
|
679567
679627
|
}]
|
|
679568
679628
|
});
|
|
679569
679629
|
if (result2.episodeId) committedEpisodeIds.push(result2.episodeId);
|
|
@@ -679621,7 +679681,7 @@ var init_visual_identity_association = __esm({
|
|
|
679621
679681
|
|
|
679622
679682
|
// packages/cli/src/tui/identity-memory-tool.ts
|
|
679623
679683
|
import { existsSync as existsSync146 } from "node:fs";
|
|
679624
|
-
import { basename as
|
|
679684
|
+
import { basename as basename34, extname as extname19, resolve as resolve67 } from "node:path";
|
|
679625
679685
|
function personKey2(name10) {
|
|
679626
679686
|
return `person:${name10.trim().toLowerCase().replace(/\s+/g, " ")}`;
|
|
679627
679687
|
}
|
|
@@ -679690,7 +679750,7 @@ async function resolveMediaFromArgs(args, opts) {
|
|
|
679690
679750
|
path: path15,
|
|
679691
679751
|
media,
|
|
679692
679752
|
modality: inferModality(media),
|
|
679693
|
-
label:
|
|
679753
|
+
label: basename34(path15)
|
|
679694
679754
|
};
|
|
679695
679755
|
}
|
|
679696
679756
|
function edgeDirection(edge, nodeId, otherText) {
|
|
@@ -679864,7 +679924,7 @@ var init_identity_memory_tool = __esm({
|
|
|
679864
679924
|
} else if (shouldEnrollFace) {
|
|
679865
679925
|
faceLine = "face enrollment: skipped because no resolved image path was available";
|
|
679866
679926
|
}
|
|
679867
|
-
const mediaLine = resolvedMedia ? `media: ${resolvedMedia.label ||
|
|
679927
|
+
const mediaLine = resolvedMedia ? `media: ${resolvedMedia.label || basename34(resolvedMedia.path)} (${resolvedMedia.path})` : "media: none; stored as scoped textual identity evidence only";
|
|
679868
679928
|
const output = [
|
|
679869
679929
|
`Stored identity evidence for ${name10}.`,
|
|
679870
679930
|
`relation: ${relation}`,
|
|
@@ -679936,7 +679996,7 @@ var init_identity_memory_tool = __esm({
|
|
|
679936
679996
|
} else if (shouldEnrollFace) {
|
|
679937
679997
|
faceLine = "face enrollment: skipped because no resolved image path was available";
|
|
679938
679998
|
}
|
|
679939
|
-
const mediaLine = resolvedMedia ? `media: ${resolvedMedia.label ||
|
|
679999
|
+
const mediaLine = resolvedMedia ? `media: ${resolvedMedia.label || basename34(resolvedMedia.path)} (${resolvedMedia.path})` : "media: none; stored as scoped textual identity evidence only";
|
|
679940
680000
|
return {
|
|
679941
680001
|
success: true,
|
|
679942
680002
|
output: [
|
|
@@ -680927,7 +680987,7 @@ var init_banner = __esm({
|
|
|
680927
680987
|
|
|
680928
680988
|
// packages/cli/src/tui/carousel-descriptors.ts
|
|
680929
680989
|
import { existsSync as existsSync148, readFileSync as readFileSync121, writeFileSync as writeFileSync77, mkdirSync as mkdirSync89, readdirSync as readdirSync51 } from "node:fs";
|
|
680930
|
-
import { join as join159, basename as
|
|
680990
|
+
import { join as join159, basename as basename35 } from "node:path";
|
|
680931
680991
|
function loadToolProfile(repoRoot) {
|
|
680932
680992
|
const filePath = join159(repoRoot, OMNIUS_DIR, "context", TOOL_PROFILE_FILE);
|
|
680933
680993
|
try {
|
|
@@ -681023,7 +681083,7 @@ function generateDescriptors(repoRoot) {
|
|
|
681023
681083
|
extractFromSessions(repoRoot, tags);
|
|
681024
681084
|
extractFromMemory(repoRoot, tags);
|
|
681025
681085
|
extractFromToolProfile(profile, tags);
|
|
681026
|
-
const repoName2 =
|
|
681086
|
+
const repoName2 = basename35(repoRoot);
|
|
681027
681087
|
if (repoName2 && !tags.includes(repoName2)) {
|
|
681028
681088
|
tags.push(repoName2);
|
|
681029
681089
|
}
|
|
@@ -682201,7 +682261,7 @@ var init_edit_history = __esm({
|
|
|
682201
682261
|
|
|
682202
682262
|
// packages/cli/src/tui/snr-engine.ts
|
|
682203
682263
|
import { existsSync as existsSync149, readdirSync as readdirSync52, readFileSync as readFileSync122, writeFileSync as writeFileSync78, mkdirSync as mkdirSync91, rmSync as rmSync13 } from "node:fs";
|
|
682204
|
-
import { join as join161, basename as
|
|
682264
|
+
import { join as join161, basename as basename36 } from "node:path";
|
|
682205
682265
|
function computeDPrime2(signalScores, noiseScores) {
|
|
682206
682266
|
if (signalScores.length === 0 || noiseScores.length === 0) return 0;
|
|
682207
682267
|
const mean = (arr) => arr.reduce((s2, v) => s2 + v, 0) / arr.length;
|
|
@@ -682504,7 +682564,7 @@ Call task_complete with the JSON array when done.`,
|
|
|
682504
682564
|
try {
|
|
682505
682565
|
const files = readdirSync52(dir).filter((f2) => f2.endsWith(".json"));
|
|
682506
682566
|
for (const f2 of files) {
|
|
682507
|
-
const topic =
|
|
682567
|
+
const topic = basename36(f2, ".json");
|
|
682508
682568
|
if (topics.length > 0 && !topics.includes(topic)) continue;
|
|
682509
682569
|
try {
|
|
682510
682570
|
const data = JSON.parse(readFileSync122(join161(dir, f2), "utf-8"));
|
|
@@ -682664,7 +682724,7 @@ Call task_complete with the JSON array when done.`,
|
|
|
682664
682724
|
|
|
682665
682725
|
// packages/cli/src/tui/promptLoader.ts
|
|
682666
682726
|
import { readFileSync as readFileSync123, existsSync as existsSync150 } from "node:fs";
|
|
682667
|
-
import { join as join162, dirname as
|
|
682727
|
+
import { join as join162, dirname as dirname50 } from "node:path";
|
|
682668
682728
|
import { fileURLToPath as fileURLToPath21 } from "node:url";
|
|
682669
682729
|
function loadPrompt3(promptPath, vars) {
|
|
682670
682730
|
let content = cache7.get(promptPath);
|
|
@@ -682684,7 +682744,7 @@ var init_promptLoader3 = __esm({
|
|
|
682684
682744
|
"packages/cli/src/tui/promptLoader.ts"() {
|
|
682685
682745
|
"use strict";
|
|
682686
682746
|
__filename5 = fileURLToPath21(import.meta.url);
|
|
682687
|
-
__dirname6 =
|
|
682747
|
+
__dirname6 = dirname50(__filename5);
|
|
682688
682748
|
devPath2 = join162(__dirname6, "..", "..", "prompts");
|
|
682689
682749
|
publishedPath2 = join162(__dirname6, "..", "prompts");
|
|
682690
682750
|
PROMPTS_DIR3 = existsSync150(devPath2) ? devPath2 : publishedPath2;
|
|
@@ -682700,7 +682760,7 @@ import {
|
|
|
682700
682760
|
existsSync as existsSync151,
|
|
682701
682761
|
readdirSync as readdirSync53
|
|
682702
682762
|
} from "node:fs";
|
|
682703
|
-
import { join as join163, basename as
|
|
682763
|
+
import { join as join163, basename as basename37 } from "node:path";
|
|
682704
682764
|
function setDreamWriteContent(fn) {
|
|
682705
682765
|
_dreamWriteContent = fn;
|
|
682706
682766
|
}
|
|
@@ -682960,7 +683020,7 @@ var init_dream_engine = __esm({
|
|
|
682960
683020
|
error: "path is required",
|
|
682961
683021
|
durationMs: Date.now() - start2
|
|
682962
683022
|
};
|
|
682963
|
-
const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".omnius/autoresearch") ? join163(this.autoresearchDir,
|
|
683023
|
+
const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".omnius/autoresearch") ? join163(this.autoresearchDir, basename37(rawPath)) : join163(this.autoresearchDir, rawPath);
|
|
682964
683024
|
if (!targetPath.startsWith(this.autoresearchDir)) {
|
|
682965
683025
|
return {
|
|
682966
683026
|
success: false,
|
|
@@ -683012,7 +683072,7 @@ var init_dream_engine = __esm({
|
|
|
683012
683072
|
const rawPath = String(args["path"] ?? "");
|
|
683013
683073
|
const oldStr = String(args["old_string"] ?? "");
|
|
683014
683074
|
const newStr = String(args["new_string"] ?? "");
|
|
683015
|
-
const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".omnius/autoresearch") ? join163(this.autoresearchDir,
|
|
683075
|
+
const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".omnius/autoresearch") ? join163(this.autoresearchDir, basename37(rawPath)) : join163(this.autoresearchDir, rawPath);
|
|
683016
683076
|
if (!targetPath.startsWith(this.autoresearchDir)) {
|
|
683017
683077
|
return {
|
|
683018
683078
|
success: false,
|
|
@@ -683114,7 +683174,7 @@ var init_dream_engine = __esm({
|
|
|
683114
683174
|
error: "path is required",
|
|
683115
683175
|
durationMs: Date.now() - start2
|
|
683116
683176
|
};
|
|
683117
|
-
const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".omnius/dreams") ? join163(this.dreamsDir,
|
|
683177
|
+
const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".omnius/dreams") ? join163(this.dreamsDir, basename37(rawPath)) : join163(this.dreamsDir, rawPath);
|
|
683118
683178
|
if (!targetPath.startsWith(this.dreamsDir)) {
|
|
683119
683179
|
return {
|
|
683120
683180
|
success: false,
|
|
@@ -683166,7 +683226,7 @@ var init_dream_engine = __esm({
|
|
|
683166
683226
|
const rawPath = String(args["path"] ?? "");
|
|
683167
683227
|
const oldStr = String(args["old_string"] ?? "");
|
|
683168
683228
|
const newStr = String(args["new_string"] ?? "");
|
|
683169
|
-
const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".omnius/dreams") ? join163(this.dreamsDir,
|
|
683229
|
+
const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".omnius/dreams") ? join163(this.dreamsDir, basename37(rawPath)) : join163(this.dreamsDir, rawPath);
|
|
683170
683230
|
if (!targetPath.startsWith(this.dreamsDir)) {
|
|
683171
683231
|
return {
|
|
683172
683232
|
success: false,
|
|
@@ -685015,7 +685075,7 @@ import {
|
|
|
685015
685075
|
readdirSync as readdirSync54,
|
|
685016
685076
|
unlinkSync as unlinkSync31
|
|
685017
685077
|
} from "node:fs";
|
|
685018
|
-
import { join as join164, basename as
|
|
685078
|
+
import { join as join164, basename as basename38 } from "node:path";
|
|
685019
685079
|
import { exec as exec6 } from "node:child_process";
|
|
685020
685080
|
import { promisify as promisify8 } from "node:util";
|
|
685021
685081
|
function buildDMNGatherPrompt(recentTaskSummaries, dueReminders, attentionItems, memoryTopics, capabilities, competence, reflectionBuffer, projectOpportunities = []) {
|
|
@@ -685996,7 +686056,7 @@ If decision is GO, selectedTask MUST be a fully-populated object (NEVER null)
|
|
|
685996
686056
|
try {
|
|
685997
686057
|
const files = readdirSync54(dir).filter((f2) => f2.endsWith(".json"));
|
|
685998
686058
|
for (const f2 of files) {
|
|
685999
|
-
const topic =
|
|
686059
|
+
const topic = basename38(f2, ".json");
|
|
686000
686060
|
if (!topics.includes(topic)) topics.push(topic);
|
|
686001
686061
|
}
|
|
686002
686062
|
} catch {
|
|
@@ -686332,13 +686392,70 @@ var init_emotion_engine = __esm({
|
|
|
686332
686392
|
this.state.arousal = BASELINE_AROUSAL + (this.state.arousal - BASELINE_AROUSAL) * decayFactor;
|
|
686333
686393
|
this.state.updatedAt = Date.now();
|
|
686334
686394
|
}
|
|
686395
|
+
emotionModelInferencePolicy() {
|
|
686396
|
+
const raw = process.env["OMNIUS_EMOTION_MODEL_INFERENCE"] ?? process.env["OMNIUS_EMOTION_LLM"] ?? this.config.modelInference ?? "auto";
|
|
686397
|
+
const value2 = String(raw).trim().toLowerCase();
|
|
686398
|
+
if (["0", "false", "off", "no", "disabled"].includes(value2)) {
|
|
686399
|
+
return "off";
|
|
686400
|
+
}
|
|
686401
|
+
if (["1", "true", "on", "yes", "enabled"].includes(value2)) {
|
|
686402
|
+
return "on";
|
|
686403
|
+
}
|
|
686404
|
+
return "auto";
|
|
686405
|
+
}
|
|
686406
|
+
async admitInternalInference() {
|
|
686407
|
+
const policy = this.emotionModelInferencePolicy();
|
|
686408
|
+
if (policy === "off") {
|
|
686409
|
+
return { allowed: false, reason: "emotion_model_inference_disabled" };
|
|
686410
|
+
}
|
|
686411
|
+
if (policy === "on") return { allowed: true };
|
|
686412
|
+
if (!shouldUseOllamaPoolForBaseUrl(this.config.backendUrl)) {
|
|
686413
|
+
return { allowed: true };
|
|
686414
|
+
}
|
|
686415
|
+
try {
|
|
686416
|
+
const status = await getOllamaPool({
|
|
686417
|
+
baseInstanceUrl: this.config.backendUrl
|
|
686418
|
+
}).status();
|
|
686419
|
+
const gpuCount = status.hardware.gpus.length;
|
|
686420
|
+
if (status.placement.mode === "constrained") {
|
|
686421
|
+
return {
|
|
686422
|
+
allowed: false,
|
|
686423
|
+
reason: `local_ollama_constrained_placement:${gpuCount}gpu`
|
|
686424
|
+
};
|
|
686425
|
+
}
|
|
686426
|
+
const hasImmediateSlot = status.instances.some((inst) => {
|
|
686427
|
+
const maxParallel = Math.max(1, inst.maxParallel);
|
|
686428
|
+
return inst.inflight < maxParallel;
|
|
686429
|
+
});
|
|
686430
|
+
if (!hasImmediateSlot) {
|
|
686431
|
+
return {
|
|
686432
|
+
allowed: false,
|
|
686433
|
+
reason: "local_ollama_no_immediate_background_slot"
|
|
686434
|
+
};
|
|
686435
|
+
}
|
|
686436
|
+
} catch (err) {
|
|
686437
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
686438
|
+
return {
|
|
686439
|
+
allowed: false,
|
|
686440
|
+
reason: `local_ollama_pool_status_unavailable:${detail.slice(0, 160)}`
|
|
686441
|
+
};
|
|
686442
|
+
}
|
|
686443
|
+
return { allowed: true };
|
|
686444
|
+
}
|
|
686335
686445
|
async runDirectInternalInference(opts) {
|
|
686336
|
-
const
|
|
686337
|
-
|
|
686338
|
-
|
|
686339
|
-
|
|
686340
|
-
|
|
686341
|
-
|
|
686446
|
+
const cwd4 = resolve68(process.cwd());
|
|
686447
|
+
const startedAt2 = Date.now();
|
|
686448
|
+
const admission = await this.admitInternalInference();
|
|
686449
|
+
if (!admission.allowed) {
|
|
686450
|
+
this.recordInternalDecision({
|
|
686451
|
+
stage: opts.stage,
|
|
686452
|
+
status: "skipped",
|
|
686453
|
+
elapsedMs: Date.now() - startedAt2,
|
|
686454
|
+
skipReason: admission.reason,
|
|
686455
|
+
promptChars: opts.system.length + opts.user.length
|
|
686456
|
+
});
|
|
686457
|
+
return null;
|
|
686458
|
+
}
|
|
686342
686459
|
const request = {
|
|
686343
686460
|
messages: [
|
|
686344
686461
|
{ role: "system", content: opts.system },
|
|
@@ -686349,10 +686466,10 @@ var init_emotion_engine = __esm({
|
|
|
686349
686466
|
maxTokens: opts.maxTokens,
|
|
686350
686467
|
timeoutMs: opts.timeoutMs,
|
|
686351
686468
|
think: false,
|
|
686352
|
-
disableEmptyContentRecovery: true
|
|
686469
|
+
disableEmptyContentRecovery: true,
|
|
686470
|
+
poolQueuePolicy: "skip",
|
|
686471
|
+
poolQueueTimeoutMs: 1
|
|
686353
686472
|
};
|
|
686354
|
-
const cwd4 = resolve68(process.cwd());
|
|
686355
|
-
const startedAt2 = Date.now();
|
|
686356
686473
|
recordContextWindowDump({
|
|
686357
686474
|
source: "emotionEngine",
|
|
686358
686475
|
stage: opts.stage,
|
|
@@ -686367,6 +686484,12 @@ var init_emotion_engine = __esm({
|
|
|
686367
686484
|
request
|
|
686368
686485
|
});
|
|
686369
686486
|
try {
|
|
686487
|
+
const backend = new OllamaAgenticBackend(
|
|
686488
|
+
this.config.backendUrl,
|
|
686489
|
+
this.config.model,
|
|
686490
|
+
this.config.apiKey,
|
|
686491
|
+
false
|
|
686492
|
+
);
|
|
686370
686493
|
const result = await backend.chatCompletion(request);
|
|
686371
686494
|
const output = String(
|
|
686372
686495
|
result.choices?.[0]?.message?.content ?? ""
|
|
@@ -686429,6 +686552,12 @@ var init_emotion_engine = __esm({
|
|
|
686429
686552
|
timeoutMs: 1e4,
|
|
686430
686553
|
note: "best-effort emotion label refresh"
|
|
686431
686554
|
});
|
|
686555
|
+
if (output === null) {
|
|
686556
|
+
this.lastLabelUpdate = Date.now();
|
|
686557
|
+
this.lastLabelValence = this.state.valence;
|
|
686558
|
+
this.lastLabelArousal = this.state.arousal;
|
|
686559
|
+
return;
|
|
686560
|
+
}
|
|
686432
686561
|
const match = output.match(new RegExp("^(\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F?)\\s+(\\S+)", "u"));
|
|
686433
686562
|
if (match) {
|
|
686434
686563
|
this.state.emoji = match[1];
|
|
@@ -686503,6 +686632,7 @@ var init_emotion_engine = __esm({
|
|
|
686503
686632
|
timeoutMs: 2e4,
|
|
686504
686633
|
note: "best-effort Telegram admin outreach gate"
|
|
686505
686634
|
});
|
|
686635
|
+
if (output === null) return;
|
|
686506
686636
|
const message2 = this.normalizeReflectionDecision(output);
|
|
686507
686637
|
if (message2) outreach(message2);
|
|
686508
686638
|
} catch {
|
|
@@ -687753,8 +687883,8 @@ import {
|
|
|
687753
687883
|
} from "node:fs";
|
|
687754
687884
|
import { mkdir as mkdir22 } from "node:fs/promises";
|
|
687755
687885
|
import {
|
|
687756
|
-
basename as
|
|
687757
|
-
dirname as
|
|
687886
|
+
basename as basename39,
|
|
687887
|
+
dirname as dirname51,
|
|
687758
687888
|
extname as extname20,
|
|
687759
687889
|
isAbsolute as isAbsolute14,
|
|
687760
687890
|
join as join166,
|
|
@@ -687975,7 +688105,7 @@ function scopedTool(base3, root, mode) {
|
|
|
687975
688105
|
guarded.path.rel
|
|
687976
688106
|
);
|
|
687977
688107
|
if (!materialized.ok) return denied(materialized.error);
|
|
687978
|
-
mkdirSync95(
|
|
688108
|
+
mkdirSync95(dirname51(guarded.path.abs), { recursive: true });
|
|
687979
688109
|
writeFileSync82(guarded.path.abs, readFileSync126(materialized.path));
|
|
687980
688110
|
materialized.cleanup?.();
|
|
687981
688111
|
restoredEditPath = guarded.path.abs;
|
|
@@ -688059,7 +688189,7 @@ function guardPath(root, rawPath) {
|
|
|
688059
688189
|
error: `Path escapes the public creative workspace. Use a relative path under ${rootAbs}.`
|
|
688060
688190
|
};
|
|
688061
688191
|
}
|
|
688062
|
-
if (
|
|
688192
|
+
if (basename39(abs) === MANIFEST_FILE) {
|
|
688063
688193
|
return {
|
|
688064
688194
|
ok: false,
|
|
688065
688195
|
error: "The creative workspace manifest is internal and cannot be edited."
|
|
@@ -688173,7 +688303,7 @@ function rememberCreated(root, absPath) {
|
|
|
688173
688303
|
manifest.objects[rel] = {
|
|
688174
688304
|
logicalRel: rel,
|
|
688175
688305
|
storedRel,
|
|
688176
|
-
originalName:
|
|
688306
|
+
originalName: basename39(guarded.path.abs),
|
|
688177
688307
|
prefixBytes: prefix.length,
|
|
688178
688308
|
encrypted: true,
|
|
688179
688309
|
key: key.toString("base64"),
|
|
@@ -688237,7 +688367,7 @@ function materializeTelegramCreativeArtifactForSend(root, rawPath) {
|
|
|
688237
688367
|
`${Date.now()}-${randomBytes26(8).toString("hex")}`
|
|
688238
688368
|
);
|
|
688239
688369
|
mkdirSync95(stageDir, { recursive: true });
|
|
688240
|
-
const staged = join166(stageDir, object.originalName ||
|
|
688370
|
+
const staged = join166(stageDir, object.originalName || basename39(rel));
|
|
688241
688371
|
writeFileSync82(staged, payload);
|
|
688242
688372
|
return {
|
|
688243
688373
|
ok: true,
|
|
@@ -688495,7 +688625,7 @@ var init_telegram_creative_tools = __esm({
|
|
|
688495
688625
|
stage: "setup",
|
|
688496
688626
|
message: "Preparing scoped TTS audio file"
|
|
688497
688627
|
});
|
|
688498
|
-
await mkdir22(
|
|
688628
|
+
await mkdir22(dirname51(guarded.path.abs), { recursive: true });
|
|
688499
688629
|
const tts = new TtsGenerateTool();
|
|
688500
688630
|
this.emitProgress(start2, {
|
|
688501
688631
|
stage: "load",
|
|
@@ -689016,7 +689146,7 @@ __export(visual_object_association_exports, {
|
|
|
689016
689146
|
extractExplicitVisualObjectLabels: () => extractExplicitVisualObjectLabels,
|
|
689017
689147
|
formatVisualObjectMemoryContext: () => formatVisualObjectMemoryContext
|
|
689018
689148
|
});
|
|
689019
|
-
import { basename as
|
|
689149
|
+
import { basename as basename40 } from "node:path";
|
|
689020
689150
|
function stringValue2(value2) {
|
|
689021
689151
|
return typeof value2 === "string" ? value2.trim() : "";
|
|
689022
689152
|
}
|
|
@@ -689157,7 +689287,7 @@ async function associateVisualObjectFromImage(options2) {
|
|
|
689157
689287
|
aliases,
|
|
689158
689288
|
contextBlock: "",
|
|
689159
689289
|
output: teach.output,
|
|
689160
|
-
degradedReason: teach.error || teach.output || `visual_memory teach failed for ${
|
|
689290
|
+
degradedReason: teach.error || teach.output || `visual_memory teach failed for ${basename40(options2.imagePath)}`
|
|
689161
689291
|
};
|
|
689162
689292
|
}
|
|
689163
689293
|
const result = {
|
|
@@ -691937,7 +692067,7 @@ import {
|
|
|
691937
692067
|
import {
|
|
691938
692068
|
join as join169,
|
|
691939
692069
|
resolve as resolve70,
|
|
691940
|
-
basename as
|
|
692070
|
+
basename as basename41,
|
|
691941
692071
|
relative as relative19,
|
|
691942
692072
|
isAbsolute as isAbsolute15,
|
|
691943
692073
|
extname as extname21
|
|
@@ -699150,7 +699280,7 @@ ${mediaContext}` : ""
|
|
|
699150
699280
|
}
|
|
699151
699281
|
const matchingEntry = mediaEntries.find((entry) => {
|
|
699152
699282
|
if (resolve70(entry.localPath) === resolve70(raw)) return true;
|
|
699153
|
-
if (
|
|
699283
|
+
if (basename41(entry.localPath) === raw) return true;
|
|
699154
699284
|
if (entry.fileUniqueId === raw || entry.fileId === raw) return true;
|
|
699155
699285
|
if (entry.messageId && String(entry.messageId) === raw) return true;
|
|
699156
699286
|
if (entry.messageId && `message_id:${entry.messageId}` === raw.toLowerCase())
|
|
@@ -699191,7 +699321,7 @@ ${mediaContext}` : ""
|
|
|
699191
699321
|
sourceMessageId,
|
|
699192
699322
|
chatKey,
|
|
699193
699323
|
mediaKind,
|
|
699194
|
-
safeAlias:
|
|
699324
|
+
safeAlias: basename41(result.path)
|
|
699195
699325
|
}
|
|
699196
699326
|
};
|
|
699197
699327
|
}
|
|
@@ -699232,7 +699362,7 @@ ${mediaContext}` : ""
|
|
|
699232
699362
|
}
|
|
699233
699363
|
return entries.find((entry2) => {
|
|
699234
699364
|
if (resolve70(entry2.localPath) === resolve70(ref)) return true;
|
|
699235
|
-
if (
|
|
699365
|
+
if (basename41(entry2.localPath) === ref) return true;
|
|
699236
699366
|
if (entry2.fileUniqueId === ref || entry2.fileId === ref) return true;
|
|
699237
699367
|
if (entry2.messageId && String(entry2.messageId) === ref) return true;
|
|
699238
699368
|
return false;
|
|
@@ -699260,7 +699390,7 @@ ${mediaContext}` : ""
|
|
|
699260
699390
|
caption: entry.caption
|
|
699261
699391
|
},
|
|
699262
699392
|
modality,
|
|
699263
|
-
label: `Telegram message_id ${entry.messageId || "unknown"} ${
|
|
699393
|
+
label: `Telegram message_id ${entry.messageId || "unknown"} ${basename41(entry.localPath)}`,
|
|
699264
699394
|
extractedContent: entry.extractedContent
|
|
699265
699395
|
};
|
|
699266
699396
|
}
|
|
@@ -700463,8 +700593,8 @@ ${cardLines.join("\n")}`
|
|
|
700463
700593
|
const caption = entry.caption ? ` caption=${telegramContextJsonString(entry.caption, 120)}` : "";
|
|
700464
700594
|
const extracted = entry.extractedContent ? `
|
|
700465
700595
|
extracted=${telegramContextJsonString(entry.extractedContent.replace(/\s+/g, " "), 220)}` : "";
|
|
700466
|
-
const alias = entry.messageId ? `message_id:${entry.messageId}` :
|
|
700467
|
-
return `- ${alias}${replyMark}: ${kind}; file ${
|
|
700596
|
+
const alias = entry.messageId ? `message_id:${entry.messageId}` : basename41(entry.localPath);
|
|
700597
|
+
return `- ${alias}${replyMark}: ${kind}; file ${basename41(entry.localPath)}${caption}${extracted}`;
|
|
700468
700598
|
});
|
|
700469
700599
|
sections.push(
|
|
700470
700600
|
[
|
|
@@ -708716,12 +708846,12 @@ ${objectMemory.contextBlock}`);
|
|
|
708716
708846
|
};
|
|
708717
708847
|
}
|
|
708718
708848
|
const lines = entries.map((entry, index) => {
|
|
708719
|
-
const pathAlias = entry.messageId ? `message_id:${entry.messageId}` :
|
|
708849
|
+
const pathAlias = entry.messageId ? `message_id:${entry.messageId}` : basename41(entry.localPath);
|
|
708720
708850
|
const parts = [
|
|
708721
708851
|
`${index + 1}. message_id ${entry.messageId || "unknown"}`,
|
|
708722
708852
|
currentMsg?.replyToMessageId === entry.messageId ? "replied-to" : "",
|
|
708723
708853
|
telegramCachedMediaIsImage(entry) ? "image" : telegramCachedMediaIsPdf(entry) ? "pdf" : telegramCachedMediaIsAudio(entry) ? "audio" : telegramCachedMediaIsVideo(entry) ? "video" : entry.mediaType,
|
|
708724
|
-
`file=${
|
|
708854
|
+
`file=${basename41(entry.localPath)}`,
|
|
708725
708855
|
`path_alias=${pathAlias}`,
|
|
708726
708856
|
entry.caption ? `caption=${telegramContextJsonString(entry.caption, 140)}` : ""
|
|
708727
708857
|
].filter(Boolean);
|
|
@@ -708904,8 +709034,8 @@ ${objectMemory.contextBlock}`);
|
|
|
708904
709034
|
)) {
|
|
708905
709035
|
return {
|
|
708906
709036
|
success: true,
|
|
708907
|
-
output: `Telegram file already sent in this turn: ${
|
|
708908
|
-
llmContent: `Already sent ${
|
|
709037
|
+
output: `Telegram file already sent in this turn: ${basename41(file.path)} as ${kind} to ${String(target.chatId)}`,
|
|
709038
|
+
llmContent: `Already sent ${basename41(file.path)} to Telegram as ${kind}; do not send it again.`,
|
|
708909
709039
|
durationMs: performance.now() - start2,
|
|
708910
709040
|
mutated: false,
|
|
708911
709041
|
mutatedFiles: []
|
|
@@ -708932,8 +709062,8 @@ ${objectMemory.contextBlock}`);
|
|
|
708932
709062
|
);
|
|
708933
709063
|
return {
|
|
708934
709064
|
success: true,
|
|
708935
|
-
output: `Sent Telegram file: ${
|
|
708936
|
-
llmContent: `Sent ${
|
|
709065
|
+
output: `Sent Telegram file: ${basename41(file.path)} as ${kind} to ${String(target.chatId)}${messageId ? ` (message_id ${messageId})` : ""}`,
|
|
709066
|
+
llmContent: `Sent ${basename41(file.path)} to Telegram as ${kind}.`,
|
|
708937
709067
|
durationMs: performance.now() - start2,
|
|
708938
709068
|
mutated: false,
|
|
708939
709069
|
mutatedFiles: []
|
|
@@ -709592,7 +709722,7 @@ ${text2}`.trim()
|
|
|
709592
709722
|
throw new Error(`File does not exist: ${media.value}`);
|
|
709593
709723
|
const buffer2 = readFileSync129(media.value);
|
|
709594
709724
|
const boundary = `----omnius-media-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
709595
|
-
const filename =
|
|
709725
|
+
const filename = basename41(media.value);
|
|
709596
709726
|
const contentType = mimeForPath(media.value, media.kind);
|
|
709597
709727
|
const parts = [];
|
|
709598
709728
|
const addField = (name10, value2) => {
|
|
@@ -709830,7 +709960,7 @@ Content-Type: ${contentType}\r
|
|
|
709830
709960
|
audioAsVoice: false
|
|
709831
709961
|
},
|
|
709832
709962
|
{
|
|
709833
|
-
caption: `Vision action loop screenshot: ${
|
|
709963
|
+
caption: `Vision action loop screenshot: ${basename41(abs)}`
|
|
709834
709964
|
}
|
|
709835
709965
|
).catch(() => null);
|
|
709836
709966
|
}
|
|
@@ -709910,7 +710040,7 @@ Content-Type: ${contentType}\r
|
|
|
709910
710040
|
continue;
|
|
709911
710041
|
}
|
|
709912
710042
|
const buffer2 = readFileSync129(pathOrFileId);
|
|
709913
|
-
const filename =
|
|
710043
|
+
const filename = basename41(pathOrFileId);
|
|
709914
710044
|
parts.push(Buffer.from(`--${boundary}\r
|
|
709915
710045
|
`));
|
|
709916
710046
|
parts.push(
|
|
@@ -712050,7 +712180,7 @@ __export(projects_exports, {
|
|
|
712050
712180
|
});
|
|
712051
712181
|
import { readFileSync as readFileSync130, writeFileSync as writeFileSync85, mkdirSync as mkdirSync98, existsSync as existsSync157, statSync as statSync59, renameSync as renameSync14 } from "node:fs";
|
|
712052
712182
|
import { homedir as homedir56 } from "node:os";
|
|
712053
|
-
import { basename as
|
|
712183
|
+
import { basename as basename42, join as join170, resolve as resolve71 } from "node:path";
|
|
712054
712184
|
import { randomUUID as randomUUID19 } from "node:crypto";
|
|
712055
712185
|
function readAll2() {
|
|
712056
712186
|
try {
|
|
@@ -712098,7 +712228,7 @@ function registerProject(root, pid) {
|
|
|
712098
712228
|
} else {
|
|
712099
712229
|
entry = {
|
|
712100
712230
|
root: canonical,
|
|
712101
|
-
name:
|
|
712231
|
+
name: basename42(canonical) || canonical,
|
|
712102
712232
|
firstSeen: now2,
|
|
712103
712233
|
lastSeen: now2,
|
|
712104
712234
|
pid: pid ?? null,
|
|
@@ -713221,7 +713351,7 @@ var init_audit_log = __esm({
|
|
|
713221
713351
|
// packages/cli/src/api/disk-task-output.ts
|
|
713222
713352
|
import { open } from "node:fs/promises";
|
|
713223
713353
|
import { existsSync as existsSync160, mkdirSync as mkdirSync101, statSync as statSync60 } from "node:fs";
|
|
713224
|
-
import { dirname as
|
|
713354
|
+
import { dirname as dirname52 } from "node:path";
|
|
713225
713355
|
import * as fsConstants from "node:constants";
|
|
713226
713356
|
var O_NOFOLLOW2, O_APPEND2, O_CREAT2, O_WRONLY2, OPEN_FLAGS_WRITE, OPEN_MODE, DiskTaskOutput;
|
|
713227
713357
|
var init_disk_task_output = __esm({
|
|
@@ -713240,7 +713370,7 @@ var init_disk_task_output = __esm({
|
|
|
713240
713370
|
fileSize = 0;
|
|
713241
713371
|
constructor(outputPath3) {
|
|
713242
713372
|
this.path = outputPath3;
|
|
713243
|
-
mkdirSync101(
|
|
713373
|
+
mkdirSync101(dirname52(outputPath3), { recursive: true });
|
|
713244
713374
|
}
|
|
713245
713375
|
/** Queue content for async append. Non-blocking. */
|
|
713246
713376
|
append(chunk) {
|
|
@@ -713508,7 +713638,7 @@ data: ${JSON.stringify(ev)}
|
|
|
713508
713638
|
|
|
713509
713639
|
// packages/cli/src/api/routes-media.ts
|
|
713510
713640
|
import { existsSync as existsSync161, mkdirSync as mkdirSync102, statSync as statSync61, copyFileSync as copyFileSync7, createReadStream } from "node:fs";
|
|
713511
|
-
import { basename as
|
|
713641
|
+
import { basename as basename43, join as join173, resolve as pathResolve2 } from "node:path";
|
|
713512
713642
|
function mediaWorkDir() {
|
|
713513
713643
|
return join173(omniusHomeDir(), "media", "_work");
|
|
713514
713644
|
}
|
|
@@ -713530,7 +713660,7 @@ function extractGeneratedPath(output) {
|
|
|
713530
713660
|
function publishToGallery(srcPath, kind) {
|
|
713531
713661
|
ensureGlobalMediaDirs();
|
|
713532
713662
|
const dir = globalMediaDir(kind);
|
|
713533
|
-
const name10 =
|
|
713663
|
+
const name10 = basename43(srcPath);
|
|
713534
713664
|
const dest = join173(dir, name10);
|
|
713535
713665
|
try {
|
|
713536
713666
|
if (pathResolve2(srcPath) !== pathResolve2(dest)) {
|
|
@@ -713731,7 +713861,7 @@ async function handleAvAnalyze(ctx3) {
|
|
|
713731
713861
|
adapterStatus[role] = a2 && !a2.meta.isMock ? "live" : "mock";
|
|
713732
713862
|
if (adapterStatus[role] === "live") anyLive = true;
|
|
713733
713863
|
}
|
|
713734
|
-
const episodeId = `rest-${
|
|
713864
|
+
const episodeId = `rest-${basename43(filePath)}-${Date.now().toString(36)}`;
|
|
713735
713865
|
const ingest = await ingestMedia(episodeId, `file://${filePath}`);
|
|
713736
713866
|
const store2 = await analyzeEpisode({ episodeId, mediaUri: `file://${filePath}`, durationSec: ingest.source.durationSec, registry: registry4, windows: ingest.shots, roles: AV_ROLES });
|
|
713737
713867
|
const world = store2.snapshot();
|
|
@@ -713901,7 +714031,7 @@ function handleFile(ctx3) {
|
|
|
713901
714031
|
return true;
|
|
713902
714032
|
}
|
|
713903
714033
|
const dir = globalMediaDir(kind);
|
|
713904
|
-
const full = pathResolve2(dir,
|
|
714034
|
+
const full = pathResolve2(dir, basename43(name10));
|
|
713905
714035
|
if (!full.startsWith(pathResolve2(dir)) || !existsSync161(full)) {
|
|
713906
714036
|
sendProblem(ctx3.res, problemDetails({
|
|
713907
714037
|
type: P.notFound,
|
|
@@ -732419,7 +732549,7 @@ var init_chat_followup = __esm({
|
|
|
732419
732549
|
// packages/cli/src/docker.ts
|
|
732420
732550
|
import { execSync as execSync39, spawn as spawn37 } from "node:child_process";
|
|
732421
732551
|
import { existsSync as existsSync169, mkdirSync as mkdirSync108, writeFileSync as writeFileSync91 } from "node:fs";
|
|
732422
|
-
import { join as join181, resolve as resolve73, dirname as
|
|
732552
|
+
import { join as join181, resolve as resolve73, dirname as dirname53 } from "node:path";
|
|
732423
732553
|
import { homedir as homedir62 } from "node:os";
|
|
732424
732554
|
import { fileURLToPath as fileURLToPath22 } from "node:url";
|
|
732425
732555
|
function getDockerDir() {
|
|
@@ -732430,7 +732560,7 @@ function getDockerDir() {
|
|
|
732430
732560
|
} catch {
|
|
732431
732561
|
}
|
|
732432
732562
|
try {
|
|
732433
|
-
const thisDir =
|
|
732563
|
+
const thisDir = dirname53(fileURLToPath22(import.meta.url));
|
|
732434
732564
|
return join181(thisDir, "..", "..", "..", "docker");
|
|
732435
732565
|
} catch {
|
|
732436
732566
|
}
|
|
@@ -732717,7 +732847,7 @@ __export(embedding_workers_exports, {
|
|
|
732717
732847
|
startEmbeddingWorkers: () => startEmbeddingWorkers,
|
|
732718
732848
|
stopEmbeddingWorkers: () => stopEmbeddingWorkers
|
|
732719
732849
|
});
|
|
732720
|
-
import { basename as
|
|
732850
|
+
import { basename as basename44, join as join182 } from "node:path";
|
|
732721
732851
|
function startEmbeddingWorkers(opts) {
|
|
732722
732852
|
if (_running) return;
|
|
732723
732853
|
_running = true;
|
|
@@ -732783,7 +732913,7 @@ async function runEmbeddingTask(modality, episodeId, taskId, opts) {
|
|
|
732783
732913
|
try {
|
|
732784
732914
|
if (!_aligner) {
|
|
732785
732915
|
const stateRoot = process.env.OMNIUS_DIR || process.cwd();
|
|
732786
|
-
const omniusDir =
|
|
732916
|
+
const omniusDir = basename44(stateRoot) === ".omnius" ? stateRoot : join182(stateRoot, ".omnius");
|
|
732787
732917
|
const memDir = join182(omniusDir, "memory");
|
|
732788
732918
|
_aligner = new EmbeddingAligner(
|
|
732789
732919
|
`${modality}-${emb.length}`,
|
|
@@ -732899,7 +733029,7 @@ import * as http5 from "node:http";
|
|
|
732899
733029
|
import * as https3 from "node:https";
|
|
732900
733030
|
import { createRequire as createRequire8 } from "node:module";
|
|
732901
733031
|
import { fileURLToPath as fileURLToPath23 } from "node:url";
|
|
732902
|
-
import { dirname as
|
|
733032
|
+
import { dirname as dirname54, join as join183, resolve as resolve74 } from "node:path";
|
|
732903
733033
|
import { homedir as homedir63 } from "node:os";
|
|
732904
733034
|
import { spawn as spawn38, execSync as execSync40 } from "node:child_process";
|
|
732905
733035
|
import {
|
|
@@ -732929,7 +733059,7 @@ function memoryDbPaths3(baseDir = process.cwd()) {
|
|
|
732929
733059
|
}
|
|
732930
733060
|
function getVersion3() {
|
|
732931
733061
|
try {
|
|
732932
|
-
const thisDir =
|
|
733062
|
+
const thisDir = dirname54(fileURLToPath23(import.meta.url));
|
|
732933
733063
|
const candidates = [
|
|
732934
733064
|
join183(thisDir, "..", "package.json"),
|
|
732935
733065
|
join183(thisDir, "..", "..", "package.json"),
|
|
@@ -736391,7 +736521,7 @@ async function handleV1Update(req3, res, requestId) {
|
|
|
736391
736521
|
);
|
|
736392
736522
|
const fs14 = require4("node:fs");
|
|
736393
736523
|
const nodeBin = process.execPath;
|
|
736394
|
-
const nodeDir =
|
|
736524
|
+
const nodeDir = dirname54(nodeBin);
|
|
736395
736525
|
const { execSync: es } = require4("node:child_process");
|
|
736396
736526
|
const isWin2 = process.platform === "win32";
|
|
736397
736527
|
let npmBin = "";
|
|
@@ -736406,7 +736536,7 @@ async function handleV1Update(req3, res, requestId) {
|
|
|
736406
736536
|
const dir = join183(homedir63(), ".omnius");
|
|
736407
736537
|
fs14.mkdirSync(dir, { recursive: true });
|
|
736408
736538
|
const logFd = fs14.openSync(logPath3, "w");
|
|
736409
|
-
const npmPrefix =
|
|
736539
|
+
const npmPrefix = dirname54(nodeDir);
|
|
736410
736540
|
let globalBinDir = "";
|
|
736411
736541
|
try {
|
|
736412
736542
|
if (isWin2) {
|
|
@@ -742349,7 +742479,7 @@ function startApiServer(options2 = {}) {
|
|
|
742349
742479
|
if (process.env["OMNIUS_DAEMON"] === "1" && process.env["OMNIUS_NO_VERSION_GUARD"] !== "1") {
|
|
742350
742480
|
const readDiskVersion = () => {
|
|
742351
742481
|
try {
|
|
742352
|
-
const here =
|
|
742482
|
+
const here = dirname54(fileURLToPath23(import.meta.url));
|
|
742353
742483
|
for (const rel of ["../package.json", "../../package.json", "../../../package.json", "../../../../package.json"]) {
|
|
742354
742484
|
const p2 = join183(here, rel);
|
|
742355
742485
|
if (existsSync170(p2)) {
|
|
@@ -743442,7 +743572,7 @@ var init_clipboard_media = __esm({
|
|
|
743442
743572
|
|
|
743443
743573
|
// packages/cli/src/tui/interactive.ts
|
|
743444
743574
|
import { cwd } from "node:process";
|
|
743445
|
-
import { resolve as resolve75, join as join185, dirname as
|
|
743575
|
+
import { resolve as resolve75, join as join185, dirname as dirname55, extname as extname22, relative as relative20, sep as sep5 } from "node:path";
|
|
743446
743576
|
import { createRequire as createRequire9 } from "node:module";
|
|
743447
743577
|
import { fileURLToPath as fileURLToPath24 } from "node:url";
|
|
743448
743578
|
import {
|
|
@@ -743502,7 +743632,7 @@ function formatTimeAgo2(date) {
|
|
|
743502
743632
|
function getVersion4() {
|
|
743503
743633
|
try {
|
|
743504
743634
|
const require5 = createRequire9(import.meta.url);
|
|
743505
|
-
const thisDir =
|
|
743635
|
+
const thisDir = dirname55(fileURLToPath24(import.meta.url));
|
|
743506
743636
|
const candidates = [
|
|
743507
743637
|
join185(thisDir, "..", "package.json"),
|
|
743508
743638
|
join185(thisDir, "..", "..", "package.json"),
|
|
@@ -755428,7 +755558,7 @@ init_typed_node_events();
|
|
|
755428
755558
|
init_dist5();
|
|
755429
755559
|
import { parseArgs as nodeParseArgs2 } from "node:util";
|
|
755430
755560
|
import { fileURLToPath as fileURLToPath25 } from "node:url";
|
|
755431
|
-
import { dirname as
|
|
755561
|
+
import { dirname as dirname56, join as join189 } from "node:path";
|
|
755432
755562
|
import { createRequire as createRequire10 } from "node:module";
|
|
755433
755563
|
|
|
755434
755564
|
// packages/cli/src/cli.ts
|
|
@@ -755576,7 +755706,7 @@ init_output();
|
|
|
755576
755706
|
function getVersion5() {
|
|
755577
755707
|
try {
|
|
755578
755708
|
const require5 = createRequire10(import.meta.url);
|
|
755579
|
-
const pkgPath = join189(
|
|
755709
|
+
const pkgPath = join189(dirname56(fileURLToPath25(import.meta.url)), "..", "package.json");
|
|
755580
755710
|
const pkg = require5(pkgPath);
|
|
755581
755711
|
return pkg.version;
|
|
755582
755712
|
} catch {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.521",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.521",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED