@vincemakes/kiso-tui 0.1.28 → 0.1.29
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/body.d.ts +16 -0
- package/dist/body.js +31 -0
- package/dist/render.d.ts +7 -0
- package/dist/render.js +11 -0
- package/package.json +1 -1
package/dist/body.d.ts
CHANGED
|
@@ -62,6 +62,14 @@ export type BodyCell = {
|
|
|
62
62
|
label: string;
|
|
63
63
|
line: string;
|
|
64
64
|
done: true;
|
|
65
|
+
} | {
|
|
66
|
+
kind: "checklist";
|
|
67
|
+
header: string;
|
|
68
|
+
items: {
|
|
69
|
+
text: string;
|
|
70
|
+
status: "pending" | "active" | "done";
|
|
71
|
+
}[];
|
|
72
|
+
done: true;
|
|
65
73
|
};
|
|
66
74
|
export interface BodyOptions {
|
|
67
75
|
/** Is the cell renderer live? A color TTY with a real size — checked
|
|
@@ -121,6 +129,14 @@ export declare class Body {
|
|
|
121
129
|
/** The terminal's status line + the rhythm gap (one blank). */
|
|
122
130
|
terminal(label: string, statusLine: string): void;
|
|
123
131
|
notice(text: string): void;
|
|
132
|
+
/** ⑥ todo round: the durable checklist — header + one brick-glyph line
|
|
133
|
+
* per item, frozen immediately (it is static content). The CLI
|
|
134
|
+
* translates a tagged tool result into the structured items; the
|
|
135
|
+
* passthrough writes the same lines (byte-identical in pipes). */
|
|
136
|
+
checklist(header: string, items: {
|
|
137
|
+
text: string;
|
|
138
|
+
status: "pending" | "active" | "done";
|
|
139
|
+
}[]): void;
|
|
124
140
|
/** A pre-rendered block (the banner, the session line, slash-command
|
|
125
141
|
* outputs) — frozen immediately. */
|
|
126
142
|
raw(lines: string[]): void;
|
package/dist/body.js
CHANGED
|
@@ -301,6 +301,26 @@ export class Body {
|
|
|
301
301
|
this.#cells.push({ kind: "notice", text, done: true });
|
|
302
302
|
this.#mark();
|
|
303
303
|
}
|
|
304
|
+
/** ⑥ todo round: the durable checklist — header + one brick-glyph line
|
|
305
|
+
* per item, frozen immediately (it is static content). The CLI
|
|
306
|
+
* translates a tagged tool result into the structured items; the
|
|
307
|
+
* passthrough writes the same lines (byte-identical in pipes). */
|
|
308
|
+
checklist(header, items) {
|
|
309
|
+
const glyphOf = (status) => (status === "pending" ? "□" : status === "active" ? "▖" : "▣");
|
|
310
|
+
if (!this.#isActive()) {
|
|
311
|
+
this.#closeOpenThinking();
|
|
312
|
+
this.#closeOpenText();
|
|
313
|
+
const p = palette();
|
|
314
|
+
process.stdout.write(`${p.bold}▞${p.reset} ${escapeTerminal(header)}\n`);
|
|
315
|
+
for (const item of items)
|
|
316
|
+
process.stdout.write(` ${glyphOf(item.status)} ${escapeTerminal(item.text)}\n`);
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
this.#closeOpenThinking();
|
|
320
|
+
this.#closeOpenText();
|
|
321
|
+
this.#cells.push({ kind: "checklist", header, items, done: true });
|
|
322
|
+
this.#mark();
|
|
323
|
+
}
|
|
304
324
|
/** A pre-rendered block (the banner, the session line, slash-command
|
|
305
325
|
* outputs) — frozen immediately. */
|
|
306
326
|
raw(lines) {
|
|
@@ -478,6 +498,17 @@ export class Body {
|
|
|
478
498
|
// the honest label (done / aborted / error) + the status + the
|
|
479
499
|
// rhythm gap blank
|
|
480
500
|
return [cell.label, cell.line, ""];
|
|
501
|
+
case "checklist": {
|
|
502
|
+
// ⑥: the durable checklist — the ▞ header accent + one brick
|
|
503
|
+
// glyph per item (□ pending / ▖ active / ▣ done). Text is
|
|
504
|
+
// escaped at composition; the glyphs are renderer-owned.
|
|
505
|
+
const lines = [`${p.bold}▞${p.reset} ${escapeTerminal(cell.header)}`];
|
|
506
|
+
for (const item of cell.items) {
|
|
507
|
+
const glyph = item.status === "pending" ? "□" : item.status === "active" ? "▖" : "▣";
|
|
508
|
+
lines.push(` ${glyph} ${escapeTerminal(item.text)}`);
|
|
509
|
+
}
|
|
510
|
+
return lines;
|
|
511
|
+
}
|
|
481
512
|
}
|
|
482
513
|
}
|
|
483
514
|
#cellHeight(cell, W) {
|
package/dist/render.d.ts
CHANGED
|
@@ -137,6 +137,13 @@ export type RenderInput = {
|
|
|
137
137
|
readonly name: string;
|
|
138
138
|
readonly executionId: string;
|
|
139
139
|
readonly error: string;
|
|
140
|
+
} | {
|
|
141
|
+
readonly type: "checklist";
|
|
142
|
+
readonly header: string;
|
|
143
|
+
readonly items: readonly {
|
|
144
|
+
readonly text: string;
|
|
145
|
+
readonly status: "pending" | "active" | "done";
|
|
146
|
+
}[];
|
|
140
147
|
};
|
|
141
148
|
/**
|
|
142
149
|
* Render one event. `text` may be a continuation (text_delta appends to the
|
package/dist/render.js
CHANGED
|
@@ -146,6 +146,17 @@ export function renderEvent(ev, prevThinking = false, resolvePath = (p) => p) {
|
|
|
146
146
|
newline: true,
|
|
147
147
|
prompt: false,
|
|
148
148
|
};
|
|
149
|
+
case "checklist": {
|
|
150
|
+
// ⑥: the durable checklist — the ▞ header accent (the recap's
|
|
151
|
+
// brick) + one brick-glyph line per item. Static line content:
|
|
152
|
+
// byte-identical in pipes and NO_COLOR.
|
|
153
|
+
const lines = [`${p.bold}▞${p.reset} ${escapeTerminal(ev.header)}`];
|
|
154
|
+
for (const item of ev.items) {
|
|
155
|
+
const glyph = item.status === "pending" ? "□" : item.status === "active" ? "▖" : "▣";
|
|
156
|
+
lines.push(` ${glyph} ${escapeTerminal(item.text)}`);
|
|
157
|
+
}
|
|
158
|
+
return { text: `${lines.join("\n")}\n`, newline: true, prompt: false };
|
|
159
|
+
}
|
|
149
160
|
default:
|
|
150
161
|
return { text: "", newline: false, prompt: false };
|
|
151
162
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-tui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.29",
|
|
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",
|