omnius 1.0.655 → 1.0.656
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 +180 -14
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/prompts/agentic/system-common.md +2 -0
package/dist/index.js
CHANGED
|
@@ -651696,6 +651696,52 @@ function resolveTrajectoryGroundingMode(explicit, subAgent) {
|
|
|
651696
651696
|
}
|
|
651697
651697
|
return subAgent ? "off" : "adaptive";
|
|
651698
651698
|
}
|
|
651699
|
+
function withTaskCompleteCloseoutContract(tool) {
|
|
651700
|
+
if (tool.name !== "task_complete")
|
|
651701
|
+
return tool;
|
|
651702
|
+
const parameters = tool.parameters && typeof tool.parameters === "object" ? tool.parameters : {};
|
|
651703
|
+
const existingProperties = parameters["properties"] && typeof parameters["properties"] === "object" && !Array.isArray(parameters["properties"]) ? parameters["properties"] : {};
|
|
651704
|
+
const originalDescription = String(tool.description ?? "").trim();
|
|
651705
|
+
return {
|
|
651706
|
+
...tool,
|
|
651707
|
+
description: originalDescription.startsWith(TASK_COMPLETE_CLOSEOUT_DESCRIPTION) ? originalDescription : `${TASK_COMPLETE_CLOSEOUT_DESCRIPTION} ${originalDescription}`.trim(),
|
|
651708
|
+
parameters: {
|
|
651709
|
+
...parameters,
|
|
651710
|
+
type: "object",
|
|
651711
|
+
properties: {
|
|
651712
|
+
...existingProperties,
|
|
651713
|
+
status: existingProperties["status"] ?? {
|
|
651714
|
+
type: "string",
|
|
651715
|
+
enum: [
|
|
651716
|
+
"completed",
|
|
651717
|
+
"blocked",
|
|
651718
|
+
"incomplete",
|
|
651719
|
+
"no_changes_required",
|
|
651720
|
+
"needs_input"
|
|
651721
|
+
],
|
|
651722
|
+
description: "Use completed only when the requested outcome is satisfied. Use blocked, incomplete, or needs_input when a known gap remains."
|
|
651723
|
+
},
|
|
651724
|
+
closeout_reviewed: existingProperties["closeout_reviewed"] ?? {
|
|
651725
|
+
type: "boolean",
|
|
651726
|
+
description: "True after comparing the active request, current todo/work graph state, and observed evidence immediately before this call."
|
|
651727
|
+
},
|
|
651728
|
+
remaining_gaps: existingProperties["remaining_gaps"] ?? {
|
|
651729
|
+
type: "array",
|
|
651730
|
+
items: { type: "string" },
|
|
651731
|
+
description: "Known unfinished, blocked, superseded, or unverified items that remain after the closeout review. Use an empty array only when none remain."
|
|
651732
|
+
},
|
|
651733
|
+
override_closeout_review: existingProperties["override_closeout_review"] ?? {
|
|
651734
|
+
type: "boolean",
|
|
651735
|
+
description: "Optional explicit override. Set true only when deliberately ending without reconciling the tracked state. This never bypasses independent safety or delivery checks."
|
|
651736
|
+
},
|
|
651737
|
+
override_reason: existingProperties["override_reason"] ?? {
|
|
651738
|
+
type: "string",
|
|
651739
|
+
description: "Required by policy when override_closeout_review is true. State why ending now is the correct action."
|
|
651740
|
+
}
|
|
651741
|
+
}
|
|
651742
|
+
}
|
|
651743
|
+
};
|
|
651744
|
+
}
|
|
651699
651745
|
function upsertContextFrame(messages2, frame2, marker = "[ACTIVE CONTEXT FRAME]") {
|
|
651700
651746
|
for (let i2 = messages2.length - 1; i2 >= 0; i2--) {
|
|
651701
651747
|
const m2 = messages2[i2];
|
|
@@ -652425,7 +652471,7 @@ function classifyThinkOutcome(raw) {
|
|
|
652425
652471
|
}
|
|
652426
652472
|
return null;
|
|
652427
652473
|
}
|
|
652428
|
-
var PRESERVE_MODEL_VISIBLE_HISTORY, TOOL_SUBSETS, TOOL_AUTO_DEMOTE_TURNS, LEGACY_ACTION_REASON_KEYS, CLAIM_TASK_STOPWORDS, SYSTEM_PROMPT_COMMON, SYSTEM_PROMPT, SYSTEM_PROMPT_MEDIUM, SYSTEM_PROMPT_SMALL, VISUAL_TOOLS, AUDIO_TOOLS, SOCIAL_TOOLS, SPATIAL_TOOLS, CODE_TOOLS, AgenticRunner, InferenceHttpError, OllamaAgenticBackend;
|
|
652474
|
+
var PRESERVE_MODEL_VISIBLE_HISTORY, TOOL_SUBSETS, TOOL_AUTO_DEMOTE_TURNS, LEGACY_ACTION_REASON_KEYS, CLAIM_TASK_STOPWORDS, TASK_COMPLETE_CLOSEOUT_DESCRIPTION, SYSTEM_PROMPT_COMMON, SYSTEM_PROMPT, SYSTEM_PROMPT_MEDIUM, SYSTEM_PROMPT_SMALL, VISUAL_TOOLS, AUDIO_TOOLS, SOCIAL_TOOLS, SPATIAL_TOOLS, CODE_TOOLS, AgenticRunner, InferenceHttpError, OllamaAgenticBackend;
|
|
652429
652475
|
var init_agenticRunner = __esm({
|
|
652430
652476
|
"packages/orchestrator/dist/agenticRunner.js"() {
|
|
652431
652477
|
"use strict";
|
|
@@ -652619,6 +652665,7 @@ var init_agenticRunner = __esm({
|
|
|
652619
652665
|
"new",
|
|
652620
652666
|
"old"
|
|
652621
652667
|
]);
|
|
652668
|
+
TASK_COMPLETE_CLOSEOUT_DESCRIPTION = "Before task_complete, reconcile the active request, task state, and evidence; close or accurately report every gap.";
|
|
652622
652669
|
SYSTEM_PROMPT_COMMON = `${STE_COMMUNICATION_POLICY}
|
|
652623
652670
|
|
|
652624
652671
|
${loadPrompt("agentic/system-common.md")}`;
|
|
@@ -657352,6 +657399,40 @@ Pick the SMALLEST concrete deliverable from the spec — typically the project e
|
|
|
657352
657399
|
}
|
|
657353
657400
|
return refreshed.authoritativeBlockers;
|
|
657354
657401
|
}
|
|
657402
|
+
/**
|
|
657403
|
+
* Put current unresolved leaves beside the work graph before inference can
|
|
657404
|
+
* select task_complete. This guidance never holds or rejects the terminal
|
|
657405
|
+
* tool, including on bounded chat surfaces that disable planning nudges.
|
|
657406
|
+
*/
|
|
657407
|
+
_injectTaskCloseoutReconciliationContext(messages2) {
|
|
657408
|
+
const marker = "[TASK CLOSEOUT REVIEW]";
|
|
657409
|
+
for (let index = messages2.length - 1; index >= 0; index--) {
|
|
657410
|
+
const message2 = messages2[index];
|
|
657411
|
+
if (message2?.role === "system" && typeof message2.content === "string" && message2.content.startsWith(marker)) {
|
|
657412
|
+
messages2.splice(index, 1);
|
|
657413
|
+
}
|
|
657414
|
+
}
|
|
657415
|
+
if (!this.tools.has("task_complete"))
|
|
657416
|
+
return;
|
|
657417
|
+
const openItems = openTodoLeaves(this._normalizeTodosForPrompt(this.readSessionTodos() ?? []));
|
|
657418
|
+
if (openItems.length === 0)
|
|
657419
|
+
return;
|
|
657420
|
+
const updateInstruction = this._todoWriteAvailable() ? "If evidence shows that an open item is already finished, use todo_write to record its completed state before you finish." : "If an open item is already finished but no tracker-update tool is available, report that state accurately in the closeout fields.";
|
|
657421
|
+
messages2.push({
|
|
657422
|
+
role: "system",
|
|
657423
|
+
content: [
|
|
657424
|
+
marker,
|
|
657425
|
+
"This is an advisory closeout reminder, not a permission gate.",
|
|
657426
|
+
`${openItems.length} unresolved tracked leaf item(s) are visible now:`,
|
|
657427
|
+
...openItems.slice(0, 12).map((todo) => `- ${todo.id ? `${todo.id}: ` : ""}[${todo.status}] ${todo.content}`),
|
|
657428
|
+
openItems.length > 12 ? `- ${openItems.length - 12} additional unresolved item(s) remain in the current task state.` : "",
|
|
657429
|
+
"Before task_complete, compare these items with the active request and actual evidence from this run.",
|
|
657430
|
+
updateInstruction,
|
|
657431
|
+
"Continue feasible authorized work that is genuinely unfinished. If work cannot be finished, use a truthful blocked, incomplete, or needs_input status and list the exact remaining gaps.",
|
|
657432
|
+
"You can deliberately override this review by setting override_closeout_review=true and giving override_reason. The terminal signal remains callable."
|
|
657433
|
+
].filter(Boolean).join("\n")
|
|
657434
|
+
});
|
|
657435
|
+
}
|
|
657355
657436
|
_gitProgressSummary() {
|
|
657356
657437
|
return summarizeGitProgressForTrajectory(this._gitProgress);
|
|
657357
657438
|
}
|
|
@@ -659088,6 +659169,8 @@ ${context2 ?? ""}`;
|
|
|
659088
659169
|
``,
|
|
659089
659170
|
`Before claiming success or calling task_complete, derive the material claims from this exact request and your proposed final answer.`,
|
|
659090
659171
|
`For each material claim, cite observed evidence from this run or mark the claim unverified/blocked. Let the current request, proposed claims, and observations determine what matters.`,
|
|
659172
|
+
`Immediately before task_complete, reconcile the active request with the current todo/work graph and observed evidence. Mark completed-but-open work complete, continue feasible unfinished work, and report any remaining gap with a truthful terminal status.`,
|
|
659173
|
+
`This closeout review is advisory, not a hard gate. You can override it with considered judgment by setting override_closeout_review=true and giving override_reason; do not use an override to conceal known gaps.`,
|
|
659091
659174
|
`If completion is impossible, say so plainly and name the blocker plus the observations already collected.`,
|
|
659092
659175
|
``,
|
|
659093
659176
|
formatCompletionContract(completionContract)
|
|
@@ -662760,9 +662843,10 @@ ${blob}
|
|
|
662760
662843
|
registerTool(tool) {
|
|
662761
662844
|
if (!this.isToolAllowedByProfile(tool.name, tool.aliases))
|
|
662762
662845
|
return;
|
|
662763
|
-
|
|
662764
|
-
|
|
662765
|
-
|
|
662846
|
+
const registeredTool = withTaskCompleteCloseoutContract(tool);
|
|
662847
|
+
this.tools.set(registeredTool.name, registeredTool);
|
|
662848
|
+
if (registeredTool.name === "generate_image") {
|
|
662849
|
+
this.maybeInstallImagePromptExpander(registeredTool);
|
|
662766
662850
|
}
|
|
662767
662851
|
}
|
|
662768
662852
|
toolNameVariants(name10) {
|
|
@@ -666093,7 +666177,7 @@ ${dynamicProjectContext}`
|
|
|
666093
666177
|
"\nRules:",
|
|
666094
666178
|
"- Output EXACTLY ONE tool call per response in the JSON format above",
|
|
666095
666179
|
"- After seeing the tool result, continue or call another tool",
|
|
666096
|
-
'- When done: {"tool": "task_complete", "args": {"summary": "what you did"}}',
|
|
666180
|
+
'- When done: {"tool": "task_complete", "args": {"summary": "what you did", "status": "completed", "closeout_reviewed": true, "remaining_gaps": []}}',
|
|
666097
666181
|
"- You CAN also write ```bash ... ``` blocks which will be auto-executed"
|
|
666098
666182
|
].join("\n");
|
|
666099
666183
|
toolDefs = [];
|
|
@@ -666112,6 +666196,7 @@ ${dynamicProjectContext}`
|
|
|
666112
666196
|
const substantiveProgressFingerprints = /* @__PURE__ */ new Set();
|
|
666113
666197
|
let completed = false;
|
|
666114
666198
|
let summary = "";
|
|
666199
|
+
let acceptedTaskCompleteStatus;
|
|
666115
666200
|
let bruteForceCycle = 0;
|
|
666116
666201
|
this._assistantTextEmitted = false;
|
|
666117
666202
|
this._microcompactHintEmitted = false;
|
|
@@ -666738,6 +666823,7 @@ ${lastCompletionGateFeedback.trim().slice(0, 4e3)}` : ""
|
|
|
666738
666823
|
...openTodos.slice(0, 12).map((todo) => ` - [${todo.status}] ${todo.content}`)
|
|
666739
666824
|
].join("\n"), turn);
|
|
666740
666825
|
}
|
|
666826
|
+
acceptedTaskCompleteStatus = completionStatusFromTaskCompleteArgs(args);
|
|
666741
666827
|
this._completionHoldState.count = 0;
|
|
666742
666828
|
this._completionHoldState.lastKey = "";
|
|
666743
666829
|
this._completionHoldState.total = 0;
|
|
@@ -667911,6 +667997,7 @@ Respond with EXACTLY this structure before your next tool call:
|
|
|
667911
667997
|
continue;
|
|
667912
667998
|
}
|
|
667913
667999
|
this._injectOperationalWorkGraphContext(messages2, this._taskState.originalGoal || this._taskState.goal || persistentTaskGoal, turn);
|
|
668000
|
+
this._injectTaskCloseoutReconciliationContext(messages2);
|
|
667914
668001
|
if (!this.options.disableTodoPlanningNudges) {
|
|
667915
668002
|
const maybeReminder = this.getTodoReminderContent(turn);
|
|
667916
668003
|
if (maybeReminder) {
|
|
@@ -668571,7 +668658,7 @@ ${memoryLines.join("\n")}`
|
|
|
668571
668658
|
toolDescriptions,
|
|
668572
668659
|
"\nOutput EXACTLY ONE tool call per response in the JSON format above.",
|
|
668573
668660
|
"After seeing the tool result, continue or call another tool.",
|
|
668574
|
-
'When done, output: {"tool": "task_complete", "args": {"summary": "what you did"}}'
|
|
668661
|
+
'When done, output: {"tool": "task_complete", "args": {"summary": "what you did", "status": "completed", "closeout_reviewed": true, "remaining_gaps": []}}'
|
|
668575
668662
|
].join("\n");
|
|
668576
668663
|
chatRequest.messages = this._prepareModelFacingMessages([
|
|
668577
668664
|
...requestMessages2,
|
|
@@ -668595,6 +668682,16 @@ ${memoryLines.join("\n")}`
|
|
|
668595
668682
|
content: `Tool result (${parsed.tool}): ${result.output.slice(0, 2e3)}`
|
|
668596
668683
|
});
|
|
668597
668684
|
if (resolvedParsedTool.name === "task_complete") {
|
|
668685
|
+
if (!result.success) {
|
|
668686
|
+
messages2.push({
|
|
668687
|
+
role: "system",
|
|
668688
|
+
content: this.buildTaskCompleteToolFailureGuard(result.error || result.output)
|
|
668689
|
+
});
|
|
668690
|
+
continue;
|
|
668691
|
+
}
|
|
668692
|
+
if (holdTaskCompleteGates(parsed.args ?? {}, turn)) {
|
|
668693
|
+
continue;
|
|
668694
|
+
}
|
|
668598
668695
|
completed = true;
|
|
668599
668696
|
summary = String(parsed.args?.summary ?? content);
|
|
668600
668697
|
this._onTypedEvent?.({
|
|
@@ -672792,6 +672889,7 @@ ${this.options.maxTurns && this.options.maxTurns > 0 ? `You have ${this.options.
|
|
|
672792
672889
|
continue;
|
|
672793
672890
|
}
|
|
672794
672891
|
this._injectOperationalWorkGraphContext(messages2, this._taskState.originalGoal || this._taskState.goal || persistentTaskGoal, turn);
|
|
672892
|
+
this._injectTaskCloseoutReconciliationContext(messages2);
|
|
672795
672893
|
let compactedMsgs;
|
|
672796
672894
|
if (this._pendingCompaction) {
|
|
672797
672895
|
const strategy = this._pendingCompaction;
|
|
@@ -673338,7 +673436,16 @@ ${terminalFeedback.slice(0, 4e3)}`,
|
|
|
673338
673436
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
673339
673437
|
});
|
|
673340
673438
|
}
|
|
673341
|
-
|
|
673439
|
+
const declaredDegradedCompletion = acceptedTaskCompleteStatus === "blocked" || acceptedTaskCompleteStatus === "incomplete" || acceptedTaskCompleteStatus === "needs_input";
|
|
673440
|
+
if (completed && declaredDegradedCompletion) {
|
|
673441
|
+
completed = false;
|
|
673442
|
+
this.emit({
|
|
673443
|
+
type: "status",
|
|
673444
|
+
content: `task_complete retained truthful degraded status: ${acceptedTaskCompleteStatus}`,
|
|
673445
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
673446
|
+
});
|
|
673447
|
+
}
|
|
673448
|
+
let runStatus = declaredDegradedCompletion ? "incomplete" : completed ? "completed" : this._completionLedger?.status === "blocked" || this._completionLedger?.status === "request_changes" || this._completionLedger?.status === "incomplete_verification" ? "incomplete_verification" : this._completionIncompleteVerification ? "incomplete_verification" : "incomplete";
|
|
673342
673449
|
const terminalReceipt = this._commitTerminalFinalization({
|
|
673343
673450
|
status: runStatus,
|
|
673344
673451
|
summary,
|
|
@@ -796047,12 +796154,16 @@ Scoped workspace: ${scopedRoot}`,
|
|
|
796047
796154
|
buildTelegramTool(context2, repoRoot, chatId, currentMsg) {
|
|
796048
796155
|
const bridge = this;
|
|
796049
796156
|
const adminDm = context2 === "telegram-admin-dm";
|
|
796157
|
+
const exposedActions = Object.keys(TELEGRAM_TOOL_ACTION_GROUP).filter(
|
|
796158
|
+
(action) => this.telegramToolActionEnabled(action, chatId)
|
|
796159
|
+
);
|
|
796050
796160
|
return {
|
|
796051
796161
|
name: "telegram",
|
|
796052
796162
|
description: [
|
|
796053
|
-
"
|
|
796163
|
+
"Use approval-gated kick_chat_member for remove, kick, or eject requests; never substitute ban_chat_member.",
|
|
796164
|
+
"Use action to inspect chat state, send messages/files, delete messages, manage reactions, or manage Telegram tool policy.",
|
|
796054
796165
|
"kick_chat_member stages an immutable, expiring request and asks the numeric global human admin for verbal approval; it never removes a member in the tool call.",
|
|
796055
|
-
"A reply to the target member's message can supply the kick target
|
|
796166
|
+
"A reply to the target member's message, a numeric user_id, or an exact uniquely observed target_username can supply the kick target. ban_chat_member is a persistent or expiring ban only, and unban_chat_member cannot be used as an unapproved kick.",
|
|
796056
796167
|
"Deletion and other moderation actions require authenticated admin context, Omnius Telegram tool policy enablement, current/known chat scoping, and Telegram bot rights.",
|
|
796057
796168
|
"Use scope_status before risky actions when uncertain. Use render_admin_buttons to show clickable admin toggles."
|
|
796058
796169
|
].join(" "),
|
|
@@ -796061,8 +796172,8 @@ Scoped workspace: ${scopedRoot}`,
|
|
|
796061
796172
|
properties: {
|
|
796062
796173
|
action: {
|
|
796063
796174
|
type: "string",
|
|
796064
|
-
enum:
|
|
796065
|
-
description: "Telegram
|
|
796175
|
+
enum: exposedActions,
|
|
796176
|
+
description: "Telegram operation. kick_chat_member is the only remove/kick/eject operation: it stages immutable global-admin approval and permits later rejoin. ban_chat_member creates a persistent or expiring ban only and must never substitute for a kick; it is omitted when direct moderation policy is disabled."
|
|
796066
796177
|
},
|
|
796067
796178
|
target: {
|
|
796068
796179
|
type: "string",
|
|
@@ -796080,7 +796191,11 @@ Scoped workspace: ${scopedRoot}`,
|
|
|
796080
796191
|
},
|
|
796081
796192
|
user_id: {
|
|
796082
796193
|
type: "number",
|
|
796083
|
-
description: "Telegram user id for member/moderation/reaction actions. kick_chat_member
|
|
796194
|
+
description: "Numeric Telegram user id for member/moderation/reaction actions. For kick_chat_member, use this, target_username, or a direct reply to the target member."
|
|
796195
|
+
},
|
|
796196
|
+
target_username: {
|
|
796197
|
+
type: "string",
|
|
796198
|
+
description: "Exact Telegram username for kick_chat_member. It must resolve case-insensitively to one positive numeric user id already observed in the current chat; unknown or conflicting identities fail closed."
|
|
796084
796199
|
},
|
|
796085
796200
|
text: { type: "string", description: "Text for send/edit actions." },
|
|
796086
796201
|
caption: {
|
|
@@ -796525,13 +796640,18 @@ Scoped workspace: ${scopedRoot}`,
|
|
|
796525
796640
|
}
|
|
796526
796641
|
case "kick_chat_member":
|
|
796527
796642
|
case "ban_chat_member": {
|
|
796643
|
+
const targetUsername = String(args["target_username"] ?? "").trim();
|
|
796528
796644
|
const moderationTargetUserId = userId ?? this.telegramModerationReplyTargetUserId(
|
|
796529
796645
|
env2.currentMsg,
|
|
796530
796646
|
targetChatId
|
|
796531
|
-
)
|
|
796647
|
+
) ?? (targetUsername && targetChatId !== void 0 ? this.telegramModerationUsernameTargetUserId(
|
|
796648
|
+
targetUsername,
|
|
796649
|
+
targetChatId,
|
|
796650
|
+
env2.currentMsg
|
|
796651
|
+
) : void 0);
|
|
796532
796652
|
if (targetChatId === void 0 || moderationTargetUserId === void 0)
|
|
796533
796653
|
throw new Error(
|
|
796534
|
-
`target/chat_id and a
|
|
796654
|
+
`target/chat_id and a verified member identity are required for ${action}. Supply a numeric user_id, an exact uniquely observed target_username, or directly reply to that member's message in the target chat.`
|
|
796535
796655
|
);
|
|
796536
796656
|
if (dryRun)
|
|
796537
796657
|
return this.telegramDryRun(action, targetChatId, {
|
|
@@ -796734,6 +796854,46 @@ Scoped workspace: ${scopedRoot}`,
|
|
|
796734
796854
|
}
|
|
796735
796855
|
return reply.sender.id;
|
|
796736
796856
|
}
|
|
796857
|
+
telegramModerationUsernameTargetUserId(rawUsername, targetChatId, currentMsg) {
|
|
796858
|
+
const username = rawUsername.trim().replace(/^@/, "").toLowerCase();
|
|
796859
|
+
if (!username) {
|
|
796860
|
+
throw new Error(
|
|
796861
|
+
"target_username must contain an exact Telegram username."
|
|
796862
|
+
);
|
|
796863
|
+
}
|
|
796864
|
+
this.ensureAllTelegramConversationsLoaded();
|
|
796865
|
+
const observedIds = /* @__PURE__ */ new Set();
|
|
796866
|
+
const addObserved = (candidateUsername, candidateId) => {
|
|
796867
|
+
if (candidateUsername?.trim().replace(/^@/, "").toLowerCase() === username && Number.isSafeInteger(candidateId) && Number(candidateId) > 0) {
|
|
796868
|
+
observedIds.add(Number(candidateId));
|
|
796869
|
+
}
|
|
796870
|
+
};
|
|
796871
|
+
if (String(currentMsg?.chatId) === String(targetChatId)) {
|
|
796872
|
+
addObserved(currentMsg?.username, currentMsg?.fromUserId);
|
|
796873
|
+
addObserved(
|
|
796874
|
+
currentMsg?.replyContext?.sender?.username,
|
|
796875
|
+
currentMsg?.replyContext?.sender?.id
|
|
796876
|
+
);
|
|
796877
|
+
}
|
|
796878
|
+
const history = this.chatHistory.get(`chat:${String(targetChatId)}`) ?? [];
|
|
796879
|
+
for (const entry of history) {
|
|
796880
|
+
if (String(entry.chatId) !== String(targetChatId)) continue;
|
|
796881
|
+
addObserved(entry.username, entry.fromUserId);
|
|
796882
|
+
addObserved(
|
|
796883
|
+
entry.replyContext?.sender?.username,
|
|
796884
|
+
entry.replyContext?.sender?.id
|
|
796885
|
+
);
|
|
796886
|
+
}
|
|
796887
|
+
if (observedIds.size === 1) return [...observedIds][0];
|
|
796888
|
+
if (observedIds.size > 1) {
|
|
796889
|
+
throw new Error(
|
|
796890
|
+
`target_username @${username} maps to conflicting observed Telegram user ids in chat ${String(targetChatId)}. Reply directly to the target message or supply the verified numeric user_id.`
|
|
796891
|
+
);
|
|
796892
|
+
}
|
|
796893
|
+
throw new Error(
|
|
796894
|
+
`target_username @${username} has no exact positive numeric user-id observation in chat ${String(targetChatId)}. Reply directly to the target message or supply the verified numeric user_id.`
|
|
796895
|
+
);
|
|
796896
|
+
}
|
|
796737
796897
|
telegramModerationActionDigest(action) {
|
|
796738
796898
|
return createHash74("sha256").update(JSON.stringify(action)).digest("hex");
|
|
796739
796899
|
}
|
|
@@ -797493,6 +797653,12 @@ ${this.quoteTelegramContextBlock(msg.text, 800)}`,
|
|
|
797493
797653
|
}
|
|
797494
797654
|
if (!this.telegramToolActionEnabled(action, targetChatId)) {
|
|
797495
797655
|
const scope = targetChatId !== void 0 && this.telegramToolPolicy.chatOverrides?.[String(targetChatId)] ? `chat ${String(targetChatId)}` : "global/default";
|
|
797656
|
+
if (action === "ban_chat_member") {
|
|
797657
|
+
return {
|
|
797658
|
+
ok: false,
|
|
797659
|
+
error: `Direct ban_chat_member remains disabled by ${scope} policy. For a remove, kick, or eject request that permits later rejoin, use kick_chat_member with a numeric user_id, exact observed target_username, or direct reply; it stages global-admin approval. If the user explicitly requested a persistent or expiring ban, do not substitute a kick; an administrator must enable the moderation action first.`
|
|
797660
|
+
};
|
|
797661
|
+
}
|
|
797496
797662
|
return {
|
|
797497
797663
|
ok: false,
|
|
797498
797664
|
error: `Telegram action ${action} is disabled by ${scope} policy. Enable ${group} or ${action} first.`
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.656",
|
|
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.656",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED
|
@@ -108,5 +108,7 @@ Do not repeat a recorded change without new evidence that requires repetition.
|
|
|
108
108
|
|
|
109
109
|
- Report only verified results.
|
|
110
110
|
- If a required result is blocked, identify the blocker and its evidence.
|
|
111
|
+
- Immediately before `task_complete`, compare the active request with the current todo/work graph and observed evidence. Mark finished-but-open items complete, continue feasible unfinished work, and accurately list unresolved gaps with a blocked, incomplete, or needs-input status.
|
|
112
|
+
- This closeout review is advisory. You can override it with considered judgment by setting `override_closeout_review=true` and giving `override_reason`; do not use an override to hide a known gap.
|
|
111
113
|
- Continue authorized work when the user says `finish` or `do not stop`.
|
|
112
114
|
- Do not treat a terminal phrase as new authority for unrelated work.
|