omnius 1.0.527 → 1.0.528

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
@@ -628049,6 +628049,21 @@ function uniqueNonEmpty(values) {
628049
628049
  }
628050
628050
  return out;
628051
628051
  }
628052
+ function hangingIndentForBoxText(text2, width) {
628053
+ const plain = stripAnsi(text2);
628054
+ const patterns = [
628055
+ /^(\s*(?:[✔○]\s+\[[^\]]+\]\s+))/,
628056
+ /^(\s*(?:[-*+•]\s+))/,
628057
+ /^(\s*(?:\d+[.)]\s+))/,
628058
+ /^(\s*(?:[A-Za-z][\w.-]{0,28}:\s+))/,
628059
+ /^(\s+)/
628060
+ ];
628061
+ for (const pattern of patterns) {
628062
+ const match = plain.match(pattern);
628063
+ if (match?.[1]) return Math.min(match[1].length, Math.max(0, width - 8));
628064
+ }
628065
+ return 0;
628066
+ }
628052
628067
  function wrapToWidth(text2, width) {
628053
628068
  if (width <= 0) return [text2];
628054
628069
  const out = [];
@@ -628057,14 +628072,22 @@ function wrapToWidth(text2, width) {
628057
628072
  out.push("");
628058
628073
  continue;
628059
628074
  }
628075
+ const continuationIndent = hangingIndentForBoxText(paragraph, width);
628076
+ const continuationPrefix = " ".repeat(continuationIndent);
628077
+ const firstWidth = width;
628078
+ const continuationWidth = Math.max(8, width - continuationIndent);
628060
628079
  let remaining = paragraph;
628061
- while (remaining.length > width) {
628062
- let breakAt = remaining.lastIndexOf(" ", width);
628063
- if (breakAt <= 0) breakAt = width;
628064
- out.push(remaining.slice(0, breakAt).trimEnd());
628080
+ let first2 = true;
628081
+ while (remaining.length > (first2 ? firstWidth : continuationWidth)) {
628082
+ const lineWidth = first2 ? firstWidth : continuationWidth;
628083
+ let breakAt = remaining.lastIndexOf(" ", lineWidth);
628084
+ if (breakAt <= 0) breakAt = lineWidth;
628085
+ const wrapped = remaining.slice(0, breakAt).trimEnd();
628086
+ out.push(first2 ? wrapped : continuationPrefix + wrapped);
628065
628087
  remaining = remaining.slice(breakAt).trimStart();
628088
+ first2 = false;
628066
628089
  }
628067
- out.push(remaining);
628090
+ out.push(first2 ? remaining : continuationPrefix + remaining);
628068
628091
  }
628069
628092
  return out;
628070
628093
  }
