@gonrocca/zero-pi 0.1.65 → 0.1.67
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
CHANGED
|
@@ -114,7 +114,9 @@ into `/forge` for you.
|
|
|
114
114
|
| **Provider guard** | Warns when the `anthropic` provider runs on a metered API key instead of your subscription. |
|
|
115
115
|
| **Startup banner** | The sunset ANSI-Shadow `ZERO` wordmark, drawn once at pi startup — `ZERO_HEADER=off` to disable. |
|
|
116
116
|
| **ZERO HUD** | OMP-inspired segmented footer for SDD work: phase, model, tokens, cache, cost, diff, context %, and branch. Switch presets with `/zero-hud compact\|minimal\|full\|ascii\|off` or `ZERO_HUD_PRESET`. |
|
|
117
|
-
| **
|
|
117
|
+
| **Pretty input box** | OMP-style prompt chrome with rounded corners, side borders, ZERO chips, and compact keyboard hints. |
|
|
118
|
+
| **Pretty code fences** | Markdown code blocks render as bordered panels with language badges instead of raw ```txt / ```json fence lines. |
|
|
119
|
+
| **Working-phrase ticker** | Swaps pi's static `Working...` / `Procesando...` for a large pool of context-aware Spanish/ZERO/SDD phrases + spinner. |
|
|
118
120
|
| **Conversation resume** | Writes `.pi/zero-resume.md` on exit — the restore command + a conversation tail. |
|
|
119
121
|
| **Windows tree-kill** | Aborting a turn kills the whole process tree — no orphaned `claude`. |
|
|
120
122
|
| **SDD routing skill** | Natural-language requests that say "hacelo con sdd" route into `/forge` without remembering the slash command. |
|
|
@@ -40,15 +40,55 @@ const THINKING_PLAYFUL = [
|
|
|
40
40
|
"Maquinando",
|
|
41
41
|
"Rumiando",
|
|
42
42
|
"Pensando",
|
|
43
|
-
"Cocinando",
|
|
44
|
-
"Tramando",
|
|
45
|
-
"Conjurando",
|
|
46
|
-
"Cavilando",
|
|
43
|
+
"Cocinando una idea",
|
|
44
|
+
"Tramando el próximo paso",
|
|
45
|
+
"Conjurando contexto",
|
|
46
|
+
"Cavilando fino",
|
|
47
47
|
"Hilando ideas",
|
|
48
|
-
"Procesando",
|
|
48
|
+
"Procesando señales",
|
|
49
49
|
"Razonando",
|
|
50
50
|
"Atando cabos",
|
|
51
|
-
"Calibrando",
|
|
51
|
+
"Calibrando criterio",
|
|
52
|
+
"Afilando el lápiz",
|
|
53
|
+
"Leyendo entre líneas",
|
|
54
|
+
"Buscando el camino corto",
|
|
55
|
+
"Separando ruido de señal",
|
|
56
|
+
"Ordenando el quilombo",
|
|
57
|
+
"Mirando el diff mental",
|
|
58
|
+
"Midiendo impacto",
|
|
59
|
+
"Puliendo la respuesta",
|
|
60
|
+
"Armando la jugada",
|
|
61
|
+
"Pensando como reviewer",
|
|
62
|
+
"Evitando overengineering",
|
|
63
|
+
"Cuidando tus tokens",
|
|
64
|
+
"Chequeando supuestos",
|
|
65
|
+
"Bajando a tierra",
|
|
66
|
+
"Buscando el bug escondido",
|
|
67
|
+
"Haciendo magia responsable",
|
|
68
|
+
"Tirando del hilo",
|
|
69
|
+
"Cruzando evidencia",
|
|
70
|
+
"Afinando el plan",
|
|
71
|
+
"Sacando filo",
|
|
72
|
+
"Cargando mate cognitivo",
|
|
73
|
+
"No rompiendo producción",
|
|
74
|
+
"Haciendo que compile en la cabeza",
|
|
75
|
+
"Respirando antes de tocar código",
|
|
76
|
+
"Usando la Fuerza",
|
|
77
|
+
"Afinando el sable láser",
|
|
78
|
+
"Saltando al hiperespacio",
|
|
79
|
+
"Esquivando blasters",
|
|
80
|
+
"Consultando al droide astromecánico",
|
|
81
|
+
"Que el diff te acompañe",
|
|
82
|
+
"Evitando el lado oscuro del scope",
|
|
83
|
+
"No es el bug que estás buscando",
|
|
84
|
+
"Cargando el ki",
|
|
85
|
+
"Entrando en modo Super Saiyajin",
|
|
86
|
+
"Juntando energía para la Genkidama",
|
|
87
|
+
"Buscando las Esferas del Dragón",
|
|
88
|
+
"Entrenando en gravedad 100x",
|
|
89
|
+
"Midiendo poder con el scouter",
|
|
90
|
+
"Preparando un Kamehameha al bug",
|
|
91
|
+
"Teletransportando contexto",
|
|
52
92
|
];
|
|
53
93
|
|
|
54
94
|
/** Thinking verbs biased toward SDD work — used once an SDD run is detected. */
|
|
@@ -59,6 +99,30 @@ const THINKING_SDD = [
|
|
|
59
99
|
"Revisando supuestos",
|
|
60
100
|
"Ordenando las tareas",
|
|
61
101
|
"Cuadrando el spec",
|
|
102
|
+
"Alineando requisitos",
|
|
103
|
+
"Buscando criterios de éxito",
|
|
104
|
+
"Separando explore de build",
|
|
105
|
+
"Guardando el contexto útil",
|
|
106
|
+
"Preparando el veredicto",
|
|
107
|
+
"Pensando tests primero",
|
|
108
|
+
"Revisando riesgos",
|
|
109
|
+
"Midiendo alcance",
|
|
110
|
+
"Evitando scope creep",
|
|
111
|
+
"Diseñando el camino mínimo",
|
|
112
|
+
"Armando evidencia TDD",
|
|
113
|
+
"Verificando invariantes",
|
|
114
|
+
"Preguntando lo justo",
|
|
115
|
+
"Cerrando ambigüedades",
|
|
116
|
+
"Forjando el spec",
|
|
117
|
+
"Escribiendo el holocrón del spec",
|
|
118
|
+
"Auditando como Consejo Jedi",
|
|
119
|
+
"Manteniendo balance en la Fuerza",
|
|
120
|
+
"Evitando el lado oscuro del scope creep",
|
|
121
|
+
"Buscando el canon del requisito",
|
|
122
|
+
"Entrenando en la Habitación del Tiempo",
|
|
123
|
+
"Cargando Genkidama de tests",
|
|
124
|
+
"Subiendo el poder del build",
|
|
125
|
+
"Invocando a Shenlong por un veredicto pasa",
|
|
62
126
|
"Maquinando",
|
|
63
127
|
"Razonando",
|
|
64
128
|
];
|
|
@@ -79,9 +143,15 @@ const TOOL_RULES: Array<[RegExp, string]> = [
|
|
|
79
143
|
[/(multi.?edit|str.?replace|edit|patch|apply)/i, "Aplicando cambios"],
|
|
80
144
|
[/(write|create)/i, "Escribiendo archivos"],
|
|
81
145
|
[/(bash|shell|exec|run|terminal|cmd)/i, "Ejecutando comandos"],
|
|
146
|
+
[/(test|vitest|jest|mocha|node:test|coverage)/i, "Corriendo pruebas"],
|
|
147
|
+
[/(npm|pnpm|bun|yarn|publish|pack)/i, "Preparando paquete"],
|
|
148
|
+
[/(git|commit|push|branch|diff|status)/i, "Hablando con git"],
|
|
82
149
|
[/(grep|search|ripgrep|^rg)/i, "Buscando en el código"],
|
|
83
150
|
[/(glob|find|^ls$|list|tree)/i, "Rastreando archivos"],
|
|
84
151
|
[/(web|fetch|http|url|browse|curl)/i, "Navegando la web"],
|
|
152
|
+
[/(browser|click|type|screenshot|tab)/i, "Moviendo el navegador"],
|
|
153
|
+
[/(cortex|memoria|memory|recall)/i, "Consultando memoria"],
|
|
154
|
+
[/(image|screenshot|vision)/i, "Mirando la imagen"],
|
|
85
155
|
[/(subagent|custom-agent|^task$|agent)/i, "Coordinando sub-agentes"],
|
|
86
156
|
[/(todo|plan)/i, "Ordenando el plan"],
|
|
87
157
|
];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Markdown, visibleWidth } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
|
|
4
|
+
type MarkdownInstance = {
|
|
5
|
+
theme: {
|
|
6
|
+
codeBlock: (text: string) => string;
|
|
7
|
+
codeBlockBorder: (text: string) => string;
|
|
8
|
+
codeBlockIndent?: string;
|
|
9
|
+
highlightCode?: (code: string, lang?: string) => string[];
|
|
10
|
+
};
|
|
11
|
+
renderToken: (token: { type?: string; text?: string; lang?: string }, width: number, nextTokenType?: string, styleContext?: unknown) => string[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const PATCHED = Symbol.for("gon.pi.pretty-code-fences.patched");
|
|
15
|
+
|
|
16
|
+
function displayLang(lang?: string): string {
|
|
17
|
+
const raw = (lang ?? "").trim().toLowerCase();
|
|
18
|
+
if (!raw || raw === "txt" || raw === "text" || raw === "plain") return "";
|
|
19
|
+
if (raw === "typescript") return "ts";
|
|
20
|
+
if (raw === "javascript") return "js";
|
|
21
|
+
if (raw === "shell" || raw === "bash") return "sh";
|
|
22
|
+
return raw;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function border(theme: MarkdownInstance["theme"], width: number, position: "top" | "bottom", lang = ""): string {
|
|
26
|
+
const maxWidth = Math.max(10, Math.min(width, 96));
|
|
27
|
+
if (position === "bottom") {
|
|
28
|
+
return theme.codeBlockBorder(`╰${"─".repeat(Math.max(1, maxWidth - 2))}╯`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const label = lang ? ` ${lang} ` : "";
|
|
32
|
+
const prefix = `╭─${label}`;
|
|
33
|
+
const suffix = "╮";
|
|
34
|
+
const fill = "─".repeat(Math.max(1, maxWidth - visibleWidth(prefix) - visibleWidth(suffix)));
|
|
35
|
+
return theme.codeBlockBorder(`${prefix}${fill}${suffix}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function patchMarkdownRenderer(): void {
|
|
39
|
+
const proto = Markdown.prototype as unknown as MarkdownInstance & { [PATCHED]?: boolean };
|
|
40
|
+
if (proto[PATCHED]) return;
|
|
41
|
+
proto[PATCHED] = true;
|
|
42
|
+
|
|
43
|
+
const original = proto.renderToken;
|
|
44
|
+
proto.renderToken = function prettyRenderToken(token, width, nextTokenType, styleContext): string[] {
|
|
45
|
+
if (token?.type !== "code") {
|
|
46
|
+
return original.call(this, token, width, nextTokenType, styleContext);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const lang = displayLang(token.lang);
|
|
50
|
+
const lines: string[] = [];
|
|
51
|
+
const gutter = this.theme.codeBlockBorder("│ ");
|
|
52
|
+
lines.push(border(this.theme, width, "top", lang));
|
|
53
|
+
|
|
54
|
+
if (this.theme.highlightCode) {
|
|
55
|
+
const highlightedLines = this.theme.highlightCode(token.text ?? "", token.lang);
|
|
56
|
+
for (const hlLine of highlightedLines) {
|
|
57
|
+
lines.push(`${gutter}${hlLine}`);
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
const codeLines = (token.text ?? "").split("\n");
|
|
61
|
+
for (const codeLine of codeLines) {
|
|
62
|
+
lines.push(`${gutter}${this.theme.codeBlock(codeLine)}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
lines.push(border(this.theme, width, "bottom"));
|
|
67
|
+
if (nextTokenType && nextTokenType !== "space") {
|
|
68
|
+
lines.push("");
|
|
69
|
+
}
|
|
70
|
+
return lines;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default function (_pi: ExtensionAPI) {
|
|
75
|
+
patchMarkdownRenderer();
|
|
76
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Editor, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
|
|
4
|
+
const PATCHED = Symbol.for("gon.pi.pretty-input-box.patched");
|
|
5
|
+
const ANSI_RE = /\x1b\[[0-9;]*m/g;
|
|
6
|
+
|
|
7
|
+
function rgb(hex: string, text: string): string {
|
|
8
|
+
const clean = hex.replace(/^#/, "");
|
|
9
|
+
const r = Number.parseInt(clean.slice(0, 2), 16);
|
|
10
|
+
const g = Number.parseInt(clean.slice(2, 4), 16);
|
|
11
|
+
const b = Number.parseInt(clean.slice(4, 6), 16);
|
|
12
|
+
return `\x1b[38;2;${r};${g};${b}m${text}\x1b[0m`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const c = {
|
|
16
|
+
border: (s: string) => rgb("#ff6b5f", s),
|
|
17
|
+
borderDim: (s: string) => rgb("#8b514a", s),
|
|
18
|
+
cyan: (s: string) => rgb("#00d7ff", s),
|
|
19
|
+
green: (s: string) => rgb("#00ff8a", s),
|
|
20
|
+
gold: (s: string) => rgb("#f6b85a", s),
|
|
21
|
+
muted: (s: string) => rgb("#7a6d62", s),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
function stripAnsi(text: string): string {
|
|
25
|
+
return text.replace(ANSI_RE, "");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function padAnsi(text: string, width: number): string {
|
|
29
|
+
const clipped = truncateToWidth(text, width, "");
|
|
30
|
+
return clipped + " ".repeat(Math.max(0, width - visibleWidth(clipped)));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function line(width: number, side: "top" | "bottom", original = ""): string {
|
|
34
|
+
if (width < 20) return c.border("─".repeat(width));
|
|
35
|
+
|
|
36
|
+
const isTop = side === "top";
|
|
37
|
+
const leftCorner = isTop ? "╭" : "╰";
|
|
38
|
+
const rightCorner = isTop ? "╮" : "╯";
|
|
39
|
+
const strippedOriginal = stripAnsi(original);
|
|
40
|
+
const scrollMatch = strippedOriginal.match(/[↑↓] \d+ more/);
|
|
41
|
+
|
|
42
|
+
const leftLabel = isTop
|
|
43
|
+
? `${c.border(leftCorner + "─")} ${c.cyan("π")} ${c.muted("•")} ${c.green("ZERO")} ${c.muted("•")} ${c.gold("prompt")} `
|
|
44
|
+
: `${c.border(leftCorner + "─")} ${c.muted("ctrl+j newline")} `;
|
|
45
|
+
const rightLabel = isTop
|
|
46
|
+
? ` ${scrollMatch ? c.gold(scrollMatch[0]) : c.muted("Enter ↵")} ${c.border("─" + rightCorner)}`
|
|
47
|
+
: ` ${c.muted("esc stop")} ${c.border("─" + rightCorner)}`;
|
|
48
|
+
|
|
49
|
+
const fill = Math.max(1, width - visibleWidth(leftLabel) - visibleWidth(rightLabel));
|
|
50
|
+
return leftLabel + c.borderDim("─".repeat(fill)) + rightLabel;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function isHorizontalEditorLine(text: string): boolean {
|
|
54
|
+
const stripped = stripAnsi(text).trim();
|
|
55
|
+
return /^─+$/.test(stripped) || /^─── [↑↓] \d+ more/.test(stripped);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function patchEditor(): void {
|
|
59
|
+
const proto = Editor.prototype as unknown as {
|
|
60
|
+
render: (width: number) => string[];
|
|
61
|
+
[PATCHED]?: boolean;
|
|
62
|
+
};
|
|
63
|
+
if (proto[PATCHED]) return;
|
|
64
|
+
proto[PATCHED] = true;
|
|
65
|
+
|
|
66
|
+
const originalRender = proto.render;
|
|
67
|
+
proto.render = function prettyEditorRender(width: number): string[] {
|
|
68
|
+
if (width < 24) return originalRender.call(this, width);
|
|
69
|
+
|
|
70
|
+
const innerWidth = Math.max(1, width - 2);
|
|
71
|
+
const raw = originalRender.call(this, innerWidth);
|
|
72
|
+
if (raw.length < 3) return originalRender.call(this, width);
|
|
73
|
+
|
|
74
|
+
const bottomIndex = raw.findIndex((rawLine, index) => index > 0 && isHorizontalEditorLine(rawLine));
|
|
75
|
+
const resolvedBottomIndex = bottomIndex === -1 ? raw.length - 1 : bottomIndex;
|
|
76
|
+
const result: string[] = [];
|
|
77
|
+
|
|
78
|
+
result.push(line(width, "top", raw[0]));
|
|
79
|
+
for (let i = 1; i < resolvedBottomIndex; i++) {
|
|
80
|
+
result.push(`${c.border("│")} ${padAnsi(raw[i], innerWidth - 2)} ${c.border("│")}`);
|
|
81
|
+
}
|
|
82
|
+
result.push(line(width, "bottom", raw[resolvedBottomIndex]));
|
|
83
|
+
for (let i = resolvedBottomIndex + 1; i < raw.length; i++) {
|
|
84
|
+
result.push(`${c.border("│")} ${padAnsi(raw[i], innerWidth - 2)} ${c.border("│")}`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return result;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export default function (_pi: ExtensionAPI) {
|
|
92
|
+
patchEditor();
|
|
93
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gonrocca/zero-pi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.67",
|
|
4
4
|
"description": "zero-pi — an installable layer for pi (pi.dev): the zero spec-driven development workflow (clarify → explore → plan → analyze → build → veredicto) with automatic clarify/analyze gates, per-phase model autotune, and token-efficient batched builds. Adds capability to pi without modifying pi.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
"extensions": [
|
|
27
27
|
"./extensions/zero-banner.ts",
|
|
28
28
|
"./extensions/zero-hud.ts",
|
|
29
|
+
"./extensions/zero-pretty-code-fences.ts",
|
|
30
|
+
"./extensions/zero-pretty-input-box.ts",
|
|
29
31
|
"./extensions/working-phrases.ts",
|
|
30
32
|
"./extensions/win-tree-kill.ts",
|
|
31
33
|
"./extensions/sdd-agents.ts",
|
|
@@ -55,6 +57,8 @@
|
|
|
55
57
|
"assets/preview.png",
|
|
56
58
|
"extensions/zero-banner.ts",
|
|
57
59
|
"extensions/zero-hud.ts",
|
|
60
|
+
"extensions/zero-pretty-code-fences.ts",
|
|
61
|
+
"extensions/zero-pretty-input-box.ts",
|
|
58
62
|
"extensions/zero-statusline.ts",
|
|
59
63
|
"extensions/working-phrases.ts",
|
|
60
64
|
"extensions/win-tree-kill.ts",
|