@janvitos/pi-plan-build 0.1.1 → 0.1.2
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 +2 -4
- package/package.json +1 -1
- package/utils.ts +14 -0
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** and replaces normal Tab autocomplete.
|
|
11
|
-
-
|
|
11
|
+
- Fixed-width, bold, color-coded **Build** (blue) and **Plan** (yellow) status badges in Pi's footer.
|
|
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
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
buildPlanReviewMessage,
|
|
20
20
|
classifyPlanExitChoice,
|
|
21
21
|
decodeModeState,
|
|
22
|
+
formatModeStatus,
|
|
22
23
|
isAllowedPlanMutation,
|
|
23
24
|
makePlanPath,
|
|
24
25
|
nextMode,
|
|
@@ -94,10 +95,7 @@ export default function planBuildModes(pi: ExtensionAPI): void {
|
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
function updateStatus(ctx: ExtensionContext): void {
|
|
97
|
-
|
|
98
|
-
? ctx.ui.theme.fg("warning", "Plan")
|
|
99
|
-
: ctx.ui.theme.fg("border", "Build");
|
|
100
|
-
ctx.ui.setStatus(STATUS_KEY, `[${label}]`);
|
|
98
|
+
ctx.ui.setStatus(STATUS_KEY, formatModeStatus(selectedMode));
|
|
101
99
|
}
|
|
102
100
|
|
|
103
101
|
function discoverUnmanagedTools(): void {
|
package/package.json
CHANGED
package/utils.ts
CHANGED
|
@@ -2,6 +2,20 @@ import path from "node:path";
|
|
|
2
2
|
|
|
3
3
|
export type Mode = "build" | "plan";
|
|
4
4
|
|
|
5
|
+
const ANSI_RESET = "\x1b[0m";
|
|
6
|
+
const BOLD_BLACK_FOREGROUND = "1;38;2;0;0;0";
|
|
7
|
+
const MODE_BADGES: Record<Mode, { background: string; text: string; reservedSpace: string }> = {
|
|
8
|
+
// A trailing reset keeps Pi's status sanitizer from trimming the uncolored reserved cell.
|
|
9
|
+
plan: { background: "48;2;255;215;0", text: " PLAN ", reservedSpace: "\u00a0" },
|
|
10
|
+
build: { background: "48;2;59;130;246", text: " BUILD ", reservedSpace: "" },
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function formatModeStatus(mode: Mode): string {
|
|
14
|
+
const badge = MODE_BADGES[mode];
|
|
15
|
+
const reservedSuffix = badge.reservedSpace ? `${badge.reservedSpace}${ANSI_RESET}` : "";
|
|
16
|
+
return `\x1b[${BOLD_BLACK_FOREGROUND};${badge.background}m${badge.text}${ANSI_RESET}${reservedSuffix}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
5
19
|
export const PLAN_EXIT_APPROVE_CHOICE = "Switch to Build and implement here";
|
|
6
20
|
export const PLAN_EXIT_FRESH_CHOICE = "Start fresh and implement";
|
|
7
21
|
export const PLAN_EXIT_STAY_CHOICE = "Stay in Plan mode";
|