omnius 1.0.172 → 1.0.173

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 CHANGED
@@ -627516,7 +627516,12 @@ function truncateTelegramUrlSafe(text, maxLength, suffix = "...") {
627516
627516
  if (maxLength <= suffix.length) return normalized.slice(0, maxLength);
627517
627517
  let cut = maxLength - suffix.length;
627518
627518
  const span = telegramUrlSpanAt(normalized, cut);
627519
- if (span) cut = span.start;
627519
+ if (span) {
627520
+ cut = span.start;
627521
+ const tagStart = normalized.lastIndexOf("<", cut);
627522
+ const tagEnd = normalized.lastIndexOf(">", cut);
627523
+ if (tagStart > tagEnd) cut = tagStart;
627524
+ }
627520
627525
  return `${normalized.slice(0, Math.max(0, cut)).trimEnd()}${suffix}`;
627521
627526
  }
627522
627527
  function splitTelegramMessageText(text, maxLength = 3900) {
@@ -634781,7 +634786,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
634781
634786
  */
634782
634787
  async editLiveMessage(chatId, messageId, html) {
634783
634788
  const normalizedHtml = normalizeTelegramOutboundLinks(html);
634784
- const truncated = normalizedHtml.length > 4e3 ? normalizedHtml.slice(0, 3950) + "\n\n<i>... (streaming)</i>" : normalizedHtml;
634789
+ const truncated = normalizedHtml.length > 4e3 ? truncateTelegramUrlSafe(normalizedHtml, 4e3, "\n\n<i>... (streaming)</i>") : normalizedHtml;
634785
634790
  try {
634786
634791
  const result = await this.apiCall("editMessageText", {
634787
634792
  chat_id: chatId,
@@ -634795,7 +634800,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
634795
634800
  } catch {
634796
634801
  try {
634797
634802
  const plain = normalizedHtml.replace(/<[^>]+>/g, "");
634798
- const truncPlain = plain.length > 4e3 ? plain.slice(0, 3950) + "\n\n... (streaming)" : plain;
634803
+ const truncPlain = plain.length > 4e3 ? truncateTelegramUrlSafe(plain, 4e3, "\n\n... (streaming)") : plain;
634799
634804
  const result = await this.apiCall("editMessageText", {
634800
634805
  chat_id: chatId,
634801
634806
  message_id: messageId,
@@ -637237,7 +637242,7 @@ Scoped workspace: ${scopedRoot}`,
637237
637242
  reply_to_message_id: entry.replyToMessageId,
637238
637243
  chat_type: entry.chatType,
637239
637244
  chat_title: entry.chatTitle,
637240
- text: redactTelegramLocalPaths(stripTelegramHiddenThinking(entry.text || "")).slice(0, 4e3)
637245
+ text: truncateTelegramUrlSafe(redactTelegramLocalPaths(stripTelegramHiddenThinking(entry.text || "")), 4e3)
637241
637246
  };
637242
637247
  if (entry.mediaSummary) {
637243
637248
  safe["media_summary"] = redactTelegramLocalPaths(entry.mediaSummary);
@@ -637248,13 +637253,13 @@ Scoped workspace: ${scopedRoot}`,
637248
637253
  source: entry.replyContext.source,
637249
637254
  message_id: entry.replyContext.messageId,
637250
637255
  sender: entry.replyContext.sender ? telegramReplySenderLabel(entry.replyContext.sender) : void 0,
637251
- text: entry.replyContext.text ? redactTelegramLocalPaths(stripTelegramHiddenThinking(entry.replyContext.text)).slice(0, 2e3) : void 0,
637252
- caption: entry.replyContext.caption ? redactTelegramLocalPaths(entry.replyContext.caption).slice(0, 1200) : void 0,
637256
+ text: entry.replyContext.text ? truncateTelegramUrlSafe(redactTelegramLocalPaths(stripTelegramHiddenThinking(entry.replyContext.text)), 2e3) : void 0,
637257
+ caption: entry.replyContext.caption ? truncateTelegramUrlSafe(redactTelegramLocalPaths(entry.replyContext.caption), 1200) : void 0,
637253
637258
  media_summary: entry.replyContext.mediaSummary ? redactTelegramLocalPaths(entry.replyContext.mediaSummary) : void 0
637254
637259
  };
637255
637260
  }
637256
637261
  if (includePrivate && entry.generatedMediaPromptInfo?.originalPrompt) {
637257
- safe["generated_image_prompt"] = redactTelegramLocalPaths(entry.generatedMediaPromptInfo.originalPrompt).slice(0, 2e3);
637262
+ safe["generated_image_prompt"] = truncateTelegramUrlSafe(redactTelegramLocalPaths(entry.generatedMediaPromptInfo.originalPrompt), 2e3);
637258
637263
  }
637259
637264
  return safe;
637260
637265
  }
@@ -638886,7 +638891,7 @@ Content-Type: ${mimeForPath(pathOrFileId, field === "photo" ? "image" : "video")
638886
638891
  */
638887
638892
  async answerGuestQuery(guestQueryId, text, options2 = {}) {
638888
638893
  const normalizedText = normalizeTelegramOutboundLinks(text);
638889
- const truncated = normalizedText.length > 4e3 ? normalizedText.slice(0, 3950) + "\n\n... (truncated)" : normalizedText;
638894
+ const truncated = normalizedText.length > 4e3 ? truncateTelegramUrlSafe(normalizedText, 4e3, "\n\n... (truncated)") : normalizedText;
638890
638895
  const inputMessageContent = {
638891
638896
  message_text: truncated
638892
638897
  };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.172",
3
+ "version": "1.0.173",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.172",
9
+ "version": "1.0.173",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.172",
3
+ "version": "1.0.173",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",