omnius 1.0.268 → 1.0.269
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 +270 -58
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -554725,7 +554725,7 @@ var init_verifierRunner = __esm({
|
|
|
554725
554725
|
continue;
|
|
554726
554726
|
const { stdout, stderr } = await execFileAsync5(bin, args, {
|
|
554727
554727
|
cwd: workDir,
|
|
554728
|
-
timeout:
|
|
554728
|
+
timeout: 15e3,
|
|
554729
554729
|
maxBuffer: 1024 * 1024
|
|
554730
554730
|
});
|
|
554731
554731
|
outputs.push(`$ ${cmd}
|
|
@@ -557139,6 +557139,23 @@ var init_ollama_pool = __esm({
|
|
|
557139
557139
|
scored.sort((a2, b) => b.score - a2.score);
|
|
557140
557140
|
return scored[0].inst;
|
|
557141
557141
|
}
|
|
557142
|
+
_lastEagerCleanup = 0;
|
|
557143
|
+
triggerEagerCleanup() {
|
|
557144
|
+
if (process.env["NODE_ENV"] === "test" || process.env["VITEST"])
|
|
557145
|
+
return;
|
|
557146
|
+
const now2 = Date.now();
|
|
557147
|
+
if (now2 - this._lastEagerCleanup < 5e3)
|
|
557148
|
+
return;
|
|
557149
|
+
this._lastEagerCleanup = now2;
|
|
557150
|
+
Promise.resolve().then(() => (init_ollama_pool_cleanup(), ollama_pool_cleanup_exports)).then((mod3) => mod3.cleanupStaleOllamaProcesses({
|
|
557151
|
+
dryRun: false,
|
|
557152
|
+
useInference: "auto",
|
|
557153
|
+
baseInstanceUrl: this.config.baseInstanceUrl,
|
|
557154
|
+
poolPortStart: this.config.spawnPortStart,
|
|
557155
|
+
poolStatus: null
|
|
557156
|
+
})).catch(() => {
|
|
557157
|
+
});
|
|
557158
|
+
}
|
|
557142
557159
|
buildSlot(inst, agentId) {
|
|
557143
557160
|
return {
|
|
557144
557161
|
instanceId: inst.state.id,
|
|
@@ -557151,6 +557168,7 @@ var init_ollama_pool = __esm({
|
|
|
557151
557168
|
release: (success) => {
|
|
557152
557169
|
inst.release(success);
|
|
557153
557170
|
this.wakeNextSlotWaiter();
|
|
557171
|
+
this.triggerEagerCleanup();
|
|
557154
557172
|
}
|
|
557155
557173
|
};
|
|
557156
557174
|
}
|
|
@@ -557163,7 +557181,13 @@ var init_ollama_pool = __esm({
|
|
|
557163
557181
|
this.recordAffinity(agentId, pick.state.id);
|
|
557164
557182
|
return this.buildSlot(pick, agentId);
|
|
557165
557183
|
}
|
|
557166
|
-
await new Promise((resolve70) =>
|
|
557184
|
+
await new Promise((resolve70, reject) => {
|
|
557185
|
+
const timer = setTimeout(() => reject(new Error("No GPU slot available after 30s. All slots occupied.")), 3e4);
|
|
557186
|
+
this.slotWaiters.push(() => {
|
|
557187
|
+
clearTimeout(timer);
|
|
557188
|
+
resolve70();
|
|
557189
|
+
});
|
|
557190
|
+
});
|
|
557167
557191
|
}
|
|
557168
557192
|
}
|
|
557169
557193
|
wakeNextSlotWaiter() {
|
|
@@ -561875,7 +561899,7 @@ function partitionToolCalls(calls, readOnlyHints) {
|
|
|
561875
561899
|
}
|
|
561876
561900
|
return batches;
|
|
561877
561901
|
}
|
|
561878
|
-
async function withConcurrencyLimit(fns, limit =
|
|
561902
|
+
async function withConcurrencyLimit(fns, limit = 8) {
|
|
561879
561903
|
const results = new Array(fns.length);
|
|
561880
561904
|
let nextIdx = 0;
|
|
561881
561905
|
async function runNext() {
|
|
@@ -561888,7 +561912,7 @@ async function withConcurrencyLimit(fns, limit = 5) {
|
|
|
561888
561912
|
await Promise.all(workers);
|
|
561889
561913
|
return results;
|
|
561890
561914
|
}
|
|
561891
|
-
async function executeBatch(batch2, executeFn, concurrencyLimit =
|
|
561915
|
+
async function executeBatch(batch2, executeFn, concurrencyLimit = 8) {
|
|
561892
561916
|
if (!batch2.concurrent || batch2.calls.length === 1) {
|
|
561893
561917
|
const results = [];
|
|
561894
561918
|
for (const call of batch2.calls) {
|
|
@@ -562501,8 +562525,18 @@ var init_app_state = __esm({
|
|
|
562501
562525
|
function stableValueKey(value2) {
|
|
562502
562526
|
if (value2 === null || typeof value2 !== "object")
|
|
562503
562527
|
return JSON.stringify(value2);
|
|
562504
|
-
if (Array.isArray(value2))
|
|
562528
|
+
if (Array.isArray(value2)) {
|
|
562529
|
+
if (value2.length > 256)
|
|
562530
|
+
return `[${value2.length}items]`;
|
|
562505
562531
|
return `[${value2.map(stableValueKey).join(",")}]`;
|
|
562532
|
+
}
|
|
562533
|
+
const raw = JSON.stringify(value2);
|
|
562534
|
+
if (raw.length > 10240) {
|
|
562535
|
+
let hash = 5381;
|
|
562536
|
+
for (let i2 = 0; i2 < raw.length; i2++)
|
|
562537
|
+
hash = (hash << 5) + hash + raw.charCodeAt(i2) | 0;
|
|
562538
|
+
return `{size:${raw.length},hash:${Math.abs(hash).toString(36)}}`;
|
|
562539
|
+
}
|
|
562506
562540
|
const record = value2;
|
|
562507
562541
|
return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${stableValueKey(record[key])}`).join(",")}}`;
|
|
562508
562542
|
}
|
|
@@ -595676,6 +595710,20 @@ function buildToolDivider(width, colorCode) {
|
|
|
595676
595710
|
const border = toolColorSeq(colorCode);
|
|
595677
595711
|
return `${border}${BOX_TJ_L2}${BOX_H2.repeat(Math.max(0, width - 2))}${BOX_TJ_R2}${toolResetSeq()}`;
|
|
595678
595712
|
}
|
|
595713
|
+
function buildRoutingHeader(title, _metrics, width, colorCode, _metricsColorCode = 222) {
|
|
595714
|
+
const border = toolColorSeq(colorCode);
|
|
595715
|
+
const titleColor = toolColorSeq(colorCode, true);
|
|
595716
|
+
const reset = toolResetSeq();
|
|
595717
|
+
const w = Math.max(40, width);
|
|
595718
|
+
const titleVisible = stripAnsi(title);
|
|
595719
|
+
const titleChip = ` ${titleVisible} `;
|
|
595720
|
+
const shortBoxWidth = titleChip.length + 7;
|
|
595721
|
+
const line1 = `${border}${BOX_TL2}${BOX_H2}${border}${BOX_TJ_L2}${titleColor}${titleChip}${reset}${border}${BOX_TJ_R2}${BOX_H2}${BOX_H2}${BOX_TR2}${reset}`;
|
|
595722
|
+
const gap = Math.max(0, shortBoxWidth - 1);
|
|
595723
|
+
const dashCount = Math.max(0, w - shortBoxWidth - 2);
|
|
595724
|
+
const line2 = `${border}${BOX_TJ_L2}${reset}` + " ".repeat(gap) + `${border}╰${BOX_H2.repeat(dashCount)}${BOX_TJ_R2}${reset}`;
|
|
595725
|
+
return [line1, line2];
|
|
595726
|
+
}
|
|
595679
595727
|
function buildToolBottom(width, colorCode) {
|
|
595680
595728
|
const border = toolColorSeq(colorCode);
|
|
595681
595729
|
return `${border}${BOX_BL2}${BOX_H2.repeat(Math.max(0, width - 2))}${BOX_BR2}${toolResetSeq()}`;
|
|
@@ -595821,26 +595869,38 @@ function buildCombinedToolBoxLines(toolName, callArgs, success, output, opts, wi
|
|
|
595821
595869
|
{ label: "Provenance", items: provenance }
|
|
595822
595870
|
];
|
|
595823
595871
|
const colorCode = success ? toolColorCode(toolName) : TOOL_ERROR_COLOR_CODE;
|
|
595824
|
-
const
|
|
595825
|
-
|
|
595872
|
+
const triggerTexts = formatToolArgsForBox(toolName, callArgs, opts.verbose);
|
|
595873
|
+
const lines = [];
|
|
595874
|
+
if (triggerTexts.length === 0) {
|
|
595875
|
+
const [r1, r2] = buildRoutingHeader(
|
|
595826
595876
|
`${status} ${label}`,
|
|
595827
595877
|
metrics2,
|
|
595828
595878
|
w,
|
|
595829
595879
|
colorCode,
|
|
595830
595880
|
success ? void 0 : TOOL_ERROR_COLOR_CODE
|
|
595831
|
-
)
|
|
595832
|
-
|
|
595833
|
-
|
|
595834
|
-
|
|
595835
|
-
|
|
595836
|
-
|
|
595837
|
-
|
|
595838
|
-
|
|
595839
|
-
|
|
595840
|
-
|
|
595881
|
+
);
|
|
595882
|
+
lines.push(r1, r2);
|
|
595883
|
+
} else {
|
|
595884
|
+
lines.push(
|
|
595885
|
+
buildToolTopBorder(
|
|
595886
|
+
`${status} ${label}`,
|
|
595887
|
+
metrics2,
|
|
595888
|
+
w,
|
|
595889
|
+
colorCode,
|
|
595890
|
+
success ? void 0 : TOOL_ERROR_COLOR_CODE
|
|
595891
|
+
)
|
|
595892
|
+
);
|
|
595893
|
+
for (const text2 of triggerTexts) {
|
|
595894
|
+
const pipe3 = " ";
|
|
595895
|
+
const chunks = wrapToolTextLine(text2, innerWidth, pipe3);
|
|
595896
|
+
for (const chunk of chunks) {
|
|
595897
|
+
lines.push(
|
|
595898
|
+
buildToolContentRow(formatToolBoxLine(chunk, "tool"), w, colorCode)
|
|
595899
|
+
);
|
|
595900
|
+
}
|
|
595841
595901
|
}
|
|
595902
|
+
lines.push(buildToolDivider(w, colorCode));
|
|
595842
595903
|
}
|
|
595843
|
-
lines.push(buildToolDivider(w, colorCode));
|
|
595844
595904
|
if (resultBody.length > 0) {
|
|
595845
595905
|
for (const bodyLine of resultBody) {
|
|
595846
595906
|
const text2 = sanitizeToolBoxContent(bodyLine.text);
|
|
@@ -596212,11 +596272,22 @@ function buildToolResultBody(toolName, success, output, verbose) {
|
|
|
596212
596272
|
}
|
|
596213
596273
|
if (toolName === "task_complete") {
|
|
596214
596274
|
const summary = output && output.trim() ? output : "Done";
|
|
596215
|
-
|
|
596275
|
+
const maxLines2 = resolveToolOutputMaxLines(verbose);
|
|
596276
|
+
const lines = summary.split("\n");
|
|
596277
|
+
const body = lines.slice(0, maxLines2).map((line) => ({
|
|
596216
596278
|
text: line,
|
|
596217
596279
|
mode: "wrap",
|
|
596218
596280
|
kind: "markdown"
|
|
596219
596281
|
}));
|
|
596282
|
+
const remaining = lines.length - maxLines2;
|
|
596283
|
+
if (remaining > 0) {
|
|
596284
|
+
body.push({
|
|
596285
|
+
text: `... ${remaining} more lines`,
|
|
596286
|
+
mode: "wrap",
|
|
596287
|
+
kind: "dim"
|
|
596288
|
+
});
|
|
596289
|
+
}
|
|
596290
|
+
return body;
|
|
596220
596291
|
}
|
|
596221
596292
|
const filtered = output.split("\n").map(sanitizeToolBoxContent).map((line) => debug ? line : stripTrustTierWrapperForTui(line)).filter((line) => {
|
|
596222
596293
|
const trimmed = line.trim();
|
|
@@ -645422,6 +645493,23 @@ function italicText(text2) {
|
|
|
645422
645493
|
function dimItalic(text2) {
|
|
645423
645494
|
return isTTY8 ? `\x1B[3m\x1B[38;5;${tuiTextDim()}m${text2}\x1B[0m` : text2;
|
|
645424
645495
|
}
|
|
645496
|
+
function thinkingBoxTop(width) {
|
|
645497
|
+
const inner = Math.max(4, width);
|
|
645498
|
+
const title = " Processing ";
|
|
645499
|
+
return `╭─┤${title}├${"─".repeat(Math.max(0, inner - 6 - title.length))}╮`;
|
|
645500
|
+
}
|
|
645501
|
+
function thinkingBoxRow(text2, width) {
|
|
645502
|
+
const inner = Math.max(1, width - 4);
|
|
645503
|
+
const plain = stripAnsi(text2);
|
|
645504
|
+
const truncated = plain.length > inner ? plain.slice(0, Math.max(1, inner - 1)) + "…" : text2;
|
|
645505
|
+
const plainLen = stripAnsi(truncated).length;
|
|
645506
|
+
const padding = " ".repeat(Math.max(0, inner - plainLen));
|
|
645507
|
+
return `│ ${truncated}${padding} │`;
|
|
645508
|
+
}
|
|
645509
|
+
function thinkingBoxBottom(width) {
|
|
645510
|
+
const inner = Math.max(4, width);
|
|
645511
|
+
return `╰${"─".repeat(inner - 2)}╯`;
|
|
645512
|
+
}
|
|
645425
645513
|
function boldText(text2) {
|
|
645426
645514
|
return isTTY8 ? `\x1B[1m${text2}\x1B[0m` : text2;
|
|
645427
645515
|
}
|
|
@@ -645547,6 +645635,9 @@ var init_stream_renderer = __esm({
|
|
|
645547
645635
|
thinkingIndicatorShown = false;
|
|
645548
645636
|
thinkingTokenCount = 0;
|
|
645549
645637
|
thinkingCache = "";
|
|
645638
|
+
/** Thinking box — compact bordered box for the thinking indicator */
|
|
645639
|
+
thinkingBoxOpen = false;
|
|
645640
|
+
thinkingBoxRowCount = 0;
|
|
645550
645641
|
write(token, kind) {
|
|
645551
645642
|
if (!this.enabled) return;
|
|
645552
645643
|
this.tokenCount++;
|
|
@@ -645554,6 +645645,9 @@ var init_stream_renderer = __esm({
|
|
|
645554
645645
|
this.thinkingTokenCount++;
|
|
645555
645646
|
if (token && !this.showThinking) this.thinkingCache += token;
|
|
645556
645647
|
if (this.showThinking) {
|
|
645648
|
+
if (this.thinkingBoxOpen) {
|
|
645649
|
+
this.closeThinkingBox(`buffered ${this.thinkingTokenCount} tokens`);
|
|
645650
|
+
}
|
|
645557
645651
|
for (const char of token) {
|
|
645558
645652
|
this.lineBuffer += char;
|
|
645559
645653
|
if (char === "\n") this.flushLine("thinking");
|
|
@@ -645561,23 +645655,26 @@ var init_stream_renderer = __esm({
|
|
|
645561
645655
|
this.scheduleFlush("thinking");
|
|
645562
645656
|
return;
|
|
645563
645657
|
} else {
|
|
645564
|
-
|
|
645565
|
-
|
|
645566
|
-
this.
|
|
645658
|
+
const w = termCols();
|
|
645659
|
+
if (!this.thinkingBoxOpen) {
|
|
645660
|
+
this.thinkingBoxOpen = true;
|
|
645661
|
+
this.thinkingBoxRowCount = 2;
|
|
645662
|
+
this.writeRaw(thinkingBoxTop(w) + "\n");
|
|
645663
|
+
this.writeRaw(thinkingBoxRow(dimItalic("processing..."), w) + "\n");
|
|
645567
645664
|
this.lineStarted = false;
|
|
645568
645665
|
}
|
|
645569
645666
|
if (this.thinkingTokenCount % 500 === 0) {
|
|
645570
|
-
this.
|
|
645571
|
-
|
|
645667
|
+
this.updateThinkingBox(
|
|
645668
|
+
`processing... (${this.thinkingTokenCount} tokens)`,
|
|
645669
|
+
w
|
|
645670
|
+
);
|
|
645572
645671
|
}
|
|
645573
645672
|
return;
|
|
645574
645673
|
}
|
|
645575
645674
|
}
|
|
645576
|
-
if (this.
|
|
645577
|
-
this.
|
|
645578
|
-
this.writeRaw(dimText(" │ ") + dimItalic(`thought for ${this.thinkingTokenCount} tokens`) + "\n");
|
|
645675
|
+
if (this.thinkingBoxOpen && kind === "content") {
|
|
645676
|
+
this.closeThinkingBox(`thought for ${this.thinkingTokenCount} tokens`);
|
|
645579
645677
|
this.thinkingTokenCount = 0;
|
|
645580
|
-
this.lineStarted = false;
|
|
645581
645678
|
}
|
|
645582
645679
|
if (kind === "tool_args" && !this.inToolArgs) {
|
|
645583
645680
|
this.flushPartial(kind);
|
|
@@ -645603,6 +645700,9 @@ var init_stream_renderer = __esm({
|
|
|
645603
645700
|
this.writeHighlighted(this.lineBuffer, kind);
|
|
645604
645701
|
this.lineBuffer = "";
|
|
645605
645702
|
}
|
|
645703
|
+
if (this.thinkingBoxOpen) {
|
|
645704
|
+
this.closeThinkingBox(`processed ${this.thinkingTokenCount} tokens`);
|
|
645705
|
+
}
|
|
645606
645706
|
if (this.lineStarted) {
|
|
645607
645707
|
process.stdout.write("\n");
|
|
645608
645708
|
this.lineStarted = false;
|
|
@@ -645636,7 +645736,11 @@ var init_stream_renderer = __esm({
|
|
|
645636
645736
|
if (line.includes("<think>")) {
|
|
645637
645737
|
this.inThinkBlock = true;
|
|
645638
645738
|
const after = line.replace(/<think>/g, "");
|
|
645639
|
-
if (after.trim())
|
|
645739
|
+
if (after.trim())
|
|
645740
|
+
this.writeHighlighted(
|
|
645741
|
+
after,
|
|
645742
|
+
this.showThinking ? "thinking" : "content"
|
|
645743
|
+
);
|
|
645640
645744
|
return;
|
|
645641
645745
|
}
|
|
645642
645746
|
if (line.includes("</think>")) {
|
|
@@ -645723,7 +645827,9 @@ var init_stream_renderer = __esm({
|
|
|
645723
645827
|
const isLast = i2 === lines.length - 1;
|
|
645724
645828
|
const lp = isFirst ? usePrefix : " ";
|
|
645725
645829
|
const needsNewline = !isLast || trailingNewline;
|
|
645726
|
-
this.writeRaw(
|
|
645830
|
+
this.writeRaw(
|
|
645831
|
+
dimText(lp) + highlight(lines[i2]) + (needsNewline ? "\n" : "")
|
|
645832
|
+
);
|
|
645727
645833
|
}
|
|
645728
645834
|
this.lineStarted = !trailingNewline;
|
|
645729
645835
|
};
|
|
@@ -645767,10 +645873,33 @@ var init_stream_renderer = __esm({
|
|
|
645767
645873
|
this.writeRaw(dimText(prefix) + rendered + (hasNewline ? "\n" : ""));
|
|
645768
645874
|
this.lineStarted = !hasNewline;
|
|
645769
645875
|
}
|
|
645876
|
+
/** In-place update of the compact thinking box content row (cursor-up + rewrite) */
|
|
645877
|
+
updateThinkingBox(text2, width) {
|
|
645878
|
+
if (!this.thinkingBoxOpen) return;
|
|
645879
|
+
const update2 = `\x1B[${this.thinkingBoxRowCount}A` + thinkingBoxTop(width) + "\n" + thinkingBoxRow(dimItalic(text2), width) + "\n";
|
|
645880
|
+
this.writeRaw(update2);
|
|
645881
|
+
this.lineStarted = false;
|
|
645882
|
+
}
|
|
645883
|
+
/** Close the compact thinking box (cursor-up, rewrite with summary + bottom border) */
|
|
645884
|
+
closeThinkingBox(summary) {
|
|
645885
|
+
if (!this.thinkingBoxOpen) return;
|
|
645886
|
+
const w = termCols();
|
|
645887
|
+
const text2 = `\x1B[${this.thinkingBoxRowCount}A` + thinkingBoxTop(w) + "\n" + thinkingBoxRow(dimItalic(summary), w) + "\n" + thinkingBoxBottom(w) + "\n";
|
|
645888
|
+
this.writeRaw(text2);
|
|
645889
|
+
this.thinkingBoxOpen = false;
|
|
645890
|
+
this.thinkingBoxRowCount = 0;
|
|
645891
|
+
this.lineStarted = false;
|
|
645892
|
+
this.thinkingIndicatorShown = false;
|
|
645893
|
+
}
|
|
645770
645894
|
/** Toggle visibility of full thinking content */
|
|
645771
645895
|
setThinkingVisible(visible) {
|
|
645772
645896
|
this.showThinking = visible;
|
|
645773
|
-
if (visible)
|
|
645897
|
+
if (visible) {
|
|
645898
|
+
if (this.thinkingBoxOpen) {
|
|
645899
|
+
this.closeThinkingBox(`buffered ${this.thinkingTokenCount} tokens`);
|
|
645900
|
+
}
|
|
645901
|
+
this.thinkingCache = "";
|
|
645902
|
+
}
|
|
645774
645903
|
}
|
|
645775
645904
|
/** Emit the cached (pre-toggle) thinking content to stdout as dim italic
|
|
645776
645905
|
* lines. Uses writeRaw so _cursorCol / lineStarted tracking stays in sync
|
|
@@ -645875,7 +646004,8 @@ var init_stream_renderer = __esm({
|
|
|
645875
646004
|
looksLikeJsonBlob(text2) {
|
|
645876
646005
|
if (/\\u[0-9a-fA-F]{4}/.test(text2)) return true;
|
|
645877
646006
|
if (/^\s*\{?"content"\s*:/.test(text2)) return true;
|
|
645878
|
-
if (text2.includes("\\n") && this.looksLikeJson(text2) && text2.length > 100)
|
|
646007
|
+
if (text2.includes("\\n") && this.looksLikeJson(text2) && text2.length > 100)
|
|
646008
|
+
return true;
|
|
645879
646009
|
return false;
|
|
645880
646010
|
}
|
|
645881
646011
|
/**
|
|
@@ -645886,12 +646016,30 @@ var init_stream_renderer = __esm({
|
|
|
645886
646016
|
const colorKey = dim ? PASTEL.toolArg : PASTEL.key;
|
|
645887
646017
|
const colorStr = dim ? PASTEL.toolArg : PASTEL.string;
|
|
645888
646018
|
let result = line;
|
|
645889
|
-
result = result.replace(
|
|
645890
|
-
|
|
645891
|
-
|
|
645892
|
-
|
|
645893
|
-
result = result.replace(
|
|
645894
|
-
|
|
646019
|
+
result = result.replace(
|
|
646020
|
+
/"([^"]*)"(\s*:)/g,
|
|
646021
|
+
(_m, key, colon) => fg2564(colorKey, `"${key}"`) + fg2564(PASTEL.colon, colon)
|
|
646022
|
+
);
|
|
646023
|
+
result = result.replace(
|
|
646024
|
+
/(:\s*)"([^"]*)"/g,
|
|
646025
|
+
(_m, prefix, val) => fg2564(PASTEL.colon, prefix) + fg2564(colorStr, `"${val}"`)
|
|
646026
|
+
);
|
|
646027
|
+
result = result.replace(
|
|
646028
|
+
/(:\s*)(\d+\.?\d*)/g,
|
|
646029
|
+
(_m, prefix, num2) => fg2564(PASTEL.colon, prefix) + fg2564(PASTEL.number, num2)
|
|
646030
|
+
);
|
|
646031
|
+
result = result.replace(
|
|
646032
|
+
/(:\s*)(true|false)/g,
|
|
646033
|
+
(_m, prefix, bool) => fg2564(PASTEL.colon, prefix) + fg2564(PASTEL.boolean, bool)
|
|
646034
|
+
);
|
|
646035
|
+
result = result.replace(
|
|
646036
|
+
/(:\s*)(null)/g,
|
|
646037
|
+
(_m, prefix, n2) => fg2564(PASTEL.colon, prefix) + fg2564(PASTEL.null, n2)
|
|
646038
|
+
);
|
|
646039
|
+
result = result.replace(
|
|
646040
|
+
/([{}[\]])/g,
|
|
646041
|
+
(_m, b) => fg2564(PASTEL.bracket, b)
|
|
646042
|
+
);
|
|
645895
646043
|
return dim ? dimText(result) : result;
|
|
645896
646044
|
}
|
|
645897
646045
|
/**
|
|
@@ -645899,16 +646047,34 @@ var init_stream_renderer = __esm({
|
|
|
645899
646047
|
*/
|
|
645900
646048
|
highlightCode(line) {
|
|
645901
646049
|
let result = line;
|
|
645902
|
-
result = result.replace(
|
|
645903
|
-
|
|
645904
|
-
|
|
645905
|
-
|
|
646050
|
+
result = result.replace(
|
|
646051
|
+
/"([^"]*)"/g,
|
|
646052
|
+
(_m, s2) => fg2564(PASTEL.string, `"${s2}"`)
|
|
646053
|
+
);
|
|
646054
|
+
result = result.replace(
|
|
646055
|
+
/'([^']*)'/g,
|
|
646056
|
+
(_m, s2) => fg2564(PASTEL.string, `'${s2}'`)
|
|
646057
|
+
);
|
|
646058
|
+
result = result.replace(
|
|
646059
|
+
/\b(\d+\.?\d*)\b/g,
|
|
646060
|
+
(_m, n2) => fg2564(PASTEL.number, n2)
|
|
646061
|
+
);
|
|
646062
|
+
result = result.replace(
|
|
646063
|
+
/\b(true|false|null|undefined|None|True|False)\b/g,
|
|
646064
|
+
(_m, kw) => fg2564(PASTEL.boolean, kw)
|
|
646065
|
+
);
|
|
645906
646066
|
result = result.replace(
|
|
645907
646067
|
/\b(function|const|let|var|return|if|else|for|while|import|export|from|class|async|await|def|self|try|catch|finally|throw|new|typeof|instanceof|type|interface|enum|struct|impl|fn|pub|mod|use|match|trait|where|mut|ref|move|yield|switch|case|default|break|continue|do|in|of|extends|implements|super|this|static|abstract|override|readonly|declare|namespace|package|func|go|chan|select|defer|range|map)\b/g,
|
|
645908
646068
|
(_m, kw) => fg2564(PASTEL.keyword, kw)
|
|
645909
646069
|
);
|
|
645910
|
-
result = result.replace(
|
|
645911
|
-
|
|
646070
|
+
result = result.replace(
|
|
646071
|
+
/:\s*([A-Z]\w*)/g,
|
|
646072
|
+
(_m, t2) => ": " + fg2564(147, t2)
|
|
646073
|
+
);
|
|
646074
|
+
result = result.replace(
|
|
646075
|
+
/(\/\/.*$|#.*$)/gm,
|
|
646076
|
+
(_m, cm) => fg2564(PASTEL.comment, cm)
|
|
646077
|
+
);
|
|
645912
646078
|
return result;
|
|
645913
646079
|
}
|
|
645914
646080
|
// -------------------------------------------------------------------------
|
|
@@ -645956,16 +646122,34 @@ var init_stream_renderer = __esm({
|
|
|
645956
646122
|
return fg2564(PASTEL.comment, line);
|
|
645957
646123
|
}
|
|
645958
646124
|
let result = line;
|
|
645959
|
-
result = result.replace(
|
|
645960
|
-
|
|
645961
|
-
|
|
645962
|
-
|
|
645963
|
-
result = result.replace(
|
|
646125
|
+
result = result.replace(
|
|
646126
|
+
/"([^"]*)"/g,
|
|
646127
|
+
(_m, s2) => fg2564(PASTEL.string, `"${s2}"`)
|
|
646128
|
+
);
|
|
646129
|
+
result = result.replace(
|
|
646130
|
+
/'([^']*)'/g,
|
|
646131
|
+
(_m, s2) => fg2564(PASTEL.string, `'${s2}'`)
|
|
646132
|
+
);
|
|
646133
|
+
result = result.replace(
|
|
646134
|
+
/(\$\{[^}]+\}|\$[A-Za-z_]\w*|\$[0-9?@#*!$-])/g,
|
|
646135
|
+
(_m, v) => fg2564(PASTEL.shellVar, v)
|
|
646136
|
+
);
|
|
646137
|
+
result = result.replace(
|
|
646138
|
+
/((?:^|\s))(--?[a-zA-Z][\w-]*)/g,
|
|
646139
|
+
(_m, ws, flag) => ws + fg2564(PASTEL.shellFlag, flag)
|
|
646140
|
+
);
|
|
646141
|
+
result = result.replace(
|
|
646142
|
+
/(\|{1,2}|>{1,2}|<{1,2}|&{1,2}|;)/g,
|
|
646143
|
+
(_m, op) => fg2564(PASTEL.shellOp, op)
|
|
646144
|
+
);
|
|
645964
646145
|
result = result.replace(
|
|
645965
646146
|
/^(\s*)(npm|npx|node|pnpm|yarn|git|docker|kubectl|curl|wget|cat|grep|find|ls|cd|cp|mv|rm|mkdir|chmod|chown|echo|printf|sed|awk|sort|uniq|head|tail|wc|tar|gzip|make|cargo|go|pip|python|python3|ruby|gem|brew|apt|yum|dnf|pacman|sudo|ssh|scp|rsync|man)\b/,
|
|
645966
646147
|
(_m, ws, cmd) => ws + boldText(fg2564(PASTEL.keyword, cmd))
|
|
645967
646148
|
);
|
|
645968
|
-
result = result.replace(
|
|
646149
|
+
result = result.replace(
|
|
646150
|
+
/(#[^{].*$)/gm,
|
|
646151
|
+
(_m, cm) => fg2564(PASTEL.comment, cm)
|
|
646152
|
+
);
|
|
645969
646153
|
return result;
|
|
645970
646154
|
}
|
|
645971
646155
|
// -------------------------------------------------------------------------
|
|
@@ -645979,7 +646163,14 @@ var init_stream_renderer = __esm({
|
|
|
645979
646163
|
if (headingMatch) {
|
|
645980
646164
|
const level = headingMatch[1].length;
|
|
645981
646165
|
const text2 = headingMatch[2];
|
|
645982
|
-
const colors2 = [
|
|
646166
|
+
const colors2 = [
|
|
646167
|
+
PASTEL.heading1,
|
|
646168
|
+
PASTEL.heading2,
|
|
646169
|
+
PASTEL.heading3,
|
|
646170
|
+
PASTEL.heading3,
|
|
646171
|
+
183,
|
|
646172
|
+
183
|
|
646173
|
+
];
|
|
645983
646174
|
return boldText(fg2564(colors2[level - 1] ?? 147, text2));
|
|
645984
646175
|
}
|
|
645985
646176
|
if (/^[-*_]{3,}\s*$/.test(line)) {
|
|
@@ -646005,13 +646196,34 @@ var init_stream_renderer = __esm({
|
|
|
646005
646196
|
*/
|
|
646006
646197
|
highlightInline(text2) {
|
|
646007
646198
|
let result = text2;
|
|
646008
|
-
result = result.replace(
|
|
646009
|
-
|
|
646010
|
-
|
|
646011
|
-
|
|
646012
|
-
result = result.replace(
|
|
646013
|
-
|
|
646014
|
-
|
|
646199
|
+
result = result.replace(
|
|
646200
|
+
/`([^`]+)`/g,
|
|
646201
|
+
(_m, code8) => fg2564(PASTEL.inlineCode, code8)
|
|
646202
|
+
);
|
|
646203
|
+
result = result.replace(
|
|
646204
|
+
/\*{3}([^*]+)\*{3}/g,
|
|
646205
|
+
(_m, t2) => boldText(italicText(t2))
|
|
646206
|
+
);
|
|
646207
|
+
result = result.replace(
|
|
646208
|
+
/\*{2}([^*]+)\*{2}/g,
|
|
646209
|
+
(_m, t2) => boldText(t2)
|
|
646210
|
+
);
|
|
646211
|
+
result = result.replace(
|
|
646212
|
+
/(?<!\*)\*([^*]+)\*(?!\*)/g,
|
|
646213
|
+
(_m, t2) => italicText(t2)
|
|
646214
|
+
);
|
|
646215
|
+
result = result.replace(
|
|
646216
|
+
/\[([^\]]+)\]\(([^)]+)\)/g,
|
|
646217
|
+
(_m, label, url) => boldText(fg2564(PASTEL.link, label)) + " " + dimText(fg2564(PASTEL.link, `(${url})`))
|
|
646218
|
+
);
|
|
646219
|
+
result = result.replace(
|
|
646220
|
+
/(?<!\w)__([^_]+)__(?!\w)/g,
|
|
646221
|
+
(_m, t2) => boldText(t2)
|
|
646222
|
+
);
|
|
646223
|
+
result = result.replace(
|
|
646224
|
+
/(?<!\w)_([^_]+)_(?!\w)/g,
|
|
646225
|
+
(_m, t2) => italicText(t2)
|
|
646226
|
+
);
|
|
646015
646227
|
result = result.replace(/~~([^~]+)~~/g, (_m, t2) => dimText(t2));
|
|
646016
646228
|
return result;
|
|
646017
646229
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.269",
|
|
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.269",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED