omnius 1.0.464 → 1.0.465
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 +208 -11
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -619139,7 +619139,10 @@ function renderTaskCompleteBox(host, data) {
|
|
|
619139
619139
|
testsRun: data.testsRun ? [...data.testsRun] : [],
|
|
619140
619140
|
provenanceAnchors: data.provenanceAnchors ? [...data.provenanceAnchors] : []
|
|
619141
619141
|
};
|
|
619142
|
-
host.registerDynamicBlock(blockId, (width) => buildBoxLines(frozen, width)
|
|
619142
|
+
host.registerDynamicBlock(blockId, (width) => buildBoxLines(frozen, width), {
|
|
619143
|
+
renderer: "task-complete",
|
|
619144
|
+
data: frozen
|
|
619145
|
+
});
|
|
619143
619146
|
host.appendDynamicBlock(blockId);
|
|
619144
619147
|
return blockId;
|
|
619145
619148
|
}
|
|
@@ -619163,7 +619166,11 @@ function renderSessionHistoryBox(host, data) {
|
|
|
619163
619166
|
};
|
|
619164
619167
|
host.registerDynamicBlock(
|
|
619165
619168
|
blockId,
|
|
619166
|
-
(width) => buildSessionHistoryBoxLines(frozen, width)
|
|
619169
|
+
(width) => buildSessionHistoryBoxLines(frozen, width),
|
|
619170
|
+
{
|
|
619171
|
+
renderer: "session-history",
|
|
619172
|
+
data: frozen
|
|
619173
|
+
}
|
|
619167
619174
|
);
|
|
619168
619175
|
host.appendDynamicBlock(blockId);
|
|
619169
619176
|
return blockId;
|
|
@@ -620206,6 +620213,7 @@ __export(render_exports, {
|
|
|
620206
620213
|
getColorsEnabled: () => getColorsEnabled,
|
|
620207
620214
|
getEmojisEnabled: () => getEmojisEnabled,
|
|
620208
620215
|
getTermWidth: () => getTermWidth,
|
|
620216
|
+
isPersistedDynamicBlockSpec: () => isPersistedDynamicBlockSpec,
|
|
620209
620217
|
pastel: () => pastel,
|
|
620210
620218
|
renderAssistantText: () => renderAssistantText,
|
|
620211
620219
|
renderBoxedBlock: () => renderBoxedBlock,
|
|
@@ -620219,6 +620227,7 @@ __export(render_exports, {
|
|
|
620219
620227
|
renderInfo: () => renderInfo,
|
|
620220
620228
|
renderModelList: () => renderModelList,
|
|
620221
620229
|
renderModelSwitch: () => renderModelSwitch,
|
|
620230
|
+
renderPersistedDynamicBlockSpec: () => renderPersistedDynamicBlockSpec,
|
|
620222
620231
|
renderRichHeader: () => renderRichHeader,
|
|
620223
620232
|
renderSlashHelp: () => renderSlashHelp,
|
|
620224
620233
|
renderSteeringIntake: () => renderSteeringIntake,
|
|
@@ -620668,6 +620677,68 @@ function applyCollapseToBox(fullLines, opts) {
|
|
|
620668
620677
|
);
|
|
620669
620678
|
return [...head, ...body, lessRow, bottom];
|
|
620670
620679
|
}
|
|
620680
|
+
function isPersistedDynamicBlockSpec(value2) {
|
|
620681
|
+
if (!value2 || typeof value2 !== "object") return false;
|
|
620682
|
+
const renderer = value2.renderer;
|
|
620683
|
+
return renderer === "tool-combined" || renderer === "tool-result" || renderer === "tool-box" || renderer === "task-complete" || renderer === "session-history";
|
|
620684
|
+
}
|
|
620685
|
+
function renderPersistedDynamicBlockSpec(spec, width, id2) {
|
|
620686
|
+
switch (spec.renderer) {
|
|
620687
|
+
case "tool-combined": {
|
|
620688
|
+
let lines = buildCombinedToolBoxLines(
|
|
620689
|
+
spec.toolName,
|
|
620690
|
+
spec.callArgs ?? {},
|
|
620691
|
+
Boolean(spec.success),
|
|
620692
|
+
String(spec.output ?? ""),
|
|
620693
|
+
spec.opts ?? {},
|
|
620694
|
+
width
|
|
620695
|
+
);
|
|
620696
|
+
if (spec.collapse && id2) {
|
|
620697
|
+
ensureCollapsible(id2);
|
|
620698
|
+
lines = applyCollapseToBox(lines, {
|
|
620699
|
+
state: getCollapseState(id2),
|
|
620700
|
+
desc: spec.collapse,
|
|
620701
|
+
width
|
|
620702
|
+
});
|
|
620703
|
+
}
|
|
620704
|
+
return lines;
|
|
620705
|
+
}
|
|
620706
|
+
case "tool-result": {
|
|
620707
|
+
let lines = buildToolResultBoxLines(
|
|
620708
|
+
spec.toolName,
|
|
620709
|
+
Boolean(spec.success),
|
|
620710
|
+
String(spec.output ?? ""),
|
|
620711
|
+
spec.opts ?? {},
|
|
620712
|
+
width
|
|
620713
|
+
);
|
|
620714
|
+
if (spec.collapse && id2) {
|
|
620715
|
+
ensureCollapsible(id2);
|
|
620716
|
+
lines = applyCollapseToBox(lines, {
|
|
620717
|
+
state: getCollapseState(id2),
|
|
620718
|
+
desc: spec.collapse,
|
|
620719
|
+
width
|
|
620720
|
+
});
|
|
620721
|
+
}
|
|
620722
|
+
return lines;
|
|
620723
|
+
}
|
|
620724
|
+
case "tool-box": {
|
|
620725
|
+
let lines = buildToolBoxLines(spec.data, width);
|
|
620726
|
+
if (spec.collapse && id2) {
|
|
620727
|
+
ensureCollapsible(id2);
|
|
620728
|
+
lines = applyCollapseToBox(lines, {
|
|
620729
|
+
state: getCollapseState(id2),
|
|
620730
|
+
desc: spec.collapse,
|
|
620731
|
+
width
|
|
620732
|
+
});
|
|
620733
|
+
}
|
|
620734
|
+
return lines;
|
|
620735
|
+
}
|
|
620736
|
+
case "task-complete":
|
|
620737
|
+
return buildBoxLines(spec.data, width);
|
|
620738
|
+
case "session-history":
|
|
620739
|
+
return buildSessionHistoryBoxLines(spec.data, width);
|
|
620740
|
+
}
|
|
620741
|
+
}
|
|
620671
620742
|
function buildToolContentRow(content, width, colorCode) {
|
|
620672
620743
|
const border = toolColorSeq(colorCode);
|
|
620673
620744
|
const reset = toolResetSeq();
|
|
@@ -620910,11 +620981,12 @@ function buildToolBoxLines(data, width) {
|
|
|
620910
620981
|
lines.push(buildToolBottom(w, data.colorCode));
|
|
620911
620982
|
return lines;
|
|
620912
620983
|
}
|
|
620913
|
-
function renderToolDynamicBlock(kind, render2, opts, collapse) {
|
|
620984
|
+
function renderToolDynamicBlock(kind, render2, opts, collapse, persistedSpec) {
|
|
620914
620985
|
const redir = _contentWriteHook?.redirect?.();
|
|
620915
620986
|
const host = opts.host !== void 0 ? opts.host : _contentWriteHook?.dynamicBlockHost?.();
|
|
620916
620987
|
if (!redir && host) {
|
|
620917
620988
|
const id2 = `${kind}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
620989
|
+
const specForPersistence = persistedSpec && collapse ? { ...persistedSpec, collapse } : persistedSpec;
|
|
620918
620990
|
if (collapse) {
|
|
620919
620991
|
ensureCollapsible(id2);
|
|
620920
620992
|
host.registerDynamicBlock(
|
|
@@ -620923,10 +620995,11 @@ function renderToolDynamicBlock(kind, render2, opts, collapse) {
|
|
|
620923
620995
|
state: getCollapseState(id2),
|
|
620924
620996
|
desc: collapse,
|
|
620925
620997
|
width
|
|
620926
|
-
})
|
|
620998
|
+
}),
|
|
620999
|
+
specForPersistence
|
|
620927
621000
|
);
|
|
620928
621001
|
} else {
|
|
620929
|
-
host.registerDynamicBlock(id2, render2);
|
|
621002
|
+
host.registerDynamicBlock(id2, render2, specForPersistence);
|
|
620930
621003
|
}
|
|
620931
621004
|
host.appendDynamicBlock(id2);
|
|
620932
621005
|
return;
|
|
@@ -621495,7 +621568,16 @@ function renderToolResult(toolName, success, output, verboseOrOpts) {
|
|
|
621495
621568
|
width
|
|
621496
621569
|
),
|
|
621497
621570
|
opts,
|
|
621498
|
-
collapseDesc
|
|
621571
|
+
collapseDesc,
|
|
621572
|
+
{
|
|
621573
|
+
renderer: "tool-combined",
|
|
621574
|
+
toolName,
|
|
621575
|
+
callArgs: { ...pending2.args ?? {} },
|
|
621576
|
+
success,
|
|
621577
|
+
output: frozenOutput,
|
|
621578
|
+
opts: { ...opts, verbose: pending2.verbose ?? opts.verbose },
|
|
621579
|
+
collapse: collapseDesc
|
|
621580
|
+
}
|
|
621499
621581
|
);
|
|
621500
621582
|
return;
|
|
621501
621583
|
}
|
|
@@ -621504,7 +621586,15 @@ function renderToolResult(toolName, success, output, verboseOrOpts) {
|
|
|
621504
621586
|
"tool-result",
|
|
621505
621587
|
(width) => buildToolResultBoxLines(toolName, success, frozenOutput, opts, width),
|
|
621506
621588
|
opts,
|
|
621507
|
-
collapseDesc
|
|
621589
|
+
collapseDesc,
|
|
621590
|
+
{
|
|
621591
|
+
renderer: "tool-result",
|
|
621592
|
+
toolName,
|
|
621593
|
+
success,
|
|
621594
|
+
output: frozenOutput,
|
|
621595
|
+
opts: { ...opts },
|
|
621596
|
+
collapse: collapseDesc
|
|
621597
|
+
}
|
|
621508
621598
|
);
|
|
621509
621599
|
}
|
|
621510
621600
|
function renderBoxedBlock(opts) {
|
|
@@ -621528,7 +621618,18 @@ function renderBoxedBlock(opts) {
|
|
|
621528
621618
|
},
|
|
621529
621619
|
width
|
|
621530
621620
|
),
|
|
621531
|
-
opts.host === void 0 ? {} : { host: opts.host }
|
|
621621
|
+
opts.host === void 0 ? {} : { host: opts.host },
|
|
621622
|
+
void 0,
|
|
621623
|
+
{
|
|
621624
|
+
renderer: "tool-box",
|
|
621625
|
+
data: {
|
|
621626
|
+
title: opts.title,
|
|
621627
|
+
metrics: opts.metrics ?? "",
|
|
621628
|
+
body,
|
|
621629
|
+
colorCode: opts.colorCode ?? tuiTextDim(),
|
|
621630
|
+
metricsColorCode: opts.metricsColorCode
|
|
621631
|
+
}
|
|
621632
|
+
}
|
|
621532
621633
|
);
|
|
621533
621634
|
}
|
|
621534
621635
|
function renderImageAsciiPreview(title, imagePath, ascii2, renderer) {
|
|
@@ -628014,6 +628115,7 @@ __export(omnius_directory_exports, {
|
|
|
628014
628115
|
loadRecentSessions: () => loadRecentSessions,
|
|
628015
628116
|
loadSessionContext: () => loadSessionContext,
|
|
628016
628117
|
loadSessionHistory: () => loadSessionHistory,
|
|
628118
|
+
loadTuiSessionState: () => loadTuiSessionState,
|
|
628017
628119
|
loadUsageHistory: () => loadUsageHistory,
|
|
628018
628120
|
readIndexData: () => readIndexData,
|
|
628019
628121
|
readIndexMeta: () => readIndexMeta,
|
|
@@ -628027,6 +628129,7 @@ __export(omnius_directory_exports, {
|
|
|
628027
628129
|
saveSession: () => saveSession,
|
|
628028
628130
|
saveSessionContext: () => saveSessionContext,
|
|
628029
628131
|
saveSessionHistory: () => saveSessionHistory,
|
|
628132
|
+
saveTuiSessionState: () => saveTuiSessionState,
|
|
628030
628133
|
sessionContextToHistoryBoxData: () => sessionContextToHistoryBoxData,
|
|
628031
628134
|
stopOmniusGitignoreWatcher: () => stopOmniusGitignoreWatcher,
|
|
628032
628135
|
updateSessionEntry: () => updateSessionEntry,
|
|
@@ -629085,9 +629188,12 @@ function buildRestoreHistoryAnchor(repoRoot) {
|
|
|
629085
629188
|
const lines = loadSessionHistory(repoRoot, latest.id) ?? [];
|
|
629086
629189
|
const meaningfulTail = lines.map((line) => cleanSessionHistoryDisplayLine(line)).filter((line) => line && !isNoisySessionHistoryLine(line)).slice(-18).map((line) => `- ${normalizeSessionText(line, 220)}`);
|
|
629087
629190
|
const path12 = join136(OMNIUS_DIR, SESSIONS_DIR, `${latest.id}.jsonl`);
|
|
629191
|
+
const statePath = join136(OMNIUS_DIR, SESSIONS_DIR, `${latest.id}${TUI_STATE_SUFFIX}`);
|
|
629192
|
+
const hasTuiState = existsSync122(join136(repoRoot, statePath));
|
|
629088
629193
|
const block = `<restored-interface-history>
|
|
629089
629194
|
latest_visual_session_id=${latest.id}
|
|
629090
|
-
|
|
629195
|
+
` + (hasTuiState ? `full_tui_state_path=${statePath}
|
|
629196
|
+
` : "") + `full_transcript_path=${path12}
|
|
629091
629197
|
recorded_lines=${lines.length}
|
|
629092
629198
|
` + (meaningfulTail.length > 0 ? `Recent visible transcript tail:
|
|
629093
629199
|
${meaningfulTail.join("\n")}
|
|
@@ -629311,6 +629417,34 @@ function saveSessionHistory(repoRoot, sessionId, contentLines, meta) {
|
|
|
629311
629417
|
}
|
|
629312
629418
|
writeFileSync64(indexPath, JSON.stringify(index, null, 2), "utf-8");
|
|
629313
629419
|
}
|
|
629420
|
+
function saveTuiSessionState(repoRoot, sessionId, state) {
|
|
629421
|
+
const sessDir = join136(repoRoot, OMNIUS_DIR, SESSIONS_DIR);
|
|
629422
|
+
mkdirSync76(sessDir, { recursive: true });
|
|
629423
|
+
const statePath = join136(sessDir, `${sessionId}${TUI_STATE_SUFFIX}`);
|
|
629424
|
+
const payload = {
|
|
629425
|
+
version: 2,
|
|
629426
|
+
savedAt: state.savedAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
629427
|
+
contentLines: Array.isArray(state.contentLines) ? state.contentLines : [],
|
|
629428
|
+
dynamicBlocks: state.dynamicBlocks && typeof state.dynamicBlocks === "object" ? state.dynamicBlocks : {}
|
|
629429
|
+
};
|
|
629430
|
+
writeFileSync64(statePath, JSON.stringify(payload, null, 2), "utf-8");
|
|
629431
|
+
}
|
|
629432
|
+
function loadTuiSessionState(repoRoot, sessionId) {
|
|
629433
|
+
const statePath = join136(repoRoot, OMNIUS_DIR, SESSIONS_DIR, `${sessionId}${TUI_STATE_SUFFIX}`);
|
|
629434
|
+
try {
|
|
629435
|
+
if (!existsSync122(statePath)) return null;
|
|
629436
|
+
const parsed = JSON.parse(readFileSync101(statePath, "utf-8"));
|
|
629437
|
+
if (parsed.version !== 2 || !Array.isArray(parsed.contentLines)) return null;
|
|
629438
|
+
return {
|
|
629439
|
+
version: 2,
|
|
629440
|
+
savedAt: typeof parsed.savedAt === "string" ? parsed.savedAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
629441
|
+
contentLines: parsed.contentLines.filter((line) => typeof line === "string"),
|
|
629442
|
+
dynamicBlocks: parsed.dynamicBlocks && typeof parsed.dynamicBlocks === "object" ? parsed.dynamicBlocks : {}
|
|
629443
|
+
};
|
|
629444
|
+
} catch {
|
|
629445
|
+
return null;
|
|
629446
|
+
}
|
|
629447
|
+
}
|
|
629314
629448
|
function listSessions(repoRoot) {
|
|
629315
629449
|
const indexPath = join136(repoRoot, OMNIUS_DIR, SESSIONS_DIR, SESSIONS_INDEX);
|
|
629316
629450
|
try {
|
|
@@ -629336,6 +629470,8 @@ function deleteSession(repoRoot, sessionId) {
|
|
|
629336
629470
|
try {
|
|
629337
629471
|
const contentPath = join136(sessDir, `${sessionId}.jsonl`);
|
|
629338
629472
|
if (existsSync122(contentPath)) unlinkSync23(contentPath);
|
|
629473
|
+
const statePath = join136(sessDir, `${sessionId}${TUI_STATE_SUFFIX}`);
|
|
629474
|
+
if (existsSync122(statePath)) unlinkSync23(statePath);
|
|
629339
629475
|
if (existsSync122(indexPath)) {
|
|
629340
629476
|
let index = JSON.parse(readFileSync101(indexPath, "utf-8"));
|
|
629341
629477
|
index = index.filter((s2) => s2.id !== sessionId);
|
|
@@ -629543,7 +629679,7 @@ function deleteUsageRecord(kind, value2, repoRoot) {
|
|
|
629543
629679
|
remove(join136(repoRoot, OMNIUS_DIR, USAGE_HISTORY_FILE));
|
|
629544
629680
|
}
|
|
629545
629681
|
}
|
|
629546
|
-
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, SKIP_DIRS3, HOME_SKIP_DIRS, USAGE_HISTORY_FILE, MAX_HISTORY_RECORDS;
|
|
629682
|
+
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;
|
|
629547
629683
|
var init_omnius_directory = __esm({
|
|
629548
629684
|
"packages/cli/src/tui/omnius-directory.ts"() {
|
|
629549
629685
|
"use strict";
|
|
@@ -629607,6 +629743,7 @@ var init_omnius_directory = __esm({
|
|
|
629607
629743
|
]);
|
|
629608
629744
|
SESSIONS_DIR = "sessions";
|
|
629609
629745
|
SESSIONS_INDEX = "sessions-index.json";
|
|
629746
|
+
TUI_STATE_SUFFIX = ".tui-state.json";
|
|
629610
629747
|
SKIP_DIRS3 = /* @__PURE__ */ new Set([
|
|
629611
629748
|
"node_modules",
|
|
629612
629749
|
".git",
|
|
@@ -632289,6 +632426,7 @@ var init_status_bar = __esm({
|
|
|
632289
632426
|
* repaint, including selection updates and scroll events.
|
|
632290
632427
|
*/
|
|
632291
632428
|
_dynamicBlocks = /* @__PURE__ */ new Map();
|
|
632429
|
+
_dynamicBlockSpecs = /* @__PURE__ */ new Map();
|
|
632292
632430
|
_dynamicBlockClickHandlers = /* @__PURE__ */ new Map();
|
|
632293
632431
|
/** Sentinel marker — used both for scrollback storage and reflow detection. */
|
|
632294
632432
|
DYNAMIC_BLOCK_MARK_PREFIX = "DYNBLOCK:";
|
|
@@ -632434,8 +632572,13 @@ var init_status_bar = __esm({
|
|
|
632434
632572
|
* through `appendDynamicBlock` which also triggers a repaint so the
|
|
632435
632573
|
* block becomes visible immediately.
|
|
632436
632574
|
*/
|
|
632437
|
-
registerDynamicBlock(id2, render2) {
|
|
632575
|
+
registerDynamicBlock(id2, render2, persistedSpec) {
|
|
632438
632576
|
this._dynamicBlocks.set(id2, render2);
|
|
632577
|
+
if (isPersistedDynamicBlockSpec(persistedSpec)) {
|
|
632578
|
+
this._dynamicBlockSpecs.set(id2, persistedSpec);
|
|
632579
|
+
} else {
|
|
632580
|
+
this._dynamicBlockSpecs.delete(id2);
|
|
632581
|
+
}
|
|
632439
632582
|
this._dynamicBlockVersion++;
|
|
632440
632583
|
this.invalidateRowCountCache();
|
|
632441
632584
|
return `${this.DYNAMIC_BLOCK_MARK_PREFIX}${id2}${this.DYNAMIC_BLOCK_MARK_SUFFIX}`;
|
|
@@ -632446,6 +632589,7 @@ var init_status_bar = __esm({
|
|
|
632446
632589
|
/** Unregister a dynamic block. Existing sentinels in scrollback become inert (rendered as empty). */
|
|
632447
632590
|
unregisterDynamicBlock(id2) {
|
|
632448
632591
|
this._dynamicBlocks.delete(id2);
|
|
632592
|
+
this._dynamicBlockSpecs.delete(id2);
|
|
632449
632593
|
this._dynamicBlockClickHandlers.delete(id2);
|
|
632450
632594
|
this._dynamicBlockVersion++;
|
|
632451
632595
|
this.invalidateRowCountCache();
|
|
@@ -632484,6 +632628,45 @@ var init_status_bar = __esm({
|
|
|
632484
632628
|
const lines = mainView?.contentLines ?? this._contentLines;
|
|
632485
632629
|
return this.expandDynamicBlockSentinels(lines, width);
|
|
632486
632630
|
}
|
|
632631
|
+
dynamicBlockIdFromSentinel(line) {
|
|
632632
|
+
if (typeof line !== "string" || !line.startsWith(this.DYNAMIC_BLOCK_MARK_PREFIX) || !line.endsWith(this.DYNAMIC_BLOCK_MARK_SUFFIX) || line.length <= this.DYNAMIC_BLOCK_MARK_PREFIX.length + this.DYNAMIC_BLOCK_MARK_SUFFIX.length) {
|
|
632633
|
+
return null;
|
|
632634
|
+
}
|
|
632635
|
+
return line.slice(
|
|
632636
|
+
this.DYNAMIC_BLOCK_MARK_PREFIX.length,
|
|
632637
|
+
line.length - this.DYNAMIC_BLOCK_MARK_SUFFIX.length
|
|
632638
|
+
);
|
|
632639
|
+
}
|
|
632640
|
+
/** Capture raw render sources for exact restart restore. */
|
|
632641
|
+
capturePersistedSessionState() {
|
|
632642
|
+
const mainView = this._agentViews.get("main");
|
|
632643
|
+
const contentLines = [...mainView?.contentLines ?? this._contentLines].slice(-this._contentMaxLines);
|
|
632644
|
+
const dynamicBlocks = {};
|
|
632645
|
+
for (const line of contentLines) {
|
|
632646
|
+
const id2 = this.dynamicBlockIdFromSentinel(line);
|
|
632647
|
+
if (!id2) continue;
|
|
632648
|
+
const spec = this._dynamicBlockSpecs.get(id2);
|
|
632649
|
+
if (spec) dynamicBlocks[id2] = spec;
|
|
632650
|
+
}
|
|
632651
|
+
return {
|
|
632652
|
+
version: 2,
|
|
632653
|
+
savedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
632654
|
+
contentLines,
|
|
632655
|
+
dynamicBlocks
|
|
632656
|
+
};
|
|
632657
|
+
}
|
|
632658
|
+
/** Restore raw render sources and re-register their live dynamic renderers. */
|
|
632659
|
+
restoreMainSessionState(state) {
|
|
632660
|
+
for (const [id2, spec] of Object.entries(state.dynamicBlocks ?? {})) {
|
|
632661
|
+
if (!isPersistedDynamicBlockSpec(spec)) continue;
|
|
632662
|
+
this.registerDynamicBlock(
|
|
632663
|
+
id2,
|
|
632664
|
+
(width) => renderPersistedDynamicBlockSpec(spec, width, id2),
|
|
632665
|
+
spec
|
|
632666
|
+
);
|
|
632667
|
+
}
|
|
632668
|
+
this.restoreMainContentLines(Array.isArray(state.contentLines) ? state.contentLines : []);
|
|
632669
|
+
}
|
|
632487
632670
|
/**
|
|
632488
632671
|
* Append a previously-registered dynamic block's sentinel to scrollback
|
|
632489
632672
|
* and trigger a repaint. The block's renderer fires immediately at the
|
|
@@ -741062,6 +741245,7 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
|
|
|
741062
741245
|
}
|
|
741063
741246
|
try {
|
|
741064
741247
|
const historySessionId = process.env["OMNIUS_SESSION_ID"] || `session-${Date.now().toString(36)}`;
|
|
741248
|
+
const tuiState = typeof statusBar?.capturePersistedSessionState === "function" ? statusBar.capturePersistedSessionState() : null;
|
|
741065
741249
|
const contentLines = typeof statusBar?.capturePersistedSessionLines === "function" ? statusBar.capturePersistedSessionLines(100) : statusBar?._contentLines ?? [];
|
|
741066
741250
|
if (contentLines.length > 0) {
|
|
741067
741251
|
const description = cleanPromptForDiary(task).slice(0, 240);
|
|
@@ -741072,6 +741256,9 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
|
|
|
741072
741256
|
taskCount: 1,
|
|
741073
741257
|
model: config.model
|
|
741074
741258
|
});
|
|
741259
|
+
if (tuiState) {
|
|
741260
|
+
saveTuiSessionState(repoRoot, historySessionId, tuiState);
|
|
741261
|
+
}
|
|
741075
741262
|
importTranscriptSession({
|
|
741076
741263
|
id: `tui:${historySessionId}`,
|
|
741077
741264
|
projectRoot: repoRoot,
|
|
@@ -742847,6 +743034,7 @@ This is an independent background session started from /background.`
|
|
|
742847
743034
|
function saveVisualSessionSnapshot(reason) {
|
|
742848
743035
|
try {
|
|
742849
743036
|
const historySessionId = process.env["OMNIUS_SESSION_ID"] || process.env["OMNIUS_TUI_SESSION_ID"] || `session-${Date.now().toString(36)}`;
|
|
743037
|
+
const tuiState = statusBar.capturePersistedSessionState();
|
|
742850
743038
|
const contentLines = statusBar.capturePersistedSessionLines(100);
|
|
742851
743039
|
if (contentLines.length === 0) return;
|
|
742852
743040
|
const description = cleanPromptForDiary(lastSubmittedPrompt || lastCompletedSummary || reason).slice(0, 240) || reason;
|
|
@@ -742857,6 +743045,7 @@ This is an independent background session started from /background.`
|
|
|
742857
743045
|
taskCount: 1,
|
|
742858
743046
|
model: currentConfig.model
|
|
742859
743047
|
});
|
|
743048
|
+
saveTuiSessionState(repoRoot, historySessionId, tuiState);
|
|
742860
743049
|
importTranscriptSession({
|
|
742861
743050
|
id: `tui:${historySessionId}`,
|
|
742862
743051
|
projectRoot: repoRoot,
|
|
@@ -742872,6 +743061,14 @@ This is an independent background session started from /background.`
|
|
|
742872
743061
|
saveVisualSessionSnapshotRef = saveVisualSessionSnapshot;
|
|
742873
743062
|
function replayRestoredVisualSession(snapshot) {
|
|
742874
743063
|
if (!snapshot.historySessionId) return false;
|
|
743064
|
+
const tuiState = loadTuiSessionState(repoRoot, snapshot.historySessionId);
|
|
743065
|
+
if (tuiState) {
|
|
743066
|
+
try {
|
|
743067
|
+
statusBar.restoreMainSessionState(tuiState);
|
|
743068
|
+
return true;
|
|
743069
|
+
} catch {
|
|
743070
|
+
}
|
|
743071
|
+
}
|
|
742875
743072
|
const lines = loadSessionHistory(repoRoot, snapshot.historySessionId);
|
|
742876
743073
|
if (!lines || lines.length === 0) return false;
|
|
742877
743074
|
try {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.465",
|
|
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.465",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED