omnius 1.0.46 → 1.0.47
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/README.md +3 -3
- package/dist/index.js +94 -34
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3606,7 +3606,7 @@ While the sub-agent is working, users see:
|
|
|
3606
3606
|
|
|
3607
3607
|
### Public User Isolation
|
|
3608
3608
|
|
|
3609
|
-
Public users get **per-chat isolated memory** — each chat is stored with explicit multimodal scope (`scope.kind = "group"|"private"`, `scope.id = chatId`) so public users can store and retrieve facts about their conversation without accessing or polluting unrelated chat memory. Public tools include: `memory_read`, `memory_write` (scoped), `memory_search`, `identity_memory` (scoped explicit identity evidence), `web_search`, `web_fetch`, and scoped minimal reminders via `reminder`/`remind`.
|
|
3609
|
+
Public users get **per-chat isolated memory** — each chat is stored with explicit multimodal scope (`scope.kind = "group"|"private"`, `scope.id = chatId`) so public users can store and retrieve facts about their conversation without accessing or polluting unrelated chat memory. Public tools include: `memory_read`, `memory_write` (scoped), `memory_search`, `identity_memory` (scoped explicit identity evidence), `web_search`, `web_fetch`, scoped advanced media analysis (`telegram_media_recent`, `image_read`, `ocr`, `ocr_image_advanced`, `vision`, `pdf_to_text`, `ocr_pdf`, `transcribe_file`, `video_understand`, `audio_analyze`), and scoped minimal reminders via `reminder`/`remind`.
|
|
3610
3610
|
|
|
3611
3611
|
The bridge also maintains a per-chat conversation state file with recent history, participants, relationship signals, and lightweight Zettelkasten memory cards. Each Telegram group or private chat gets its own scoped personality document under `.omnius/scoped-personality/telegram-chat/`; that profile is updated as people talk and injected into future Telegram context so tone, pacing, names, and relationships stay available turn to turn.
|
|
3612
3612
|
|
|
@@ -3627,8 +3627,8 @@ Tools are gated per execution context. The system enforces strict separation bet
|
|
|
3627
3627
|
|---------|--------------|-------|
|
|
3628
3628
|
| `terminal` | All tools | Wide open — shell, file read/write, everything |
|
|
3629
3629
|
| `telegram-admin-dm` | All except shell + scoped `telegram` tool | Admin DM — full tools, shell blocked by default (overridable); Telegram janitorial/moderation actions still require explicit policy and Bot API rights |
|
|
3630
|
-
| `telegram-admin-group` |
|
|
3631
|
-
| `telegram-public` |
|
|
3630
|
+
| `telegram-admin-group` | Scoped memory + web + advanced vision/OCR/media tools + scoped reminders + scoped `telegram` tool | Admin in public group — current-chat only; high-risk Telegram actions require policy enablement |
|
|
3631
|
+
| `telegram-public` | Scoped memory + web fetch/search + advanced current-chat vision/OCR/media tools + scoped creative tools + scoped minimal reminders + read/media `telegram` actions | Public users — no arbitrary local file access, shell, moderation, bot-admin, or janitorial actions |
|
|
3632
3632
|
| `api` | All tools | API endpoint — configurable |
|
|
3633
3633
|
|
|
3634
3634
|
**System tools** (`shell`, `file_write`, `file_edit`, `file_read`, `file_patch`, `batch_edit`, `grep_search`, `glob_find`, `list_directory`, `code_sandbox`, `codebase_map`, `git_info`, etc.) are **never exposed** in public-facing contexts.
|
package/dist/index.js
CHANGED
|
@@ -601148,6 +601148,7 @@ var init_tool_policy = __esm({
|
|
|
601148
601148
|
"memory_read",
|
|
601149
601149
|
"memory_write",
|
|
601150
601150
|
"memory_search",
|
|
601151
|
+
"identity_memory",
|
|
601151
601152
|
"todo_read",
|
|
601152
601153
|
"todo_write",
|
|
601153
601154
|
"web_search",
|
|
@@ -601180,6 +601181,7 @@ var init_tool_policy = __esm({
|
|
|
601180
601181
|
"memory_read",
|
|
601181
601182
|
"memory_write",
|
|
601182
601183
|
"memory_search",
|
|
601184
|
+
"identity_memory",
|
|
601183
601185
|
"todo_read",
|
|
601184
601186
|
"todo_write",
|
|
601185
601187
|
"web_search",
|
|
@@ -603783,6 +603785,32 @@ function summarizeTelegramMessageAttachments(msg) {
|
|
|
603783
603785
|
}
|
|
603784
603786
|
return parts.join("; ");
|
|
603785
603787
|
}
|
|
603788
|
+
function formatTelegramGeneratedImagePromptInfo(info, maxPromptLength = 900) {
|
|
603789
|
+
if (!info?.originalPrompt) return "";
|
|
603790
|
+
const lines = [
|
|
603791
|
+
`Generated image original prompt:
|
|
603792
|
+
${quoteTelegramContextText(info.originalPrompt, maxPromptLength)}`
|
|
603793
|
+
];
|
|
603794
|
+
if (info.promptWasExpanded && info.expandedPrompt && info.expandedPrompt.trim() !== info.originalPrompt.trim()) {
|
|
603795
|
+
lines.push(`Generated image expanded prompt actually sent to image model:
|
|
603796
|
+
${quoteTelegramContextText(info.expandedPrompt, maxPromptLength)}`);
|
|
603797
|
+
}
|
|
603798
|
+
const meta = [
|
|
603799
|
+
info.model ? `model=${info.model}` : "",
|
|
603800
|
+
info.backend ? `backend=${info.backend}` : "",
|
|
603801
|
+
info.width && info.height ? `size=${info.width}x${info.height}` : "",
|
|
603802
|
+
info.aspectRatio ? `aspect=${info.aspectRatio}` : "",
|
|
603803
|
+
info.seed !== void 0 && info.seed !== null ? `seed=${info.seed}` : "",
|
|
603804
|
+
info.createdAt ? `created_at=${info.createdAt}` : ""
|
|
603805
|
+
].filter(Boolean).join(", ");
|
|
603806
|
+
if (meta) lines.push(`Generated image metadata: ${meta}`);
|
|
603807
|
+
return lines.join("\n");
|
|
603808
|
+
}
|
|
603809
|
+
function quoteTelegramContextText(text, maxLength) {
|
|
603810
|
+
const clipped = text.length > maxLength ? `${text.slice(0, Math.max(0, maxLength - 60)).trimEnd()}
|
|
603811
|
+
[generated prompt truncated]` : text;
|
|
603812
|
+
return clipped.split(/\r?\n/).map((line) => `> ${line}`).join("\n");
|
|
603813
|
+
}
|
|
603786
603814
|
function inferTelegramToneTags(text) {
|
|
603787
603815
|
const lower = text.toLowerCase();
|
|
603788
603816
|
const tags = /* @__PURE__ */ new Set();
|
|
@@ -604641,7 +604669,7 @@ function renderTelegramSubAgentError(username, error) {
|
|
|
604641
604669
|
process.stdout.write(` ${c3.dim("⎿")} ${c3.red("✘")} @${username}: ${c3.dim(preview)}
|
|
604642
604670
|
`);
|
|
604643
604671
|
}
|
|
604644
|
-
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, GROUP_REPLY_DISCRETION_PROMPT, TELEGRAM_CHAT_MODE_PROMPT, ADMIN_CHAT_PROFILE_PROMPT, TELEGRAM_ACTION_RESPONSE_CONTRACT, TELEGRAM_EXTERNAL_ACQUISITION_CONTRACT, 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_MEMORY_STOPWORDS, TELEGRAM_SUB_AGENT_BOUNDED_OPTIONS, TELEGRAM_PUBLIC_HELP_COMMANDS, TELEGRAM_REMINDER_SLASH_COMMANDS, TELEGRAM_REFLECTION_SLASH_COMMANDS, 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, TelegramBridge;
|
|
604672
|
+
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_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_MEMORY_STOPWORDS, TELEGRAM_SUB_AGENT_BOUNDED_OPTIONS, TELEGRAM_PUBLIC_HELP_COMMANDS, TELEGRAM_REMINDER_SLASH_COMMANDS, TELEGRAM_REFLECTION_SLASH_COMMANDS, 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, TelegramBridge;
|
|
604645
604673
|
var init_telegram_bridge = __esm({
|
|
604646
604674
|
"packages/cli/src/tui/telegram-bridge.ts"() {
|
|
604647
604675
|
"use strict";
|
|
@@ -604787,7 +604815,7 @@ Although this is an admin, the group is PUBLIC — other people can see your res
|
|
|
604787
604815
|
|
|
604788
604816
|
RULES FOR GROUP CONTEXT:
|
|
604789
604817
|
1. NEVER share private information, API keys, file paths, or system internals
|
|
604790
|
-
2. You have limited tools: web search, memory, and media analysis only
|
|
604818
|
+
2. You have limited tools: scoped web search/fetch, scoped memory, scoped identity memory, and scoped media analysis only
|
|
604791
604819
|
3. Keep responses helpful and relevant to the conversation
|
|
604792
604820
|
4. Be concise — group chats should have shorter responses
|
|
604793
604821
|
5. Only respond if the message is directed at you or clearly relevant
|
|
@@ -604823,6 +604851,18 @@ PUBLIC TELEGRAM MEMORY SCOPE
|
|
|
604823
604851
|
This turn may use memory and conversation history for the current Telegram group/private chat scope only.
|
|
604824
604852
|
Users in a shared public group may ask questions about that shared group history and group memory, scoped by the current group id or by a user id/username inside that same group.
|
|
604825
604853
|
Private chats, admin DMs, other groups, local terminal sessions, and fragmented private contexts are not visible from this public group. Do not imply they exist and do not answer from them.
|
|
604854
|
+
`.trim();
|
|
604855
|
+
TELEGRAM_PUBLIC_VISION_STACK_CONTRACT = `
|
|
604856
|
+
PUBLIC TELEGRAM VISION / MEDIA STACK
|
|
604857
|
+
|
|
604858
|
+
Public Telegram runs have the full scoped media-analysis stack for media posted in this chat:
|
|
604859
|
+
- Use telegram_media_recent to find recent scoped media, then use path/media aliases 'reply' and 'latest' instead of exposing local paths to users.
|
|
604860
|
+
- Use ocr_image_advanced for complex textual imagery: screenshots, dense documents, forms, receipts, scans, diagrams with labels, low-contrast photos, or uneven lighting.
|
|
604861
|
+
- Use ocr for quick image text extraction, image_read for image metadata + OCR + multimodal image payload, and vision for captioning, visual QA, object detection, or pointing.
|
|
604862
|
+
- Use pdf_to_text for embedded-text PDFs and ocr_pdf for scanned PDFs.
|
|
604863
|
+
- Use video_understand and transcribe_file for video/audio media posted in this chat.
|
|
604864
|
+
- Use identity_memory for explicit user-provided identity assertions, staged next-image names, and "who is this?" recall from scoped media. Do not guess real identities from images.
|
|
604865
|
+
- These tools are current-chat scoped. Never inspect arbitrary local files, reveal local paths, or claim access to media outside this Telegram chat scope.
|
|
604826
604866
|
`.trim();
|
|
604827
604867
|
GROUP_REPLY_DISCRETION_PROMPT = `
|
|
604828
604868
|
REPLY DISCRETION: You are in a group chat. The live router has already filtered
|
|
@@ -605446,6 +605486,8 @@ ${this.quoteTelegramContextBlock(reply.quote, 1e3)}` : "",
|
|
|
605446
605486
|
${this.quoteTelegramContextBlock(content, 2200)}` : "",
|
|
605447
605487
|
reply.mediaSummary ? `Replied-to media: ${reply.mediaSummary}` : "",
|
|
605448
605488
|
reply.media && !reply.mediaSummary ? `Replied-to media: ${reply.media.type}${reply.media.fileName ? ` ${reply.media.fileName}` : ""}${reply.media.mimeType ? ` ${reply.media.mimeType}` : ""}` : "",
|
|
605489
|
+
reply.generatedMediaPromptInfo ? `Replied-to generated image provenance:
|
|
605490
|
+
${formatTelegramGeneratedImagePromptInfo(reply.generatedMediaPromptInfo, 1400)}` : "",
|
|
605449
605491
|
msg.text ? `Current user message:
|
|
605450
605492
|
${this.quoteTelegramContextBlock(msg.text, 1e3)}` : "",
|
|
605451
605493
|
'Instruction: resolve pronouns, follow-up requests, and requests like "links", "repos", "instructions", "that", or "this" against the replied-to content before broader chat/workspace context.'
|
|
@@ -606397,8 +606439,9 @@ ${olderLines.join("\n")}`);
|
|
|
606397
606439
|
const replySender = entry.replyContext?.sender ? `/${telegramReplySenderLabel(entry.replyContext.sender)}` : "";
|
|
606398
606440
|
const reply = entry.replyToMessageId ? ` reply_to:${entry.replyToMessageId}${replySender}` : "";
|
|
606399
606441
|
const media = entry.mediaSummary ? ` [${entry.mediaSummary}]` : "";
|
|
606442
|
+
const generatedPrompt = entry.generatedMediaPromptInfo?.originalPrompt ? ` generated_image_prompt="${truncateTelegramContextLine(entry.generatedMediaPromptInfo.originalPrompt, 220)}"` : "";
|
|
606400
606443
|
const prefix = [when, `${speaker}${mode}${reply}${media}`].filter(Boolean).join(" ");
|
|
606401
|
-
return `${prefix}: ${truncateTelegramContextLine(entry.text)}`;
|
|
606444
|
+
return `${prefix}: ${truncateTelegramContextLine(entry.text)}${generatedPrompt}`;
|
|
606402
606445
|
});
|
|
606403
606446
|
sections.push(`### Recent Thread, Oldest To Newest
|
|
606404
606447
|
${lines.join("\n")}`);
|
|
@@ -606508,7 +606551,7 @@ ${lines.join("\n")}`);
|
|
|
606508
606551
|
`Route meanings:`,
|
|
606509
606552
|
`- chat: a short conversational answer can be produced without tools.`,
|
|
606510
606553
|
`- action: tools, workspace context, media processing, web lookup, delegation, or a multi-step agent loop may be needed.`,
|
|
606511
|
-
`Route discipline: greetings, acknowledgements, casual tone/style discussion, and simple conversational questions are chat. Use action only when the message asks you to inspect, create, change, send, remember, search, analyze media, name/enroll/identify a person/face/voice from media, or otherwise do tool-backed work.`,
|
|
606554
|
+
`Route discipline: greetings, acknowledgements, casual tone/style discussion, and simple conversational questions are chat. Use action only when the message asks you to inspect, create, change, send, remember, search, analyze media, extract text from images/screenshots/forms/scans, name/enroll/identify a person/face/voice from media, or otherwise do tool-backed work.`,
|
|
606512
606555
|
``,
|
|
606513
606556
|
`Reply discretion: infer from the live thread, speaker relationships, direct platform signals, replies, tone, current message, and any private channel daydream artifact supplied in context. Do not use static keyword rules.`,
|
|
606514
606557
|
`Private chats: should_reply is normally true.`,
|
|
@@ -606786,6 +606829,8 @@ ${TELEGRAM_PUBLIC_SOUL_PROFILE}
|
|
|
606786
606829
|
|
|
606787
606830
|
${TELEGRAM_PUBLIC_MEMORY_SCOPE_CONTRACT}
|
|
606788
606831
|
|
|
606832
|
+
${TELEGRAM_PUBLIC_VISION_STACK_CONTRACT}
|
|
606833
|
+
|
|
606789
606834
|
${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
|
|
606790
606835
|
} else {
|
|
606791
606836
|
sections.push(`## Telegram Safety Contract
|
|
@@ -606796,6 +606841,8 @@ ${TELEGRAM_PUBLIC_SOUL_PROFILE}
|
|
|
606796
606841
|
|
|
606797
606842
|
${TELEGRAM_PUBLIC_MEMORY_SCOPE_CONTRACT}
|
|
606798
606843
|
|
|
606844
|
+
${TELEGRAM_PUBLIC_VISION_STACK_CONTRACT}
|
|
606845
|
+
|
|
606799
606846
|
${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
|
|
606800
606847
|
}
|
|
606801
606848
|
return { sessionKey, sessionId, context: sections.join("\n\n") };
|
|
@@ -607586,11 +607633,15 @@ Join: ${newUrl}`);
|
|
|
607586
607633
|
|
|
607587
607634
|
${TELEGRAM_PUBLIC_SOUL_PROFILE}
|
|
607588
607635
|
|
|
607589
|
-
${TELEGRAM_PUBLIC_MEMORY_SCOPE_CONTRACT}
|
|
607636
|
+
${TELEGRAM_PUBLIC_MEMORY_SCOPE_CONTRACT}
|
|
607637
|
+
|
|
607638
|
+
${TELEGRAM_PUBLIC_VISION_STACK_CONTRACT}` : `${TELEGRAM_SAFETY_PROMPT}
|
|
607590
607639
|
|
|
607591
607640
|
${TELEGRAM_PUBLIC_SOUL_PROFILE}
|
|
607592
607641
|
|
|
607593
|
-
${TELEGRAM_PUBLIC_MEMORY_SCOPE_CONTRACT}
|
|
607642
|
+
${TELEGRAM_PUBLIC_MEMORY_SCOPE_CONTRACT}
|
|
607643
|
+
|
|
607644
|
+
${TELEGRAM_PUBLIC_VISION_STACK_CONTRACT}`;
|
|
607594
607645
|
const groupHint = isGroup ? `Telegram group: ${msg.chatTitle || "unknown"}. The live router selected this turn as reply-worthy; keep the reply short and relevant. Never output a skip decision, no_reply marker, memory-stage note, or completion status.` : "Telegram private chat.";
|
|
607595
607646
|
const runtime = buildTelegramRuntimeContext(/* @__PURE__ */ new Date());
|
|
607596
607647
|
const messages2 = [
|
|
@@ -607854,6 +607905,7 @@ ${currentTelegramPrompt}`;
|
|
|
607854
607905
|
"You have access to isolated per-chat memory (memory_write, memory_read, memory_search) scoped to this conversation.",
|
|
607855
607906
|
"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.",
|
|
607856
607907
|
"You can remember facts about users and retrieve them later. You also have web_search and web_fetch to look up information.",
|
|
607908
|
+
"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'.",
|
|
607857
607909
|
formatIdentityMemoryContext(chatLabel || "Telegram private chat"),
|
|
607858
607910
|
reminderToolContract,
|
|
607859
607911
|
"If the user asks you to create an image, audio file, or document artifact, create it with the scoped creative tools. Freshly generated artifacts are recorded and automatically attached to this Telegram chat when the turn completes, so do not call telegram_send_file for those same artifacts unless the user asked for a specific caption, existing/unrecorded file, or non-default target.",
|
|
@@ -608188,6 +608240,8 @@ ${lines.join("\n\n")}` };
|
|
|
608188
608240
|
|
|
608189
608241
|
${TELEGRAM_PUBLIC_MEMORY_SCOPE_CONTRACT}
|
|
608190
608242
|
|
|
608243
|
+
${TELEGRAM_PUBLIC_VISION_STACK_CONTRACT}
|
|
608244
|
+
|
|
608191
608245
|
${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}
|
|
608192
608246
|
|
|
608193
608247
|
${conversation}`
|
|
@@ -609271,7 +609325,7 @@ Scoped workspace: ${scopedRoot}`,
|
|
|
609271
609325
|
const bridge = this;
|
|
609272
609326
|
return {
|
|
609273
609327
|
name: "telegram_media_recent",
|
|
609274
|
-
description: "List recent media files available in this Telegram chat scope, including safe aliases for image_read, ocr, vision, transcribe_file, pdf_to_text, video_understand, and audio_analyze.",
|
|
609328
|
+
description: "List recent media files available in this Telegram chat scope, including safe aliases for image_read, ocr, ocr_image_advanced, vision, identity_memory, transcribe_file, pdf_to_text, video_understand, and audio_analyze.",
|
|
609275
609329
|
parameters: {
|
|
609276
609330
|
type: "object",
|
|
609277
609331
|
properties: {
|
|
@@ -609426,7 +609480,8 @@ Scoped workspace: ${scopedRoot}`,
|
|
|
609426
609480
|
const messageId = await bridge.sendTelegramFileToChat(target.chatId, file.path, {
|
|
609427
609481
|
kind,
|
|
609428
609482
|
caption: caption || void 0,
|
|
609429
|
-
replyToMessageId
|
|
609483
|
+
replyToMessageId,
|
|
609484
|
+
sourcePromptPath: ledgerPath
|
|
609430
609485
|
});
|
|
609431
609486
|
bridge.rememberTelegramFileSendForMessage(currentMsg, sendFingerprint);
|
|
609432
609487
|
bridge.rememberTelegramDeliveredArtifactForMessage(currentMsg, ledgerPath);
|
|
@@ -609658,7 +609713,7 @@ ${knownList}` : "Private-user telegram_send_file target must be this DM or a kno
|
|
|
609658
609713
|
description = `[${sourceLabel}image received: ${localPath}${caption ? ` — caption: "${caption}"` : ""}
|
|
609659
609714
|
${visionContext}]`;
|
|
609660
609715
|
} else {
|
|
609661
|
-
description = `[${sourceLabel}image received and saved to ${localPath}${caption ? ` — caption: "${caption}"` : ""}. You can use image_read, ocr,
|
|
609716
|
+
description = `[${sourceLabel}image received and saved to ${localPath}${caption ? ` — caption: "${caption}"` : ""}. You can use image_read, ocr, ocr_image_advanced, vision, or identity_memory tools to analyze it.]`;
|
|
609662
609717
|
}
|
|
609663
609718
|
const ingestPayload = this.telegramMemoryIngestPayload(msg, media, localPath, source, cacheEntry.extractedContent);
|
|
609664
609719
|
let visualIdentityContext = "";
|
|
@@ -609926,7 +609981,7 @@ Content-Type: ${contentType}\r
|
|
|
609926
609981
|
this.state.messagesSent++;
|
|
609927
609982
|
const outboundMessageId = result.result?.message_id ?? null;
|
|
609928
609983
|
if (outboundMessageId && media.kind === "image" && media.source === "file") {
|
|
609929
|
-
this.recordOutboundGeneratedImagePrompt(chatId, outboundMessageId, media.value, caption);
|
|
609984
|
+
this.recordOutboundGeneratedImagePrompt(chatId, outboundMessageId, options2.sourcePromptPath ?? media.value, caption);
|
|
609930
609985
|
}
|
|
609931
609986
|
return outboundMessageId;
|
|
609932
609987
|
}
|
|
@@ -609940,30 +609995,7 @@ Content-Type: ${contentType}\r
|
|
|
609940
609995
|
* entry and exposes the original prompt to the model.
|
|
609941
609996
|
*/
|
|
609942
609997
|
recordOutboundGeneratedImagePrompt(chatId, messageId, imagePath, caption) {
|
|
609943
|
-
const
|
|
609944
|
-
if (!existsSync108(sidecarPath2)) return;
|
|
609945
|
-
let info = null;
|
|
609946
|
-
try {
|
|
609947
|
-
const raw = readFileSync88(sidecarPath2, "utf8");
|
|
609948
|
-
const parsed = JSON.parse(raw);
|
|
609949
|
-
if (parsed && typeof parsed === "object" && typeof parsed["original_prompt"] === "string") {
|
|
609950
|
-
info = {
|
|
609951
|
-
imagePath,
|
|
609952
|
-
originalPrompt: String(parsed["original_prompt"]),
|
|
609953
|
-
expandedPrompt: typeof parsed["expanded_prompt"] === "string" ? String(parsed["expanded_prompt"]) : void 0,
|
|
609954
|
-
promptWasExpanded: parsed["prompt_was_expanded"] === true,
|
|
609955
|
-
model: typeof parsed["model"] === "string" ? String(parsed["model"]) : void 0,
|
|
609956
|
-
backend: typeof parsed["backend"] === "string" ? String(parsed["backend"]) : void 0,
|
|
609957
|
-
width: typeof parsed["width"] === "number" ? parsed["width"] : void 0,
|
|
609958
|
-
height: typeof parsed["height"] === "number" ? parsed["height"] : void 0,
|
|
609959
|
-
aspectRatio: typeof parsed["aspect_ratio"] === "string" || parsed["aspect_ratio"] === null ? parsed["aspect_ratio"] : void 0,
|
|
609960
|
-
seed: typeof parsed["seed"] === "number" ? parsed["seed"] : null,
|
|
609961
|
-
createdAt: typeof parsed["created_at"] === "string" ? String(parsed["created_at"]) : void 0
|
|
609962
|
-
};
|
|
609963
|
-
}
|
|
609964
|
-
} catch {
|
|
609965
|
-
return;
|
|
609966
|
-
}
|
|
609998
|
+
const info = this.readGeneratedImagePromptInfo(imagePath);
|
|
609967
609999
|
if (!info) return;
|
|
609968
610000
|
const sessionKey = `chat:${String(chatId)}`;
|
|
609969
610001
|
const captionText = (caption ?? "").trim();
|
|
@@ -609984,6 +610016,32 @@ Content-Type: ${contentType}\r
|
|
|
609984
610016
|
} catch {
|
|
609985
610017
|
}
|
|
609986
610018
|
}
|
|
610019
|
+
readGeneratedImagePromptInfo(imagePath) {
|
|
610020
|
+
const sidecarPath2 = `${imagePath}.json`;
|
|
610021
|
+
if (!existsSync108(sidecarPath2)) return null;
|
|
610022
|
+
try {
|
|
610023
|
+
const raw = readFileSync88(sidecarPath2, "utf8");
|
|
610024
|
+
const parsed = JSON.parse(raw);
|
|
610025
|
+
if (!parsed || typeof parsed !== "object" || typeof parsed["original_prompt"] !== "string") {
|
|
610026
|
+
return null;
|
|
610027
|
+
}
|
|
610028
|
+
return {
|
|
610029
|
+
imagePath,
|
|
610030
|
+
originalPrompt: String(parsed["original_prompt"]),
|
|
610031
|
+
expandedPrompt: typeof parsed["expanded_prompt"] === "string" ? String(parsed["expanded_prompt"]) : void 0,
|
|
610032
|
+
promptWasExpanded: parsed["prompt_was_expanded"] === true,
|
|
610033
|
+
model: typeof parsed["model"] === "string" ? String(parsed["model"]) : void 0,
|
|
610034
|
+
backend: typeof parsed["backend"] === "string" ? String(parsed["backend"]) : void 0,
|
|
610035
|
+
width: typeof parsed["width"] === "number" ? parsed["width"] : void 0,
|
|
610036
|
+
height: typeof parsed["height"] === "number" ? parsed["height"] : void 0,
|
|
610037
|
+
aspectRatio: typeof parsed["aspect_ratio"] === "string" || parsed["aspect_ratio"] === null ? parsed["aspect_ratio"] : void 0,
|
|
610038
|
+
seed: typeof parsed["seed"] === "number" ? parsed["seed"] : null,
|
|
610039
|
+
createdAt: typeof parsed["created_at"] === "string" ? String(parsed["created_at"]) : void 0
|
|
610040
|
+
};
|
|
610041
|
+
} catch {
|
|
610042
|
+
return null;
|
|
610043
|
+
}
|
|
610044
|
+
}
|
|
609987
610045
|
async sendGeneratedArtifactsFromSubAgent(msg, subAgent, finalText, includeMentioned) {
|
|
609988
610046
|
const root = subAgent.creativeWorkspaceRoot;
|
|
609989
610047
|
if (!root) return;
|
|
@@ -610015,6 +610073,8 @@ Content-Type: ${contentType}\r
|
|
|
610015
610073
|
kind,
|
|
610016
610074
|
source: "file",
|
|
610017
610075
|
audioAsVoice: kind === "voice"
|
|
610076
|
+
}, {
|
|
610077
|
+
sourcePromptPath: abs
|
|
610018
610078
|
}).then((messageId) => {
|
|
610019
610079
|
if (messageId !== null) {
|
|
610020
610080
|
this.rememberTelegramDeliveredArtifact(subAgent, abs);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.47",
|
|
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.47",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED