pi-better-server 0.8.2 → 0.8.3
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/package.json +1 -1
- package/src/runtime/domain/background-service/shared-navigator.domain.mjs +10 -9
- package/src/runtime/domain/background-service/shared-navigator.ts +10 -9
- package/src/runtime/domain/subagents/package.json +1 -1
- package/src/runtime/domain/subagents/shared-navigator.domain.mjs +10 -9
- package/src/runtime/domain/subagents/shared-navigator.ts +10 -9
- package/src/version.ts +1 -1
package/package.json
CHANGED
|
@@ -693,21 +693,22 @@ function providerGroupLabel(label, fg) {
|
|
|
693
693
|
}
|
|
694
694
|
function formatMainListRow(row, selected, fg, width) {
|
|
695
695
|
const prefix = (selected ? fg("accent", "› ") : " ") + (row.treeDepth === 1 ? dim(` ${row.lastChild ? "└─" : "├─"} `, fg) : "");
|
|
696
|
-
const name = row
|
|
696
|
+
const name = rowDisplayName(row);
|
|
697
|
+
const summary = singleLine(rowSummary(row));
|
|
697
698
|
const indicator = statusIndicator(row);
|
|
698
699
|
const status = fg(indicator.color, indicator.glyph);
|
|
699
700
|
const elapsed = singleLine(row.elapsed || "-");
|
|
700
|
-
const available = Math.max(24, width || MAIN_LIST_FALLBACK_WIDTH);
|
|
701
701
|
const elapsedWidth = Math.min(Math.max(piVisibleWidth(elapsed), 4), 12);
|
|
702
702
|
const statusWidth = 2;
|
|
703
703
|
const leftPrefixWidth = piVisibleWidth(prefix) + statusWidth + 1;
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
const
|
|
707
|
-
const
|
|
708
|
-
const
|
|
709
|
-
const
|
|
710
|
-
const
|
|
704
|
+
const textWidth = Math.max(0, width - leftPrefixWidth - elapsedWidth - 2);
|
|
705
|
+
// Reserve a readable title when both texts are long. Each side can use the other's spare cells.
|
|
706
|
+
const preferredNameWidth = Math.max(8, Math.ceil(textWidth / 3), textWidth - piVisibleWidth(summary));
|
|
707
|
+
const nameWidth = Math.min(piVisibleWidth(name), textWidth, preferredNameWidth);
|
|
708
|
+
const summaryWidth = textWidth - nameWidth;
|
|
709
|
+
const left = `${prefix}${fit(status, statusWidth)} ${piTruncateToWidth(name, nameWidth)}`;
|
|
710
|
+
const right = `${dim(fitRight(summary, summaryWidth), fg)} ${fitRight(elapsed, elapsedWidth)}`;
|
|
711
|
+
const gap = Math.max(1, width - piVisibleWidth(left) - piVisibleWidth(right));
|
|
711
712
|
return `${left}${" ".repeat(gap)}${right}`;
|
|
712
713
|
}
|
|
713
714
|
function statusGlyph(row) {
|
|
@@ -778,21 +778,22 @@ function providerGroupLabel(label: string, fg: (color: string, value: string) =>
|
|
|
778
778
|
|
|
779
779
|
function formatMainListRow(row: InternalRow, selected: boolean, fg: (color: string, value: string) => string, width: number): string {
|
|
780
780
|
const prefix = (selected ? fg("accent", "› ") : " ") + (row.treeDepth === 1 ? dim(` ${row.lastChild ? "└─" : "├─"} `, fg) : "");
|
|
781
|
-
const name = row
|
|
781
|
+
const name = rowDisplayName(row);
|
|
782
|
+
const summary = singleLine(rowSummary(row));
|
|
782
783
|
const indicator = statusIndicator(row);
|
|
783
784
|
const status = fg(indicator.color, indicator.glyph);
|
|
784
785
|
const elapsed = singleLine(row.elapsed || "-");
|
|
785
|
-
const available = Math.max(24, width || MAIN_LIST_FALLBACK_WIDTH);
|
|
786
786
|
const elapsedWidth = Math.min(Math.max(piVisibleWidth(elapsed), 4), 12);
|
|
787
787
|
const statusWidth = 2;
|
|
788
788
|
const leftPrefixWidth = piVisibleWidth(prefix) + statusWidth + 1;
|
|
789
|
-
const
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
const
|
|
793
|
-
const
|
|
794
|
-
const
|
|
795
|
-
const
|
|
789
|
+
const textWidth = Math.max(0, width - leftPrefixWidth - elapsedWidth - 2);
|
|
790
|
+
// Reserve a readable title when both texts are long. Each side can use the other's spare cells.
|
|
791
|
+
const preferredNameWidth = Math.max(8, Math.ceil(textWidth / 3), textWidth - piVisibleWidth(summary));
|
|
792
|
+
const nameWidth = Math.min(piVisibleWidth(name), textWidth, preferredNameWidth);
|
|
793
|
+
const summaryWidth = textWidth - nameWidth;
|
|
794
|
+
const left = `${prefix}${fit(status, statusWidth)} ${piTruncateToWidth(name, nameWidth)}`;
|
|
795
|
+
const right = `${dim(fitRight(summary, summaryWidth), fg)} ${fitRight(elapsed, elapsedWidth)}`;
|
|
796
|
+
const gap = Math.max(1, width - piVisibleWidth(left) - piVisibleWidth(right));
|
|
796
797
|
return `${left}${" ".repeat(gap)}${right}`;
|
|
797
798
|
}
|
|
798
799
|
|
|
@@ -693,21 +693,22 @@ function providerGroupLabel(label, fg) {
|
|
|
693
693
|
}
|
|
694
694
|
function formatMainListRow(row, selected, fg, width) {
|
|
695
695
|
const prefix = (selected ? fg("accent", "› ") : " ") + (row.treeDepth === 1 ? dim(` ${row.lastChild ? "└─" : "├─"} `, fg) : "");
|
|
696
|
-
const name = row
|
|
696
|
+
const name = rowDisplayName(row);
|
|
697
|
+
const summary = singleLine(rowSummary(row));
|
|
697
698
|
const indicator = statusIndicator(row);
|
|
698
699
|
const status = fg(indicator.color, indicator.glyph);
|
|
699
700
|
const elapsed = singleLine(row.elapsed || "-");
|
|
700
|
-
const available = Math.max(24, width || MAIN_LIST_FALLBACK_WIDTH);
|
|
701
701
|
const elapsedWidth = Math.min(Math.max(piVisibleWidth(elapsed), 4), 12);
|
|
702
702
|
const statusWidth = 2;
|
|
703
703
|
const leftPrefixWidth = piVisibleWidth(prefix) + statusWidth + 1;
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
const
|
|
707
|
-
const
|
|
708
|
-
const
|
|
709
|
-
const
|
|
710
|
-
const
|
|
704
|
+
const textWidth = Math.max(0, width - leftPrefixWidth - elapsedWidth - 2);
|
|
705
|
+
// Reserve a readable title when both texts are long. Each side can use the other's spare cells.
|
|
706
|
+
const preferredNameWidth = Math.max(8, Math.ceil(textWidth / 3), textWidth - piVisibleWidth(summary));
|
|
707
|
+
const nameWidth = Math.min(piVisibleWidth(name), textWidth, preferredNameWidth);
|
|
708
|
+
const summaryWidth = textWidth - nameWidth;
|
|
709
|
+
const left = `${prefix}${fit(status, statusWidth)} ${piTruncateToWidth(name, nameWidth)}`;
|
|
710
|
+
const right = `${dim(fitRight(summary, summaryWidth), fg)} ${fitRight(elapsed, elapsedWidth)}`;
|
|
711
|
+
const gap = Math.max(1, width - piVisibleWidth(left) - piVisibleWidth(right));
|
|
711
712
|
return `${left}${" ".repeat(gap)}${right}`;
|
|
712
713
|
}
|
|
713
714
|
function statusGlyph(row) {
|
|
@@ -778,21 +778,22 @@ function providerGroupLabel(label: string, fg: (color: string, value: string) =>
|
|
|
778
778
|
|
|
779
779
|
function formatMainListRow(row: InternalRow, selected: boolean, fg: (color: string, value: string) => string, width: number): string {
|
|
780
780
|
const prefix = (selected ? fg("accent", "› ") : " ") + (row.treeDepth === 1 ? dim(` ${row.lastChild ? "└─" : "├─"} `, fg) : "");
|
|
781
|
-
const name = row
|
|
781
|
+
const name = rowDisplayName(row);
|
|
782
|
+
const summary = singleLine(rowSummary(row));
|
|
782
783
|
const indicator = statusIndicator(row);
|
|
783
784
|
const status = fg(indicator.color, indicator.glyph);
|
|
784
785
|
const elapsed = singleLine(row.elapsed || "-");
|
|
785
|
-
const available = Math.max(24, width || MAIN_LIST_FALLBACK_WIDTH);
|
|
786
786
|
const elapsedWidth = Math.min(Math.max(piVisibleWidth(elapsed), 4), 12);
|
|
787
787
|
const statusWidth = 2;
|
|
788
788
|
const leftPrefixWidth = piVisibleWidth(prefix) + statusWidth + 1;
|
|
789
|
-
const
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
const
|
|
793
|
-
const
|
|
794
|
-
const
|
|
795
|
-
const
|
|
789
|
+
const textWidth = Math.max(0, width - leftPrefixWidth - elapsedWidth - 2);
|
|
790
|
+
// Reserve a readable title when both texts are long. Each side can use the other's spare cells.
|
|
791
|
+
const preferredNameWidth = Math.max(8, Math.ceil(textWidth / 3), textWidth - piVisibleWidth(summary));
|
|
792
|
+
const nameWidth = Math.min(piVisibleWidth(name), textWidth, preferredNameWidth);
|
|
793
|
+
const summaryWidth = textWidth - nameWidth;
|
|
794
|
+
const left = `${prefix}${fit(status, statusWidth)} ${piTruncateToWidth(name, nameWidth)}`;
|
|
795
|
+
const right = `${dim(fitRight(summary, summaryWidth), fg)} ${fitRight(elapsed, elapsedWidth)}`;
|
|
796
|
+
const gap = Math.max(1, width - piVisibleWidth(left) - piVisibleWidth(right));
|
|
796
797
|
return `${left}${" ".repeat(gap)}${right}`;
|
|
797
798
|
}
|
|
798
799
|
|
package/src/version.ts
CHANGED