omnius 1.0.90 → 1.0.92

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
@@ -562459,9 +562459,11 @@ var init_text_selection = __esm({
562459
562459
  var task_complete_box_exports = {};
562460
562460
  __export(task_complete_box_exports, {
562461
562461
  buildBoxLines: () => buildBoxLines,
562462
+ buildSessionHistoryBoxLines: () => buildSessionHistoryBoxLines,
562462
562463
  deriveTitle: () => deriveTitle,
562463
562464
  detectProvenanceAnchors: () => detectProvenanceAnchors,
562464
562465
  detectTestRuns: () => detectTestRuns,
562466
+ renderSessionHistoryBox: () => renderSessionHistoryBox,
562465
562467
  renderTaskCompleteBox: () => renderTaskCompleteBox
562466
562468
  });
562467
562469
  function deriveTitle(task) {
@@ -562506,6 +562508,37 @@ function buildMetricsChip(data) {
562506
562508
  }
562507
562509
  return parts.join(" · ");
562508
562510
  }
562511
+ function formatShortTimestamp(value2) {
562512
+ if (!value2) return "unknown";
562513
+ const date = new Date(value2);
562514
+ if (Number.isNaN(date.getTime())) return "unknown";
562515
+ return date.toISOString().slice(0, 16).replace("T", " ");
562516
+ }
562517
+ function buildSessionHistoryMetricsChip(data) {
562518
+ const total = data.totalEntries ?? data.entries.length;
562519
+ const completed = data.entries.filter((entry) => entry.completed).length;
562520
+ const parts = [];
562521
+ parts.push(`${total} entr${total === 1 ? "y" : "ies"}`);
562522
+ if (completed > 0) parts.push(`${completed} done`);
562523
+ if (data.updatedAt) parts.push(`updated ${formatShortTimestamp(data.updatedAt)}`);
562524
+ return parts.join(" · ");
562525
+ }
562526
+ function compactDisplayText(value2, maxLen) {
562527
+ const text = String(value2 ?? "").replace(/\s+/g, " ").trim();
562528
+ if (text.length <= maxLen) return text;
562529
+ return text.slice(0, Math.max(1, maxLen - 1)) + "…";
562530
+ }
562531
+ function uniqueNonEmpty(values) {
562532
+ const seen = /* @__PURE__ */ new Set();
562533
+ const out = [];
562534
+ for (const value2 of values) {
562535
+ const clean5 = compactDisplayText(value2, 220);
562536
+ if (!clean5 || seen.has(clean5)) continue;
562537
+ seen.add(clean5);
562538
+ out.push(clean5);
562539
+ }
562540
+ return out;
562541
+ }
562509
562542
  function wrapToWidth(text, width) {
562510
562543
  if (width <= 0) return [text];
562511
562544
  const out = [];
@@ -562625,6 +562658,10 @@ function buildBoxLines(data, width) {
562625
562658
  lines.push(buildTopBorder(`${GREEN}✔${RESET} ${title}`, metrics2, w));
562626
562659
  const innerWidth = Math.max(1, w - 4);
562627
562660
  const bodyText = (data.summary ?? "").trim();
562661
+ const hasFooter = (data.testsRun?.length ?? 0) > 0 || (data.filesEdited?.length ?? 0) > 0 || (data.provenanceAnchors?.length ?? 0) > 0;
562662
+ if (bodyText || hasFooter) {
562663
+ lines.push(buildInnerDivider(w));
562664
+ }
562628
562665
  if (bodyText) {
562629
562666
  lines.push(buildEmptyRow(w));
562630
562667
  for (const para of bodyText.split(/\n/)) {
@@ -562635,9 +562672,8 @@ function buildBoxLines(data, width) {
562635
562672
  }
562636
562673
  lines.push(buildEmptyRow(w));
562637
562674
  }
562638
- const hasFooter = (data.testsRun?.length ?? 0) > 0 || (data.filesEdited?.length ?? 0) > 0 || (data.provenanceAnchors?.length ?? 0) > 0;
562639
562675
  if (hasFooter) {
562640
- lines.push(buildInnerDivider(w));
562676
+ if (bodyText) lines.push(buildInnerDivider(w));
562641
562677
  if (data.testsRun?.length) {
562642
562678
  lines.push(...buildLabeledFooterLines("Tests", data.testsRun, w));
562643
562679
  }
@@ -562651,6 +562687,51 @@ function buildBoxLines(data, width) {
562651
562687
  lines.push(buildBottomBorder(w));
562652
562688
  return lines;
562653
562689
  }
562690
+ function buildSessionHistoryBoxLines(data, width) {
562691
+ const w = Math.max(40, width);
562692
+ const title = deriveTitle(data.title || "Session History");
562693
+ const metrics2 = buildSessionHistoryMetricsChip(data);
562694
+ const entries = data.entries.slice(-8);
562695
+ const lines = [];
562696
+ const innerWidth = Math.max(1, w - 4);
562697
+ lines.push(buildTopBorder(`${GREEN}✔${RESET} ${title}`, metrics2, w));
562698
+ lines.push(buildInnerDivider(w));
562699
+ lines.push(buildEmptyRow(w));
562700
+ const bodyLines = [];
562701
+ if (entries.length === 0) {
562702
+ bodyLines.push("No session history found.");
562703
+ } else {
562704
+ for (const entry of entries) {
562705
+ const status = entry.completed ? "✔" : "○";
562706
+ const task = compactDisplayText(entry.task || entry.summary || "Untitled session", 180);
562707
+ bodyLines.push(`${status} [${formatShortTimestamp(entry.savedAt)}] ${task}`);
562708
+ const summary = compactDisplayText(entry.summary, 220);
562709
+ if (summary) bodyLines.push(` Summary: ${summary}`);
562710
+ const model = compactDisplayText(entry.model, 80);
562711
+ const calls = Number.isFinite(entry.toolCalls) && (entry.toolCalls ?? 0) > 0 ? `${entry.toolCalls} call${entry.toolCalls === 1 ? "" : "s"}` : "";
562712
+ const meta = [model, calls].filter(Boolean).join(" · ");
562713
+ if (meta) bodyLines.push(` ${meta}`);
562714
+ }
562715
+ }
562716
+ for (const line of bodyLines) {
562717
+ for (const wrapped of wrapToWidth(line, innerWidth)) {
562718
+ lines.push(buildContentRow(wrapped, w));
562719
+ }
562720
+ }
562721
+ lines.push(buildEmptyRow(w));
562722
+ const footerFiles = uniqueNonEmpty(entries.flatMap((entry) => entry.filesModified ?? [])).slice(0, 16);
562723
+ const footerTools = uniqueNonEmpty(entries.flatMap((entry) => entry.toolsUsed ?? [])).slice(0, 16);
562724
+ const footerProvenance = uniqueNonEmpty(entries.map((entry) => entry.provenance)).slice(0, 8);
562725
+ const hasFooter = footerFiles.length > 0 || footerTools.length > 0 || footerProvenance.length > 0;
562726
+ if (hasFooter) {
562727
+ lines.push(buildInnerDivider(w));
562728
+ lines.push(...buildLabeledFooterLines("Files", footerFiles, w));
562729
+ lines.push(...buildLabeledFooterLines("Tools", footerTools, w));
562730
+ lines.push(...buildLabeledFooterLines("Provenance", footerProvenance, w));
562731
+ }
562732
+ lines.push(buildBottomBorder(w));
562733
+ return lines;
562734
+ }
562654
562735
  function renderTaskCompleteBox(host, data) {
562655
562736
  const blockId = `task-complete-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
562656
562737
  const frozen = {
@@ -562668,6 +562749,28 @@ function renderTaskCompleteBox(host, data) {
562668
562749
  host.appendDynamicBlock(blockId);
562669
562750
  return blockId;
562670
562751
  }
562752
+ function renderSessionHistoryBox(host, data) {
562753
+ const blockId = `session-history-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
562754
+ const frozen = {
562755
+ title: data.title,
562756
+ totalEntries: data.totalEntries,
562757
+ updatedAt: data.updatedAt ?? null,
562758
+ entries: data.entries.map((entry) => ({
562759
+ savedAt: entry.savedAt,
562760
+ task: entry.task,
562761
+ summary: entry.summary,
562762
+ filesModified: entry.filesModified ? [...entry.filesModified] : [],
562763
+ toolsUsed: entry.toolsUsed ? [...entry.toolsUsed] : [],
562764
+ toolCalls: entry.toolCalls,
562765
+ provenance: entry.provenance,
562766
+ completed: entry.completed,
562767
+ model: entry.model
562768
+ }))
562769
+ };
562770
+ host.registerDynamicBlock(blockId, (width) => buildSessionHistoryBoxLines(frozen, width));
562771
+ host.appendDynamicBlock(blockId);
562772
+ return blockId;
562773
+ }
562671
562774
  function detectTestRuns(shellCommands) {
562672
562775
  const out = /* @__PURE__ */ new Set();
562673
562776
  const runners = [
@@ -562716,9 +562819,9 @@ var init_task_complete_box = __esm({
562716
562819
  BOX_TJ_L = "├";
562717
562820
  BOX_TJ_R = "┤";
562718
562821
  RESET = "\x1B[0m";
562719
- GREEN = "\x1B[38;5;114m";
562720
- FG_BORDER = "\x1B[38;5;245m";
562721
- FG_TITLE = "\x1B[1;38;5;117m";
562822
+ GREEN = "\x1B[38;5;154m";
562823
+ FG_BORDER = "\x1B[38;5;154m";
562824
+ FG_TITLE = "\x1B[1;38;5;154m";
562722
562825
  FG_METRIC = "\x1B[38;5;222m";
562723
562826
  FG_LABEL = "\x1B[38;5;147m";
562724
562827
  }
@@ -569016,6 +569119,7 @@ __export(omnius_directory_exports, {
569016
569119
  saveSession: () => saveSession,
569017
569120
  saveSessionContext: () => saveSessionContext,
569018
569121
  saveSessionHistory: () => saveSessionHistory,
569122
+ sessionContextToHistoryBoxData: () => sessionContextToHistoryBoxData,
569019
569123
  writeIndexData: () => writeIndexData,
569020
569124
  writeIndexMeta: () => writeIndexMeta,
569021
569125
  writeTaskHandoff: () => writeTaskHandoff2
@@ -569705,25 +569809,29 @@ function loadSessionContext(repoRoot) {
569705
569809
  }
569706
569810
  }
569707
569811
  function formatSessionHistoryDisplay(ctx3) {
569708
- if (!ctx3 || ctx3.entries.length === 0) return "No session history found.";
569709
- const recent = ctx3.entries.slice(-8);
569710
- const lines = [];
569711
- lines.push("━━━ Session History ━━━");
569712
- for (let i2 = 0; i2 < recent.length; i2++) {
569713
- const e2 = recent[i2];
569714
- const status = e2.completed ? "✓" : "○";
569715
- const time = e2.savedAt ? new Date(e2.savedAt).toLocaleString() : "unknown";
569716
- const task = normalizeSessionText(e2.task, 100);
569717
- const summary = e2.summary ? normalizeSessionText(e2.summary, 120) : "";
569718
- const files = e2.filesModified && e2.filesModified.length > 0 ? ` files: ${e2.filesModified.slice(0, 4).join(", ")}` : "";
569719
- const tools = e2.toolsUsed && e2.toolsUsed.length > 0 ? ` tools: ${e2.toolsUsed.slice(0, 5).join(", ")}` : "";
569720
- lines.push(` ${status} [${time}] ${task}`);
569721
- if (summary) lines.push(` → ${summary}`);
569722
- if (files) lines.push(` ${files}`);
569723
- if (tools) lines.push(` ${tools}`);
569724
- }
569725
- lines.push("━━━ End History ━━━");
569726
- return lines.join("\n");
569812
+ return buildSessionHistoryBoxLines(
569813
+ sessionContextToHistoryBoxData(ctx3),
569814
+ process.stdout.columns ?? 80
569815
+ ).join("\n");
569816
+ }
569817
+ function sessionContextToHistoryBoxData(ctx3, title = "Session History") {
569818
+ const entries = (ctx3?.entries ?? []).slice(-8).map((e2) => ({
569819
+ savedAt: e2.savedAt,
569820
+ task: normalizeSessionText(cleanPromptForDiary(e2.task), 220),
569821
+ summary: normalizeSessionText(e2.assistantResponse || e2.summary, 260),
569822
+ filesModified: e2.filesModified?.slice(0, 16) ?? [],
569823
+ toolsUsed: e2.toolsUsed?.slice(0, 16) ?? [],
569824
+ toolCalls: e2.toolCalls,
569825
+ provenance: normalizeSessionText(e2.provenance, 300),
569826
+ completed: e2.completed,
569827
+ model: normalizeSessionText(e2.model, 120)
569828
+ }));
569829
+ return {
569830
+ title,
569831
+ entries,
569832
+ totalEntries: ctx3?.entries.length ?? 0,
569833
+ updatedAt: ctx3?.updatedAt ?? null
569834
+ };
569727
569835
  }
569728
569836
  function buildContextRestorePrompt(repoRoot) {
569729
569837
  const ctx3 = loadSessionContext(repoRoot);
@@ -570058,6 +570166,7 @@ var OMNIUS_DIR, LEGACY_DIRS, SUBDIRS, CONTEXT_FILES, PENDING_TASK_FILE, HANDOFF_
570058
570166
  var init_omnius_directory = __esm({
570059
570167
  "packages/cli/src/tui/omnius-directory.ts"() {
570060
570168
  "use strict";
570169
+ init_task_complete_box();
570061
570170
  OMNIUS_DIR = ".omnius";
570062
570171
  LEGACY_DIRS = [".oa", ".open-agents"];
570063
570172
  SUBDIRS = ["memory", "index", "context", "history", "notes", "embedded", "provenance", "tools", "dreams"];
@@ -585105,6 +585214,13 @@ function formatImageAsciiContext(preview, label) {
585105
585214
  return `[ASCII preview of image: ${label}]
585106
585215
  ${preview.ascii}`;
585107
585216
  }
585217
+ function hasImageExtension(filePath) {
585218
+ const lower = filePath.toLowerCase();
585219
+ for (const ext of IMAGE_PREVIEW_EXTENSIONS) {
585220
+ if (lower.endsWith(ext)) return true;
585221
+ }
585222
+ return false;
585223
+ }
585108
585224
  function extractSavedImagePath(text, repoRoot) {
585109
585225
  const patterns = [
585110
585226
  /Image generated:\s*([^\n\r]+)/i,
@@ -585120,18 +585236,29 @@ function extractSavedImagePath(text, repoRoot) {
585120
585236
  const match = text.match(pattern);
585121
585237
  if (!match?.[1]) continue;
585122
585238
  const raw = match[1].trim().replace(/\s+\([^)]+\)\s*$/g, "").replace(/^["']|["']$/g, "");
585239
+ if (!hasImageExtension(raw)) continue;
585123
585240
  const candidate = raw.startsWith("/") ? raw : resolve40(repoRoot, raw);
585124
585241
  if (existsSync99(candidate)) return candidate;
585125
585242
  }
585126
585243
  return null;
585127
585244
  }
585128
- var DEFAULT_PIXELS, ANSI_PATTERN, TERMINAL_CELL_ASPECT;
585245
+ var DEFAULT_PIXELS, ANSI_PATTERN, TERMINAL_CELL_ASPECT, IMAGE_PREVIEW_EXTENSIONS;
585129
585246
  var init_image_ascii_preview = __esm({
585130
585247
  "packages/cli/src/tui/image-ascii-preview.ts"() {
585131
585248
  "use strict";
585132
585249
  DEFAULT_PIXELS = " .,:;i1tfLCG08@";
585133
585250
  ANSI_PATTERN = /\x1B\[[0-?]*[ -/]*[@-~]/g;
585134
585251
  TERMINAL_CELL_ASPECT = 0.52;
585252
+ IMAGE_PREVIEW_EXTENSIONS = /* @__PURE__ */ new Set([
585253
+ ".png",
585254
+ ".jpg",
585255
+ ".jpeg",
585256
+ ".gif",
585257
+ ".webp",
585258
+ ".bmp",
585259
+ ".tiff",
585260
+ ".tif"
585261
+ ]);
585135
585262
  }
585136
585263
  });
585137
585264
 
@@ -589490,6 +589617,13 @@ function formatCodegraphEventLine(ev) {
589490
589617
  return `${ev.type} ${JSON.stringify(ev).slice(0, 120)}`;
589491
589618
  }
589492
589619
  }
589620
+ function renderContextHistory(ctx3, title = "Session History") {
589621
+ if (ctx3.renderSessionHistory?.(title)) return;
589622
+ const historyDisplay = ctx3.contextHistoryDisplay?.();
589623
+ if (!historyDisplay) return;
589624
+ process.stdout.write(historyDisplay.endsWith("\n") ? historyDisplay : `${historyDisplay}
589625
+ `);
589626
+ }
589493
589627
  async function handleSlashCommand(input, ctx3) {
589494
589628
  const trimmed = input.trim();
589495
589629
  if (!trimmed.startsWith("/")) return "not_a_command";
@@ -594208,8 +594342,7 @@ sleep 1
594208
594342
  renderInfo(
594209
594343
  `Context restored from ${info?.entries ?? 0} saved session(s). Will be injected into your next task.`
594210
594344
  );
594211
- const historyDisplay = ctx3.contextHistoryDisplay?.();
594212
- if (historyDisplay) renderInfo(historyDisplay);
594345
+ renderContextHistory(ctx3, "Session History");
594213
594346
  ctx3.setRestoredContext?.(prompt);
594214
594347
  } else {
594215
594348
  renderWarning(
@@ -594225,8 +594358,7 @@ sleep 1
594225
594358
  renderInfo(
594226
594359
  `Session context: ${info.entries} entries saved. Last saved: ${info.lastSaved ? new Date(info.lastSaved).toLocaleString() : "unknown"}`
594227
594360
  );
594228
- const historyDisplay = ctx3.contextHistoryDisplay?.();
594229
- if (historyDisplay) renderInfo(historyDisplay);
594361
+ renderContextHistory(ctx3, "Session History");
594230
594362
  } else {
594231
594363
  renderInfo(
594232
594364
  "No session context saved yet. Context auto-saves on task completion."
@@ -654674,6 +654806,18 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
654674
654806
  contextHistoryDisplay() {
654675
654807
  const ctx3 = loadSessionContext(repoRoot);
654676
654808
  return formatSessionHistoryDisplay(ctx3);
654809
+ },
654810
+ renderSessionHistory(title = "Session History") {
654811
+ const ctx3 = loadSessionContext(repoRoot);
654812
+ if (!statusBar.isActive || isNeovimActive() || isOverlayActive()) return false;
654813
+ renderSessionHistoryBox(
654814
+ {
654815
+ registerDynamicBlock: (id, render2) => statusBar.registerDynamicBlock(id, render2),
654816
+ appendDynamicBlock: (id) => statusBar.appendDynamicBlock(id)
654817
+ },
654818
+ sessionContextToHistoryBoxData(ctx3, title)
654819
+ );
654820
+ return true;
654677
654821
  }
654678
654822
  };
654679
654823
  commandCtxRef = commandCtx;
@@ -654797,8 +654941,19 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
654797
654941
  renderInfo(
654798
654942
  auto ? `Context auto-restored from ${info?.entries.length ?? 0} session(s).` : `Context restored from ${info?.entries.length ?? 0} session(s).`
654799
654943
  );
654800
- const historyDisplay = formatSessionHistoryDisplay(info);
654801
- renderInfo(historyDisplay);
654944
+ if (statusBar.isActive && !isNeovimActive() && !isOverlayActive()) {
654945
+ renderSessionHistoryBox(
654946
+ {
654947
+ registerDynamicBlock: (id, render2) => statusBar.registerDynamicBlock(id, render2),
654948
+ appendDynamicBlock: (id) => statusBar.appendDynamicBlock(id)
654949
+ },
654950
+ sessionContextToHistoryBoxData(info, "Session History")
654951
+ );
654952
+ } else {
654953
+ const historyDisplay = formatSessionHistoryDisplay(info);
654954
+ process.stdout.write(historyDisplay.endsWith("\n") ? historyDisplay : `${historyDisplay}
654955
+ `);
654956
+ }
654802
654957
  });
654803
654958
  } else {
654804
654959
  writeContent(
@@ -656349,6 +656504,7 @@ var init_interactive = __esm({
656349
656504
  init_dist7();
656350
656505
  init_omnius_directory();
656351
656506
  init_render();
656507
+ init_task_complete_box();
656352
656508
  init_audio_waveform();
656353
656509
  init_carousel();
656354
656510
  init_banner();
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.90",
3
+ "version": "1.0.92",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.90",
9
+ "version": "1.0.92",
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.90",
3
+ "version": "1.0.92",
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",