omnius 1.0.225 → 1.0.227

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
@@ -587422,6 +587422,7 @@ __export(render_exports, {
587422
587422
  getTermWidth: () => getTermWidth,
587423
587423
  pastel: () => pastel,
587424
587424
  renderAssistantText: () => renderAssistantText,
587425
+ renderBoxedBlock: () => renderBoxedBlock,
587425
587426
  renderCompactHeader: () => renderCompactHeader,
587426
587427
  renderConfig: () => renderConfig,
587427
587428
  renderContextIntakeBox: () => renderContextIntakeBox,
@@ -587967,6 +587968,11 @@ function buildToolResultBoxLines(toolName, success, output, opts, width) {
587967
587968
  metricsColorCode: success ? void 0 : TOOL_ERROR_COLOR_CODE
587968
587969
  }, width);
587969
587970
  }
587971
+ function resolveToolOutputMaxLines(verbose) {
587972
+ const raw = Number(process.env["OMNIUS_TOOL_OUTPUT_MAX_LINES"]);
587973
+ if (Number.isFinite(raw)) return raw <= 0 ? Number.MAX_SAFE_INTEGER : Math.floor(raw);
587974
+ return verbose ? 1e3 : 500;
587975
+ }
587970
587976
  function buildToolResultBody(toolName, success, output, verbose) {
587971
587977
  const debug = loadConfig()?.debug ?? false;
587972
587978
  if (toolName === "file_write" || toolName === "file_edit") {
@@ -587981,7 +587987,7 @@ function buildToolResultBody(toolName, success, output, verbose) {
587981
587987
  if (!success) {
587982
587988
  return [{ text: extractFirstLine(output, Number.MAX_SAFE_INTEGER), mode: "wrap", kind: "error" }];
587983
587989
  }
587984
- return codePreviewLines(output, 10);
587990
+ return codePreviewLines(output, resolveToolOutputMaxLines(verbose));
587985
587991
  }
587986
587992
  if (toolName === "task_complete") {
587987
587993
  const summary = output && output.trim() ? output : "Done";
@@ -588000,7 +588006,7 @@ function buildToolResultBody(toolName, success, output, verbose) {
588000
588006
  if (filtered.length === 0) {
588001
588007
  return [{ text: success ? "Done" : "Failed", mode: "wrap", kind: success ? "success" : "error" }];
588002
588008
  }
588003
- const maxLines = verbose ? 200 : toolName === "shell" || toolName === "background_run" || toolName === "grep_search" ? 10 : 6;
588009
+ const maxLines = resolveToolOutputMaxLines(verbose);
588004
588010
  const shown = [];
588005
588011
  for (const line of filtered.slice(0, maxLines)) {
588006
588012
  if (isRawJsonDump(line) && !verbose) {
@@ -588084,18 +588090,35 @@ function renderToolResult(toolName, success, output, verboseOrOpts) {
588084
588090
  opts
588085
588091
  );
588086
588092
  }
588093
+ function renderBoxedBlock(opts) {
588094
+ const mode = opts.mode ?? "wrap";
588095
+ const kind = opts.kind ?? "plain";
588096
+ const body = (opts.lines.length > 0 ? opts.lines : [""]).map((text) => ({
588097
+ text,
588098
+ mode,
588099
+ kind
588100
+ }));
588101
+ renderToolDynamicBlock(
588102
+ "tool-result",
588103
+ (width) => buildToolBoxLines({
588104
+ title: opts.title,
588105
+ metrics: opts.metrics ?? "",
588106
+ body,
588107
+ colorCode: opts.colorCode ?? tuiTextDim(),
588108
+ metricsColorCode: opts.metricsColorCode
588109
+ }, width),
588110
+ opts.host === void 0 ? {} : { host: opts.host }
588111
+ );
588112
+ }
588087
588113
  function renderImageAsciiPreview(title, imagePath, ascii2, renderer) {
588088
- const prefix = ` ${c3.dim("│")} `;
588089
- const maxW = Math.max(getTermWidth() - 10, 40);
588090
- const header = `${title}: ${imagePath} (${renderer})`;
588091
- process.stdout.write(`
588092
- ${prefix}${c3.cyan(c3.bold(header.length > maxW ? header.slice(0, maxW - 3) + "..." : header))}
588093
- `);
588094
- for (const line of ascii2.split("\n")) {
588095
- const renderedLine = /\x1B\[[0-?]*[ -/]*[@-~]/.test(line) ? line : c3.dim(line);
588096
- process.stdout.write(`${prefix}${renderedLine}
588097
- `);
588098
- }
588114
+ renderBoxedBlock({
588115
+ title: `${title} ${imagePath}`,
588116
+ metrics: renderer,
588117
+ lines: ascii2.split("\n").map((line) => /\x1B\[[0-?]*[ -/]*[@-~]/.test(line) ? line : c3.dim(line)),
588118
+ mode: "truncate",
588119
+ colorCode: 44
588120
+ // cyan-ish, matching the prior cyan header
588121
+ });
588099
588122
  }
588100
588123
  function extractFirstLine(output, maxW) {
588101
588124
  const line = output.split("\n").find((l2) => l2.trim()) ?? output;
@@ -589394,16 +589417,15 @@ connectPP();
589394
589417
  </html>`;
589395
589418
  }
589396
589419
  function renderVoiceSessionStart(tunnelUrl) {
589397
- process.stdout.write(`
589398
- ${c3.cyan("☁")} ${c3.bold("Live Voice Session")}
589399
- `);
589400
- process.stdout.write(` ${c3.dim("│")} ${c3.cyan(tunnelUrl)}
589401
- `);
589402
- process.stdout.write(` ${c3.dim("│")} Bidirectional PCM audio + live transcription
589403
- `);
589404
- process.stdout.write(` ${c3.dim("│")} /hangup to end session (auto-closes after 1 min idle)
589405
-
589406
- `);
589420
+ renderBoxedBlock({
589421
+ title: "☁ Live Voice Session",
589422
+ lines: [
589423
+ c3.cyan(tunnelUrl),
589424
+ "Bidirectional PCM audio + live transcription",
589425
+ "/hangup to end session (auto-closes after 1 min idle)"
589426
+ ],
589427
+ colorCode: 44
589428
+ });
589407
589429
  }
589408
589430
  function renderVoiceSessionStop(runtime) {
589409
589431
  const mins = Math.floor(runtime / 60);
@@ -589415,13 +589437,13 @@ function renderVoiceSessionStop(runtime) {
589415
589437
  }
589416
589438
  function renderVoiceSessionUser(action, username) {
589417
589439
  const icon = action === "connected" ? c3.green("→") : c3.red("←");
589418
- process.stdout.write(` ${c3.dim("│")} ${c3.cyan("☁")} ${icon} ${username} ${action}
589440
+ process.stdout.write(` ${c3.cyan("☁")} ${icon} ${username} ${action}
589419
589441
  `);
589420
589442
  }
589421
589443
  function renderVoiceSessionTranscript(speaker, text) {
589422
589444
  const label = speaker === "user" ? c3.yellow("user") : c3.cyan("agent");
589423
589445
  const preview = text.length > 80 ? text.slice(0, 77) + "..." : text;
589424
- process.stdout.write(` ${c3.dim("│")} ${c3.cyan("☁")} [${label}] ${preview}
589446
+ process.stdout.write(` ${c3.cyan("☁")} [${label}] ${preview}
589425
589447
  `);
589426
589448
  }
589427
589449
  var VoiceSession;
@@ -637813,13 +637835,15 @@ var init_emotion_engine = __esm({
637813
637835
  const prompt = [
637814
637836
  "You are the agent's private reflection process deciding whether to contact the Telegram admin.",
637815
637837
  "",
637838
+ "CRITICAL ROLE BOUNDARY: You are NOT executing the task below and you must not try to. You have exactly two tools — telegram_admin_message and task_complete — and that is correct and complete for your role. You do not have, and do not need, file/shell/edit/code tools. Never report that you are 'blocked', that you 'lack tools', or ask for tool access — that is never your job and the main agent (which has the real tools) handles the work. The task is shown only as CONTEXT so you can judge whether the admin would want a message right now.",
637839
+ "",
637816
637840
  "If no message is useful, call task_complete with NO_MESSAGE.",
637817
637841
  "If a message is useful, call telegram_admin_message with the exact text to send, then call task_complete.",
637818
- "Send a message when the agent is blocked, needs a preference/secret/clarification, is about to make a risky choice, or has a high-value status update the admin should know now.",
637819
- "Do not send routine task-complete, success-streak, mood, or cheerleading updates.",
637820
- "If you message, write it naturally in first person, under 700 characters. Ask a direct question only when user input would change the next action.",
637842
+ "Send a message when the MAIN AGENT is genuinely blocked, needs a preference/secret/clarification from the admin, is about to make a risky choice, or has a high-value status update the admin should know now.",
637843
+ "Do not send routine task-complete, success-streak, mood, or cheerleading updates. Do not send messages about your own (the reflection process's) tools or capabilities.",
637844
+ "If you message, write it naturally in first person as the agent, under 700 characters. Ask a direct question only when admin input would change the next action.",
637821
637845
  "",
637822
- `Current task: ${this.currentTask || "(none recorded)"}`,
637846
+ `Task the MAIN AGENT is working on (context only — NOT for you to perform): ${this.currentTask || "(none recorded)"}`,
637823
637847
  `Last event: ${event.type}${event.toolName ? `:${event.toolName}` : ""}${event.success === false ? " failed" : event.success === true ? " succeeded" : ""}`,
637824
637848
  `Event content: ${String(event.content ?? "").slice(0, 500)}`,
637825
637849
  `Recent activity: ${this.describeRecentActivity() || "(none)"}`,
@@ -637838,8 +637862,20 @@ var init_emotion_engine = __esm({
637838
637862
  cleanReflectionMessage(raw) {
637839
637863
  const text = raw.replace(/^["'`]+|["'`]+$/g, "").trim();
637840
637864
  if (!text || /^NO_MESSAGE\.?$/i.test(text)) return "";
637865
+ if (this.isReflectionToolComplaint(text)) return "";
637841
637866
  return text.slice(0, 900);
637842
637867
  }
637868
+ /**
637869
+ * Detect reflection-process meta-complaints about its own (intentionally
637870
+ * minimal) tool surface. These are mode-collapse artifacts, not genuine
637871
+ * admin outreach, and must be suppressed.
637872
+ */
637873
+ isReflectionToolComplaint(text) {
637874
+ const t2 = text.toLowerCase();
637875
+ const mentionsTools = /\btask_complete\b/.test(t2) || /\btelegram_admin_message\b/.test(t2) || /\b(file_read|file_edit|file_write|shell|file_patch|batch_edit)\b/.test(t2) || /\btool ?set\b/.test(t2) || /\btools?\b/.test(t2);
637876
+ if (!mentionsTools) return false;
637877
+ return /\b(don'?t|do not|doesn'?t|did not|didn'?t|cannot|can'?t|unable to|no longer)\b[^.]*\b(have|access|use)\b/.test(t2) || /\b(provide|grant|give|need|require|request)\b[^.]*\b(access|tools?|tool ?set)\b/.test(t2) || /\bi (only )?have (only )?(access to )?(task_complete|telegram_admin_message)/.test(t2) || /\bblocked\b[^.]*\b(tools?|access)\b/.test(t2) || /\bonly (have|with) (reflection|admin|task_complete|telegram)/.test(t2);
637878
+ }
637843
637879
  /** Summarize recent tool activity into a brief phrase */
637844
637880
  describeRecentActivity() {
637845
637881
  if (this.recentTools.length === 0) return "";
@@ -644480,23 +644516,40 @@ function renderTelegramSubAgentStart(username, text, isAdmin) {
644480
644516
  `);
644481
644517
  }
644482
644518
  function renderTelegramSubAgentEvent(username, detail) {
644483
- process.stdout.write(` ${c3.dim("│")} ${c3.cyan("✈")} ${c3.dim(`@${username}:`)} ${detail}
644484
- `);
644519
+ renderBoxedBlock({
644520
+ title: `✈ @${username}`,
644521
+ lines: [detail],
644522
+ colorCode: 45
644523
+ });
644485
644524
  }
644486
644525
  function renderTelegramSubAgentToolCall(username, toolName, args) {
644487
644526
  const preview = args.length > 50 ? args.slice(0, 47) + "..." : args;
644488
- process.stdout.write(` ${c3.dim("│")} ${c3.cyan("✈")} ${c3.dim(`@${username}`)} ${c3.bold(toolName)}(${c3.dim(preview)})
644489
- `);
644527
+ renderBoxedBlock({
644528
+ title: `✈ @${username}`,
644529
+ metrics: toolName,
644530
+ lines: [`${c3.bold(toolName)}(${c3.dim(preview)})`],
644531
+ colorCode: 45
644532
+ });
644490
644533
  }
644491
644534
  function renderTelegramSubAgentComplete(username, summary) {
644492
644535
  const preview = summary.length > 80 ? summary.slice(0, 77) + "..." : summary;
644493
- process.stdout.write(` ${c3.dim("│")} ${c3.green("✔")} @${username}: ${c3.dim(preview)}
644494
- `);
644536
+ renderBoxedBlock({
644537
+ title: `✔ @${username}`,
644538
+ lines: [preview],
644539
+ kind: "success",
644540
+ colorCode: 42
644541
+ // green
644542
+ });
644495
644543
  }
644496
644544
  function renderTelegramSubAgentError(username, error) {
644497
644545
  const preview = error.length > 80 ? error.slice(0, 77) + "..." : error;
644498
- process.stdout.write(` ${c3.dim("│")} ${c3.magenta("✘")} @${username}: ${c3.dim(preview)}
644499
- `);
644546
+ renderBoxedBlock({
644547
+ title: `✘ @${username}`,
644548
+ lines: [preview],
644549
+ kind: "error",
644550
+ colorCode: 198
644551
+ // magenta
644552
+ });
644500
644553
  }
644501
644554
  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_LINK_INTEGRITY_CONTRACT, TELEGRAM_INTERACTION_DECISION_RESPONSE_FORMAT, TELEGRAM_INTERACTION_DECISION_MINIMAL_SCHEMA, TELEGRAM_INTERACTION_DECISION_REPAIR_SCHEMA, TELEGRAM_CHAT_REPLY_RESPONSE_FORMAT, TELEGRAM_SPACED_URL_RE, TELEGRAM_HTTP_URL_RE, 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_ASSOCIATIVE_FACT_LIMIT, TELEGRAM_ASSOCIATIVE_USER_FACT_LIMIT, TELEGRAM_ASSOCIATIVE_ACTION_LIMIT, TELEGRAM_ASSOCIATIVE_RELATION_LIMIT, TELEGRAM_MEMORY_STOPWORDS, TELEGRAM_MEMORY_GENERIC_QUERY_TOKENS, TELEGRAM_SUB_AGENT_BOUNDED_OPTIONS, TELEGRAM_PUBLIC_FAST_OPTIONS, TELEGRAM_ADMIN_EVIDENCE_OPTIONS, TELEGRAM_SUB_AGENT_DEFAULT_LIMIT, TELEGRAM_SUB_AGENT_MAX_LIMIT, TELEGRAM_SUB_AGENT_BURST_CONTEXT_LIMIT, TELEGRAM_ADMIN_LIVE_PANEL_PAGES, TELEGRAM_ADMIN_LIVE_MUTATION_TOOLS, TELEGRAM_PUBLIC_HELP_COMMANDS2, TELEGRAM_REMINDER_SLASH_COMMANDS, TELEGRAM_REFLECTION_SLASH_COMMANDS, TELEGRAM_PUBLIC_BOT_COMMAND_NAMES, 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, TELEGRAM_ALLOWED_UPDATES, TELEGRAM_DEFAULT_LONG_POLL_TIMEOUT_SECONDS, TELEGRAM_ROUTER_AUTO_MIN_PARAMETERS_B, TELEGRAM_PUBLIC_TOOL_QUOTAS, TelegramBridge;
644502
644555
  var init_telegram_bridge = __esm({
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.225",
3
+ "version": "1.0.227",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.225",
9
+ "version": "1.0.227",
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.225",
3
+ "version": "1.0.227",
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",