oh-pi 0.1.19 → 0.1.21
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.
|
@@ -4,7 +4,7 @@ const PRESETS = {
|
|
|
4
4
|
starter: {
|
|
5
5
|
labelKey: "preset.starter", hintKey: "preset.starterHint",
|
|
6
6
|
config: {
|
|
7
|
-
theme: "
|
|
7
|
+
theme: "dark", keybindings: "default", thinking: "medium",
|
|
8
8
|
extensions: ["safe-guard", "git-guard", "auto-session-name", "custom-footer", "compact-header"],
|
|
9
9
|
skills: ["quick-setup", "debug-helper"],
|
|
10
10
|
prompts: ["review", "fix", "explain", "commit"],
|
|
@@ -51,7 +51,7 @@ const PRESETS = {
|
|
|
51
51
|
full: {
|
|
52
52
|
labelKey: "preset.full", hintKey: "preset.fullHint",
|
|
53
53
|
config: {
|
|
54
|
-
theme: "
|
|
54
|
+
theme: "dark", keybindings: "default", thinking: "high",
|
|
55
55
|
extensions: ["safe-guard", "git-guard", "auto-session-name", "custom-footer", "compact-header", "ant-colony"],
|
|
56
56
|
skills: ["quick-setup", "debug-helper", "git-workflow", "ant-colony"],
|
|
57
57
|
prompts: ["review", "fix", "explain", "commit", "test", "refactor", "optimize", "security", "document", "pr"],
|
package/dist/types.js
CHANGED
|
@@ -28,13 +28,13 @@ export const PROVIDERS = {
|
|
|
28
28
|
mistral: { env: "MISTRAL_API_KEY", label: "Mistral", models: ["mistral-large-latest"] },
|
|
29
29
|
};
|
|
30
30
|
export const THEMES = [
|
|
31
|
+
{ name: "dark", label: "Pi Default Dark", style: "dark" },
|
|
31
32
|
{ name: "oh-p-dark", label: "oh-pi Dark (Cyan+Purple)", style: "dark" },
|
|
32
33
|
{ name: "cyberpunk", label: "Cyberpunk (Neon)", style: "dark" },
|
|
33
34
|
{ name: "nord", label: "Nord (Arctic)", style: "dark" },
|
|
34
35
|
{ name: "catppuccin-mocha", label: "Catppuccin Mocha (Pastel)", style: "dark" },
|
|
35
36
|
{ name: "tokyo-night", label: "Tokyo Night (Blue+Purple)", style: "dark" },
|
|
36
37
|
{ name: "gruvbox-dark", label: "Gruvbox Dark (Warm)", style: "dark" },
|
|
37
|
-
{ name: "dark", label: "Pi Default Dark", style: "dark" },
|
|
38
38
|
{ name: "light", label: "Pi Default Light", style: "light" },
|
|
39
39
|
];
|
|
40
40
|
export const EXTENSIONS = [
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* oh-pi Compact Header — table-style startup info
|
|
2
|
+
* oh-pi Compact Header — table-style startup info with dynamic column widths
|
|
3
3
|
*/
|
|
4
4
|
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
5
5
|
import { VERSION } from "@mariozechner/pi-coding-agent";
|
|
@@ -17,32 +17,48 @@ export default function (pi: ExtensionAPI) {
|
|
|
17
17
|
const cmds = pi.getCommands();
|
|
18
18
|
const prompts = cmds.filter(c => c.source === "prompt").map(c => `/${c.name}`).join(" ");
|
|
19
19
|
const skills = cmds.filter(c => c.source === "skill").map(c => c.name).join(" ");
|
|
20
|
-
const model = ctx.model ? `${ctx.model.
|
|
20
|
+
const model = ctx.model ? `${ctx.model.id}` : "no model";
|
|
21
21
|
const thinking = pi.getThinkingLevel();
|
|
22
|
+
const provider = ctx.model?.provider ?? "";
|
|
22
23
|
|
|
23
24
|
const pad = (s: string, w: number) => s + " ".repeat(Math.max(0, w - visibleWidth(s)));
|
|
24
25
|
const t = (s: string) => truncateToWidth(s, width);
|
|
25
|
-
|
|
26
|
-
const c0 = 8, c1 = 14, c2 = 6, c3 = 14, c4 = 6;
|
|
27
26
|
const sep = d(" │ ");
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
[d("
|
|
32
|
-
[d("
|
|
33
|
-
[d(""),
|
|
34
|
-
[d(""),
|
|
28
|
+
// Right two columns are fixed width
|
|
29
|
+
const rCol = [
|
|
30
|
+
[d("esc"), a("interrupt"), d("S-tab"), a("thinking")],
|
|
31
|
+
[d("^C"), a("clear/exit"), d("^O"), a("expand")],
|
|
32
|
+
[d("^P"), a("model"), d("^G"), a("editor")],
|
|
33
|
+
[d("/"), a("commands"), d("^V"), a("paste")],
|
|
34
|
+
[d("!"), a("bash"), d(""), a("")],
|
|
35
|
+
];
|
|
36
|
+
const k1w = 6, v1w = 13, k2w = 6, v2w = 9;
|
|
37
|
+
const rightW = k1w + v1w + 3 + k2w + v2w + 3; // 3 for each sep
|
|
38
|
+
|
|
39
|
+
// Left column gets remaining space
|
|
40
|
+
const leftW = Math.max(20, width - rightW);
|
|
41
|
+
const lk = 9; // label width
|
|
42
|
+
|
|
43
|
+
const lCol = [
|
|
44
|
+
[d("version"), a(`v${VERSION} ${provider}`)],
|
|
45
|
+
[d("model"), a(model)],
|
|
46
|
+
[d("think"), a(thinking)],
|
|
47
|
+
[d(""), d("")],
|
|
48
|
+
[d(""), d("")],
|
|
35
49
|
];
|
|
36
50
|
|
|
37
51
|
const lines: string[] = [""];
|
|
38
|
-
for (
|
|
39
|
-
const
|
|
40
|
-
|
|
52
|
+
for (let i = 0; i < 5; i++) {
|
|
53
|
+
const [lk0, lv0] = lCol[i];
|
|
54
|
+
const [rk0, rv0, rk1, rv1] = rCol[i];
|
|
55
|
+
const left = truncateToWidth(pad(lk0, lk) + lv0, leftW);
|
|
56
|
+
const right = pad(rk0, k1w) + pad(rv0, v1w) + sep + pad(rk1, k2w) + rv1;
|
|
57
|
+
lines.push(t(pad(left, leftW) + sep + right));
|
|
41
58
|
}
|
|
42
59
|
|
|
43
|
-
|
|
44
|
-
if (
|
|
45
|
-
if (skills) lines.push(t(`${pad(d("skills"), c0)}${a(skills)}`));
|
|
60
|
+
if (prompts) lines.push(t(`${pad(d("prompts"), lk)}${a(prompts)}`));
|
|
61
|
+
if (skills) lines.push(t(`${pad(d("skills"), lk)}${a(skills)}`));
|
|
46
62
|
lines.push(d("─".repeat(width)));
|
|
47
63
|
|
|
48
64
|
return lines;
|