antechamber 1.0.21 → 1.0.22
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/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ and this project uses [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.0.22] - 2026-10-26
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Show terminal turns appended to a session that the adapter last saved while empty, instead of keeping its
|
|
15
|
+
transcript blank. Empty forks and active reverts keep their hidden history.
|
|
16
|
+
|
|
10
17
|
## [1.0.21] - 2026-10-26
|
|
11
18
|
|
|
12
19
|
### Fixed
|
package/dist/session-tree.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export declare function getEntries(pi: PiRpcClient, signal?: AbortSignal): Promi
|
|
|
64
64
|
* those carry no conversation, so they do not undo the navigation.
|
|
65
65
|
*/
|
|
66
66
|
export declare function restoredLeaf(tree: Entries, leaf: string | null): boolean;
|
|
67
|
-
export declare function readSessionTree(piPath: string): Entries;
|
|
67
|
+
export declare function readSessionTree(piPath: string, offset?: number): Entries;
|
|
68
68
|
/** Checkpoint persisted progress after agent_end, successful compaction, or process exit. */
|
|
69
69
|
export declare function recordTurn(s: ManagedSession): void;
|
|
70
70
|
/**
|
package/dist/session-tree.js
CHANGED
|
@@ -52,8 +52,8 @@ export function restoredLeaf(tree, leaf) {
|
|
|
52
52
|
}
|
|
53
53
|
return true;
|
|
54
54
|
}
|
|
55
|
-
export function readSessionTree(piPath) {
|
|
56
|
-
const lines = readFileSync(piPath
|
|
55
|
+
export function readSessionTree(piPath, offset = 0) {
|
|
56
|
+
const lines = readFileSync(piPath).subarray(offset).toString("utf8").trimEnd().split("\n");
|
|
57
57
|
const entries = [];
|
|
58
58
|
for (const [index, line] of lines.entries()) {
|
|
59
59
|
if (line.trim().length === 0)
|
|
@@ -102,7 +102,10 @@ export function recordTurn(s) {
|
|
|
102
102
|
*/
|
|
103
103
|
export function followExternalAppends(s, piPath) {
|
|
104
104
|
const saved = s.tree.leafId;
|
|
105
|
-
if (s.tree.revert || saved === undefined
|
|
105
|
+
if (s.tree.revert || saved === undefined)
|
|
106
|
+
return;
|
|
107
|
+
// A null selection can hide an abandoned branch; require a known append boundary.
|
|
108
|
+
if (saved === null && s.tree.fileSize === undefined)
|
|
106
109
|
return;
|
|
107
110
|
const size = statSync(piPath, { throwIfNoEntry: false })?.size;
|
|
108
111
|
if (size === undefined || (s.tree.fileSize !== undefined && size <= s.tree.fileSize))
|
|
@@ -110,6 +113,11 @@ export function followExternalAppends(s, piPath) {
|
|
|
110
113
|
let tree;
|
|
111
114
|
try {
|
|
112
115
|
tree = readSessionTree(piPath);
|
|
116
|
+
if (saved === null) {
|
|
117
|
+
const appended = new Set(readSessionTree(piPath, s.tree.fileSize).entries.map((entry) => entry.id));
|
|
118
|
+
if (!branchEntries(tree).some((entry) => entry.type === "message" && appended.has(entry.id)))
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
113
121
|
}
|
|
114
122
|
catch (error) {
|
|
115
123
|
// History parsing skips malformed lines; keep the saved selection rather than guess a tail.
|
|
@@ -117,7 +125,7 @@ export function followExternalAppends(s, piPath) {
|
|
|
117
125
|
return;
|
|
118
126
|
throw error;
|
|
119
127
|
}
|
|
120
|
-
if (tree.leafId === saved || !branchEntries(tree).some((entry) => entry.id === saved))
|
|
128
|
+
if (tree.leafId === saved || (saved !== null && !branchEntries(tree).some((entry) => entry.id === saved)))
|
|
121
129
|
return;
|
|
122
130
|
s.tree.leafId = tree.leafId;
|
|
123
131
|
}
|