omnius 1.0.359 → 1.0.360

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
@@ -592185,6 +592185,78 @@ var init_dedup_gate = __esm({
592185
592185
  }
592186
592186
  });
592187
592187
 
592188
+ // packages/orchestrator/dist/conversational-scrutiny.js
592189
+ function auditPerceptionClaims(text2, evidence) {
592190
+ if (!text2 || !text2.trim())
592191
+ return [];
592192
+ const tools = (evidence.toolsUsed ?? []).map((t2) => t2.toLowerCase());
592193
+ const ran = (names) => names.some((n2) => tools.some((t2) => t2.includes(n2)));
592194
+ const out = [];
592195
+ for (const rule of RULES2) {
592196
+ const m2 = text2.match(rule.pattern);
592197
+ if (!m2)
592198
+ continue;
592199
+ if (ran(rule.satisfiedBy))
592200
+ continue;
592201
+ out.push({
592202
+ claim: m2[0].trim().slice(0, 140),
592203
+ kind: rule.kind,
592204
+ requiredTool: rule.requiredTool
592205
+ });
592206
+ }
592207
+ return out;
592208
+ }
592209
+ function confabulationDirective(violations) {
592210
+ const items = violations.map((v) => ` • You claimed: "${v.claim}" — but NO ${v.kind} tool ran this turn. ACTUALLY do it: call ${v.requiredTool}.`).join("\n");
592211
+ return [
592212
+ `[UNSUPPORTED CLAIM — you asserted an action you did not perform]`,
592213
+ items,
592214
+ ``,
592215
+ `Do NOT claim you ran vision / OCR / tests / verification unless you actually called the tool this turn.`,
592216
+ `Either CALL the tool now and base your answer on its real output, or remove the claim and state plainly that you have not done it yet.`
592217
+ ].join("\n");
592218
+ }
592219
+ var RULES2;
592220
+ var init_conversational_scrutiny = __esm({
592221
+ "packages/orchestrator/dist/conversational-scrutiny.js"() {
592222
+ "use strict";
592223
+ RULES2 = [
592224
+ {
592225
+ kind: "vision",
592226
+ // "I ran/performed full vision", "vision captioning is complete",
592227
+ // "I analyzed/captioned/looked at each image", "ran OCR on", "I examined the screenshots".
592228
+ pattern: /\b(ran|run|performed|did|completed|executed|finished)\b[^.!?\n]{0,40}\b(full\s+)?(vision|captioning|caption|ocr|image\s+analy[sz])|(vision|captioning|caption|ocr)\b[^.!?\n]{0,30}\b(is\s+)?(complete|done|finished|run)\b|\b(i|i've|i have)\b[^.!?\n]{0,30}\b(analy[sz]ed|captioned|ocr'?d|examined|inspected|looked\s+at|read)\b[^.!?\n]{0,30}\b(image|images|photo|photos|screenshot|screenshots|picture|pictures)\b/i,
592229
+ satisfiedBy: [
592230
+ "vision",
592231
+ "ocr",
592232
+ "image_analyze",
592233
+ "image_read",
592234
+ "telegram_image_analyze",
592235
+ "video_understand",
592236
+ "pdf_to_text",
592237
+ "ocr_pdf",
592238
+ "ocr_image_advanced"
592239
+ ],
592240
+ requiredTool: "telegram_image_analyze / vision / ocr_image_advanced"
592241
+ },
592242
+ {
592243
+ kind: "test",
592244
+ // "tests pass", "all tests passing", "I ran the tests", "the suite is green".
592245
+ pattern: /\b(tests?\s+(pass|passed|passing|are\s+green|succeed)|all\s+tests?\b[^.!?\n]{0,20}\bpass|i\s+ran\s+the\s+tests?|(test\s+)?suite\s+(is\s+)?green)\b/i,
592246
+ satisfiedBy: ["shell", "run_tests", "test"],
592247
+ requiredTool: "shell (run the test command)"
592248
+ },
592249
+ {
592250
+ kind: "verification",
592251
+ // "I verified by running", "I confirmed it works by", "I checked and it runs".
592252
+ pattern: /\bi\s+(verified|confirmed|checked|validated)\b[^.!?\n]{0,40}\b(by\s+running|works|runs|passes|it\s+is\s+running|live|deployed)\b/i,
592253
+ satisfiedBy: ["shell", "vision", "ocr", "image_read", "file_read"],
592254
+ requiredTool: "shell / the relevant verification tool"
592255
+ }
592256
+ ];
592257
+ }
592258
+ });
592259
+
592188
592260
  // packages/orchestrator/dist/index.js
592189
592261
  var dist_exports3 = {};
592190
592262
  __export(dist_exports3, {
@@ -592241,6 +592313,7 @@ __export(dist_exports3, {
592241
592313
  appendSteeringOutcome: () => appendSteeringOutcome,
592242
592314
  arcSummary: () => arcSummary,
592243
592315
  auditCompletionClaims: () => auditCompletionClaims,
592316
+ auditPerceptionClaims: () => auditPerceptionClaims,
592244
592317
  buildAgentNotification: () => buildAgentNotification,
592245
592318
  buildAgentTypeSummary: () => buildAgentTypeSummary,
592246
592319
  buildCompletionScenarioDecomposition: () => buildCompletionScenarioDecomposition,
@@ -592276,6 +592349,7 @@ __export(dist_exports3, {
592276
592349
  computeArc: () => computeArc,
592277
592350
  computeStabilityHash: () => computeStabilityHash,
592278
592351
  computeTodoReminder: () => computeTodoReminder,
592352
+ confabulationDirective: () => confabulationDirective,
592279
592353
  createAppState: () => createAppState,
592280
592354
  createChildAbortController: () => createChildAbortController,
592281
592355
  createCompletionLedger: () => createCompletionLedger,
@@ -592507,6 +592581,7 @@ var init_dist8 = __esm({
592507
592581
  init_exploration_fanout();
592508
592582
  init_consolidation_runtime();
592509
592583
  init_completion_evidence_gate();
592584
+ init_conversational_scrutiny();
592510
592585
  }
592511
592586
  });
592512
592587
 
@@ -674879,6 +674954,8 @@ Join: ${newUrl}`
674879
674954
  streamText: "",
674880
674955
  visibleReplyText: "",
674881
674956
  currentStreamToolNames: /* @__PURE__ */ new Set(),
674957
+ toolNamesThisRun: /* @__PURE__ */ new Set(),
674958
+ successfulToolNamesThisRun: /* @__PURE__ */ new Set(),
674882
674959
  completionBoundarySeen: false,
674883
674960
  intermediateLines: [],
674884
674961
  startedAtMs: Date.now(),
@@ -675159,6 +675236,8 @@ Join: ${newUrl}`
675159
675236
  streamText: "",
675160
675237
  visibleReplyText: "",
675161
675238
  currentStreamToolNames: /* @__PURE__ */ new Set(),
675239
+ toolNamesThisRun: /* @__PURE__ */ new Set(),
675240
+ successfulToolNamesThisRun: /* @__PURE__ */ new Set(),
675162
675241
  completionBoundarySeen: false,
675163
675242
  intermediateLines: [],
675164
675243
  startedAtMs: Date.now(),
@@ -675864,6 +675943,7 @@ ${conversationStream}`
675864
675943
  suppressExternalEvent = true;
675865
675944
  }
675866
675945
  if (event.type === "tool_call" && event.toolName) {
675946
+ subAgent.toolNamesThisRun.add(event.toolName);
675867
675947
  if (event.toolName === "task_complete") {
675868
675948
  subAgent.completionBoundarySeen = true;
675869
675949
  const toolNamesAtCompletion = new Set(
@@ -675895,6 +675975,7 @@ ${conversationStream}`
675895
675975
  `tool: ${event.toolName}(${argsPreview})`
675896
675976
  );
675897
675977
  } else if (event.type === "tool_result" && event.toolName) {
675978
+ if (event.success) subAgent.successfulToolNamesThisRun.add(event.toolName);
675898
675979
  const preview = (event.content || "").slice(0, 140);
675899
675980
  this.subAgentViewCallbacks?.onWrite(
675900
675981
  subAgent.viewId,
@@ -679877,9 +679958,14 @@ ${knownList}` : "Private-user telegram_send_file target must be this DM or a kno
679877
679958
  const safeCaption = caption ? ` — caption: ${telegramContextJsonString(caption, 220)}` : "";
679878
679959
  const cacheKey = `${String(msg.chatId)}:${String(sourceMessageId ?? 0)}:${fileUniqueId}`;
679879
679960
  const existingEntry = this.mediaCache.get(cacheKey);
679880
- if (existingEntry && existsSync146(existingEntry.localPath)) {
679881
- existingEntry.cachedAt = Date.now();
679882
- return existingEntry.extractedContent || `[${sourceLabel}${type} received: path_alias=${mediaAlias}${safeCaption}]`;
679961
+ let cacheEntry = existingEntry && existsSync146(existingEntry.localPath) ? existingEntry : void 0;
679962
+ let localPath = cacheEntry?.localPath;
679963
+ if (cacheEntry) {
679964
+ cacheEntry.cachedAt = Date.now();
679965
+ const needsDeferredImageAnalysis = isImageMedia && !eager && cacheEntry.analysisComplete !== true;
679966
+ if (!needsDeferredImageAnalysis) {
679967
+ return cacheEntry.extractedContent || `[${sourceLabel}${type} received: path_alias=${mediaAlias}${safeCaption}]`;
679968
+ }
679883
679969
  }
679884
679970
  let ext = ".bin";
679885
679971
  if (isImageMedia) ext = telegramImageExtension(media);
@@ -679890,32 +679976,44 @@ ${knownList}` : "Private-user telegram_send_file target must be this DM or a kno
679890
679976
  const dotIdx = media.fileName.lastIndexOf(".");
679891
679977
  if (dotIdx >= 0) ext = media.fileName.slice(dotIdx);
679892
679978
  }
679893
- const localPath = await this.downloadTelegramFile(fileId, ext);
679894
- if (!localPath) return `[Media: ${type} failed to download]`;
679895
- const cacheEntry = {
679896
- localPath,
679897
- fileId,
679898
- fileUniqueId,
679899
- chatId: msg.chatId,
679900
- messageId: sourceMessageId ?? 0,
679901
- username: msg.username,
679902
- mediaType: type,
679903
- mimeType,
679904
- caption,
679905
- cachedAt: Date.now()
679906
- };
679907
- this.mediaCache.set(cacheKey, cacheEntry);
679908
- const metadataKey = String(msg.chatId);
679909
- if (!this.mediaMetadata.has(metadataKey)) {
679910
- this.mediaMetadata.set(metadataKey, []);
679979
+ if (!localPath) {
679980
+ localPath = await this.downloadTelegramFile(fileId, ext) ?? void 0;
679981
+ if (!localPath) return `[Media: ${type} — failed to download]`;
679982
+ }
679983
+ if (!cacheEntry) {
679984
+ cacheEntry = {
679985
+ localPath,
679986
+ fileId,
679987
+ fileUniqueId,
679988
+ chatId: msg.chatId,
679989
+ messageId: sourceMessageId ?? 0,
679990
+ username: msg.username,
679991
+ mediaType: type,
679992
+ mimeType,
679993
+ caption,
679994
+ cachedAt: Date.now(),
679995
+ analysisComplete: false
679996
+ };
679997
+ this.mediaCache.set(cacheKey, cacheEntry);
679998
+ const metadataKey = String(msg.chatId);
679999
+ if (!this.mediaMetadata.has(metadataKey)) {
680000
+ this.mediaMetadata.set(metadataKey, []);
680001
+ }
680002
+ this.mediaMetadata.get(metadataKey).push({
680003
+ timestamp: Date.now(),
680004
+ type,
680005
+ mimeType,
680006
+ caption,
680007
+ username: msg.username
680008
+ });
680009
+ } else {
680010
+ cacheEntry.fileId = fileId;
680011
+ cacheEntry.fileUniqueId = fileUniqueId;
680012
+ cacheEntry.mediaType = type;
680013
+ cacheEntry.mimeType = mimeType;
680014
+ cacheEntry.caption = caption;
680015
+ cacheEntry.username = msg.username;
679911
680016
  }
679912
- this.mediaMetadata.get(metadataKey).push({
679913
- timestamp: Date.now(),
679914
- type,
679915
- mimeType,
679916
- caption,
679917
- username: msg.username
679918
- });
679919
680017
  let description = `[${type}${caption ? `: ${caption}` : ""}]`;
679920
680018
  if (isImageMedia && !eager) {
679921
680019
  let visionContext = "";
@@ -679931,6 +680029,7 @@ ${knownList}` : "Private-user telegram_send_file target must be this DM or a kno
679931
680029
  );
679932
680030
  visionContext = formatImageContextPrefix2(ingressResult);
679933
680031
  cacheEntry.extractedContent = ingressResult.contextBlock;
680032
+ cacheEntry.analysisComplete = true;
679934
680033
  } catch {
679935
680034
  }
679936
680035
  if (visionContext) {
@@ -679987,6 +680086,9 @@ ${visionContext}]`;
679987
680086
  }
679988
680087
  }
679989
680088
  description = appendMediaContextBlock(description, visualIdentityContext);
680089
+ } else if (isImageMedia) {
680090
+ description = `[${sourceLabel}image received: path_alias=${mediaAlias}${safeCaption}. Full visual comprehension pending; use image='${source === "reply" ? "reply" : "latest"}' or image='${mediaAlias}' with telegram_image_analyze detail='full'.]`;
680091
+ cacheEntry.analysisComplete = false;
679990
680092
  } else if (type === "audio" || type === "voice") {
679991
680093
  let transcription = null;
679992
680094
  try {
@@ -679996,6 +680098,7 @@ ${visionContext}]`;
679996
680098
  if (result?.text?.trim()) {
679997
680099
  transcription = result.text.trim();
679998
680100
  cacheEntry.extractedContent = transcription;
680101
+ cacheEntry.analysisComplete = true;
679999
680102
  }
680000
680103
  } catch {
680001
680104
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.359",
3
+ "version": "1.0.360",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.359",
9
+ "version": "1.0.360",
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.359",
3
+ "version": "1.0.360",
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",