omniharness-cli 0.1.100 → 0.1.102
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/package.json +1 -1
- package/dist/ui/groups.js +0 -50
package/package.json
CHANGED
package/dist/ui/groups.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Collapsible message groups for the transcript.
|
|
3
|
-
*
|
|
4
|
-
* Pure module: folds runs of tool-role lines into a single synthetic summary
|
|
5
|
-
* line so a long tool trail reads as one line ("4 tool calls · Ctrl+G to
|
|
6
|
-
* expand") instead of a wall of output. Runs shorter than 3 lines stay
|
|
7
|
-
* unfolded (a lone tool note isn't noise). Expansion is controlled by the
|
|
8
|
-
* caller (Ctrl+G toggles globally); non-tool lines always pass through.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Fold runs of tool lines. With `expanded` false, runs of 3+ tool lines
|
|
12
|
-
* collapse to one synthetic summary line carrying `group` metadata.
|
|
13
|
-
*
|
|
14
|
-
* `protectFrom` is a line index (into `lines`) at or after which nothing
|
|
15
|
-
* folds: the "collapse by recency, not kind" rule — the active turn stays
|
|
16
|
-
* fully expanded so nothing about the current decision is hidden, while
|
|
17
|
-
* settled history behind it still compresses. Pass `lines.length` (default)
|
|
18
|
-
* to fold everything, or the index of the last user turn to shield it.
|
|
19
|
-
*/
|
|
20
|
-
export function foldToolGroups(lines, expanded, protectFrom = lines.length) {
|
|
21
|
-
const out = [];
|
|
22
|
-
let run = [];
|
|
23
|
-
const flush = () => {
|
|
24
|
-
if (run.length === 0)
|
|
25
|
-
return;
|
|
26
|
-
const runProtected = run.some((entry) => entry.index >= protectFrom);
|
|
27
|
-
if (expanded || runProtected || run.length < 3) {
|
|
28
|
-
out.push(...run.map((entry) => entry.line));
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
out.push({
|
|
32
|
-
role: 'tool',
|
|
33
|
-
text: `${run.length} tool calls · Ctrl+G to expand`,
|
|
34
|
-
group: { count: run.length, hidden: run.map((entry) => entry.line.text) },
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
run = [];
|
|
38
|
-
};
|
|
39
|
-
lines.forEach((line, index) => {
|
|
40
|
-
if (line.role === 'tool')
|
|
41
|
-
run.push({ line, index });
|
|
42
|
-
else {
|
|
43
|
-
flush();
|
|
44
|
-
out.push(line);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
flush();
|
|
48
|
-
return out;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=groups.js.map
|