@vincemakes/kiso-tui-cells 0.46.2 → 0.47.1
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/approval-panel.d.ts +149 -62
- package/dist/approval-panel.js +346 -227
- package/dist/components.d.ts +151 -21
- package/dist/components.js +1242 -825
- package/dist/diff.d.ts +40 -3
- package/dist/diff.js +142 -5
- package/dist/graphite.d.ts +143 -0
- package/dist/graphite.js +311 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.js +6 -3
- package/dist/md.d.ts +18 -7
- package/dist/md.js +290 -37
- package/dist/render.d.ts +136 -27
- package/dist/render.js +381 -137
- package/dist/strings.d.ts +47 -46
- package/dist/strings.js +130 -171
- package/package.json +1 -1
package/dist/components.d.ts
CHANGED
|
@@ -89,6 +89,36 @@ export declare class Container implements Component {
|
|
|
89
89
|
constructor(children: Component[]);
|
|
90
90
|
render(width: number, ctx: FrameCtx): string[];
|
|
91
91
|
}
|
|
92
|
+
/** Graphite §1.8 — THE CONTENT EDGE. Every block begins at column 2
|
|
93
|
+
* (owner, 2026-09-29: the 0.44 geometry); columns 0–1 are the mark
|
|
94
|
+
* column — the seal's `✦`, a streaming thought's twinkle, the live row's
|
|
95
|
+
* mark, the person's `▌`, a card's edge and its mark cell. */
|
|
96
|
+
export declare const EDGE = " ";
|
|
97
|
+
/** Graphite §7.12 — the one word of a notice's sentence that carries the
|
|
98
|
+
* weight, and its colour: the failure colour, the plan's blue, ink, and
|
|
99
|
+
* (the tasks round) the success colour of an outcome that went well and
|
|
100
|
+
* the gold of one nobody can know. */
|
|
101
|
+
export interface NoticeMark {
|
|
102
|
+
readonly text: string;
|
|
103
|
+
readonly tone: "fail" | "blue" | "ink" | "ok" | "gold";
|
|
104
|
+
}
|
|
105
|
+
/** The tasks round — a further row of a one-row notice, drawn under the
|
|
106
|
+
* first with its own label (`""`: none) in the same cell, so the rows of
|
|
107
|
+
* one notice stay together (two cells would be a blank apart, D1). */
|
|
108
|
+
export interface NoticeRow {
|
|
109
|
+
readonly label: string;
|
|
110
|
+
readonly sentence: string;
|
|
111
|
+
readonly mark?: NoticeMark;
|
|
112
|
+
}
|
|
113
|
+
/** The last sweep (owner, 2026-10-06) — one part of what `/think` or
|
|
114
|
+
* `/last` brings back: a dim title (`input`, `output`) when it has one,
|
|
115
|
+
* and its text in the look of what it is — thinking's grey italic, or a
|
|
116
|
+
* call's output in `ink2`, hung under the title. */
|
|
117
|
+
export interface RecallSection {
|
|
118
|
+
readonly title?: string;
|
|
119
|
+
readonly text: string;
|
|
120
|
+
readonly style: "thinking" | "output";
|
|
121
|
+
}
|
|
92
122
|
export type BodyCell = {
|
|
93
123
|
kind: "user";
|
|
94
124
|
text: string;
|
|
@@ -157,10 +187,27 @@ export type BodyCell = {
|
|
|
157
187
|
kind: "md";
|
|
158
188
|
block: MdBlock;
|
|
159
189
|
done: boolean;
|
|
160
|
-
}
|
|
190
|
+
}
|
|
191
|
+
/** Graphite §7.12 — `label` and `sentence` are the meta row's two
|
|
192
|
+
* halves, derived from `text` by the compositor; `text` is what a
|
|
193
|
+
* pipe prints, unchanged. */
|
|
194
|
+
| {
|
|
161
195
|
kind: "notice";
|
|
162
196
|
text: string;
|
|
163
197
|
done: true;
|
|
198
|
+
label?: string;
|
|
199
|
+
sentence?: string;
|
|
200
|
+
mark?: NoticeMark;
|
|
201
|
+
stacked?: true;
|
|
202
|
+
oneRow?: true;
|
|
203
|
+
also?: readonly NoticeRow[];
|
|
204
|
+
}
|
|
205
|
+
/** Graphite §7.11 — the turn's seal: its forms, widest first; the
|
|
206
|
+
* widest that fits is drawn, and the narrowest is cut. */
|
|
207
|
+
| {
|
|
208
|
+
kind: "seal";
|
|
209
|
+
tiers: readonly string[];
|
|
210
|
+
done: true;
|
|
164
211
|
}
|
|
165
212
|
/** 4c — the resumed session's earlier history, replayed into cells and
|
|
166
213
|
* FOLDED: the row is ONE line on screen and never expands there (a
|
|
@@ -186,6 +233,27 @@ export type BodyCell = {
|
|
|
186
233
|
lines: string[];
|
|
187
234
|
done: true;
|
|
188
235
|
wrap?: "words";
|
|
236
|
+
}
|
|
237
|
+
/** Graphite §7.13 (G3, R2d) — the person's own `!!cmd`: run and shown,
|
|
238
|
+
* never sent (a `!cmd` is a user turn and draws the same way from its
|
|
239
|
+
* text, see `bangOf`). */
|
|
240
|
+
| {
|
|
241
|
+
kind: "bang";
|
|
242
|
+
command: string;
|
|
243
|
+
output: string;
|
|
244
|
+
isError: boolean;
|
|
245
|
+
done: true;
|
|
246
|
+
}
|
|
247
|
+
/** The last sweep — what `/think` or `/last` brings back, on the
|
|
248
|
+
* terminal: a meta row (`THINKING`, `LAST CALL`) and the sections
|
|
249
|
+
* under it. `text` is what a pipe prints, unchanged. */
|
|
250
|
+
| {
|
|
251
|
+
kind: "recall";
|
|
252
|
+
text: string;
|
|
253
|
+
label: string;
|
|
254
|
+
sentence: string;
|
|
255
|
+
sections: readonly RecallSection[];
|
|
256
|
+
done: true;
|
|
189
257
|
} | {
|
|
190
258
|
kind: "terminal";
|
|
191
259
|
label: string;
|
|
@@ -196,15 +264,33 @@ declare const TOOL_SUMMARY_MAX = 60;
|
|
|
196
264
|
/** The component for one cell — the mapping table lives here so the
|
|
197
265
|
* compositor stays a pure writer. */
|
|
198
266
|
export declare function cellComponent(cell: BodyCell): Component;
|
|
199
|
-
/**
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
267
|
+
/** G3 (R2d) — the block `!cmd` sends: a `console` fence holding `$ <command>`
|
|
268
|
+
* and what it printed (apps/cli dispatch.ts `runBang`). Null for any
|
|
269
|
+
* other text. */
|
|
270
|
+
export declare function bangOf(text: string): {
|
|
271
|
+
command: string;
|
|
272
|
+
output: string;
|
|
273
|
+
} | null;
|
|
274
|
+
/**
|
|
275
|
+
* Graphite §8.7, the main-sync round (owner, 2026-09-30) — a STEER that
|
|
276
|
+
* has not landed is ONE row in the live zone:
|
|
277
|
+
*
|
|
278
|
+
* ◇ <the message's first line> next step · ↑ takes back
|
|
279
|
+
*
|
|
280
|
+
* ADR-0057: Enter while a run works steers it — there is no queue on a
|
|
281
|
+
* terminal — and the steer lands inside the same run at its next quiet
|
|
282
|
+
* step, or after an open approval, which it never answers. The gold `◇`
|
|
283
|
+
* (a message the person sent that has not landed, §4) in the mark column
|
|
284
|
+
* and the text at the content edge; no label word (owner: the mark says
|
|
285
|
+
* it). The keys at the right say what happens next and give way first
|
|
286
|
+
* when the row is short. DECLARED REVERSAL of the `◇ queued … after this
|
|
287
|
+
* turn · ↑ edit` row, whose queue main retired in 0.45.0.
|
|
288
|
+
*/
|
|
289
|
+
export declare function pendingQueueRows(lines: readonly string[], W: number, waiting?: "step" | "approval"): string[];
|
|
290
|
+
/** A line of text folded to `width` cells, breaking after the last space
|
|
291
|
+
* that fits (the space is the break), or hard at the width when a run has
|
|
292
|
+
* none. Every other character is kept, in order. */
|
|
293
|
+
export declare function foldAtSpaces(text: string, width: number): string[];
|
|
208
294
|
/**
|
|
209
295
|
* TUI2-R1.5 ⑨ (VD-10) — the WORD-aware fold, for text a human reads.
|
|
210
296
|
*
|
|
@@ -225,14 +311,6 @@ export declare function pendingQueueRows(lines: readonly string[], W: number): s
|
|
|
225
311
|
*/
|
|
226
312
|
export declare function foldWords(line: string, W: number): string[];
|
|
227
313
|
export declare function gutterFold(gutter: string, line: string, W: number): string[];
|
|
228
|
-
/** A6: the tool-header variant — ONE cut row, never a fold. A wide
|
|
229
|
-
* header (a long target path, a wordy denial reason) used to wrap
|
|
230
|
-
* through foldLine — every wrapped row repeated the gutter, the
|
|
231
|
-
* settled row grew past its previewed height. The header names the
|
|
232
|
-
* call — the ellipsis marks the cut, the body below still carries the
|
|
233
|
-
* full content. The budget: the gutter's own visible width + the
|
|
234
|
-
* ellipsis ride the row (the invariant ① cap holds). */
|
|
235
|
-
export declare function gutterCut(gutter: string, line: string, W: number): string[];
|
|
236
314
|
export declare function foldTerms(reads: number, edits: number, others: readonly [string, number][]): string[];
|
|
237
315
|
/**
|
|
238
316
|
* R3i phase 5 — THE ANSWERED QUESTION'S BLOCK.
|
|
@@ -267,7 +345,7 @@ export declare function askedBlock(resultText: string, seconds: number | null, W
|
|
|
267
345
|
* the shell was the only settled call with rows on screen. */
|
|
268
346
|
export declare const CAP_PREVIEW = 5;
|
|
269
347
|
/** 0.24.2 ② — the live region's `thinking…` placeholder: dim italic at
|
|
270
|
-
*
|
|
348
|
+
* the content edge, no glyph, the SAME shape a thinking paragraph takes so that
|
|
271
349
|
* whatever arrives replaces it in place. Never committed — see the
|
|
272
350
|
* compositor's #project for why that is what makes it allowed. */
|
|
273
351
|
export declare function thinkingRow(): string;
|
|
@@ -384,11 +462,63 @@ export declare function selectionBar(styled: string, visible: number, W: number)
|
|
|
384
462
|
* columns the walls were taking.
|
|
385
463
|
*/
|
|
386
464
|
export declare function boxTop(W: number): string;
|
|
387
|
-
/**
|
|
388
|
-
*
|
|
465
|
+
/** Graphite R3e — a read-only sheet over the input (`/status`): the band's
|
|
466
|
+
* named hairline, one fact per row — its label dim in a column, its value
|
|
467
|
+
* folded by word under itself — and the row that says how it closes.
|
|
468
|
+
* It closes like the keys sheet, but what is typed after it is typed. */
|
|
469
|
+
export declare function infoSheetRows(title: string, facts: readonly {
|
|
470
|
+
readonly label: string;
|
|
471
|
+
readonly value: string;
|
|
472
|
+
}[], W: number): string[];
|
|
473
|
+
/** R2 — the same rule below, in the hairline colour (§1.1). Named for its
|
|
474
|
+
* POSITION, not its shape, so the compositor's two call sites did not
|
|
475
|
+
* have to move. */
|
|
389
476
|
export declare function boxBottom(W: number): string;
|
|
390
477
|
/** The terminal label + rhythm gap (the pipe path's v2c bytes — the
|
|
391
478
|
* exact render the passthrough needs). */
|
|
392
479
|
export declare function terminalPipe(label: string, statusLineText: string): string;
|
|
393
480
|
/** The pipe-path pieces the passthrough reuses (byte-identical). */
|
|
394
481
|
export { foldThinking, foldResult, renderToolSummary, TOOL_SUMMARY_MAX };
|
|
482
|
+
/**
|
|
483
|
+
* The subsequence embedding, TIGHTENED — the two-pass walk every good
|
|
484
|
+
* fuzzy finder uses, and the reason `@ra` emboldens the "ra" of
|
|
485
|
+
* "src/range.js" rather than the r of "src" and the a of "range".
|
|
486
|
+
*
|
|
487
|
+
* Pass 1 walks forward and stops at the EARLIEST index that completes
|
|
488
|
+
* the query — this both answers "does it match at all" and fixes the
|
|
489
|
+
* right-hand edge. Pass 2 walks backward from that edge, taking the
|
|
490
|
+
* LATEST position for each query character in turn, which slides every
|
|
491
|
+
* matched character as far right as it can go without crossing the
|
|
492
|
+
* next one. The result is the most clustered embedding that ends where
|
|
493
|
+
* the earliest match ends.
|
|
494
|
+
*
|
|
495
|
+
* Case-insensitive: both sides are lowercased by the caller once per
|
|
496
|
+
* query rather than once per character.
|
|
497
|
+
*
|
|
498
|
+
* Returns the ascending match indices, or null when the query is not a
|
|
499
|
+
* subsequence of the path at all.
|
|
500
|
+
*/
|
|
501
|
+
export declare function atEmbed(lowerPath: string, lowerQuery: string): number[] | null;
|
|
502
|
+
/**
|
|
503
|
+
* Graphite P2 (owner, 2026-10-03) — the band's window, shared by the file
|
|
504
|
+
* picker, the command list and the session picker: EIGHT rows on a
|
|
505
|
+
* terminal 30 rows or taller, five below.
|
|
506
|
+
*/
|
|
507
|
+
export declare function bandVisible(height: number): number;
|
|
508
|
+
/** The window over a list, with a scroll-off of one: while more lies past
|
|
509
|
+
* an edge the cursor stays a row inside it, so the edge row that carries
|
|
510
|
+
* a more-mark is never the selected one. Stateless, like bandWindow. */
|
|
511
|
+
export declare function bandWindow(total: number, selected: number, visible: number): {
|
|
512
|
+
first: number;
|
|
513
|
+
count: number;
|
|
514
|
+
};
|
|
515
|
+
/** The more-mark for row `i` of a window: `↑` on its first row when the
|
|
516
|
+
* list goes on above, `↓` on its last when it goes on below. */
|
|
517
|
+
export declare function moreMark(i: number, first: number, count: number, total: number): string | null;
|
|
518
|
+
/** The key row that closes a band: what the keys do, then the selection's
|
|
519
|
+
* place in the list at the right edge. The keys give way from the least
|
|
520
|
+
* needed (the first in `keys`); the counter stays. */
|
|
521
|
+
export declare function bandKeyRow(keys: readonly string[], selected: number, total: number, W: number): string;
|
|
522
|
+
/** Text with the given code-unit positions in bold gold — what the person
|
|
523
|
+
* typed, in the colour of what the person says — and the rest in `base`. */
|
|
524
|
+
export declare function goldHits(text: string, hits: ReadonlySet<number>, base: string): string;
|