omnius 1.0.170 → 1.0.171
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 +60 -17
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -546736,14 +546736,30 @@ function estimateTokens2(text) {
|
|
|
546736
546736
|
function normalizeSignalContent(content) {
|
|
546737
546737
|
return content.replace(/\r\n/g, "\n").split("\n").map((line) => line.trimEnd()).join("\n").trim();
|
|
546738
546738
|
}
|
|
546739
|
+
function urlSpanAt(text, index) {
|
|
546740
|
+
URL_RE.lastIndex = 0;
|
|
546741
|
+
for (const match of text.matchAll(URL_RE)) {
|
|
546742
|
+
const start2 = match.index ?? 0;
|
|
546743
|
+
const end = start2 + match[0].length;
|
|
546744
|
+
if (start2 < index && index < end)
|
|
546745
|
+
return { start: start2, end };
|
|
546746
|
+
}
|
|
546747
|
+
return null;
|
|
546748
|
+
}
|
|
546739
546749
|
function truncateText2(text, maxChars) {
|
|
546740
546750
|
if (text.length <= maxChars)
|
|
546741
546751
|
return { text, truncated: false };
|
|
546742
546752
|
if (maxChars <= 40)
|
|
546743
546753
|
return { text: text.slice(0, maxChars), truncated: true };
|
|
546754
|
+
const suffix = CONTEXT_FABRIC_TRUNCATION_SUFFIX;
|
|
546755
|
+
let cutIndex = maxChars - suffix.length;
|
|
546756
|
+
const urlSpan = urlSpanAt(text, cutIndex);
|
|
546757
|
+
if (urlSpan) {
|
|
546758
|
+
cutIndex = urlSpan.start;
|
|
546759
|
+
}
|
|
546760
|
+
const prefix = text.slice(0, Math.max(0, cutIndex)).trimEnd();
|
|
546744
546761
|
return {
|
|
546745
|
-
text: `${
|
|
546746
|
-
... [truncated by context fabric]`,
|
|
546762
|
+
text: `${prefix}${suffix}`,
|
|
546747
546763
|
truncated: true
|
|
546748
546764
|
};
|
|
546749
546765
|
}
|
|
@@ -546812,7 +546828,7 @@ function signalFromBlock(kind, source, content, options2 = {}) {
|
|
|
546812
546828
|
metadata: options2.metadata
|
|
546813
546829
|
};
|
|
546814
546830
|
}
|
|
546815
|
-
var KIND_ORDER, KIND_LABELS, DEFAULT_KIND_CHAR_BUDGET, ContextLedger, ContextFrameBuilder;
|
|
546831
|
+
var KIND_ORDER, KIND_LABELS, DEFAULT_KIND_CHAR_BUDGET, URL_RE, CONTEXT_FABRIC_TRUNCATION_SUFFIX, ContextLedger, ContextFrameBuilder;
|
|
546816
546832
|
var init_context_fabric = __esm({
|
|
546817
546833
|
"packages/orchestrator/dist/context-fabric.js"() {
|
|
546818
546834
|
"use strict";
|
|
@@ -546864,6 +546880,8 @@ var init_context_fabric = __esm({
|
|
|
546864
546880
|
environment: 900,
|
|
546865
546881
|
compaction_summary: 1200
|
|
546866
546882
|
};
|
|
546883
|
+
URL_RE = /\bhttps?:\/\/[^\s<>"'()[\]{}]+/gi;
|
|
546884
|
+
CONTEXT_FABRIC_TRUNCATION_SUFFIX = "\n... [truncated by context fabric]";
|
|
546867
546885
|
ContextLedger = class {
|
|
546868
546886
|
signals = /* @__PURE__ */ new Map();
|
|
546869
546887
|
sequence = 0;
|
|
@@ -592291,7 +592309,7 @@ function extractMediaReferences(text) {
|
|
|
592291
592309
|
const offset = match[0].indexOf("MEDIA:");
|
|
592292
592310
|
addCandidate(value2, match[0].slice(offset), match.index + offset, match.index + match[0].length);
|
|
592293
592311
|
}
|
|
592294
|
-
for (const match of matchAll(
|
|
592312
|
+
for (const match of matchAll(URL_RE2, text)) {
|
|
592295
592313
|
const original = trimTrailingPunctuation(match[0]);
|
|
592296
592314
|
if (original.length !== match[0].length) {
|
|
592297
592315
|
addCandidate(original, original, match.index, match.index + original.length);
|
|
@@ -592415,7 +592433,7 @@ function decodeUri(value2) {
|
|
|
592415
592433
|
function trimTrailingPunctuation(value2) {
|
|
592416
592434
|
return value2.replace(/[),.;:!?]+$/, "");
|
|
592417
592435
|
}
|
|
592418
|
-
var IMAGE_EXT, AUDIO_EXT, VIDEO_EXT, DOC_EXT, MEDIA_DIRECTIVE_RE, AUDIO_AS_VOICE_RE, MARKDOWN_IMAGE_RE, HTML_IMG_RE,
|
|
592436
|
+
var IMAGE_EXT, AUDIO_EXT, VIDEO_EXT, DOC_EXT, MEDIA_DIRECTIVE_RE, AUDIO_AS_VOICE_RE, MARKDOWN_IMAGE_RE, HTML_IMG_RE, URL_RE2, LOCAL_PATH_RE;
|
|
592419
592437
|
var init_media_routing = __esm({
|
|
592420
592438
|
"packages/cli/src/tui/media-routing.ts"() {
|
|
592421
592439
|
"use strict";
|
|
@@ -592447,7 +592465,7 @@ var init_media_routing = __esm({
|
|
|
592447
592465
|
AUDIO_AS_VOICE_RE = /\[\[audio_as_voice\]\]/gi;
|
|
592448
592466
|
MARKDOWN_IMAGE_RE = /!\[[^\]]*]\(([^)\s]+)(?:\s+"[^"]*")?\)/g;
|
|
592449
592467
|
HTML_IMG_RE = /<img\b[^>]*\bsrc\s*=\s*["']([^"']+)["'][^>]*>/gi;
|
|
592450
|
-
|
|
592468
|
+
URL_RE2 = /\bhttps?:\/\/[^\s<>"')]+/gi;
|
|
592451
592469
|
LOCAL_PATH_RE = /(?:^|[\s([])((?:~|\/)[^\s<>"')\]]+\.(?:png|jpe?g|webp|gif|bmp|tiff?|svg|wav|mp3|ogg|oga|opus|m4a|flac|aac|mp4|mov|mkv|webm|avi|m4v|pdf|txt|md|markdown|csv|tsv|jsonl?|xlsx?|docx?|pptx?|html?|xml|zip|tar|gz))(?:$|[\s),.\]])/gim;
|
|
592452
592470
|
}
|
|
592453
592471
|
});
|
|
@@ -627420,7 +627438,7 @@ function parseTelegramReflectionFollowupDecision(text) {
|
|
|
627420
627438
|
}
|
|
627421
627439
|
}
|
|
627422
627440
|
function convertMarkdownToTelegramHTML(md) {
|
|
627423
|
-
let html = md;
|
|
627441
|
+
let html = normalizeTelegramOutboundLinks(md);
|
|
627424
627442
|
html = html.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
627425
627443
|
html = html.replace(
|
|
627426
627444
|
/```[\w]*\n([\s\S]*?)```/g,
|
|
@@ -627440,6 +627458,13 @@ function convertMarkdownToTelegramHTML(md) {
|
|
|
627440
627458
|
function escapeTelegramHTML(text) {
|
|
627441
627459
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
627442
627460
|
}
|
|
627461
|
+
function normalizeTelegramOutboundLinks(text) {
|
|
627462
|
+
if (!text) return text;
|
|
627463
|
+
return text.replace(
|
|
627464
|
+
TELEGRAM_SPACED_URL_RE,
|
|
627465
|
+
(match) => match.replace(/^(https?:\/\/)\s*/i, "$1").replace(/\s*\.\s*/g, ".").replace(/\s*:\s*(\d+)/g, ":$1")
|
|
627466
|
+
);
|
|
627467
|
+
}
|
|
627443
627468
|
function splitTelegramMessageText(text, maxLength = 3900) {
|
|
627444
627469
|
const trimmed = text.trim();
|
|
627445
627470
|
if (!trimmed) return [];
|
|
@@ -627545,7 +627570,7 @@ function stripTelegramStuckSelfTalk(text) {
|
|
|
627545
627570
|
return kept.join("\n\n");
|
|
627546
627571
|
}
|
|
627547
627572
|
function cleanTelegramVisibleReply(text, options2 = {}) {
|
|
627548
|
-
const clean5 = stripTelegramHiddenThinking(text).trim();
|
|
627573
|
+
const clean5 = normalizeTelegramOutboundLinks(stripTelegramHiddenThinking(text)).trim();
|
|
627549
627574
|
if (!clean5) return "";
|
|
627550
627575
|
if (options2.suppressPotentialNoReplyPrefix && isTelegramPotentialNoReplyPrefix(clean5)) return "";
|
|
627551
627576
|
if (isTelegramInternalStatusText(clean5)) return "";
|
|
@@ -628622,7 +628647,7 @@ function renderTelegramSubAgentError(username, error) {
|
|
|
628622
628647
|
process.stdout.write(` ${c3.dim("│")} ${c3.magenta("✘")} @${username}: ${c3.dim(preview)}
|
|
628623
628648
|
`);
|
|
628624
628649
|
}
|
|
628625
|
-
var TELEGRAM_TOOL_ACTION_GROUPS, TELEGRAM_TOOL_ACTION_GROUP, TELEGRAM_TOOL_MUTATING_GROUPS, DEFAULT_TELEGRAM_TOOL_GROUP_POLICY, TELEGRAM_TOOL_BUTTON_LABELS, TELEGRAM_SAFETY_PROMPT, ADMIN_DM_PROMPT, ADMIN_GROUP_PROMPT, TELEGRAM_PUBLIC_SOUL_PROFILE, TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT, TELEGRAM_PUBLIC_MEMORY_SCOPE_CONTRACT, TELEGRAM_PUBLIC_VISION_STACK_CONTRACT, GROUP_REPLY_DISCRETION_PROMPT, TELEGRAM_CHAT_MODE_PROMPT, ADMIN_CHAT_PROFILE_PROMPT, TELEGRAM_ACTION_RESPONSE_CONTRACT, TELEGRAM_EXTERNAL_ACQUISITION_CONTRACT, TELEGRAM_INTERACTION_DECISION_RESPONSE_FORMAT, TELEGRAM_INTERACTION_DECISION_MINIMAL_SCHEMA, TELEGRAM_INTERACTION_DECISION_REPAIR_SCHEMA, TELEGRAM_CHAT_REPLY_RESPONSE_FORMAT, TELEGRAM_STUCK_SELF_TALK_PREFIXES, TELEGRAM_CHAT_HISTORY_LIMIT, TELEGRAM_CONTEXT_RECENT_DEFAULT, TELEGRAM_CONTEXT_LINE_LIMIT, TELEGRAM_CONTEXT_SAMPLE_LIMIT, TELEGRAM_MEMORY_CARD_LIMIT, TELEGRAM_MEMORY_NOTE_LIMIT, TELEGRAM_ASSOCIATIVE_FACT_LIMIT, TELEGRAM_ASSOCIATIVE_USER_FACT_LIMIT, TELEGRAM_ASSOCIATIVE_ACTION_LIMIT, TELEGRAM_ASSOCIATIVE_RELATION_LIMIT, TELEGRAM_MEMORY_STOPWORDS, TELEGRAM_MEMORY_GENERIC_QUERY_TOKENS, TELEGRAM_SUB_AGENT_BOUNDED_OPTIONS, TELEGRAM_SUB_AGENT_DEFAULT_LIMIT, TELEGRAM_SUB_AGENT_MAX_LIMIT, TELEGRAM_SUB_AGENT_BURST_CONTEXT_LIMIT, TELEGRAM_PUBLIC_HELP_COMMANDS2, TELEGRAM_REMINDER_SLASH_COMMANDS, TELEGRAM_REFLECTION_SLASH_COMMANDS, TELEGRAM_PUBLIC_BOT_COMMAND_NAMES, TELEGRAM_IMAGE_EXTENSIONS, MEDIA_CACHE_TTL_MS, TELEGRAM_CHANNEL_DMN_SWEEP_MS, TELEGRAM_CHANNEL_DMN_IDLE_AFTER_MS, TELEGRAM_CHANNEL_DMN_MIN_INTERVAL_MS, TELEGRAM_CHANNEL_DMN_MIN_MESSAGES, TELEGRAM_ALLOWED_UPDATES, TELEGRAM_PUBLIC_TOOL_QUOTAS, TelegramBridge;
|
|
628650
|
+
var TELEGRAM_TOOL_ACTION_GROUPS, TELEGRAM_TOOL_ACTION_GROUP, TELEGRAM_TOOL_MUTATING_GROUPS, DEFAULT_TELEGRAM_TOOL_GROUP_POLICY, TELEGRAM_TOOL_BUTTON_LABELS, TELEGRAM_SAFETY_PROMPT, ADMIN_DM_PROMPT, ADMIN_GROUP_PROMPT, TELEGRAM_PUBLIC_SOUL_PROFILE, TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT, TELEGRAM_PUBLIC_MEMORY_SCOPE_CONTRACT, TELEGRAM_PUBLIC_VISION_STACK_CONTRACT, GROUP_REPLY_DISCRETION_PROMPT, TELEGRAM_CHAT_MODE_PROMPT, ADMIN_CHAT_PROFILE_PROMPT, TELEGRAM_ACTION_RESPONSE_CONTRACT, TELEGRAM_EXTERNAL_ACQUISITION_CONTRACT, TELEGRAM_LINK_INTEGRITY_CONTRACT, TELEGRAM_INTERACTION_DECISION_RESPONSE_FORMAT, TELEGRAM_INTERACTION_DECISION_MINIMAL_SCHEMA, TELEGRAM_INTERACTION_DECISION_REPAIR_SCHEMA, TELEGRAM_CHAT_REPLY_RESPONSE_FORMAT, TELEGRAM_SPACED_URL_RE, TELEGRAM_STUCK_SELF_TALK_PREFIXES, TELEGRAM_CHAT_HISTORY_LIMIT, TELEGRAM_CONTEXT_RECENT_DEFAULT, TELEGRAM_CONTEXT_LINE_LIMIT, TELEGRAM_CONTEXT_SAMPLE_LIMIT, TELEGRAM_MEMORY_CARD_LIMIT, TELEGRAM_MEMORY_NOTE_LIMIT, TELEGRAM_ASSOCIATIVE_FACT_LIMIT, TELEGRAM_ASSOCIATIVE_USER_FACT_LIMIT, TELEGRAM_ASSOCIATIVE_ACTION_LIMIT, TELEGRAM_ASSOCIATIVE_RELATION_LIMIT, TELEGRAM_MEMORY_STOPWORDS, TELEGRAM_MEMORY_GENERIC_QUERY_TOKENS, TELEGRAM_SUB_AGENT_BOUNDED_OPTIONS, TELEGRAM_SUB_AGENT_DEFAULT_LIMIT, TELEGRAM_SUB_AGENT_MAX_LIMIT, TELEGRAM_SUB_AGENT_BURST_CONTEXT_LIMIT, TELEGRAM_PUBLIC_HELP_COMMANDS2, TELEGRAM_REMINDER_SLASH_COMMANDS, TELEGRAM_REFLECTION_SLASH_COMMANDS, TELEGRAM_PUBLIC_BOT_COMMAND_NAMES, TELEGRAM_IMAGE_EXTENSIONS, MEDIA_CACHE_TTL_MS, TELEGRAM_CHANNEL_DMN_SWEEP_MS, TELEGRAM_CHANNEL_DMN_IDLE_AFTER_MS, TELEGRAM_CHANNEL_DMN_MIN_INTERVAL_MS, TELEGRAM_CHANNEL_DMN_MIN_MESSAGES, TELEGRAM_ALLOWED_UPDATES, TELEGRAM_PUBLIC_TOOL_QUOTAS, TelegramBridge;
|
|
628626
628651
|
var init_telegram_bridge = __esm({
|
|
628627
628652
|
"packages/cli/src/tui/telegram-bridge.ts"() {
|
|
628628
628653
|
"use strict";
|
|
@@ -628890,6 +628915,13 @@ External acquisition contract:
|
|
|
628890
628915
|
- Treat repeated invalid downloads (saved HTML/JSON/login pages instead of the expected file type) as the same blocker; do not retry past a small bounded number of attempts.
|
|
628891
628916
|
- The browser tool is for interactive web work; it does not save arbitrary rendered files to disk. For file acquisition, use the download/file tool and verify content-type + size before reporting success.
|
|
628892
628917
|
- Report the exact blocker concisely and offer lawful alternatives (library hold, official store, summary/discussion if the user supplies an authorized copy).
|
|
628918
|
+
`.trim();
|
|
628919
|
+
TELEGRAM_LINK_INTEGRITY_CONTRACT = `
|
|
628920
|
+
Telegram link integrity contract:
|
|
628921
|
+
- When sending public http(s) URLs, copy the URL exactly from source/tool output.
|
|
628922
|
+
- Never defang, space out, redact, or rewrite dots, slashes, host labels, or TLDs in normal public URLs.
|
|
628923
|
+
- Prefer Markdown links when helpful, but keep the href URL contiguous and parseable.
|
|
628924
|
+
- If you are uncertain a URL is real, say so or omit it instead of reconstructing a broken URL.
|
|
628893
628925
|
`.trim();
|
|
628894
628926
|
TELEGRAM_INTERACTION_DECISION_RESPONSE_FORMAT = {
|
|
628895
628927
|
type: "json_object"
|
|
@@ -628914,6 +628946,7 @@ External acquisition contract:
|
|
|
628914
628946
|
}
|
|
628915
628947
|
}
|
|
628916
628948
|
};
|
|
628949
|
+
TELEGRAM_SPACED_URL_RE = /\bhttps?:\/\/\s*[A-Za-z0-9-]+(?:\s*\.\s*[A-Za-z0-9-]+)+(?:\s*:\s*\d+)?(?:[/?#][^\s<>"'()[\]{}]*)?/gi;
|
|
628917
628950
|
TELEGRAM_STUCK_SELF_TALK_PREFIXES = [
|
|
628918
628951
|
/^i'?ve been stuck for\b/i,
|
|
628919
628952
|
/^i am (still |currently )?stuck\b/i,
|
|
@@ -634269,7 +634302,8 @@ Todo/session id: ${sessionId}
|
|
|
634269
634302
|
Profile: ${profile}
|
|
634270
634303
|
Tool context: ${toolContext}
|
|
634271
634304
|
${chatLabel}`,
|
|
634272
|
-
TELEGRAM_ACTION_RESPONSE_CONTRACT
|
|
634305
|
+
TELEGRAM_ACTION_RESPONSE_CONTRACT,
|
|
634306
|
+
TELEGRAM_LINK_INTEGRITY_CONTRACT
|
|
634273
634307
|
];
|
|
634274
634308
|
sections.push(conversationStream);
|
|
634275
634309
|
const sendTargetContext = this.buildTelegramSendTargetContext(msg, isAdminDM);
|
|
@@ -634638,10 +634672,11 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
|
|
|
634638
634672
|
* streamed content. Returns the message_id for subsequent edits.
|
|
634639
634673
|
*/
|
|
634640
634674
|
async sendLiveMessage(chatId, initialText, replyToMessageId) {
|
|
634675
|
+
const normalizedInitialText = normalizeTelegramOutboundLinks(initialText);
|
|
634641
634676
|
try {
|
|
634642
634677
|
const body = {
|
|
634643
634678
|
chat_id: chatId,
|
|
634644
|
-
text:
|
|
634679
|
+
text: normalizedInitialText,
|
|
634645
634680
|
parse_mode: "HTML"
|
|
634646
634681
|
};
|
|
634647
634682
|
const replyParameters = telegramReplyParameters(replyToMessageId);
|
|
@@ -634658,7 +634693,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
|
|
|
634658
634693
|
try {
|
|
634659
634694
|
const body = {
|
|
634660
634695
|
chat_id: chatId,
|
|
634661
|
-
text:
|
|
634696
|
+
text: normalizedInitialText
|
|
634662
634697
|
};
|
|
634663
634698
|
const replyParameters = telegramReplyParameters(replyToMessageId);
|
|
634664
634699
|
if (replyParameters) body["reply_parameters"] = replyParameters;
|
|
@@ -634693,7 +634728,8 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
|
|
|
634693
634728
|
* Handles rate limits and Telegram's "message is not modified" error silently.
|
|
634694
634729
|
*/
|
|
634695
634730
|
async editLiveMessage(chatId, messageId, html) {
|
|
634696
|
-
const
|
|
634731
|
+
const normalizedHtml = normalizeTelegramOutboundLinks(html);
|
|
634732
|
+
const truncated = normalizedHtml.length > 4e3 ? normalizedHtml.slice(0, 3950) + "\n\n<i>... (streaming)</i>" : normalizedHtml;
|
|
634697
634733
|
try {
|
|
634698
634734
|
const result = await this.apiCall("editMessageText", {
|
|
634699
634735
|
chat_id: chatId,
|
|
@@ -634706,7 +634742,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
|
|
|
634706
634742
|
return true;
|
|
634707
634743
|
} catch {
|
|
634708
634744
|
try {
|
|
634709
|
-
const plain =
|
|
634745
|
+
const plain = normalizedHtml.replace(/<[^>]+>/g, "");
|
|
634710
634746
|
const truncPlain = plain.length > 4e3 ? plain.slice(0, 3950) + "\n\n... (streaming)" : plain;
|
|
634711
634747
|
const result = await this.apiCall("editMessageText", {
|
|
634712
634748
|
chat_id: chatId,
|
|
@@ -635405,6 +635441,8 @@ ${TELEGRAM_PUBLIC_VISION_STACK_CONTRACT}`;
|
|
|
635405
635441
|
role: "system",
|
|
635406
635442
|
content: `${TELEGRAM_CHAT_MODE_PROMPT}
|
|
635407
635443
|
|
|
635444
|
+
${TELEGRAM_LINK_INTEGRITY_CONTRACT}
|
|
635445
|
+
|
|
635408
635446
|
## Runtime Context
|
|
635409
635447
|
|
|
635410
635448
|
${runtime}
|
|
@@ -635730,6 +635768,8 @@ ${GROUP_REPLY_DISCRETION_PROMPT}` : "";
|
|
|
635730
635768
|
|
|
635731
635769
|
${TELEGRAM_ACTION_RESPONSE_CONTRACT}
|
|
635732
635770
|
|
|
635771
|
+
${TELEGRAM_LINK_INTEGRITY_CONTRACT}
|
|
635772
|
+
|
|
635733
635773
|
${TELEGRAM_EXTERNAL_ACQUISITION_CONTRACT}
|
|
635734
635774
|
|
|
635735
635775
|
${reminderToolContract}
|
|
@@ -635742,6 +635782,7 @@ ${currentTelegramPrompt}`;
|
|
|
635742
635782
|
"You have access to isolated per-chat memory (memory_write, memory_read, memory_search) scoped to this conversation.",
|
|
635743
635783
|
"memory_search may use scope=group/current_chat for this group or scope=user with user_id/username for a participant in this same group. Other groups, admin chats, and private DMs are not accessible here.",
|
|
635744
635784
|
"You can remember facts about users and retrieve them later. Durable associative memory in the prompt includes participant profiles, relationships, scoped facts, and prior actions retained across days, sessions, and Omnius updates. You also have web_search and web_fetch to look up information.",
|
|
635785
|
+
TELEGRAM_LINK_INTEGRITY_CONTRACT,
|
|
635745
635786
|
"If a user explicitly states a durable preference for reply cadence/order, call telegram_preference_set. Do not infer or classify reply-mode preferences from keywords, style, tone, or task type.",
|
|
635746
635787
|
"You have the full scoped Telegram media-analysis stack by default: telegram_media_recent, image_read, ocr, ocr_image_advanced, vision, pdf_to_text, ocr_pdf, transcribe_file, video_understand, audio_analyze, and identity_memory. For complex textual imagery, screenshots, forms, scans, or dense labels, prefer ocr_image_advanced after resolving media with path='reply' or path='latest'.",
|
|
635747
635788
|
formatIdentityMemoryContext(chatLabel || "Telegram private chat"),
|
|
@@ -638322,9 +638363,10 @@ ${text}`.trim());
|
|
|
638322
638363
|
return result.messageId ?? null;
|
|
638323
638364
|
}
|
|
638324
638365
|
async sendMessageHTMLDetailed(chatId, html, replyToMessageId, options2 = {}) {
|
|
638325
|
-
const
|
|
638366
|
+
const normalizedHtml = normalizeTelegramOutboundLinks(html);
|
|
638367
|
+
const extracted = extractMediaReferences(normalizedHtml);
|
|
638326
638368
|
const mediaRefs = this.filterTelegramMediaReferences(extracted.media, options2);
|
|
638327
|
-
const sendHtml = extracted.text || (extracted.media.length > 0 ? "" :
|
|
638369
|
+
const sendHtml = extracted.text || (extracted.media.length > 0 ? "" : normalizedHtml);
|
|
638328
638370
|
let sentId = null;
|
|
638329
638371
|
if (!sendHtml.trim()) {
|
|
638330
638372
|
for (let idx = 0; idx < mediaRefs.length; idx++) {
|
|
@@ -638791,7 +638833,8 @@ Content-Type: ${mimeForPath(pathOrFileId, field === "photo" ? "image" : "video")
|
|
|
638791
638833
|
* article carrying the message text Telegram should send to the guest chat.
|
|
638792
638834
|
*/
|
|
638793
638835
|
async answerGuestQuery(guestQueryId, text, options2 = {}) {
|
|
638794
|
-
const
|
|
638836
|
+
const normalizedText = normalizeTelegramOutboundLinks(text);
|
|
638837
|
+
const truncated = normalizedText.length > 4e3 ? normalizedText.slice(0, 3950) + "\n\n... (truncated)" : normalizedText;
|
|
638795
638838
|
const inputMessageContent = {
|
|
638796
638839
|
message_text: truncated
|
|
638797
638840
|
};
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.171",
|
|
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.171",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED