@vincemakes/kiso-tui 0.24.2 → 0.24.4
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/compositor.js +59 -3
- package/package.json +2 -2
package/dist/compositor.js
CHANGED
|
@@ -1783,7 +1783,25 @@ export class Body {
|
|
|
1783
1783
|
if (tighter.length <= cap)
|
|
1784
1784
|
return tighter;
|
|
1785
1785
|
}
|
|
1786
|
-
|
|
1786
|
+
const heads = this.#project(W, ctx, 0);
|
|
1787
|
+
if (heads.length <= cap)
|
|
1788
|
+
return heads;
|
|
1789
|
+
// DC-53 — the LAST RESORT, and ONLY when the force-commit loop is
|
|
1790
|
+
// blocked. If the head of the queue can still be committed, this
|
|
1791
|
+
// projection must hand back everything it has: the loop counts its
|
|
1792
|
+
// rows to decide what to spill, and a truncated projection tells
|
|
1793
|
+
// it the region fits when it does not — which LOSES the rows it
|
|
1794
|
+
// would have committed (measured: a 40-line burst on a 12-row
|
|
1795
|
+
// screen kept 13 of them). Only a RUNNING CALL at the head makes
|
|
1796
|
+
// the loop unable to act, and only then is counting the tail the
|
|
1797
|
+
// honest thing left to draw.
|
|
1798
|
+
const head = this.#cells[this.#committed];
|
|
1799
|
+
if (head === undefined || head.kind !== "tool" || head.done)
|
|
1800
|
+
return heads;
|
|
1801
|
+
const keep = Math.max(1, cap - 1);
|
|
1802
|
+
const hidden = heads.length - keep;
|
|
1803
|
+
const p = palette();
|
|
1804
|
+
return [...heads.slice(0, keep), cutLine(`${p.dim} +${hidden} more${p.reset}`, W)];
|
|
1787
1805
|
}
|
|
1788
1806
|
/**
|
|
1789
1807
|
* R13 — ONE PASS, AND EVERY CELL RENDERS ITSELF.
|
|
@@ -1847,7 +1865,18 @@ export class Body {
|
|
|
1847
1865
|
* card is running" reduces to once every cell renders itself). */
|
|
1848
1866
|
#thinkingGap() {
|
|
1849
1867
|
const turn = this.#turns[this.#turns.length - 1];
|
|
1850
|
-
|
|
1868
|
+
if (turn === undefined || turn.ended)
|
|
1869
|
+
return false;
|
|
1870
|
+
// DC-53 — and NOTHING is in flight. The caller has already found
|
|
1871
|
+
// the projection empty, which used to be taken as "nothing is
|
|
1872
|
+
// happening"; it is also what a wrongly-committed running cell
|
|
1873
|
+
// leaves behind, and the placeholder then sat beside a call that
|
|
1874
|
+
// was running. An uncommitted cell is work in flight whether or
|
|
1875
|
+
// not it drew a row this frame.
|
|
1876
|
+
for (let i = this.#committed; i < this.#cells.length; i += 1)
|
|
1877
|
+
if (!this.#cells[i].done)
|
|
1878
|
+
return false;
|
|
1879
|
+
return true;
|
|
1851
1880
|
}
|
|
1852
1881
|
/** The live region's scalar — the unit tests assert the cap directly
|
|
1853
1882
|
* (the e2e gate pins the screen consequence). W11: the formula's
|
|
@@ -2102,7 +2131,34 @@ export class Body {
|
|
|
2102
2131
|
// commits the oldest live cell UNCONDITIONALLY (the one sharp
|
|
2103
2132
|
// edge — the cap scalar is asserted by the gates). W22: the
|
|
2104
2133
|
// queue band shrinks the cap by its rows (empty queue → H−4).
|
|
2105
|
-
|
|
2134
|
+
// DC-53 — AND NEVER A CELL THAT IS NOT DONE.
|
|
2135
|
+
//
|
|
2136
|
+
// This loop committed `#committed` unconditionally. R4's standing
|
|
2137
|
+
// slot held the live region at a constant height, so the
|
|
2138
|
+
// projection never grew past the cap on its own and the loop never
|
|
2139
|
+
// reached a running cell; R13 retired the slot (DC-46) and it
|
|
2140
|
+
// promptly did. Three parallel searches, the last two settling
|
|
2141
|
+
// first: their cards pushed the region over the cap, the loop
|
|
2142
|
+
// committed the FIRST call — still in flight — froze its
|
|
2143
|
+
// three-row running card and its breathing mark into the
|
|
2144
|
+
// scrollback, and stepped `#committed` past it. When the result
|
|
2145
|
+
// arrived there was no live cell left to draw it into, so the work
|
|
2146
|
+
// never reached the screen at all.
|
|
2147
|
+
//
|
|
2148
|
+
// A cell that is not done has no committed form yet; committing
|
|
2149
|
+
// one is writing history that has not happened. When the head is
|
|
2150
|
+
// running, the region gives way instead — the cards behind it
|
|
2151
|
+
// degrade first, then the running window shrinks (DC-43's own
|
|
2152
|
+
// ladder, in #liveProjection), and the remainder is counted.
|
|
2153
|
+
// The guard is on a RUNNING TOOL CALL specifically, not on any
|
|
2154
|
+
// unfinished cell. A streaming text or raw cell HAS a committed
|
|
2155
|
+
// form — the rows it has already written are final, append-only —
|
|
2156
|
+
// and spilling those is exactly what this loop is for. A running
|
|
2157
|
+
// call does not: its card changes shape at the settle, so a
|
|
2158
|
+
// committed one is a row that will never be corrected.
|
|
2159
|
+
while (liveLines.length > H - 4 - inputExtra - queueRows.length && // V6-3: the content cap H−4 (KC1: −N's extra rows)
|
|
2160
|
+
this.#committed < this.#cells.length &&
|
|
2161
|
+
!(this.#cells[this.#committed].kind === "tool" && !this.#cells[this.#committed].done)) {
|
|
2106
2162
|
// R3f: the cell about to be force-committed marks its segment
|
|
2107
2163
|
// SPILLED. The rule was written at R3b — "a segment too big for
|
|
2108
2164
|
// the screen already has rows in the scrollback that cannot be
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-tui",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.4",
|
|
4
4
|
"description": "kiso tui — the pure terminal layer (cell renderer, dock, raw editor, diff, palette). Zero runtime dependencies: input is data, output is bytes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/vincemakes/kiso/tree/main/packages/tui#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@vincemakes/kiso-tui-cells": "0.24.
|
|
38
|
+
"@vincemakes/kiso-tui-cells": "0.24.4"
|
|
39
39
|
}
|
|
40
40
|
}
|