oh-pi 0.1.15 → 0.1.17

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.
@@ -56,6 +56,7 @@ export function applyConfig(config) {
56
56
  enableSkillCommands: true,
57
57
  compaction: { enabled: true, reserveTokens, keepRecentTokens: 20000 },
58
58
  retry: { enabled: true, maxRetries: 3 },
59
+ quietStartup: true,
59
60
  };
60
61
  if (config.providers.length > 1) {
61
62
  settings.enabledModels = config.providers.flatMap((p) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-pi",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "One-click setup for pi-coding-agent. Like oh-my-zsh for pi.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,8 @@
1
1
  /**
2
- * oh-pi Compact Header — replaces verbose startup with dense info block
2
+ * oh-pi Compact Header — aligned, scannable startup info
3
3
  */
4
4
  import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
5
+ import { VERSION } from "@mariozechner/pi-coding-agent";
5
6
  import { truncateToWidth } from "@mariozechner/pi-tui";
6
7
 
7
8
  export default function (pi: ExtensionAPI) {
@@ -10,38 +11,53 @@ export default function (pi: ExtensionAPI) {
10
11
 
11
12
  ctx.ui.setHeader((_tui, theme) => ({
12
13
  render(width: number): string[] {
13
- const dim = (s: string) => theme.fg("dim", s);
14
- const acc = (s: string) => theme.fg("accent", s);
15
- const mut = (s: string) => theme.fg("muted", s);
14
+ const d = (s: string) => theme.fg("dim", s);
15
+ const a = (s: string) => theme.fg("accent", s);
16
16
 
17
- // Gather info
18
17
  const cmds = pi.getCommands();
19
- const prompts = cmds.filter(c => c.source === "prompt").map(c => `/${c.name}`);
20
- const skills = cmds.filter(c => c.source === "skill").map(c => c.name);
21
- const exts = cmds.filter(c => c.source === "extension").map(c => `/${c.name}`);
18
+ const prompts = cmds.filter(c => c.source === "prompt").map(c => `/${c.name}`).join(" ");
19
+ const skills = cmds.filter(c => c.source === "skill").map(c => c.name).join(" ");
20
+ const model = ctx.model ? `${ctx.model.provider}/${ctx.model.id}` : "no model";
21
+ const thinking = pi.getThinkingLevel();
22
+ const t = (s: string) => truncateToWidth(s, width);
23
+ const bar = d("─".repeat(width));
22
24
 
23
- const lines: string[] = [];
25
+ // Column-aligned key=value pairs
26
+ const col1 = [
27
+ [d("version"), a(`v${VERSION}`)],
28
+ [d(" model"), a(model)],
29
+ [d(" think"), a(thinking)],
30
+ ];
31
+ const col2 = [
32
+ [a("esc"), d("interrupt")],
33
+ [a("^C"), d("clear/exit")],
34
+ [a("^P"), d("cycle model")],
35
+ ];
36
+ const col3 = [
37
+ [a("S-tab"), d("thinking")],
38
+ [a("^O"), d("expand")],
39
+ [a("^G"), d("ext editor")],
40
+ ];
41
+ const col4 = [
42
+ [a("/"), d("commands")],
43
+ [a("!"), d("bash")],
44
+ [a("^V"), d("paste img")],
45
+ ];
24
46
 
25
- // Line 1: keys
26
- const keys = [
27
- `${acc("esc")} interrupt`,
28
- `${acc("ctrl+c")} clear/exit`,
29
- `${acc("shift+tab")} thinking`,
30
- `${acc("ctrl+p")} model`,
31
- `${acc("ctrl+o")} expand`,
32
- `${acc("/")} commands`,
33
- `${acc("!")} bash`,
34
- ].join(dim(" "));
35
- lines.push(truncateToWidth(keys, width));
47
+ const lines: string[] = [""];
48
+ for (let i = 0; i < 3; i++) {
49
+ const [k1, v1] = col1[i];
50
+ const [k2, v2] = col2[i];
51
+ const [k3, v3] = col3[i];
52
+ const [k4, v4] = col4[i];
53
+ lines.push(t(`${k1} ${v1} ${k2} ${v2} ${k3} ${v3} ${k4} ${v4}`));
54
+ }
36
55
 
37
- // Line 2: prompts + skills
38
- const parts: string[] = [];
39
- if (prompts.length) parts.push(`${mut("prompts")} ${acc(prompts.join(" "))}`);
40
- if (skills.length) parts.push(`${mut("skills")} ${acc(skills.join(" "))}`);
41
- if (exts.length) parts.push(`${mut("cmds")} ${acc(exts.join(" "))}`);
42
- if (parts.length) lines.push(truncateToWidth(parts.join(dim(" ")), width));
56
+ if (prompts) lines.push(t(`${d("prompts")} ${a(prompts)}`));
57
+ if (skills) lines.push(t(`${d(" skills")} ${a(skills)}`));
58
+ lines.push(bar);
43
59
 
44
- return ["", ...lines, ""];
60
+ return lines;
45
61
  },
46
62
  invalidate() {},
47
63
  }));