@janvitos/pi-plan-build 0.1.17 → 0.1.19
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/README.md +1 -1
- package/index.ts +4 -0
- package/package.json +1 -1
- package/utils.ts +10 -8
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ A global [Pi coding agent](https://github.com/badlogic/pi-mono) extension that a
|
|
|
8
8
|
|
|
9
9
|
- New sessions start in **Build** mode.
|
|
10
10
|
- Bare `Tab` cycles **Build → Plan → Build**, while active autocomplete dropdowns retain Pi's normal Tab completion.
|
|
11
|
-
- The composer uses OpenCode prompt-inspired blue/orange mode colors on the rounded top-left border and left rail, complemented by Pi's border color on the right rail and rounded bottom-right border; dim rounded corners and
|
|
11
|
+
- The composer uses OpenCode prompt-inspired blue/orange mode colors on the rounded top-left border and left rail, complemented by Pi's border color on the right rail and rounded bottom-right border; dim rounded corners with color-matched heavy horizontal `╍` and vertical `┇` segments bridge the borders at the top right and bottom left. It also includes a mode/model/thinking metadata row; cycling the thinking level updates this row without adding a duplicate status above the composer. The model is shown as `model-id [provider]` (for example, `gpt-5.6-luna [openai]`), with the model ID inheriting the terminal foreground like unselected entries in `/model` and the provider using the footer's dim text color. The footer keeps the remaining path and usage stats without duplicating model metadata.
|
|
12
12
|
- `/plan`, `/build`, and the `--plan` startup flag.
|
|
13
13
|
- Per-session plans at `~/.pi/agent/plans/<session-id>.md`.
|
|
14
14
|
- In Plan mode, built-in `edit` and `write` are restricted to the exact plan file.
|
package/index.ts
CHANGED
|
@@ -495,10 +495,13 @@ export default function planBuildModes(pi: ExtensionAPI): void {
|
|
|
495
495
|
|
|
496
496
|
const leftRail = `${formatModeRail(selectedMode)} `;
|
|
497
497
|
const rightRail = this.borderColor("│");
|
|
498
|
+
const topRightVerticalTransition = this.borderColor("┇");
|
|
499
|
+
const bottomLeftVerticalTransition = formatModeRail(selectedMode, "┇");
|
|
498
500
|
const metadata = truncateToWidth(
|
|
499
501
|
formatModeMetadata(selectedMode, pi.getThinkingLevel(), ctx.ui.theme, this.borderColor, {
|
|
500
502
|
modelName: ctx.model?.id ?? "no-model",
|
|
501
503
|
modelProvider: ctx.model?.provider,
|
|
504
|
+
rail: bottomLeftVerticalTransition,
|
|
502
505
|
}),
|
|
503
506
|
width - 1,
|
|
504
507
|
"",
|
|
@@ -509,6 +512,7 @@ export default function planBuildModes(pi: ExtensionAPI): void {
|
|
|
509
512
|
topBorder,
|
|
510
513
|
leftRail,
|
|
511
514
|
rightRail,
|
|
515
|
+
topRightVerticalTransition,
|
|
512
516
|
metadata,
|
|
513
517
|
ctx.ui.theme.fg("dim", "╰"),
|
|
514
518
|
railWidth,
|
package/package.json
CHANGED
package/utils.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface ModeStatusTheme {
|
|
|
15
15
|
export interface PromptMetadataOptions {
|
|
16
16
|
modelName: string;
|
|
17
17
|
modelProvider?: string;
|
|
18
|
+
rail?: string;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export type ThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
@@ -38,13 +39,13 @@ function formatModeColor(mode: Mode, text: string): string {
|
|
|
38
39
|
return `\x1b[${MODE_LABELS[mode].color}m${text}${ANSI_RESET}`;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
export function formatModeRail(mode: Mode): string {
|
|
42
|
-
return formatModeColor(mode,
|
|
42
|
+
export function formatModeRail(mode: Mode, glyph = "│"): string {
|
|
43
|
+
return formatModeColor(mode, glyph);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
export function formatModeTopBorder(mode: Mode, width: number, topRightCorner: string): string {
|
|
46
47
|
if (width <= 2) return "";
|
|
47
|
-
return `${formatModeColor(mode, `╭${"─".repeat(width - 3)}
|
|
48
|
+
return `${formatModeColor(mode, `╭${"─".repeat(width - 3)}╍`)}${topRightCorner}`;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
export function formatModeMetadata(
|
|
@@ -62,7 +63,7 @@ export function formatModeMetadata(
|
|
|
62
63
|
}`
|
|
63
64
|
: "";
|
|
64
65
|
const thinkingSeparator = options ? " • " : " · ";
|
|
65
|
-
return `${formatModeRail(mode)} ${modeText}${modelText}${theme.fg("dim", thinkingSeparator)}${thinkingColor(thinkingLevel)}`;
|
|
66
|
+
return `${options?.rail ?? formatModeRail(mode)} ${modeText}${modelText}${theme.fg("dim", thinkingSeparator)}${thinkingColor(thinkingLevel)}`;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
export function formatTokens(count: number): string {
|
|
@@ -94,6 +95,7 @@ export function renderModeComposer(
|
|
|
94
95
|
topBorder: string,
|
|
95
96
|
leftRailPrefix: string,
|
|
96
97
|
rightRail: string,
|
|
98
|
+
topRightRail: string,
|
|
97
99
|
metadata: string,
|
|
98
100
|
bottomLeftCorner: string,
|
|
99
101
|
reservedWidth: number,
|
|
@@ -105,20 +107,20 @@ export function renderModeComposer(
|
|
|
105
107
|
const bottomBorderIndex = lines.findIndex((line, index) => index > 0 && !line.startsWith(reservedPrefix));
|
|
106
108
|
if (bottomBorderIndex < 2) return lines;
|
|
107
109
|
|
|
108
|
-
const addRightRail = (line: string): string => {
|
|
110
|
+
const addRightRail = (line: string, rail = rightRail): string => {
|
|
109
111
|
const content = lineWidth.truncate(line, width - 1);
|
|
110
|
-
return `${content}${" ".repeat(Math.max(0, width - 1 - lineWidth.measure(content)))}${
|
|
112
|
+
return `${content}${" ".repeat(Math.max(0, width - 1 - lineWidth.measure(content)))}${rail}`;
|
|
111
113
|
};
|
|
112
114
|
const promptLines = lines
|
|
113
115
|
.slice(1, bottomBorderIndex)
|
|
114
116
|
.map((line) => addRightRail(leftRailPrefix + line.slice(reservedPrefix.length)));
|
|
115
117
|
const ansiSequence = "(?:\\x1b\\[[0-?]*[ -/]*[@-~])*";
|
|
116
118
|
const bottomBorder = bottomLeftCorner + lineWidth.truncate(lines[bottomBorderIndex]!, width)
|
|
117
|
-
.replace(new RegExp(`^(${ansiSequence}).${ansiSequence}.`, "u"), "$1
|
|
119
|
+
.replace(new RegExp(`^(${ansiSequence}).${ansiSequence}.`, "u"), "$1╍")
|
|
118
120
|
.replace(/.(?=(?:\x1b\[[0-?]*[ -/]*[@-~])*$)/u, "╯");
|
|
119
121
|
return [
|
|
120
122
|
topBorder,
|
|
121
|
-
addRightRail(leftRailPrefix),
|
|
123
|
+
addRightRail(leftRailPrefix, topRightRail),
|
|
122
124
|
...promptLines,
|
|
123
125
|
addRightRail(leftRailPrefix),
|
|
124
126
|
addRightRail(metadata),
|