@vincemakes/kiso-tui 0.1.37 → 0.1.39
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/components.d.ts +87 -4
- package/dist/components.js +240 -48
- package/dist/compositor.d.ts +41 -2
- package/dist/compositor.js +374 -26
- package/dist/editor.d.ts +1 -0
- package/dist/editor.js +16 -1
- package/dist/render.d.ts +14 -3
- package/dist/render.js +35 -1
- package/package.json +1 -1
package/dist/render.js
CHANGED
|
@@ -189,9 +189,16 @@ function approvalDetail(name, input, resolvePath) {
|
|
|
189
189
|
* edit/write show +/- line counts, read shows lines, shell shows the exit
|
|
190
190
|
* code; failures (isError) are ✗. Pure and deterministic.
|
|
191
191
|
*/
|
|
192
|
-
export function renderToolSummary(name, input, result) {
|
|
192
|
+
export function renderToolSummary(name, input, result, reason = null) {
|
|
193
193
|
// v2a/v5: ✓ is a bold identity accent; ✗ stays red.
|
|
194
194
|
const p = palette();
|
|
195
|
+
// W19: a DENIED call (the "denied" tag) renders the pinned row — the
|
|
196
|
+
// FULL call name, the target, the reason in the W4 parentheses idiom,
|
|
197
|
+
// and NO timing metadata (the call never ran — (0.0s) would be noise).
|
|
198
|
+
// The same row in the interactive and pipe paths, byte-clean on a pipe.
|
|
199
|
+
if (reason !== null) {
|
|
200
|
+
return `${p.red}✗${p.reset} ${escapeTerminal(`${name} ${toolTarget(name, input)} (${reason})`)}`;
|
|
201
|
+
}
|
|
195
202
|
const mark = result.isError ? `${p.red}✗${p.reset}` : `${p.bold}✓${p.reset}`;
|
|
196
203
|
const shortName = name.replace("_file", "");
|
|
197
204
|
const detail = toolSummaryDetail(name, input, result);
|
|
@@ -233,6 +240,24 @@ function toolSummaryDetail(name, input, result) {
|
|
|
233
240
|
return String(input.path ?? input.command ?? "");
|
|
234
241
|
}
|
|
235
242
|
}
|
|
243
|
+
/** W15 — the expand header's target: the tool call's subject (the path
|
|
244
|
+
* for the *_file tools, the command for shell) — the same extraction
|
|
245
|
+
* the summary detail uses, WITHOUT the counts (the header names what
|
|
246
|
+
* was expanded, not its size). */
|
|
247
|
+
export function toolTarget(name, input) {
|
|
248
|
+
switch (name) {
|
|
249
|
+
case "read_file":
|
|
250
|
+
case "write_file":
|
|
251
|
+
case "edit_file":
|
|
252
|
+
return String(input.path ?? "?");
|
|
253
|
+
case "shell":
|
|
254
|
+
return String(input.command ?? "?");
|
|
255
|
+
case "list_dir":
|
|
256
|
+
return String(input.path ?? "(root)");
|
|
257
|
+
default:
|
|
258
|
+
return String(input.path ?? input.command ?? "");
|
|
259
|
+
}
|
|
260
|
+
}
|
|
236
261
|
/** The exit code of a shell result: parsed from the failure text, 0 on success. */
|
|
237
262
|
function exitCodeOf(result) {
|
|
238
263
|
if (!result.isError)
|
|
@@ -373,6 +398,15 @@ export function bannerLines(W, H, version, extensionsText, resume = [], now = Da
|
|
|
373
398
|
}
|
|
374
399
|
export function renderRecap(s) {
|
|
375
400
|
const p = palette();
|
|
401
|
+
// W19: under plan the recap is the way out of the mode — the header
|
|
402
|
+
// names the mode's posture, the hints name the exits (the ONLY
|
|
403
|
+
// controls — /mode is the only way to leave plan mode).
|
|
404
|
+
if (s.mode === "plan") {
|
|
405
|
+
const parts = ["plan ready", "/mode default executes", "/mode accept-edits auto-approves edits"];
|
|
406
|
+
if (s.ctxLeftPct !== null)
|
|
407
|
+
parts.push(`ctx left ~${Math.round(s.ctxLeftPct)}%`);
|
|
408
|
+
return `${p.bold}▞${p.reset} ${parts.join(" · ")}\n`;
|
|
409
|
+
}
|
|
376
410
|
const parts = [`${s.seconds}s`, `${s.tools} tool${s.tools === 1 ? "" : "s"}${s.edits > 0 ? ` (${s.edits} edit${s.edits === 1 ? "" : "s"})` : ""}`];
|
|
377
411
|
if (s.usage.known) {
|
|
378
412
|
const seg = `${s.usage.in !== null ? `in ${kUnit(s.usage.in)}` : ""}${s.usage.in !== null && s.usage.out !== null ? " " : ""}${s.usage.out !== null ? `out ${kUnit(s.usage.out)}` : ""}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-tui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.39",
|
|
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",
|