@linxiraos/pi-tui 1.4.13 → 1.5.0
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/CHANGELOG.md +17 -34
- package/dist/types/chat/messages.d.ts +2 -0
- package/dist/types/chat/spotlight.d.ts +8 -3
- package/dist/types/chat/transcript-render-helpers.d.ts +5 -0
- package/dist/types/components/editor.d.ts +4 -1
- package/dist/types/html-form/data.d.ts +56 -0
- package/dist/types/html-form/dialog.d.ts +51 -0
- package/dist/types/html-form/media.d.ts +28 -0
- package/dist/types/html-form/paginate.d.ts +43 -0
- package/dist/types/html-form/parse.d.ts +99 -0
- package/dist/types/overlays/ask-dialog.d.ts +11 -6
- package/dist/types/overlays/copy-targets.d.ts +8 -6
- package/dist/types/overlays/hook-editor.d.ts +3 -1
- package/dist/types/overlays/hub-frame.d.ts +2 -0
- package/dist/types/overlays/model-hub.d.ts +2 -0
- package/dist/types/overlays/team-hub.d.ts +150 -0
- package/dist/types/render/row-moves.d.ts +41 -0
- package/dist/types/status-line/component.d.ts +5 -0
- package/dist/types/status-line/host.d.ts +2 -2
- package/dist/types/status-line/schema.d.ts +1 -1
- package/dist/types/status-line/types.d.ts +8 -0
- package/dist/types/tools/ask.d.ts +11 -49
- package/dist/types/tools/autoresearch.d.ts +2 -2
- package/dist/types/tools/eval.d.ts +4 -0
- package/dist/types/tools/grouped-file-output.d.ts +2 -0
- package/dist/types/tools/shell-viz.d.ts +6 -2
- package/dist/types/tools/xd-url.d.ts +6 -0
- package/dist/types/windows-input-mode.d.ts +8 -0
- package/package.json +9 -9
- package/src/charts/table-data.ts +18 -5
- package/src/chat/chat-transcript-builder.ts +27 -10
- package/src/chat/image-loading.ts +55 -0
- package/src/chat/messages.d.ts +2 -0
- package/src/chat/messages.ts +3 -0
- package/src/chat/spotlight.d.ts +8 -3
- package/src/chat/spotlight.ts +23 -11
- package/src/chat/tool-execution.ts +5 -0
- package/src/chat/transcript-render-helpers.d.ts +5 -0
- package/src/chat/transcript-render-helpers.ts +13 -0
- package/src/chrome/transcript-container.ts +1 -1
- package/src/components/editor.d.ts +4 -1
- package/src/components/editor.ts +3 -2
- package/src/components/markdown.ts +70 -12
- package/src/html-form/data.d.ts +56 -0
- package/src/html-form/data.ts +177 -0
- package/src/html-form/dialog.ts +1450 -0
- package/src/html-form/media.ts +105 -0
- package/src/html-form/paginate.ts +99 -0
- package/src/html-form/parse.d.ts +99 -0
- package/src/html-form/parse.ts +568 -0
- package/src/lang-from-path.ts +1 -0
- package/src/latex-block.ts +3 -3
- package/src/latex-to-unicode.ts +18 -5
- package/src/overlays/ask-dialog.ts +69 -52
- package/src/overlays/copy-targets.d.ts +8 -6
- package/src/overlays/copy-targets.ts +25 -46
- package/src/overlays/hook-editor.ts +16 -15
- package/src/overlays/hub-frame.ts +8 -1
- package/src/overlays/model-hub.ts +12 -2
- package/src/overlays/spotlight-sheet.ts +18 -18
- package/src/overlays/team-hub.ts +901 -0
- package/src/render/row-moves.d.ts +41 -0
- package/src/render/row-moves.ts +109 -0
- package/src/setup/wizard-overlay.ts +7 -3
- package/src/status-line/component.ts +19 -0
- package/src/status-line/footer.ts +2 -2
- package/src/status-line/host.ts +2 -2
- package/src/status-line/presets.ts +6 -6
- package/src/status-line/schema.ts +2 -1
- package/src/status-line/segments.ts +31 -4
- package/src/status-line/startup.ts +1 -1
- package/src/status-line/types.ts +8 -0
- package/src/stdin-buffer.ts +15 -1
- package/src/terminal-capabilities.ts +12 -3
- package/src/terminal.ts +41 -3
- package/src/tools/ask.d.ts +11 -49
- package/src/tools/ask.ts +201 -606
- package/src/tools/autoresearch.ts +2 -2
- package/src/tools/debug.ts +31 -38
- package/src/tools/eval.d.ts +4 -0
- package/src/tools/eval.ts +4 -0
- package/src/tools/grep.ts +38 -16
- package/src/tools/grouped-file-output.d.ts +2 -0
- package/src/tools/grouped-file-output.ts +5 -0
- package/src/tools/shell-viz-render.ts +37 -6
- package/src/tools/shell-viz.d.ts +6 -2
- package/src/tools/shell-viz.ts +19 -6
- package/src/tools/xd-url.d.ts +6 -0
- package/src/tools/xd-url.ts +19 -1
- package/src/tui.ts +129 -1
- package/src/windows-input-mode.d.ts +8 -0
- package/src/windows-input-mode.ts +13 -0
|
@@ -67,9 +67,9 @@ const LEGEND: readonly { cls: LineClass; tone: TspTone; label: string }[] = [
|
|
|
67
67
|
{ cls: "cut", tone: "muted", label: "cut" },
|
|
68
68
|
];
|
|
69
69
|
|
|
70
|
-
/** One legend entry (role `
|
|
70
|
+
/** One legend entry (role `zeta.spotlight.key`): a swatch and a muted label. */
|
|
71
71
|
function legendKey(swatch: NativeNode, label: string): NativeNode {
|
|
72
|
-
return row([swatch, text([span(label, "muted")])], { gap: "xs", align: "center", role: "
|
|
72
|
+
return row([swatch, text([span(label, "muted")])], { gap: "xs", align: "center", role: "zeta.spotlight.key" });
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/** A count with thousands separators. */
|
|
@@ -104,7 +104,7 @@ function nonBlankParams(params: SpotlightRequestParams): Param[] {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
* One parameter's row (role `
|
|
107
|
+
* One parameter's row (role `zeta.spotlight.param`): its name, then its non-blank values on one run of spaces and at
|
|
108
108
|
* most `lines` lines, whole in the tooltip; `end` (the toggle) last.
|
|
109
109
|
*/
|
|
110
110
|
function paramRow(param: Param, lines: number, end?: NativeNode): NativeNode {
|
|
@@ -115,11 +115,11 @@ function paramRow(param: Param, lines: number, end?: NativeNode): NativeNode {
|
|
|
115
115
|
return i === 0 ? [part] : [span(" · ", param.style ? `dim ${param.style}` : "dim"), part];
|
|
116
116
|
});
|
|
117
117
|
const shown = text(spans, { lines, truncate: "end", title: whole.join("\n") });
|
|
118
|
-
return row(compact([text(param.name), shown, end]), { gap: "md", align: "baseline", role: "
|
|
118
|
+
return row(compact([text(param.name), shown, end]), { gap: "md", align: "baseline", role: "zeta.spotlight.param" });
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
|
-
* What the result's Spotlight requests sent besides its lines (role `
|
|
122
|
+
* What the result's Spotlight requests sent besides its lines (role `zeta.spotlight.params`): collapsed, the first
|
|
123
123
|
* parameter (the intent) on one line and a toggle naming the rest; expanded, a row per parameter.
|
|
124
124
|
*/
|
|
125
125
|
function requestParams(params: SpotlightRequestParams, expanded: boolean): NativeNode | undefined {
|
|
@@ -129,14 +129,14 @@ function requestParams(params: SpotlightRequestParams, expanded: boolean): Nativ
|
|
|
129
129
|
const toggle =
|
|
130
130
|
rest.length > 0
|
|
131
131
|
? text(expanded ? "fewer ▾" : `${rest.map(param => param.name).join(", ")} ▸`, {
|
|
132
|
-
role: "
|
|
132
|
+
role: "zeta.spotlight.more",
|
|
133
133
|
actions: { click: "params" },
|
|
134
134
|
})
|
|
135
135
|
: undefined;
|
|
136
136
|
const rows = (expanded ? named : named.slice(0, 1)).map((param, i) =>
|
|
137
137
|
paramRow(param, expanded ? 2 : 1, i === 0 ? toggle : undefined),
|
|
138
138
|
);
|
|
139
|
-
return col(rows, { gap: "xs", role: "
|
|
139
|
+
return col(rows, { gap: "xs", role: "zeta.spotlight.params" });
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
/** The class the summary counts original line `i` (0-based) in; undefined without a reason. */
|
|
@@ -148,7 +148,7 @@ function lineClass(original: SpotlightOriginal, i: number): LineClass | undefine
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
|
-
* The summary row (role `
|
|
151
|
+
* The summary row (role `zeta.spotlight.summary`): a legend swatch and count per class of the shown lines (with
|
|
152
152
|
* reasons), then the ranking step's budget and cutoff and whether the view is cut; undefined when it has nothing.
|
|
153
153
|
*/
|
|
154
154
|
function summary(original: SpotlightOriginal, shown: number, total: number): NativeNode | undefined {
|
|
@@ -161,7 +161,7 @@ function summary(original: SpotlightOriginal, shown: number, total: number): Nat
|
|
|
161
161
|
}
|
|
162
162
|
for (const { cls, tone, label } of LEGEND) {
|
|
163
163
|
const n = counts.get(cls);
|
|
164
|
-
if (n) items.push(legendKey(text("■", { role: "
|
|
164
|
+
if (n) items.push(legendKey(text("■", { role: "zeta.spotlight.swatch", tone }), `${label} ${count(n)}`));
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
const facts: string[] = [];
|
|
@@ -175,12 +175,12 @@ function summary(original: SpotlightOriginal, shown: number, total: number): Nat
|
|
|
175
175
|
}
|
|
176
176
|
if (shown < total) facts.push(`first ${count(shown)} of ${count(total)} lines`);
|
|
177
177
|
if (items.length === 0 && facts.length === 0) return undefined;
|
|
178
|
-
const budget = facts.length > 0 && text([span(facts.join(" · "), "muted")], { role: "
|
|
178
|
+
const budget = facts.length > 0 && text([span(facts.join(" · "), "muted")], { role: "zeta.spotlight.budget" });
|
|
179
179
|
return row(compact([...items, node("spacer", { grow: 1 }), budget]), {
|
|
180
180
|
gap: "md",
|
|
181
181
|
align: "center",
|
|
182
182
|
wrap: true,
|
|
183
|
-
role: "
|
|
183
|
+
role: "zeta.spotlight.summary",
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -280,7 +280,7 @@ function hotCard(sheet: SheetText, i: number): TspPropNode {
|
|
|
280
280
|
]),
|
|
281
281
|
why !== undefined && text([span(why, "error")]),
|
|
282
282
|
]),
|
|
283
|
-
{ gap: "xs", role: "
|
|
283
|
+
{ gap: "xs", role: "zeta.spotlight.card" },
|
|
284
284
|
),
|
|
285
285
|
);
|
|
286
286
|
}
|
|
@@ -333,7 +333,7 @@ function folds(sheet: SheetText): TspCodeFold[] {
|
|
|
333
333
|
const OVERVIEW_MIN_LINES = 60;
|
|
334
334
|
|
|
335
335
|
/**
|
|
336
|
-
* The original as one `code` element (role `
|
|
336
|
+
* The original as one `code` element (role `zeta.spotlight.code`): marks, folds, and the overview past
|
|
337
337
|
* {@link OVERVIEW_MIN_LINES}. Command output (no file) wraps, a file keeps its lines.
|
|
338
338
|
*/
|
|
339
339
|
function originalCode(sheet: SheetText): NativeNode {
|
|
@@ -341,7 +341,7 @@ function originalCode(sheet: SheetText): NativeNode {
|
|
|
341
341
|
const marks = compact(sheet.lines.map((_, i) => lineMark(original, i)));
|
|
342
342
|
const shut = folds(sheet);
|
|
343
343
|
return code(sheet.lines.join("\n"), {
|
|
344
|
-
role: "
|
|
344
|
+
role: "zeta.spotlight.code",
|
|
345
345
|
path: sheet.path,
|
|
346
346
|
start: original.start,
|
|
347
347
|
numbers: true,
|
|
@@ -368,20 +368,20 @@ function shapingNotes(sheet: SheetText, heldOut: boolean): NativeNode | undefine
|
|
|
368
368
|
const heading = heldOut ? "notes the model would have seen" : "notes the model saw";
|
|
369
369
|
return col([text([span(heading, "muted")]), ...notes.map(note => text([span(note, "muted mono")]))], {
|
|
370
370
|
gap: "xs",
|
|
371
|
-
role: "
|
|
371
|
+
role: "zeta.spotlight.notes",
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
/**
|
|
376
|
-
* The footer's key to the rows' wash (role `
|
|
376
|
+
* The footer's key to the rows' wash (role `zeta.spotlight.legend`): the heat ramp (role `zeta.spotlight.ramp`, drawn
|
|
377
377
|
* by the terminal) before the rank's parts in their order across a row.
|
|
378
378
|
*/
|
|
379
379
|
function rankLegend(rank: SpotlightRank): NativeNode {
|
|
380
380
|
const label =
|
|
381
381
|
rank.parts.length > 1 ? `row tint, left to right: ${rank.parts.join(" → ")}` : `row tint: ${rank.parts[0]}`;
|
|
382
|
-
return row([legendKey(text("", { role: "
|
|
382
|
+
return row([legendKey(text("", { role: "zeta.spotlight.ramp" }), label)], {
|
|
383
383
|
align: "center",
|
|
384
|
-
role: "
|
|
384
|
+
role: "zeta.spotlight.legend",
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
|