omnius 1.0.69 → 1.0.71
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 +41 -27
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -609996,6 +609996,10 @@ function telegramHistoryTime(entry) {
|
|
|
609996
609996
|
minute: "2-digit"
|
|
609997
609997
|
});
|
|
609998
609998
|
}
|
|
609999
|
+
function formatTelegramIdentitySignals(signals) {
|
|
610000
|
+
const unique = [...new Set(signals.map((signal) => signal.trim()).filter(Boolean))];
|
|
610001
|
+
return unique.length > 0 ? unique.join(", ") : "none";
|
|
610002
|
+
}
|
|
609999
610003
|
function summarizeTelegramMessageAttachments(msg) {
|
|
610000
610004
|
const parts = [];
|
|
610001
610005
|
if (msg.media) {
|
|
@@ -610921,6 +610925,15 @@ function renderTelegramMessage(username, text) {
|
|
|
610921
610925
|
process.stdout.write(` ${c3.cyan("✈")} ${c3.bold(`@${username}`)}: ${preview}
|
|
610922
610926
|
`);
|
|
610923
610927
|
}
|
|
610928
|
+
function renderTelegramIngressMessage(msg) {
|
|
610929
|
+
const body = (msg.text || summarizeTelegramMessageAttachments(msg) || "[non-text Telegram message]").replace(/\s+/g, " ").trim();
|
|
610930
|
+
const preview = body.length > 96 ? body.slice(0, 93) + "..." : body;
|
|
610931
|
+
const chat = msg.chatType !== "private" ? ` ${c3.dim(`[${msg.chatTitle || msg.chatType}]`)}` : "";
|
|
610932
|
+
process.stdout.write(
|
|
610933
|
+
` ${c3.cyan("✈")} ${c3.dim("heard")}${chat} ${c3.bold(`@${msg.username || "unknown"}`)} ${c3.dim(`[${telegramActorKindLabel(msg)}]`)}: ${preview}
|
|
610934
|
+
`
|
|
610935
|
+
);
|
|
610936
|
+
}
|
|
610924
610937
|
function renderTelegramSubAgentStart(username, text, isAdmin) {
|
|
610925
610938
|
const preview = text.length > 60 ? text.slice(0, 57) + "..." : text;
|
|
610926
610939
|
const mode = isAdmin ? c3.green("admin") : c3.yellow("public");
|
|
@@ -611148,12 +611161,12 @@ Public Telegram runs have the full scoped media-analysis stack for media posted
|
|
|
611148
611161
|
- These tools are current-chat scoped. Never inspect arbitrary local files, reveal local paths, or claim access to media outside this Telegram chat scope.
|
|
611149
611162
|
`.trim();
|
|
611150
611163
|
GROUP_REPLY_DISCRETION_PROMPT = `
|
|
611151
|
-
REPLY DISCRETION: You are in a group chat. The live router
|
|
611152
|
-
|
|
611153
|
-
1.
|
|
611154
|
-
|
|
611155
|
-
2.
|
|
611156
|
-
|
|
611164
|
+
REPLY DISCRETION: You are in a group chat. The live router selected this turn
|
|
611165
|
+
using context, attention, and relationship signals. Continue that same approach:
|
|
611166
|
+
1. Use the supplied conversation context to decide whether a visible reply is
|
|
611167
|
+
socially appropriate for this specific turn.
|
|
611168
|
+
2. Treat direct address, replies, ongoing task continuity, and speaker intent as
|
|
611169
|
+
contextual evidence, not automatic triggers.
|
|
611157
611170
|
3. Do not reply just because you know an answer or could add color.
|
|
611158
611171
|
4. Peer bots are labeled as bots in context. Do not reflexively answer bot
|
|
611159
611172
|
chatter; only continue bot-to-bot exchanges when the message is clearly
|
|
@@ -611367,6 +611380,7 @@ External acquisition contract:
|
|
|
611367
611380
|
state = {
|
|
611368
611381
|
active: false,
|
|
611369
611382
|
botUsername: "",
|
|
611383
|
+
botFirstName: void 0,
|
|
611370
611384
|
supportsGuestQueries: false,
|
|
611371
611385
|
canReadAllGroupMessages: false,
|
|
611372
611386
|
interactionMode: "auto",
|
|
@@ -614249,21 +614263,12 @@ ${lines.join("\n")}`);
|
|
|
614249
614263
|
activeAgent: this.subAgents.has(sessionKey),
|
|
614250
614264
|
forceAnalyze: daydreamForceCheck
|
|
614251
614265
|
});
|
|
614252
|
-
if (isGroup && !stimulationProbe.shouldAnalyze) {
|
|
614253
|
-
return {
|
|
614254
|
-
route: forcedRoute ?? "chat",
|
|
614255
|
-
shouldReply: false,
|
|
614256
|
-
confidence: 0.35,
|
|
614257
|
-
reason: `stimulation cadence held analysis (${stimulationProbe.reason}); context retained`,
|
|
614258
|
-
source: "attention-gated"
|
|
614259
|
-
};
|
|
614260
|
-
}
|
|
614261
614266
|
if (!config) {
|
|
614262
614267
|
const fallback2 = {
|
|
614263
614268
|
route: forcedRoute ?? (isGroup ? "action" : "chat"),
|
|
614264
|
-
shouldReply:
|
|
614269
|
+
shouldReply: false,
|
|
614265
614270
|
confidence: 0,
|
|
614266
|
-
reason:
|
|
614271
|
+
reason: "router inference unavailable; no model-derived reply decision",
|
|
614267
614272
|
source: "inference-unavailable"
|
|
614268
614273
|
};
|
|
614269
614274
|
this.applyTelegramStimulationDecision(sessionKey, fallback2);
|
|
@@ -614277,6 +614282,12 @@ ${lines.join("\n")}`);
|
|
|
614277
614282
|
const forcedLine = forcedRoute ? `The operator selected Telegram mode "${forcedRoute}". The route field MUST be "${forcedRoute}", but should_reply must still be inferred live from context.` : `The operator selected Telegram mode "auto". Infer route live from context.`;
|
|
614278
614283
|
const context2 = this.buildTelegramConversationContextStream(sessionKey, msg, isGroup ? 36 : 20);
|
|
614279
614284
|
const currentReplyContext = this.buildTelegramCurrentReplyContext(sessionKey, msg);
|
|
614285
|
+
const botUsername = this.state.botUsername || "unknown";
|
|
614286
|
+
const botIdentitySignals = [
|
|
614287
|
+
botUsername && botUsername !== "unknown" ? `@${botUsername}` : "",
|
|
614288
|
+
botUsername && botUsername !== "unknown" ? botUsername.replace(/^@/, "") : "",
|
|
614289
|
+
this.state.botFirstName || ""
|
|
614290
|
+
];
|
|
614280
614291
|
const userPrompt = [
|
|
614281
614292
|
`You are the Telegram live routing and reply-discretion model.`,
|
|
614282
614293
|
`Return JSON only, with no markdown and no explanation outside JSON.`,
|
|
@@ -614288,10 +614299,10 @@ ${lines.join("\n")}`);
|
|
|
614288
614299
|
`- action: tools, workspace context, media processing, web lookup, delegation, or a multi-step agent loop may be needed.`,
|
|
614289
614300
|
`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.`,
|
|
614290
614301
|
``,
|
|
614291
|
-
`Reply discretion:
|
|
614292
|
-
`
|
|
614293
|
-
`
|
|
614294
|
-
`Bot-to-bot discipline: sender labels include [bot] or [human]. Treat peer bots as autonomous actors, not human users.
|
|
614302
|
+
`Reply discretion: make a human-like attention decision from the full social context. Observe the message, relationship stream, reply graph, conversation momentum, prior bot involvement, speaker intent, and notification-like signals, then decide whether a visible reply would be natural.`,
|
|
614303
|
+
`No hard triggers: direct address, @mentions, name/identity references, private-chat delivery, replies, active threads, and stimulation score are evidence only. They may raise or lower salience, but none guarantees should_reply=true or should_reply=false.`,
|
|
614304
|
+
`No keyword routing: do not use static keyword rules. Infer whether identity references are actually aimed at this bot from syntax, tone, recent turns, and relationships.`,
|
|
614305
|
+
`Bot-to-bot discipline: sender labels include [bot] or [human]. Treat peer bots as autonomous actors, not human users. Avoid bot loops by replying only when the exchange context makes a response socially useful.`,
|
|
614295
614306
|
`Ingress discipline: this Telegram message has already been retained as chat context. should_reply controls only whether to emit a visible reply.`,
|
|
614296
614307
|
`Memory discipline: use durable associative user memory, relationships, prior actions, and recent context to infer whether this speaker is continuing a bot-related thread. A mention is not required when the semantic target is clearly the bot or an ongoing bot-mediated discussion.`,
|
|
614297
614308
|
`Channel daydream discipline: a daydream artifact may highlight relationship signals, unresolved questions, or possible reply opportunities from idle reflection. It can justify analyzing this turn, but it does not force a reply. Reply only if the current user entry makes the intervention timely and socially appropriate.`,
|
|
@@ -614299,8 +614310,8 @@ ${lines.join("\n")}`);
|
|
|
614299
614310
|
forcedLine,
|
|
614300
614311
|
``,
|
|
614301
614312
|
`Tool context: ${toolContext}`,
|
|
614302
|
-
`
|
|
614303
|
-
`
|
|
614313
|
+
`Known self identity signals (context only, not triggers): ${formatTelegramIdentitySignals(botIdentitySignals)}`,
|
|
614314
|
+
`Platform notification/direct-address signal (salience evidence only, not a decision): ${addressesBot ? "yes" : "no"}`,
|
|
614304
614315
|
`Current chat type: ${msg.chatType}`,
|
|
614305
614316
|
`Current sender: ${telegramSpeakerLabel(msg)} [${telegramActorKindLabel(msg)}]`,
|
|
614306
614317
|
msg.replyToMessageId ? `Current message replies to message_id ${msg.replyToMessageId}` : "",
|
|
@@ -614309,8 +614320,9 @@ ${lines.join("\n")}`);
|
|
|
614309
614320
|
(msg.mentionedUsernames ?? []).length > 0 ? `Current message mentions: ${(msg.mentionedUsernames ?? []).map((name10) => `@${name10}`).join(", ")}` : "",
|
|
614310
614321
|
msg.media ? `Current message has media: ${summarizeTelegramMessageAttachments(msg)}` : "",
|
|
614311
614322
|
``,
|
|
614312
|
-
`Current stimulation state before semantic decision:
|
|
614323
|
+
`Current stimulation state before semantic decision (context only; do not treat cadence as a hard reply filter):
|
|
614313
614324
|
${stimulationProbe.context}`,
|
|
614325
|
+
`Stimulation analysis cadence says: ${stimulationProbe.shouldAnalyze ? "analyze-now" : `low-priority sample (${stimulationProbe.reason})`}. You must still make the should_reply decision semantically.`,
|
|
614314
614326
|
``,
|
|
614315
614327
|
context2,
|
|
614316
614328
|
``,
|
|
@@ -614334,7 +614346,7 @@ ${this.quoteTelegramContextBlock(msg.text, 1200)}`
|
|
|
614334
614346
|
});
|
|
614335
614347
|
const text = result.choices[0]?.message?.content ?? "";
|
|
614336
614348
|
const parsed = parseTelegramInteractionDecision(text, forcedRoute, {
|
|
614337
|
-
defaultShouldReply:
|
|
614349
|
+
defaultShouldReply: false
|
|
614338
614350
|
});
|
|
614339
614351
|
if (parsed) {
|
|
614340
614352
|
this.applyTelegramStimulationDecision(sessionKey, parsed);
|
|
@@ -614344,9 +614356,9 @@ ${this.quoteTelegramContextBlock(msg.text, 1200)}`
|
|
|
614344
614356
|
}
|
|
614345
614357
|
const fallback = {
|
|
614346
614358
|
route: forcedRoute ?? (isGroup ? "action" : "chat"),
|
|
614347
|
-
shouldReply:
|
|
614359
|
+
shouldReply: false,
|
|
614348
614360
|
confidence: 0,
|
|
614349
|
-
reason:
|
|
614361
|
+
reason: "router inference failed; no model-derived reply decision",
|
|
614350
614362
|
source: "inference-unavailable"
|
|
614351
614363
|
};
|
|
614352
614364
|
this.applyTelegramStimulationDecision(sessionKey, fallback);
|
|
@@ -614698,6 +614710,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
|
|
|
614698
614710
|
this.state = {
|
|
614699
614711
|
active: true,
|
|
614700
614712
|
botUsername: me.result?.username ?? "unknown",
|
|
614713
|
+
botFirstName: typeof me.result?.first_name === "string" ? me.result.first_name : void 0,
|
|
614701
614714
|
supportsGuestQueries: Boolean(me.result?.supports_guest_queries),
|
|
614702
614715
|
canReadAllGroupMessages: me.result?.can_read_all_group_messages === true,
|
|
614703
614716
|
interactionMode: this.interactionMode,
|
|
@@ -614947,6 +614960,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
|
|
|
614947
614960
|
}
|
|
614948
614961
|
if (msg.chatType !== "private") {
|
|
614949
614962
|
this.recordTelegramUserMessage(msg, "ambient");
|
|
614963
|
+
this.tuiWrite(() => renderTelegramIngressMessage(msg));
|
|
614950
614964
|
}
|
|
614951
614965
|
if (startsWithSlash && !isAdminAuthSecretCommand && await this.handleAdminAuthCommand({ ...msg, text: normalizedCommandText })) {
|
|
614952
614966
|
return;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.71",
|
|
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.71",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED