omnius 1.0.185 → 1.0.186
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 +39 -10
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -630107,7 +630107,19 @@ function previewTelegramAdminArgs(args, maxLength = 220) {
|
|
|
630107
630107
|
}
|
|
630108
630108
|
}
|
|
630109
630109
|
function telegramAdminLivePanelIntakeText(requestPreview) {
|
|
630110
|
-
|
|
630110
|
+
void requestPreview;
|
|
630111
|
+
return "";
|
|
630112
|
+
}
|
|
630113
|
+
function renderTelegramHalftoneProgressBar(elapsedSec, width = 12) {
|
|
630114
|
+
const safeWidth = Math.max(1, Math.floor(width));
|
|
630115
|
+
const phase = Math.max(0, elapsedSec) % 60 / 60 * safeWidth;
|
|
630116
|
+
const filled = Math.max(0, Math.min(safeWidth, Math.floor(phase)));
|
|
630117
|
+
const hasLead = filled < safeWidth;
|
|
630118
|
+
return [
|
|
630119
|
+
"█".repeat(filled),
|
|
630120
|
+
hasLead ? "▒" : "",
|
|
630121
|
+
"░".repeat(Math.max(0, safeWidth - filled - (hasLead ? 1 : 0)))
|
|
630122
|
+
].join("");
|
|
630111
630123
|
}
|
|
630112
630124
|
function createTelegramAdminLivePanelState(args) {
|
|
630113
630125
|
const now = args.now ?? Date.now();
|
|
@@ -630191,9 +630203,9 @@ function renderTelegramAdminLivePanelPayload(state) {
|
|
|
630191
630203
|
].filter(Boolean).join("\n");
|
|
630192
630204
|
let body;
|
|
630193
630205
|
if (state.activePage === "response") {
|
|
630194
|
-
const response = state.responseText
|
|
630206
|
+
const response = state.responseText.trim();
|
|
630195
630207
|
const clipped = response.length > 2600 ? `${response.slice(0, 2597).trimEnd()}...` : response;
|
|
630196
|
-
body = convertMarkdownToTelegramHTML(clipped);
|
|
630208
|
+
body = clipped ? convertMarkdownToTelegramHTML(clipped) : "";
|
|
630197
630209
|
} else if (state.activePage === "tools") {
|
|
630198
630210
|
const lines = state.toolLines.slice(-12);
|
|
630199
630211
|
body = lines.length > 0 ? `<blockquote>${escapeTelegramHTML(lines.join("\n"))}</blockquote>` : "<i>No tool calls yet.</i>";
|
|
@@ -633374,6 +633386,16 @@ ${mediaContext}` : ""
|
|
|
633374
633386
|
return void 0;
|
|
633375
633387
|
}
|
|
633376
633388
|
}
|
|
633389
|
+
telegramPollingDebugEnabled() {
|
|
633390
|
+
return process.env["OMNIUS_TELEGRAM_DEBUG_POLLING"] === "1";
|
|
633391
|
+
}
|
|
633392
|
+
telegramSendFailureIsExpectedCapabilityError(reason) {
|
|
633393
|
+
return /not enough rights to send text messages|can't send messages|cannot send messages|bot was blocked|chat not found/i.test(reason);
|
|
633394
|
+
}
|
|
633395
|
+
shouldLogTelegramSendFailure(reason) {
|
|
633396
|
+
if (process.env["OMNIUS_TELEGRAM_DEBUG_SEND_FAILURES"] === "1") return true;
|
|
633397
|
+
return !this.telegramSendFailureIsExpectedCapabilityError(reason);
|
|
633398
|
+
}
|
|
633377
633399
|
formatTelegramDeliveryCapabilityContext(sessionKey, msg) {
|
|
633378
633400
|
const capability = this.telegramTextDeliveryCapability(sessionKey, msg.chatId, msg.messageThreadId);
|
|
633379
633401
|
if (!capability) return "Telegram text delivery raw warning stream for this chat: none recorded.";
|
|
@@ -637451,7 +637473,9 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
|
|
|
637451
637473
|
return result.result?.message_id ?? null;
|
|
637452
637474
|
} catch (err) {
|
|
637453
637475
|
const errStr = err instanceof Error ? err.message : String(err);
|
|
637454
|
-
this.
|
|
637476
|
+
if (this.shouldLogTelegramSendFailure(errStr)) {
|
|
637477
|
+
this.tuiWrite(() => renderWarning(`Failed to send Telegram live message: ${errStr}`));
|
|
637478
|
+
}
|
|
637455
637479
|
this.updateTelegramTextDeliveryCapability(chatId, {
|
|
637456
637480
|
status: "failed",
|
|
637457
637481
|
reason: errStr,
|
|
@@ -637510,9 +637534,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
|
|
|
637510
637534
|
const sessionKey = this.sessionKeyForMessage(msg);
|
|
637511
637535
|
const activeInference = this.getTelegramActiveInferences().find((inf) => inf.sessionKey === sessionKey);
|
|
637512
637536
|
const status = activeInference ? activeInference.ttfbSec === void 0 ? `model request active; waiting for first token (${activeInference.kind}, ${activeInference.elapsedSec.toFixed(1)}s)` : `streaming ${activeInference.kind}; content=${activeInference.contentTokens}t thinking=${activeInference.thinkingTokens}t` : phase;
|
|
637513
|
-
const
|
|
637514
|
-
const filled = Math.min(width, Math.floor(elapsedSec % 60 / 60 * width));
|
|
637515
|
-
const bar = `[${"#".repeat(filled)}${"-".repeat(width - filled)}]`;
|
|
637537
|
+
const bar = renderTelegramHalftoneProgressBar(elapsedSec, 12);
|
|
637516
637538
|
return [
|
|
637517
637539
|
`<b>Working</b>`,
|
|
637518
637540
|
`<code>${bar}</code> ${elapsedSec}s`,
|
|
@@ -637593,6 +637615,9 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
|
|
|
637593
637615
|
updateTelegramAdminLivePanelFromEvent(subAgent, msg, event) {
|
|
637594
637616
|
const state = this.ensureTelegramAdminLivePanel(subAgent, msg);
|
|
637595
637617
|
applyTelegramAdminLivePanelEvent(state, event);
|
|
637618
|
+
if (state.messageId === void 0 && !state.responseText.trim()) {
|
|
637619
|
+
return;
|
|
637620
|
+
}
|
|
637596
637621
|
const now = Date.now();
|
|
637597
637622
|
if (state.messageId !== void 0 && now - subAgent.lastEditMs <= 900) return;
|
|
637598
637623
|
subAgent.lastEditMs = now;
|
|
@@ -641438,8 +641463,10 @@ ${text}`.trim());
|
|
|
641438
641463
|
ts: Date.now()
|
|
641439
641464
|
});
|
|
641440
641465
|
} catch (err) {
|
|
641441
|
-
this.tuiWrite(() => renderWarning(`Failed to send Telegram message: ${err instanceof Error ? err.message : String(err)}`));
|
|
641442
641466
|
const errStr = err instanceof Error ? err.message : String(err);
|
|
641467
|
+
if (this.shouldLogTelegramSendFailure(errStr)) {
|
|
641468
|
+
this.tuiWrite(() => renderWarning(`Failed to send Telegram message: ${errStr}`));
|
|
641469
|
+
}
|
|
641443
641470
|
this.updateTelegramTextDeliveryCapability(chatId, {
|
|
641444
641471
|
status: "failed",
|
|
641445
641472
|
reason: errStr,
|
|
@@ -642133,13 +642160,15 @@ ${caption}\r
|
|
|
642133
642160
|
this.stopTelegramPollingAfterFatal(reason);
|
|
642134
642161
|
return;
|
|
642135
642162
|
}
|
|
642136
|
-
this.
|
|
642163
|
+
if (this.telegramPollingDebugEnabled()) {
|
|
642164
|
+
this.tuiWrite(() => renderWarning(`Telegram polling warning: ${reason}`));
|
|
642165
|
+
}
|
|
642137
642166
|
await new Promise((r2) => setTimeout(r2, 5e3));
|
|
642138
642167
|
}
|
|
642139
642168
|
} catch (err) {
|
|
642140
642169
|
if (this.polling) {
|
|
642141
642170
|
const now = Date.now();
|
|
642142
|
-
if (now - this.telegramPollWarningLastAtMs > 3e4) {
|
|
642171
|
+
if (this.telegramPollingDebugEnabled() && now - this.telegramPollWarningLastAtMs > 3e4) {
|
|
642143
642172
|
this.telegramPollWarningLastAtMs = now;
|
|
642144
642173
|
this.tuiWrite(() => renderWarning(
|
|
642145
642174
|
`Telegram polling warning: getUpdates failed (${err instanceof Error ? err.message : String(err)}); long_poll_timeout=${longPollTimeoutSeconds}s client_deadline_ms=${this.telegramLongPollClientTimeoutMs(longPollTimeoutSeconds) ?? "none"}; retrying`
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.186",
|
|
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.186",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED