pi-cc-extensions 0.8.23 → 0.8.25
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.
|
@@ -224,6 +224,12 @@ function saveConfig() {
|
|
|
224
224
|
writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2));
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
const TOOL_VIEWPORT_WIDTH_RATIO = 0.8;
|
|
228
|
+
|
|
229
|
+
function toolViewportWidth(width: number): number {
|
|
230
|
+
return Math.max(1, Math.floor(width * TOOL_VIEWPORT_WIDTH_RATIO));
|
|
231
|
+
}
|
|
232
|
+
|
|
227
233
|
function oneLine(value: unknown, max = 72): string {
|
|
228
234
|
const text = String(value ?? "")
|
|
229
235
|
.replace(/\s+/g, " ")
|
|
@@ -534,7 +540,7 @@ export class ExpandedToolIoView {
|
|
|
534
540
|
const safeWidth = Math.max(1, Math.floor(width));
|
|
535
541
|
const rail = " │ ";
|
|
536
542
|
const railWidth = visibleWidth(rail);
|
|
537
|
-
const bodyWidth =
|
|
543
|
+
const bodyWidth = toolViewportWidth(safeWidth);
|
|
538
544
|
const contentWidth = Math.max(1, bodyWidth - railWidth);
|
|
539
545
|
const bodyColor = this.isError ? "error" : "toolOutput";
|
|
540
546
|
const lines: string[] = [];
|
|
@@ -697,11 +703,12 @@ export function renderCollapsedToolResultToWidth(
|
|
|
697
703
|
collapsedHint: string,
|
|
698
704
|
width: number,
|
|
699
705
|
): string {
|
|
706
|
+
const previewWidth = toolViewportWidth(width);
|
|
700
707
|
const prefix = " ↳ ";
|
|
701
|
-
const bodyWidth = Math.max(1,
|
|
708
|
+
const bodyWidth = Math.max(1, previewWidth - visibleWidth(prefix) - visibleWidth(collapsedHint));
|
|
702
709
|
return truncateToWidth(
|
|
703
710
|
prefix + middleTruncateToWidth(body, bodyWidth) + collapsedHint,
|
|
704
|
-
|
|
711
|
+
previewWidth,
|
|
705
712
|
"",
|
|
706
713
|
);
|
|
707
714
|
}
|
|
@@ -1707,7 +1714,7 @@ function restoreToolMouseRenderPatch(): void {
|
|
|
1707
1714
|
}
|
|
1708
1715
|
|
|
1709
1716
|
function patchToolMouseMotionAfterRender(tui: any): void {
|
|
1710
|
-
if (!
|
|
1717
|
+
if (!toolMouseFixedFeaturesEnabled || toolMouseRenderPatchTui === tui) return;
|
|
1711
1718
|
restoreToolMouseRenderPatch();
|
|
1712
1719
|
const original = tui?.doRender;
|
|
1713
1720
|
const terminal = tui?.terminal;
|
|
@@ -2358,7 +2365,7 @@ function createCcstyleTool(
|
|
|
2358
2365
|
return {
|
|
2359
2366
|
render(width: number) {
|
|
2360
2367
|
if (cachedLine !== undefined && cachedWidth === width) return [cachedLine];
|
|
2361
|
-
const callWidth = Math.max(0, width - visibleWidth(icon) - 1);
|
|
2368
|
+
const callWidth = Math.max(0, toolViewportWidth(width) - visibleWidth(icon) - 1);
|
|
2362
2369
|
const argumentWidth = Math.max(1, callWidth - visibleWidth(`${label}()`));
|
|
2363
2370
|
const shown = argument ? middleTruncateToWidth(argument.value, argumentWidth) : undefined;
|
|
2364
2371
|
const call = shown === undefined ? label : `${label}(${shown})`;
|
|
@@ -2403,7 +2410,7 @@ function createCcstyleTool(
|
|
|
2403
2410
|
|
|
2404
2411
|
const text = textFromResult(result);
|
|
2405
2412
|
const args = context?.args;
|
|
2406
|
-
const rendered = !expanded ? (text ? oneLine(text
|
|
2413
|
+
const rendered = !expanded ? (text ? oneLine(text) : "Done") : text;
|
|
2407
2414
|
|
|
2408
2415
|
const detailLineCount = outputLineCount(result) || countLines(formatToolInputArgs(args));
|
|
2409
2416
|
const hint =
|
package/package.json
CHANGED