osdy-pi 0.1.0 → 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 +63 -52
- package/extensions/osdy-pi.ts +35 -6
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,97 +1,108 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Osdy Pi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<img width="1857" height="847" alt="image" src="https://github.com/user-attachments/assets/84907a2b-4913-41a1-bc6e-1840490d5404" />
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Theme package for [Pi](https://github.com/earendil-works/pi) with the Osdy terminal style: neon pink/purple colors, a custom ASCII header, and a framed editor experience.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- `osdy-pi-light` neon pink/purple companion theme included.
|
|
9
|
-
- Centered custom Osdy-Pi ASCII header with responsive Git, path, MCP, plugins, AGENTS, extensions, Pi version, and tools status.
|
|
10
|
-
- Custom editor with four internal lines by default and smaller responsive fallback.
|
|
11
|
-
- Full-width Osdy editor frame with complete top, bottom, and side borders in normal terminal widths.
|
|
12
|
-
- Editor border status:
|
|
13
|
-
- top-right: current model and thinking level;
|
|
14
|
-
- bottom-left: input/output/cache tokens, accumulated cost, and context percentage/window.
|
|
15
|
-
- Animation disabled.
|
|
7
|
+
## What you get
|
|
16
8
|
|
|
17
|
-
|
|
9
|
+
- **Dark theme:** `osdy-pi-dark`, enabled by default when the package starts.
|
|
10
|
+
- **Light theme:** `osdy-pi-light`, with the same Osdy palette adapted for light terminals.
|
|
11
|
+
- **Custom header:** centered Osdy-Pi ASCII branding with responsive status metadata.
|
|
12
|
+
- **Custom editor:** full-width framed input area with model, thinking, token, cost, and context status.
|
|
13
|
+
- **Clean layout:** the built-in footer/working row is hidden while Osdy Pi is enabled to avoid duplicated UI.
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
<img width="1280" height="433" alt="image" src="https://github.com/user-attachments/assets/20c7624d-9ad8-4494-97fb-6b6d81aaf328" />
|
|
20
16
|
|
|
21
|
-
### From npm
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
## Install in Pi
|
|
19
|
+
|
|
20
|
+
Install the package directly from GitHub:
|
|
24
21
|
|
|
25
22
|
```bash
|
|
26
|
-
pi install
|
|
23
|
+
pi install git:github.com/OsdyOrtiz/Osdy-Pi
|
|
27
24
|
```
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
After pushing this package to a GitHub repository:
|
|
26
|
+
Then start Pi normally:
|
|
32
27
|
|
|
33
28
|
```bash
|
|
34
|
-
pi
|
|
29
|
+
pi
|
|
35
30
|
```
|
|
36
31
|
|
|
37
|
-
|
|
32
|
+
Osdy Pi enables the `osdy-pi-dark` theme and custom UI automatically on `session_start`.
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
pi install git:github.com/<owner>/osdy-pi@v0.1.0
|
|
41
|
-
```
|
|
34
|
+
## Choose the theme manually
|
|
42
35
|
|
|
43
|
-
|
|
36
|
+
If you only want to switch themes, open Pi settings:
|
|
44
37
|
|
|
45
|
-
|
|
38
|
+
```text
|
|
39
|
+
/settings
|
|
40
|
+
```
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
Then select one of these theme names:
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
osdy-pi-dark
|
|
46
|
+
osdy-pi-light
|
|
49
47
|
```
|
|
50
48
|
|
|
51
|
-
|
|
49
|
+
You can also set it in your Pi `settings.json`:
|
|
52
50
|
|
|
53
|
-
```
|
|
54
|
-
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"theme": "osdy-pi-dark"
|
|
54
|
+
}
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Use `osdy-pi-light` instead if you prefer the light version.
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
## Commands
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
Osdy Pi includes a small command group:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
/osdy-pi enable
|
|
65
|
+
/osdy-pi disable
|
|
66
|
+
/osdy-pi status
|
|
65
67
|
```
|
|
66
68
|
|
|
67
|
-
|
|
69
|
+
- `enable` applies the dark Osdy theme, custom header, custom editor, and clean layout.
|
|
70
|
+
- `disable` restores Pi's built-in header, editor, footer, and working visibility, then switches back to the previous theme or `dark`.
|
|
71
|
+
- `status` shows whether the Osdy Pi UI is currently enabled.
|
|
72
|
+
|
|
73
|
+
## Local install
|
|
74
|
+
|
|
75
|
+
If you cloned this repository and want to test it locally:
|
|
68
76
|
|
|
69
77
|
```bash
|
|
70
|
-
pi
|
|
78
|
+
pi -e .
|
|
71
79
|
```
|
|
72
80
|
|
|
73
|
-
|
|
81
|
+
To install it from a local path:
|
|
74
82
|
|
|
75
|
-
|
|
83
|
+
```bash
|
|
84
|
+
pi install /absolute/path/to/Osdy-Pi
|
|
85
|
+
```
|
|
76
86
|
|
|
77
|
-
##
|
|
87
|
+
## Package contents
|
|
78
88
|
|
|
79
89
|
```text
|
|
80
|
-
/osdy-pi
|
|
81
|
-
/osdy-pi
|
|
82
|
-
/osdy-pi
|
|
90
|
+
themes/osdy-pi-dark.json
|
|
91
|
+
themes/osdy-pi-light.json
|
|
92
|
+
extensions/osdy-pi.ts
|
|
83
93
|
```
|
|
84
94
|
|
|
85
|
-
`
|
|
95
|
+
The Pi manifest is declared in `package.json` through `pi.themes` and `pi.extensions`, so Pi can discover the themes and extension after installation.
|
|
86
96
|
|
|
87
|
-
|
|
97
|
+
## Uninstall or turn off
|
|
88
98
|
|
|
89
|
-
|
|
99
|
+
To temporarily turn off the custom UI inside Pi:
|
|
90
100
|
|
|
91
|
-
|
|
101
|
+
```text
|
|
102
|
+
/osdy-pi disable
|
|
103
|
+
```
|
|
92
104
|
|
|
93
|
-
|
|
94
|
-
- extension: `extensions/osdy-pi.ts`
|
|
105
|
+
To remove the package completely, use Pi's package management command for installed packages.
|
|
95
106
|
|
|
96
107
|
## License
|
|
97
108
|
|
package/extensions/osdy-pi.ts
CHANGED
|
@@ -86,11 +86,19 @@ const HEADER_WIDTH = HEADER.reduce(
|
|
|
86
86
|
const HEADER_FALLBACK = ["OSDY - PI", "</> Compilador de ideas"];
|
|
87
87
|
|
|
88
88
|
class OsdyFooter implements Component {
|
|
89
|
+
private readonly ctx: ExtensionContext;
|
|
90
|
+
private readonly footerData: any;
|
|
91
|
+
private readonly theme: { fg(name: string, text: string): string };
|
|
92
|
+
|
|
89
93
|
constructor(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
) {
|
|
94
|
+
ctx: ExtensionContext,
|
|
95
|
+
footerData: any,
|
|
96
|
+
theme: { fg(name: string, text: string): string },
|
|
97
|
+
) {
|
|
98
|
+
this.ctx = ctx;
|
|
99
|
+
this.footerData = footerData;
|
|
100
|
+
this.theme = theme;
|
|
101
|
+
}
|
|
94
102
|
|
|
95
103
|
render(width: number): string[] {
|
|
96
104
|
let location = formatPath(this.ctx.cwd);
|
|
@@ -500,12 +508,15 @@ function applyOsdyPi(
|
|
|
500
508
|
ctx.ui.setWorkingVisible(false);
|
|
501
509
|
|
|
502
510
|
class OsdyEditor extends CustomEditor {
|
|
511
|
+
private readonly tuiRef: TUI;
|
|
512
|
+
|
|
503
513
|
constructor(
|
|
504
|
-
|
|
514
|
+
tuiRef: TUI,
|
|
505
515
|
theme: EditorTheme,
|
|
506
516
|
keybindings: KeybindingsManager,
|
|
507
517
|
) {
|
|
508
518
|
super(tuiRef, theme, keybindings, { paddingX: 1 });
|
|
519
|
+
this.tuiRef = tuiRef;
|
|
509
520
|
}
|
|
510
521
|
render(width: number): string[] {
|
|
511
522
|
if (width < 4 || this.isShowingAutocomplete()) return super.render(width);
|
|
@@ -564,6 +575,24 @@ function disableOsdyPi(ctx: ExtensionContext, state: OsdyState): void {
|
|
|
564
575
|
ctx.ui.notify("osdy-pi disabled", "info");
|
|
565
576
|
}
|
|
566
577
|
|
|
578
|
+
function claimOsdyVisualLayer(
|
|
579
|
+
pi: ExtensionAPI,
|
|
580
|
+
ctx: ExtensionContext,
|
|
581
|
+
state: OsdyState,
|
|
582
|
+
): void {
|
|
583
|
+
if (!state.enabled) return;
|
|
584
|
+
applyOsdyPi(pi, ctx, state);
|
|
585
|
+
|
|
586
|
+
// Some packages install startup headers asynchronously. Re-apply Osdy-Pi
|
|
587
|
+
// after startup so it remains the visual owner without disabling those
|
|
588
|
+
// packages' prompts, agents, MCP tools, commands, or other behavior.
|
|
589
|
+
for (const delayMs of [300, 1000]) {
|
|
590
|
+
setTimeout(() => {
|
|
591
|
+
if (state.enabled) applyOsdyPi(pi, ctx, state);
|
|
592
|
+
}, delayMs);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
567
596
|
export default function (pi: ExtensionAPI) {
|
|
568
597
|
const state: OsdyState = { enabled: true, gitLabel: "-", agentsLabel: "-" };
|
|
569
598
|
pi.on("session_start", (_event, ctx) => {
|
|
@@ -589,7 +618,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
589
618
|
.catch(() => {
|
|
590
619
|
state.agentsLabel = "0";
|
|
591
620
|
});
|
|
592
|
-
|
|
621
|
+
claimOsdyVisualLayer(pi, ctx, state);
|
|
593
622
|
});
|
|
594
623
|
pi.registerCommand("osdy-pi", {
|
|
595
624
|
description: "Manage the Osdy Pi experience: enable, disable, or status.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "osdy-pi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Osdy Pi package: themes, header, and custom editor for Pi.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
],
|
|
24
24
|
"extensions": [
|
|
25
25
|
"./extensions/osdy-pi.ts"
|
|
26
|
-
]
|
|
26
|
+
],
|
|
27
|
+
"image": "https://raw.githubusercontent.com/OsdyOrtiz/Osdy-Pi/main/mapche1.png"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
29
30
|
"@earendil-works/pi-coding-agent": "*",
|