@@ -637348,6 +637371,7 @@ __export(omnius_directory_exports, {
637348
637371
  recordUsage: () => recordUsage,
637349
637372
  renderSessionDiary: () => renderSessionDiary,
637350
637373
  resolveSettings: () => resolveSettings,
637374
+ sanitizeRestoredSessionLines: () => sanitizeRestoredSessionLines,
637351
637375
  saveGlobalSettings: () => saveGlobalSettings,
637352
637376
  savePendingTask: () => savePendingTask,
637353
637377
  saveProjectSettings: () => saveProjectSettings,
@@ -638411,7 +638435,8 @@ function buildRestoreHistoryAnchor(repoRoot) {
638411
638435
  const [latest] = listSessions(repoRoot);
638412
638436
  if (!latest?.id) return null;
638413
638437
  const lines = loadSessionHistory(repoRoot, latest.id) ?? [];
638414
- const meaningfulTail = lines.map((line) => cleanSessionHistoryDisplayLine(line)).filter((line) => line && !isNoisySessionHistoryLine(line)).slice(-18).map((line) => `- ${normalizeSessionText(line, 220)}`);
638438
+ const restoredLines = sanitizeRestoredSessionLines(lines);
638439
+ const meaningfulTail = restoredLines.map((line) => cleanSessionHistoryDisplayLine(line)).filter((line) => line && !isNoisySessionHistoryLine(line)).slice(-18).map((line) => `- ${normalizeSessionText(line, 220)}`);
638415
638440
  const path16 = join136(OMNIUS_DIR, SESSIONS_DIR, `${latest.id}.jsonl`);
638416
638441
  const statePath = join136(OMNIUS_DIR, SESSIONS_DIR, `${latest.id}${TUI_STATE_SUFFIX}`);
638417
638442
  const hasTuiState = existsSync123(join136(repoRoot, statePath));
@@ -638419,12 +638444,12 @@ function buildRestoreHistoryAnchor(repoRoot) {
638419
638444
  latest_visual_session_id=${latest.id}
638420
638445
  ` + (hasTuiState ? `full_tui_state_path=${statePath}
638421
638446
  ` : "") + `full_transcript_path=${path16}
638422
- recorded_lines=${lines.length}
638447
+ recorded_lines=${restoredLines.length}
638423
638448
  ` + (meaningfulTail.length > 0 ? `Recent visible transcript tail:
638424
638449
  ${meaningfulTail.join("\n")}
638425
638450
  ` : "") + `Recall contract: the full transcript artifact above is restored into the TUI scrollback and is the authoritative previous interface state. Read it only when exact prior UI/tool output is needed; otherwise use this restored state to avoid rediscovery.
638426
638451
  </restored-interface-history>`;
638427
- return { sessionId: latest.id, path: path16, lineCount: lines.length, block };
638452
+ return { sessionId: latest.id, path: path16, lineCount: restoredLines.length, block };
638428
638453
  }
638429
638454
  function appendRestoreBlocks(base3, blocks) {
638430
638455
  return [base3, ...blocks].filter((part) => part && part.trim()).join("\n\n");
@@ -638576,12 +638601,37 @@ function updateSessionEntry(repoRoot, sessionId, patch) {
638576
638601
  }
638577
638602
  }
638578
638603
  function cleanSessionHistoryDisplayLine(line) {
638579
- return String(line || "").replace(/\x1B\[[0-9;]*[a-zA-Z]/g, "").replace(/^[>❯▹∙•*+\-\s]+/, "").replace(/^\[.*?\]\s*/, "").replace(/^(?:User|Assistant|You|Open Agent|Omnius)\s*:\s*/i, "").replace(/\s+/g, " ").trim();
638604
+ return String(line || "").replace(/\x1B\[[0-9;]*[a-zA-Z]/g, "").replace(/^[>❯▹·∙•*+\-\s]+/, "").replace(/^\[.*?\]\s*/, "").replace(/^(?:User|Assistant|You|Open Agent|Omnius)\s*:\s*/i, "").replace(/\s+/g, " ").trim();
638580
638605
  }
638581
638606
  function isNoisySessionHistoryLine(line) {
638582
638607
  const clean5 = cleanSessionHistoryDisplayLine(line || "");
638583
638608
  if (!clean5) return true;
638584
- return /^(?:Previous session found|REST API:|Nexus P2P network connected|No context to restore|Starting fresh|Use \/endpoint|Knowledge graph:|Zettelkasten:|Episodes captured:|Current OMNIUS_HOST:|Loaded TUI session|General session$|Chat tui:sess|TUI session\b|Using (?:expanded )?context model|Using model|Context (?:auto-)?restored|Context restored|Recovered session|Last task:|\(manual save\)|\[VRAM|VRAM |model_info|KV |arch[ -]capped|i\s+)/i.test(clean5);
638609
+ const withoutEventPrefix = clean5.replace(/^(?:E|W|⚠)\s+/, "");
638610
+ const noise2 = /^(?:Previous session found|REST API:|Nexus P2P network connected|No context to restore|Starting fresh|Use \/endpoint|Knowledge graph:|Zettelkasten:|Episodes captured:|Current OMNIUS_HOST:|Loaded TUI session|General session$|Chat tui:sess|TUI session\b|Using (?:expanded )?context model|Using model|Context (?:auto-)?restored|Context restored|Recovered session|Last task:|Voice feedback enabled\b|Clone ref:|clone-[^\s]+\.wav$|Memory maintenance:|reclaimed\b.*\.?$|Task timeout reached during backend retry|Incomplete: task timed out\b|Task incomplete\b|Tokens:\s*[\d,~]+|\(manual save\)|continue$|\[VRAM|VRAM |model_info|KV |arch[ -]capped|i\s+(?:starting|loaded|using|context|rest|nexus|previous)\b)/i;
638611
+ return noise2.test(clean5) || noise2.test(withoutEventPrefix);
638612
+ }
638613
+ function sanitizeRestoredSessionLines(lines, options2 = {}) {
638614
+ const maxLines = Math.max(
638615
+ 1,
638616
+ Math.floor(options2.maxLines ?? DEFAULT_RESTORED_SESSION_HISTORY_MAX_LINES)
638617
+ );
638618
+ const out = [];
638619
+ let previousBlank = false;
638620
+ for (const raw of lines) {
638621
+ const line = String(raw ?? "").replace(/\x1B\[[0-9;]*[a-zA-Z]/g, "").replace(/\s+$/g, "");
638622
+ if (isNoisySessionHistoryLine(line)) continue;
638623
+ if (!line.trim()) {
638624
+ if (previousBlank) continue;
638625
+ previousBlank = true;
638626
+ out.push("");
638627
+ continue;
638628
+ }
638629
+ previousBlank = false;
638630
+ out.push(line);
638631
+ }
638632
+ while (out[0] === "") out.shift();
638633
+ while (out[out.length - 1] === "") out.pop();
638634
+ return out.slice(-maxLines);
638585
638635
  }
638586
638636
  function firstMeaningfulSessionHistoryLine(lines) {
638587
638637
  for (const line of lines) {
@@ -638904,7 +638954,7 @@ function deleteUsageRecord(kind, value2, repoRoot) {
638904
638954
  remove(join136(repoRoot, OMNIUS_DIR, USAGE_HISTORY_FILE));
638905
638955
  }
638906
638956
  }
638907
- var OMNIUS_DIR, LEGACY_DIRS, SUBDIRS, gitignoreWatchers, gitignoreRetryTimers, CONTEXT_FILES, PENDING_TASK_FILE, HANDOFF_FILE, CONTEXT_SAVE_FILE, CONTEXT_LEDGER_FILE, MAX_CONTEXT_ENTRIES, MAX_SESSION_DIARY_ENTRIES, MAX_SESSION_DIARY_DETAILED_ENTRIES, MAX_CONTEXT_LEDGER_LINES, MAX_CONTEXT_LEDGER_BYTES, SAME_TASK_REPLACE_WINDOW_MS, LOCK_TIMEOUT_MS, LOCK_RETRY_MS, LOCK_RETRY_MAX, DEICTIC_CONTINUATION_TERMS, SESSIONS_DIR, SESSIONS_INDEX, TUI_STATE_SUFFIX, SKIP_DIRS3, HOME_SKIP_DIRS, USAGE_HISTORY_FILE, MAX_HISTORY_RECORDS;
638957
+ var OMNIUS_DIR, LEGACY_DIRS, SUBDIRS, gitignoreWatchers, gitignoreRetryTimers, CONTEXT_FILES, PENDING_TASK_FILE, HANDOFF_FILE, CONTEXT_SAVE_FILE, CONTEXT_LEDGER_FILE, MAX_CONTEXT_ENTRIES, MAX_SESSION_DIARY_ENTRIES, MAX_SESSION_DIARY_DETAILED_ENTRIES, MAX_CONTEXT_LEDGER_LINES, MAX_CONTEXT_LEDGER_BYTES, SAME_TASK_REPLACE_WINDOW_MS, LOCK_TIMEOUT_MS, LOCK_RETRY_MS, LOCK_RETRY_MAX, DEFAULT_RESTORED_SESSION_HISTORY_MAX_LINES, DEICTIC_CONTINUATION_TERMS, SESSIONS_DIR, SESSIONS_INDEX, TUI_STATE_SUFFIX, SKIP_DIRS3, HOME_SKIP_DIRS, USAGE_HISTORY_FILE, MAX_HISTORY_RECORDS;
638908
638958
  var init_omnius_directory = __esm({
638909
638959
  "packages/cli/src/tui/omnius-directory.ts"() {
638910
638960
  init_dist5();
@@ -638937,6 +638987,7 @@ var init_omnius_directory = __esm({
638937
638987
  LOCK_TIMEOUT_MS = 5e3;
638938
638988
  LOCK_RETRY_MS = 50;
638939
638989
  LOCK_RETRY_MAX = 100;
638990
+ DEFAULT_RESTORED_SESSION_HISTORY_MAX_LINES = 600;
638940
638991
  DEICTIC_CONTINUATION_TERMS = /* @__PURE__ */ new Set([
638941
638992
  "again",
638942
638993
  "and",
@@ -752674,15 +752725,23 @@ This is an independent background session started from /background.`
752674
752725
  const tuiState = loadTuiSessionState(repoRoot, snapshot.historySessionId);
752675
752726
  if (tuiState) {
752676
752727
  try {
752677
- statusBar.restoreMainSessionState(tuiState);
752678
- return true;
752728
+ const contentLines = sanitizeRestoredSessionLines(tuiState.contentLines);
752729
+ if (contentLines.length > 0) {
752730
+ statusBar.restoreMainSessionState({
752731
+ ...tuiState,
752732
+ contentLines
752733
+ });
752734
+ return true;
752735
+ }
752679
752736
  } catch {
752680
752737
  }
752681
752738
  }
752682
752739
  const lines = loadSessionHistory(repoRoot, snapshot.historySessionId);
752683
752740
  if (!lines || lines.length === 0) return false;
752684
752741
  try {
752685
- statusBar.restoreMainContentLines(lines);
752742
+ const contentLines = sanitizeRestoredSessionLines(lines);
752743
+ if (contentLines.length === 0) return false;
752744
+ statusBar.restoreMainContentLines(contentLines);
752686
752745
  return true;
752687
752746
  } catch {
752688
752747
  return false;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.527",
3
+ "version": "1.0.528",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.527",
9
+ "version": "1.0.528",
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.527",
3
+ "version": "1.0.528",
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",