omnius 1.0.264 → 1.0.266
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 +231 -70
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -595366,26 +595366,29 @@ function truncateAnsiToWidth(text2, width) {
|
|
|
595366
595366
|
}
|
|
595367
595367
|
function wrapToolTextLine(text2, width, prefix = "") {
|
|
595368
595368
|
text2 = sanitizeToolBoxContent(text2);
|
|
595369
|
-
if (width <= 0) return
|
|
595370
|
-
if (text2.length === 0) return
|
|
595369
|
+
if (width <= 0) return [text2];
|
|
595370
|
+
if (text2.length === 0) return [""];
|
|
595371
595371
|
const out = [];
|
|
595372
|
-
const continuationIndent = hangingIndentForPlainLine(text2, width);
|
|
595373
595372
|
const prefixLen = visibleLen(prefix);
|
|
595374
|
-
const avail = Math.max(4, width - prefixLen);
|
|
595375
595373
|
let remaining = text2;
|
|
595376
|
-
|
|
595374
|
+
let first2 = true;
|
|
595375
|
+
while (true) {
|
|
595376
|
+
const avail = Math.max(4, first2 ? width : width - prefixLen);
|
|
595377
|
+
if (visibleLen(remaining) <= avail) {
|
|
595378
|
+
out.push(first2 ? remaining : prefix + remaining);
|
|
595379
|
+
break;
|
|
595380
|
+
}
|
|
595377
595381
|
const breakOffset = findVisibleBreak(remaining, avail);
|
|
595378
595382
|
let breakAt = breakOffset;
|
|
595379
|
-
|
|
595383
|
+
const bestBreak = remaining.lastIndexOf(" ", breakOffset);
|
|
595380
595384
|
if (bestBreak > 0) {
|
|
595381
595385
|
breakAt = bestBreak;
|
|
595382
595386
|
}
|
|
595383
595387
|
const line = remaining.slice(0, breakAt).trimEnd();
|
|
595384
|
-
out.push(
|
|
595388
|
+
out.push(first2 ? line : prefix + line);
|
|
595385
595389
|
remaining = remaining.slice(breakAt).trimStart();
|
|
595390
|
+
first2 = false;
|
|
595386
595391
|
}
|
|
595387
|
-
const lastLine = prefix ? prefix + remaining : remaining;
|
|
595388
|
-
out.push(lastLine);
|
|
595389
595392
|
return out;
|
|
595390
595393
|
}
|
|
595391
595394
|
function wrapLinesWithPrefix(content, prefix, maxWidth) {
|
|
@@ -595552,7 +595555,7 @@ function wrapFooterItems(items, width) {
|
|
|
595552
595555
|
}
|
|
595553
595556
|
if (current) lines.push(current);
|
|
595554
595557
|
if (clean5.length > width) {
|
|
595555
|
-
const pipe3 = "
|
|
595558
|
+
const pipe3 = " ";
|
|
595556
595559
|
const chunks = wrapToolTextLine(clean5, width, pipe3);
|
|
595557
595560
|
lines.push(...chunks.slice(0, -1));
|
|
595558
595561
|
current = chunks[chunks.length - 1] ?? "";
|
|
@@ -595624,7 +595627,7 @@ function buildCombinedToolBoxLines(toolName, callArgs, success, output, opts, wi
|
|
|
595624
595627
|
];
|
|
595625
595628
|
const triggerTexts = formatToolArgsForBox(toolName, callArgs, opts.verbose);
|
|
595626
595629
|
for (const text2 of triggerTexts) {
|
|
595627
|
-
const pipe3 = "
|
|
595630
|
+
const pipe3 = " ";
|
|
595628
595631
|
const chunks = wrapToolTextLine(text2, innerWidth, pipe3);
|
|
595629
595632
|
for (const chunk of chunks) {
|
|
595630
595633
|
lines.push(
|
|
@@ -595636,7 +595639,7 @@ function buildCombinedToolBoxLines(toolName, callArgs, success, output, opts, wi
|
|
|
595636
595639
|
if (resultBody.length > 0) {
|
|
595637
595640
|
for (const bodyLine of resultBody) {
|
|
595638
595641
|
const text2 = sanitizeToolBoxContent(bodyLine.text);
|
|
595639
|
-
const pipe3 = "
|
|
595642
|
+
const pipe3 = " ";
|
|
595640
595643
|
const chunks = bodyLine.mode === "truncate" ? [truncateAnsiToWidth(text2, innerWidth)] : wrapToolTextLine(text2, innerWidth, pipe3);
|
|
595641
595644
|
for (const chunk of chunks) {
|
|
595642
595645
|
lines.push(
|
|
@@ -595678,7 +595681,7 @@ function buildToolBoxLines(data, width) {
|
|
|
595678
595681
|
];
|
|
595679
595682
|
for (const bodyLine of data.body.length > 0 ? data.body : [{ text: "Done", mode: "wrap", kind: "dim" }]) {
|
|
595680
595683
|
const text2 = sanitizeToolBoxContent(bodyLine.text);
|
|
595681
|
-
const pipe3 = "
|
|
595684
|
+
const pipe3 = " ";
|
|
595682
595685
|
const chunks = bodyLine.mode === "truncate" ? [truncateAnsiToWidth(text2, innerWidth)] : wrapToolTextLine(text2, innerWidth, pipe3);
|
|
595683
595686
|
for (const chunk of chunks) {
|
|
595684
595687
|
lines.push(
|
|
@@ -606077,6 +606080,7 @@ var init_status_bar = __esm({
|
|
|
606077
606080
|
_autoScroll = true;
|
|
606078
606081
|
/** Cached click region for the spacer button */
|
|
606079
606082
|
_scrollBtnRegion = null;
|
|
606083
|
+
_copyBtnRegion = null;
|
|
606080
606084
|
stdinHooked = false;
|
|
606081
606085
|
/** COHERE distributed cognitive commons active flag */
|
|
606082
606086
|
_cohereActive = false;
|
|
@@ -607776,6 +607780,12 @@ var init_status_bar = __esm({
|
|
|
607776
607780
|
return;
|
|
607777
607781
|
}
|
|
607778
607782
|
}
|
|
607783
|
+
if (type === "press" && this._copyBtnRegion && row === this._copyBtnRegion.row) {
|
|
607784
|
+
if (col >= this._copyBtnRegion.start && col <= this._copyBtnRegion.end) {
|
|
607785
|
+
this.copySessionToClipboard();
|
|
607786
|
+
return;
|
|
607787
|
+
}
|
|
607788
|
+
}
|
|
607779
607789
|
const pos = this.rowPositions(termRows());
|
|
607780
607790
|
if (type === "press" && pos.tabBarRow > 0 && row === pos.tabBarRow) {
|
|
607781
607791
|
const viewId = this.hitTestTabBar(col);
|
|
@@ -608627,6 +608637,60 @@ ${CONTENT_BG_SEQ}`);
|
|
|
608627
608637
|
this._syncPagerScope();
|
|
608628
608638
|
this.repaintContent();
|
|
608629
608639
|
}
|
|
608640
|
+
/** Copy the visible session content to the system clipboard */
|
|
608641
|
+
copySessionToClipboard() {
|
|
608642
|
+
const lines = this._contentLines;
|
|
608643
|
+
if (!lines || lines.length === 0) return;
|
|
608644
|
+
const offset = this._contentScrollOffset;
|
|
608645
|
+
const visible = this.contentHeight;
|
|
608646
|
+
const startIdx = Math.max(0, offset);
|
|
608647
|
+
const endIdx = Math.min(lines.length, startIdx + visible);
|
|
608648
|
+
const visibleLines = lines.slice(startIdx, endIdx);
|
|
608649
|
+
const stripped = visibleLines.map(
|
|
608650
|
+
(line) => line.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, "").replace(/\x1B\]?[^\x07]*\x07/g, "")
|
|
608651
|
+
);
|
|
608652
|
+
const text2 = stripped.join("\n");
|
|
608653
|
+
const clipboardCmds = [
|
|
608654
|
+
["wl-copy", text2],
|
|
608655
|
+
["xclip", ["-selection", "clipboard"], "-i"],
|
|
608656
|
+
["xsel", "--clipboard", "--input"]
|
|
608657
|
+
];
|
|
608658
|
+
let success = false;
|
|
608659
|
+
for (const [cmd, ...args] of clipboardCmds) {
|
|
608660
|
+
try {
|
|
608661
|
+
const { execSync: execSync63 } = __require("child_process");
|
|
608662
|
+
const child = __require("child_process").spawn(cmd, args, {
|
|
608663
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
608664
|
+
});
|
|
608665
|
+
if (child.stdin) {
|
|
608666
|
+
child.stdin.write(text2);
|
|
608667
|
+
child.stdin.end();
|
|
608668
|
+
}
|
|
608669
|
+
child.on("close", (code8) => {
|
|
608670
|
+
if (code8 === 0) success = true;
|
|
608671
|
+
});
|
|
608672
|
+
setTimeout(() => {
|
|
608673
|
+
if (!success) {
|
|
608674
|
+
try {
|
|
608675
|
+
child.kill();
|
|
608676
|
+
} catch {
|
|
608677
|
+
}
|
|
608678
|
+
}
|
|
608679
|
+
}, 500);
|
|
608680
|
+
break;
|
|
608681
|
+
} catch {
|
|
608682
|
+
continue;
|
|
608683
|
+
}
|
|
608684
|
+
}
|
|
608685
|
+
if (!success) {
|
|
608686
|
+
const fs11 = __require("fs");
|
|
608687
|
+
const os9 = __require("os");
|
|
608688
|
+
const tmpPath = __require("path").join(os9.tmpdir(), "omnius-session-copy.txt");
|
|
608689
|
+
fs11.writeFileSync(tmpPath, text2, "utf-8");
|
|
608690
|
+
process.stderr.write(`\x1B[38;5;208mClipboard unavailable — session saved to ${tmpPath}\x1B[0m
|
|
608691
|
+
`);
|
|
608692
|
+
}
|
|
608693
|
+
}
|
|
608630
608694
|
/**
|
|
608631
608695
|
* WO-TASK-02 — sync the tasks panel "pager" scope flag with the current
|
|
608632
608696
|
* scroll-back state. While the user is scrolled back through content
|
|
@@ -608692,8 +608756,19 @@ ${CONTENT_BG_SEQ}`);
|
|
|
608692
608756
|
start: startCol,
|
|
608693
608757
|
end: startCol + label.length - 1
|
|
608694
608758
|
};
|
|
608759
|
+
const copyLabel = " ⎘ copy session ";
|
|
608760
|
+
const copyCol = Math.max(startCol + label.length + 2, w - copyLabel.length);
|
|
608761
|
+
if (copyCol + copyLabel.length <= w) {
|
|
608762
|
+
buf += `\x1B[${spacerRow};${copyCol}H\x1B[38;5;141m${copyLabel}\x1B[0m${CONTENT_BG_SEQ}`;
|
|
608763
|
+
this._copyBtnRegion = {
|
|
608764
|
+
row: spacerRow,
|
|
608765
|
+
start: copyCol,
|
|
608766
|
+
end: copyCol + copyLabel.length - 1
|
|
608767
|
+
};
|
|
608768
|
+
}
|
|
608695
608769
|
} else {
|
|
608696
608770
|
this._scrollBtnRegion = null;
|
|
608771
|
+
this._copyBtnRegion = null;
|
|
608697
608772
|
}
|
|
608698
608773
|
}
|
|
608699
608774
|
if (this._contentScrollOffset > 0) {
|
|
@@ -673007,7 +673082,7 @@ function buildShellLiveBlockLines(state, width) {
|
|
|
673007
673082
|
const elapsed = Math.max(0, Date.now() - state.startedAt);
|
|
673008
673083
|
const status = state.status === "running" ? `live ${formatElapsed2(elapsed)}` : state.status;
|
|
673009
673084
|
const title = ` Shell ${status} `;
|
|
673010
|
-
const top =
|
|
673085
|
+
const top = `╭─┤${title}├${"─".repeat(Math.max(0, w - 5 - title.length))}╮`;
|
|
673011
673086
|
const bottom = `╰${"─".repeat(w - 2)}╯`;
|
|
673012
673087
|
const visibleLines = [...state.lines];
|
|
673013
673088
|
if (state.currentLine) visibleLines.push(state.currentLine);
|
|
@@ -673018,7 +673093,10 @@ function buildShellLiveBlockLines(state, width) {
|
|
|
673018
673093
|
contentRow(`$ ${state.command}`, inner),
|
|
673019
673094
|
contentRow("", inner)
|
|
673020
673095
|
];
|
|
673021
|
-
if (hidden > 0)
|
|
673096
|
+
if (hidden > 0)
|
|
673097
|
+
rows.push(
|
|
673098
|
+
contentRow(`... ${hidden} earlier line${hidden === 1 ? "" : "s"}`, inner)
|
|
673099
|
+
);
|
|
673022
673100
|
if (body.length === 0) {
|
|
673023
673101
|
rows.push(contentRow("(waiting for output)", inner));
|
|
673024
673102
|
} else {
|
|
@@ -673045,11 +673123,6 @@ function fit2(value2, width) {
|
|
|
673045
673123
|
}
|
|
673046
673124
|
return plain + " ".repeat(width - chars.length);
|
|
673047
673125
|
}
|
|
673048
|
-
function fitWithFill(value2, width, fill) {
|
|
673049
|
-
const chars = Array.from(value2);
|
|
673050
|
-
if (chars.length > width) return chars.slice(0, width).join("");
|
|
673051
|
-
return value2 + fill.repeat(width - chars.length);
|
|
673052
|
-
}
|
|
673053
673126
|
function formatElapsed2(ms) {
|
|
673054
673127
|
const seconds = Math.floor(ms / 1e3);
|
|
673055
673128
|
if (seconds < 60) return `${seconds}s`;
|
|
@@ -690936,7 +691009,7 @@ import {
|
|
|
690936
691009
|
readSync as readSync2,
|
|
690937
691010
|
closeSync as closeSync6
|
|
690938
691011
|
} from "node:fs";
|
|
690939
|
-
import { randomBytes as randomBytes28, randomUUID as randomUUID21 } from "node:crypto";
|
|
691012
|
+
import { randomBytes as randomBytes28, randomUUID as randomUUID21, timingSafeEqual as timingSafeEqual2 } from "node:crypto";
|
|
690940
691013
|
import { createHash as createHash42 } from "node:crypto";
|
|
690941
691014
|
function memoryDbPaths3(baseDir = process.cwd()) {
|
|
690942
691015
|
const dir = join164(baseDir, ".omnius");
|
|
@@ -692499,16 +692572,69 @@ function runtimeKeysExist() {
|
|
|
692499
692572
|
return false;
|
|
692500
692573
|
}
|
|
692501
692574
|
}
|
|
692575
|
+
function tokensMatch(a2, b) {
|
|
692576
|
+
if (typeof a2 !== "string" || typeof b !== "string") return false;
|
|
692577
|
+
if (a2.length === 0 || b.length === 0) return false;
|
|
692578
|
+
const ab = Buffer.from(a2, "utf8");
|
|
692579
|
+
const bb = Buffer.from(b, "utf8");
|
|
692580
|
+
if (ab.length !== bb.length) return false;
|
|
692581
|
+
try {
|
|
692582
|
+
return timingSafeEqual2(ab, bb);
|
|
692583
|
+
} catch {
|
|
692584
|
+
return false;
|
|
692585
|
+
}
|
|
692586
|
+
}
|
|
692587
|
+
function scopedEnvKeySources() {
|
|
692588
|
+
const pick = (...names) => {
|
|
692589
|
+
for (const n2 of names) {
|
|
692590
|
+
const v = process.env[n2];
|
|
692591
|
+
if (v && v.trim()) return v.trim();
|
|
692592
|
+
}
|
|
692593
|
+
return void 0;
|
|
692594
|
+
};
|
|
692595
|
+
return [
|
|
692596
|
+
{
|
|
692597
|
+
value: pick("OMNIUS_REST_READ_API_KEY", "OMNIUS_READ_API_KEY"),
|
|
692598
|
+
scope: "read",
|
|
692599
|
+
user: "rest-read"
|
|
692600
|
+
},
|
|
692601
|
+
{
|
|
692602
|
+
value: pick("OMNIUS_REST_RUN_API_KEY", "OMNIUS_RUN_API_KEY"),
|
|
692603
|
+
scope: "run",
|
|
692604
|
+
user: "rest-run"
|
|
692605
|
+
},
|
|
692606
|
+
{
|
|
692607
|
+
value: pick("OMNIUS_REST_AUDITOR_API_KEY", "OMNIUS_AUDITOR_API_KEY"),
|
|
692608
|
+
scope: "read",
|
|
692609
|
+
user: "rest-auditor"
|
|
692610
|
+
},
|
|
692611
|
+
{
|
|
692612
|
+
value: pick("OMNIUS_REST_ADMIN_API_KEY", "OMNIUS_ADMIN_API_KEY"),
|
|
692613
|
+
scope: "admin",
|
|
692614
|
+
user: "rest-admin"
|
|
692615
|
+
},
|
|
692616
|
+
{ value: pick("OMNIUS_REST_API_KEY"), scope: "admin", user: "rest-admin" }
|
|
692617
|
+
];
|
|
692618
|
+
}
|
|
692619
|
+
function anyEnvAuthKeyConfigured() {
|
|
692620
|
+
if (process.env["OMNIUS_REST_API_KEYS"] || process.env["OMNIUS_API_KEYS"]) {
|
|
692621
|
+
return true;
|
|
692622
|
+
}
|
|
692623
|
+
if (process.env["OMNIUS_API_KEY"]) return true;
|
|
692624
|
+
return scopedEnvKeySources().some((s2) => Boolean(s2.value));
|
|
692625
|
+
}
|
|
692626
|
+
function anyAuthKeyConfigured() {
|
|
692627
|
+
return anyEnvAuthKeyConfigured() || runtimeKeysExist();
|
|
692628
|
+
}
|
|
692502
692629
|
function resolveAuth(req3) {
|
|
692503
692630
|
const authHeader = req3.headers["authorization"];
|
|
692504
|
-
const token = authHeader
|
|
692631
|
+
const token = typeof authHeader === "string" && authHeader.startsWith("Bearer ") ? authHeader.slice(7).trim() : null;
|
|
692505
692632
|
const multiKeys = process.env["OMNIUS_REST_API_KEYS"] || process.env["OMNIUS_API_KEYS"];
|
|
692506
|
-
if (multiKeys) {
|
|
692507
|
-
if (!token) return { authenticated: false, scope: "read" };
|
|
692633
|
+
if (token && multiKeys) {
|
|
692508
692634
|
for (const entry of multiKeys.split(",")) {
|
|
692509
692635
|
const parts = entry.trim().split(":");
|
|
692510
692636
|
const [key, scope, user, rpmStr, tpdStr, maxJobsStr] = parts;
|
|
692511
|
-
if (key
|
|
692637
|
+
if (key && tokensMatch(key, token)) {
|
|
692512
692638
|
return {
|
|
692513
692639
|
authenticated: true,
|
|
692514
692640
|
scope: scope || "admin",
|
|
@@ -692519,26 +692645,25 @@ function resolveAuth(req3) {
|
|
|
692519
692645
|
};
|
|
692520
692646
|
}
|
|
692521
692647
|
}
|
|
692522
|
-
return { authenticated: false, scope: "read" };
|
|
692523
692648
|
}
|
|
692524
|
-
|
|
692525
|
-
|
|
692526
|
-
|
|
692527
|
-
|
|
692528
|
-
|
|
692529
|
-
|
|
692530
|
-
|
|
692531
|
-
|
|
692532
|
-
|
|
692649
|
+
if (token) {
|
|
692650
|
+
for (const source of scopedEnvKeySources()) {
|
|
692651
|
+
if (source.value && tokensMatch(source.value, token)) {
|
|
692652
|
+
return {
|
|
692653
|
+
authenticated: true,
|
|
692654
|
+
scope: source.scope,
|
|
692655
|
+
user: source.user
|
|
692656
|
+
};
|
|
692657
|
+
}
|
|
692658
|
+
}
|
|
692533
692659
|
}
|
|
692534
692660
|
const singleKey = process.env["OMNIUS_API_KEY"];
|
|
692535
|
-
if (singleKey) {
|
|
692536
|
-
|
|
692537
|
-
|
|
692538
|
-
|
|
692539
|
-
|
|
692540
|
-
|
|
692541
|
-
};
|
|
692661
|
+
if (token && singleKey && tokensMatch(singleKey, token)) {
|
|
692662
|
+
return {
|
|
692663
|
+
authenticated: true,
|
|
692664
|
+
scope: "admin",
|
|
692665
|
+
user: "legacy-omnius-api-key"
|
|
692666
|
+
};
|
|
692542
692667
|
}
|
|
692543
692668
|
if (token) {
|
|
692544
692669
|
try {
|
|
@@ -692558,13 +692683,12 @@ function resolveAuth(req3) {
|
|
|
692558
692683
|
} catch {
|
|
692559
692684
|
}
|
|
692560
692685
|
}
|
|
692561
|
-
if (!
|
|
692686
|
+
if (!anyEnvAuthKeyConfigured()) {
|
|
692562
692687
|
const insecureLoopbackAdmin = process.env["OMNIUS_INSECURE_LOOPBACK_ADMIN"] === "1";
|
|
692563
692688
|
const remoteIp = (req3.socket?.remoteAddress || "").replace(/^::ffff:/, "");
|
|
692564
692689
|
if (insecureLoopbackAdmin && isLoopbackIP(remoteIp)) {
|
|
692565
692690
|
return { authenticated: true, scope: "admin", user: "insecure-loopback" };
|
|
692566
692691
|
}
|
|
692567
|
-
return { authenticated: false, scope: "read" };
|
|
692568
692692
|
}
|
|
692569
692693
|
return { authenticated: false, scope: "read" };
|
|
692570
692694
|
}
|
|
@@ -692572,9 +692696,22 @@ function checkAuth(req3, res, requiredScope = "read") {
|
|
|
692572
692696
|
const scopeLevel = { read: 1, run: 2, admin: 3 };
|
|
692573
692697
|
const auth = resolveAuth(req3);
|
|
692574
692698
|
if (!auth.authenticated) {
|
|
692699
|
+
if (process.env["OMNIUS_AUTH_DEBUG"] === "1") {
|
|
692700
|
+
const hasBearer = typeof req3.headers["authorization"] === "string" && req3.headers["authorization"].startsWith("Bearer ");
|
|
692701
|
+
const remoteIp = (req3.socket?.remoteAddress || "").replace(
|
|
692702
|
+
/^::ffff:/,
|
|
692703
|
+
""
|
|
692704
|
+
);
|
|
692705
|
+
const reason = !hasBearer ? "no_bearer_token" : anyAuthKeyConfigured() ? "token_not_recognized" : "no_server_keys_configured";
|
|
692706
|
+
process.stderr.write(
|
|
692707
|
+
`[auth] 401 ${reason} ip=${remoteIp} requiredScope=${requiredScope}
|
|
692708
|
+
`
|
|
692709
|
+
);
|
|
692710
|
+
}
|
|
692575
692711
|
jsonResponse(res, 401, {
|
|
692576
692712
|
error: "Unauthorized",
|
|
692577
|
-
message: "Invalid or missing Bearer token"
|
|
692713
|
+
message: "Invalid or missing Bearer token",
|
|
692714
|
+
hint: "Send 'Authorization: Bearer <token>'. The token must match OMNIUS_API_KEYS, a scoped OMNIUS_[REST_]<SCOPE>_API_KEY, OMNIUS_API_KEY, or a runtime/dashboard-minted key."
|
|
692578
692715
|
});
|
|
692579
692716
|
return false;
|
|
692580
692717
|
}
|
|
@@ -699711,9 +699848,7 @@ function startApiServer(options2 = {}) {
|
|
|
699711
699848
|
res.setHeader("X-API-Version", API_VERSION);
|
|
699712
699849
|
const rawIp = req3.socket?.remoteAddress ?? "";
|
|
699713
699850
|
const hasBearer = typeof req3.headers["authorization"] === "string" && req3.headers["authorization"].startsWith("Bearer ");
|
|
699714
|
-
const anyKeyConfigured = hasBearer &&
|
|
699715
|
-
process.env["OMNIUS_API_KEY"] || process.env["OMNIUS_API_KEYS"] || process.env["OMNIUS_REST_API_KEY"] || process.env["OMNIUS_REST_API_KEYS"] || process.env["OMNIUS_REST_READ_API_KEY"] || process.env["OMNIUS_REST_RUN_API_KEY"] || process.env["OMNIUS_REST_ADMIN_API_KEY"] || runtimeKeysExist()
|
|
699716
|
-
);
|
|
699851
|
+
const anyKeyConfigured = hasBearer && anyAuthKeyConfigured();
|
|
699717
699852
|
if (!isAllowedIP(rawIp, runtimeAccessMode) && !(hasBearer && anyKeyConfigured)) {
|
|
699718
699853
|
_accessRejected++;
|
|
699719
699854
|
metrics.totalErrors++;
|
|
@@ -700278,19 +700413,27 @@ function startApiServer(options2 = {}) {
|
|
|
700278
700413
|
}
|
|
700279
700414
|
}, 36e5).unref();
|
|
700280
700415
|
}
|
|
700281
|
-
|
|
700282
|
-
|
|
700283
|
-
const
|
|
700284
|
-
|
|
700285
|
-
`);
|
|
700286
|
-
|
|
700287
|
-
|
|
700416
|
+
{
|
|
700417
|
+
const sources = [];
|
|
700418
|
+
const multiMap = process.env["OMNIUS_REST_API_KEYS"] || process.env["OMNIUS_API_KEYS"];
|
|
700419
|
+
if (multiMap) {
|
|
700420
|
+
sources.push(`${multiMap.split(",").length} multi-key map entry(ies)`);
|
|
700421
|
+
}
|
|
700422
|
+
const scopedCount = scopedEnvKeySources().filter(
|
|
700423
|
+
(s2) => Boolean(s2.value)
|
|
700424
|
+
).length;
|
|
700425
|
+
if (scopedCount > 0) sources.push(`${scopedCount} scoped env key(s)`);
|
|
700426
|
+
if (process.env["OMNIUS_API_KEY"]) sources.push("legacy single key");
|
|
700427
|
+
if (runtimeKeysExist()) sources.push("runtime/dashboard keys");
|
|
700428
|
+
if (sources.length > 0) {
|
|
700429
|
+
log22(` Auth: enabled — ${sources.join(", ")}
|
|
700288
700430
|
`);
|
|
700289
|
-
|
|
700290
|
-
|
|
700291
|
-
|
|
700431
|
+
} else {
|
|
700432
|
+
log22(
|
|
700433
|
+
` Auth: disabled (set OMNIUS_RUN_API_KEY / OMNIUS_REST_API_KEY / OMNIUS_API_KEYS, or mint a runtime key, to enable)
|
|
700292
700434
|
`
|
|
700293
|
-
|
|
700435
|
+
);
|
|
700436
|
+
}
|
|
700294
700437
|
}
|
|
700295
700438
|
log22(` Discovering sponsors in background...
|
|
700296
700439
|
|
|
@@ -704160,20 +704303,32 @@ ${entry.fullContent}`
|
|
|
704160
704303
|
case "debug_adversary":
|
|
704161
704304
|
if (event.adversaryAction) {
|
|
704162
704305
|
const lm = event.adversaryAction;
|
|
704163
|
-
if (lm.intervention) {
|
|
704164
|
-
const simple = `⚠ ${lm.intervention}`;
|
|
704165
|
-
contentWrite(() => renderInfo(simple));
|
|
704166
|
-
}
|
|
704167
704306
|
if (lm.details) {
|
|
704168
704307
|
adversaryBuffer.push(lm.details);
|
|
704169
704308
|
if (adversaryBuffer.length > 50)
|
|
704170
704309
|
adversaryBuffer.splice(0, adversaryBuffer.length - 50);
|
|
704171
|
-
|
|
704172
|
-
|
|
704173
|
-
|
|
704174
|
-
|
|
704310
|
+
}
|
|
704311
|
+
if (lm.intervention) {
|
|
704312
|
+
contentWrite(() => {
|
|
704313
|
+
const lines = [`⚠ ${lm.intervention}`];
|
|
704314
|
+
if (lm.details && showAdversary) {
|
|
704315
|
+
const det = String(lm.details);
|
|
704316
|
+
lines.push(...det.split("\n").filter(Boolean));
|
|
704317
|
+
}
|
|
704318
|
+
renderBoxedBlock({
|
|
704319
|
+
title: "Adversary",
|
|
704320
|
+
lines,
|
|
704321
|
+
kind: "plain"
|
|
704175
704322
|
});
|
|
704176
|
-
}
|
|
704323
|
+
});
|
|
704324
|
+
} else if (lm.details && showAdversary) {
|
|
704325
|
+
contentWrite(() => {
|
|
704326
|
+
renderBoxedBlock({
|
|
704327
|
+
title: "Adversary",
|
|
704328
|
+
lines: String(lm.details).split("\n").filter(Boolean),
|
|
704329
|
+
kind: "dim"
|
|
704330
|
+
});
|
|
704331
|
+
});
|
|
704177
704332
|
}
|
|
704178
704333
|
}
|
|
704179
704334
|
break;
|
|
@@ -705143,8 +705298,14 @@ Review its full output via sub_agent(action='output', id='${id}')`
|
|
|
705143
705298
|
subToolInstances.push(new TodoReadTool());
|
|
705144
705299
|
subRunner.registerTools(subToolInstances.map(adaptTool6));
|
|
705145
705300
|
const subAgentId = opts.id || `sub-${Date.now()}`;
|
|
705146
|
-
statusBar.registerAgentView(
|
|
705147
|
-
|
|
705301
|
+
statusBar.registerAgentView(
|
|
705302
|
+
subAgentId,
|
|
705303
|
+
`Sub-agent ${subAgentId}`,
|
|
705304
|
+
"sub"
|
|
705305
|
+
);
|
|
705306
|
+
subRunner.registerTool(
|
|
705307
|
+
createTaskCompleteTool(subTier, repoRoot, true)
|
|
705308
|
+
);
|
|
705148
705309
|
const systemCtx = opts.systemPromptAddition ? `Working directory: ${repoRoot}
|
|
705149
705310
|
|
|
705150
705311
|
${opts.systemPromptAddition}` : `Working directory: ${repoRoot}`;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.266",
|
|
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.266",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
|
@@ -6337,9 +6337,9 @@
|
|
|
6337
6337
|
"license": "MIT"
|
|
6338
6338
|
},
|
|
6339
6339
|
"node_modules/semver": {
|
|
6340
|
-
"version": "7.8.
|
|
6341
|
-
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.
|
|
6342
|
-
"integrity": "sha512-
|
|
6340
|
+
"version": "7.8.4",
|
|
6341
|
+
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz",
|
|
6342
|
+
"integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==",
|
|
6343
6343
|
"license": "ISC",
|
|
6344
6344
|
"bin": {
|
|
6345
6345
|
"semver": "bin/semver.js"
|
package/package.json
CHANGED