omnius 1.0.91 → 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 +160 -25
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
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 = [];
|
|
@@ -562654,6 +562687,51 @@ function buildBoxLines(data, width) {
|
|
|
562654
562687
|
lines.push(buildBottomBorder(w));
|
|
562655
562688
|
return lines;
|
|
562656
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
|
+
}
|
|
562657
562735
|
function renderTaskCompleteBox(host, data) {
|
|
562658
562736
|
const blockId = `task-complete-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
562659
562737
|
const frozen = {
|
|
@@ -562671,6 +562749,28 @@ function renderTaskCompleteBox(host, data) {
|
|
|
562671
562749
|
host.appendDynamicBlock(blockId);
|
|
562672
562750
|
return blockId;
|
|
562673
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
|
+
}
|
|
562674
562774
|
function detectTestRuns(shellCommands) {
|
|
562675
562775
|
const out = /* @__PURE__ */ new Set();
|
|
562676
562776
|
const runners = [
|
|
@@ -569019,6 +569119,7 @@ __export(omnius_directory_exports, {
|
|
|
569019
569119
|
saveSession: () => saveSession,
|
|
569020
569120
|
saveSessionContext: () => saveSessionContext,
|
|
569021
569121
|
saveSessionHistory: () => saveSessionHistory,
|
|
569122
|
+
sessionContextToHistoryBoxData: () => sessionContextToHistoryBoxData,
|
|
569022
569123
|
writeIndexData: () => writeIndexData,
|
|
569023
569124
|
writeIndexMeta: () => writeIndexMeta,
|
|
569024
569125
|
writeTaskHandoff: () => writeTaskHandoff2
|
|
@@ -569708,25 +569809,29 @@ function loadSessionContext(repoRoot) {
|
|
|
569708
569809
|
}
|
|
569709
569810
|
}
|
|
569710
569811
|
function formatSessionHistoryDisplay(ctx3) {
|
|
569711
|
-
|
|
569712
|
-
|
|
569713
|
-
|
|
569714
|
-
|
|
569715
|
-
|
|
569716
|
-
|
|
569717
|
-
|
|
569718
|
-
|
|
569719
|
-
|
|
569720
|
-
|
|
569721
|
-
|
|
569722
|
-
|
|
569723
|
-
|
|
569724
|
-
|
|
569725
|
-
|
|
569726
|
-
|
|
569727
|
-
}
|
|
569728
|
-
|
|
569729
|
-
|
|
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
|
+
};
|
|
569730
569835
|
}
|
|
569731
569836
|
function buildContextRestorePrompt(repoRoot) {
|
|
569732
569837
|
const ctx3 = loadSessionContext(repoRoot);
|
|
@@ -570061,6 +570166,7 @@ var OMNIUS_DIR, LEGACY_DIRS, SUBDIRS, CONTEXT_FILES, PENDING_TASK_FILE, HANDOFF_
|
|
|
570061
570166
|
var init_omnius_directory = __esm({
|
|
570062
570167
|
"packages/cli/src/tui/omnius-directory.ts"() {
|
|
570063
570168
|
"use strict";
|
|
570169
|
+
init_task_complete_box();
|
|
570064
570170
|
OMNIUS_DIR = ".omnius";
|
|
570065
570171
|
LEGACY_DIRS = [".oa", ".open-agents"];
|
|
570066
570172
|
SUBDIRS = ["memory", "index", "context", "history", "notes", "embedded", "provenance", "tools", "dreams"];
|
|
@@ -589511,6 +589617,13 @@ function formatCodegraphEventLine(ev) {
|
|
|
589511
589617
|
return `${ev.type} ${JSON.stringify(ev).slice(0, 120)}`;
|
|
589512
589618
|
}
|
|
589513
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
|
+
}
|
|
589514
589627
|
async function handleSlashCommand(input, ctx3) {
|
|
589515
589628
|
const trimmed = input.trim();
|
|
589516
589629
|
if (!trimmed.startsWith("/")) return "not_a_command";
|
|
@@ -594229,8 +594342,7 @@ sleep 1
|
|
|
594229
594342
|
renderInfo(
|
|
594230
594343
|
`Context restored from ${info?.entries ?? 0} saved session(s). Will be injected into your next task.`
|
|
594231
594344
|
);
|
|
594232
|
-
|
|
594233
|
-
if (historyDisplay) renderInfo(historyDisplay);
|
|
594345
|
+
renderContextHistory(ctx3, "Session History");
|
|
594234
594346
|
ctx3.setRestoredContext?.(prompt);
|
|
594235
594347
|
} else {
|
|
594236
594348
|
renderWarning(
|
|
@@ -594246,8 +594358,7 @@ sleep 1
|
|
|
594246
594358
|
renderInfo(
|
|
594247
594359
|
`Session context: ${info.entries} entries saved. Last saved: ${info.lastSaved ? new Date(info.lastSaved).toLocaleString() : "unknown"}`
|
|
594248
594360
|
);
|
|
594249
|
-
|
|
594250
|
-
if (historyDisplay) renderInfo(historyDisplay);
|
|
594361
|
+
renderContextHistory(ctx3, "Session History");
|
|
594251
594362
|
} else {
|
|
594252
594363
|
renderInfo(
|
|
594253
594364
|
"No session context saved yet. Context auto-saves on task completion."
|
|
@@ -654695,6 +654806,18 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
654695
654806
|
contextHistoryDisplay() {
|
|
654696
654807
|
const ctx3 = loadSessionContext(repoRoot);
|
|
654697
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;
|
|
654698
654821
|
}
|
|
654699
654822
|
};
|
|
654700
654823
|
commandCtxRef = commandCtx;
|
|
@@ -654818,8 +654941,19 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
654818
654941
|
renderInfo(
|
|
654819
654942
|
auto ? `Context auto-restored from ${info?.entries.length ?? 0} session(s).` : `Context restored from ${info?.entries.length ?? 0} session(s).`
|
|
654820
654943
|
);
|
|
654821
|
-
|
|
654822
|
-
|
|
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
|
+
}
|
|
654823
654957
|
});
|
|
654824
654958
|
} else {
|
|
654825
654959
|
writeContent(
|
|
@@ -656370,6 +656504,7 @@ var init_interactive = __esm({
|
|
|
656370
656504
|
init_dist7();
|
|
656371
656505
|
init_omnius_directory();
|
|
656372
656506
|
init_render();
|
|
656507
|
+
init_task_complete_box();
|
|
656373
656508
|
init_audio_waveform();
|
|
656374
656509
|
init_carousel();
|
|
656375
656510
|
init_banner();
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
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.
|
|
9
|
+
"version": "1.0.92",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED