@leo-alvarenga/pi-zen-frame 0.21.2 → 0.22.0
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/extensions/config/constants/defaults.ts +1 -1
- package/extensions/config/constants/messages.ts +13 -0
- package/extensions/config/types.ts +1 -1
- package/extensions/headers/box/index.ts +2 -1
- package/extensions/headers/index.ts +1 -0
- package/extensions/headers/zen/index.ts +51 -0
- package/extensions/headers/zen/quotes.ts +187 -0
- package/extensions/index.ts +1 -1
- package/extensions/renderers/registry.ts +2 -1
- package/package.json +1 -1
|
@@ -174,3 +174,16 @@ export const HEADER_TIPS: BannerTip[] = [
|
|
|
174
174
|
text: "For multi-file changes, ask for a plan first (files touched + order) and approve it before any edits — cheap insurance against wrong-direction refactors",
|
|
175
175
|
},
|
|
176
176
|
];
|
|
177
|
+
|
|
178
|
+
export const GREETINGS: string[] = [
|
|
179
|
+
"Welcome back!",
|
|
180
|
+
"Ready when you are",
|
|
181
|
+
"New moment, new beginning",
|
|
182
|
+
"The present is yours",
|
|
183
|
+
"Stillness before the work",
|
|
184
|
+
"Breathe. Then begin",
|
|
185
|
+
"Here and now",
|
|
186
|
+
"Empty mind, open hands",
|
|
187
|
+
"The path continues",
|
|
188
|
+
"Begin with intention",
|
|
189
|
+
];
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
DEFAULT_ICONS,
|
|
10
|
+
GREETINGS,
|
|
10
11
|
HEADER_TIPS,
|
|
11
12
|
LOGO_COLOR,
|
|
12
13
|
LOGO_LINES,
|
|
@@ -20,7 +21,7 @@ import { HeaderEnv } from "../types";
|
|
|
20
21
|
const MIN_BOX_WIDTH = 20;
|
|
21
22
|
const LEFT_COL_RATIO = 0.4; // logo column width / total width
|
|
22
23
|
|
|
23
|
-
const HEADING =
|
|
24
|
+
const HEADING = GREETINGS[Math.floor(Math.random() * GREETINGS.length)]!;
|
|
24
25
|
const SUBHEADING =
|
|
25
26
|
"Ready for your next session? Terminal warm, context clean, tools ready to execute";
|
|
26
27
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { TUI } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { ExtensionAPI, Theme } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
|
|
4
|
+
import { GREETINGS, LOGO_COLOR, LOGO_LINES } from "../../config/constants";
|
|
5
|
+
import type { Settings } from "../../config/types";
|
|
6
|
+
import type { HeaderEnv } from "../types";
|
|
7
|
+
import { center, wrapLines } from "../../utils";
|
|
8
|
+
import { QUOTES } from "./quotes";
|
|
9
|
+
|
|
10
|
+
const TOP_PAD = 2;
|
|
11
|
+
|
|
12
|
+
const GREETING = GREETINGS[Math.floor(Math.random() * GREETINGS.length)]!;
|
|
13
|
+
const QUOTE = QUOTES[Math.floor(Math.random() * QUOTES.length)]!;
|
|
14
|
+
|
|
15
|
+
export function createZenHeader(
|
|
16
|
+
_tui: TUI,
|
|
17
|
+
theme: Theme,
|
|
18
|
+
_pi: ExtensionAPI,
|
|
19
|
+
settings: Settings,
|
|
20
|
+
_getEnv: (pi: ExtensionAPI) => HeaderEnv,
|
|
21
|
+
) {
|
|
22
|
+
if (!settings.header?.enable) {
|
|
23
|
+
return { render: (): string[] => [], invalidate() {} };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
invalidate() {},
|
|
28
|
+
|
|
29
|
+
render(width: number): string[] {
|
|
30
|
+
const lines: string[] = [];
|
|
31
|
+
|
|
32
|
+
for (let i = 0; i < TOP_PAD; i++) lines.push("");
|
|
33
|
+
|
|
34
|
+
for (const line of LOGO_LINES) {
|
|
35
|
+
lines.push(center(theme.fg(LOGO_COLOR, line), width));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
lines.push("");
|
|
39
|
+
lines.push(center(theme.bold(GREETING), width));
|
|
40
|
+
lines.push("");
|
|
41
|
+
|
|
42
|
+
const quoteText = `"${QUOTE.text}" — ${QUOTE.author}`;
|
|
43
|
+
for (const l of wrapLines([quoteText], Math.min(width - 4, 80))) {
|
|
44
|
+
lines.push(center(theme.italic(theme.fg("muted", l)), width));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
lines.push("");
|
|
48
|
+
return lines;
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
export const QUOTES = [
|
|
2
|
+
{
|
|
3
|
+
text: "Do not dwell in the past, do not dream of the future, concentrate the mind on the present moment.",
|
|
4
|
+
author: "Buddha",
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
text: "The present moment is the only moment available to us, and it is the door to all moments.",
|
|
8
|
+
author: "Thich Nhat Hanh",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
text: "You have power over your mind, not outside events. Realize this, and you will find strength.",
|
|
12
|
+
author: "Marcus Aurelius",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
text: "Knowing others is wisdom. Knowing yourself is enlightenment.",
|
|
16
|
+
author: "Lao Tzu",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
text: "Out beyond ideas of wrongdoing and rightdoing, there is a field. I'll meet you there.",
|
|
20
|
+
author: "Rumi",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
text: "Life is what happens to you while you're busy making other plans.",
|
|
24
|
+
author: "John Lennon",
|
|
25
|
+
},
|
|
26
|
+
{ text: "The obstacle is the path.", author: "Zen proverb" },
|
|
27
|
+
{
|
|
28
|
+
text: "He who is not every day conquering some fear has not learned the secret of life.",
|
|
29
|
+
author: "Ralph Waldo Emerson",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
text: "Make the present moment your friend rather than your enemy.",
|
|
33
|
+
author: "Eckhart Tolle",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
text: "Waste no more time arguing about what a good person should be. Be one.",
|
|
37
|
+
author: "Marcus Aurelius",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
text: "The quieter you become, the more you can hear.",
|
|
41
|
+
author: "Ram Dass",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
text: "Nature does not hurry, yet everything is accomplished.",
|
|
45
|
+
author: "Lao Tzu",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
text: "Man suffers only because he takes seriously what the gods made for fun.",
|
|
49
|
+
author: "Alan Watts",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
text: "If you realize that all things change, there is nothing you will try to hold on to.",
|
|
53
|
+
author: "Lao Tzu",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
text: "Before enlightenment, chop wood, carry water. After enlightenment, chop wood, carry water.",
|
|
57
|
+
author: "Zen proverb",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
text: "It is not death that a person should fear, but rather they should fear never beginning to live.",
|
|
61
|
+
author: "Marcus Aurelius",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
text: "The soul that sees beauty may sometimes walk alone.",
|
|
65
|
+
author: "Johann Wolfgang von Goethe",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
text: "Wherever you are is always the right place. There is never a need to fix anything, to hush the noise or turn off the light.",
|
|
69
|
+
author: "John Kabat-Zinn",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
text: "When you realize there is nothing lacking, the whole world belongs to you.",
|
|
73
|
+
author: "Lao Tzu",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
text: "The first step in the journey of a thousand miles is taken beneath your feet.",
|
|
77
|
+
author: "Lao Tzu",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
text: "Do not be too timid and squeamish about your actions. All life is an experiment.",
|
|
81
|
+
author: "Ralph Waldo Emerson",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
text: "Peace comes from within. Do not seek it without.",
|
|
85
|
+
author: "Buddha",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
text: "Not knowing how near the truth is, people seek it far away.",
|
|
89
|
+
author: "Hakuin Ekaku",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
text: "The Tao that can be told is not the eternal Tao.",
|
|
93
|
+
author: "Lao Tzu",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
text: "You must be the change you wish to see in the world.",
|
|
97
|
+
author: "Mahatma Gandhi",
|
|
98
|
+
},
|
|
99
|
+
{ text: "What you seek is seeking you.", author: "Rumi" },
|
|
100
|
+
{ text: "Sell your cleverness and buy bewilderment.", author: "Rumi" },
|
|
101
|
+
{
|
|
102
|
+
text: "To understand everything is to forgive everything.",
|
|
103
|
+
author: "Osho",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
text: "Begin at once to live, and count each separate day as a separate life.",
|
|
107
|
+
author: "Seneca",
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
text: "Happiness is not something ready made. It comes from your own actions.",
|
|
111
|
+
author: "Dalai Lama",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
text: "We are what we repeatedly do. Excellence, then, is not an act but a habit.",
|
|
115
|
+
author: "Aristotle",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
text: "The mind is everything. What you think you become.",
|
|
119
|
+
author: "Buddha",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
text: "In the beginner's mind there are many possibilities, but in the expert's mind there are few.",
|
|
123
|
+
author: "Shunryu Suzuki",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
text: "No snowflake ever falls in the wrong place.",
|
|
127
|
+
author: "Zen proverb",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
text: "Look within. Within is the fountain of good, and it will ever bubble up, if thou wilt ever dig.",
|
|
131
|
+
author: "Marcus Aurelius",
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
text: "There is no way to happiness. Happiness is the way.",
|
|
135
|
+
author: "Thich Nhat Hanh",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
text: "The two most powerful warriors are patience and time.",
|
|
139
|
+
author: "Leo Tolstoy",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
text: "A man who dares to waste one hour of life has not discovered the value of life.",
|
|
143
|
+
author: "Charles Darwin",
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
text: "The only way to do great work is to love what you do.",
|
|
147
|
+
author: "Steve Jobs",
|
|
148
|
+
},
|
|
149
|
+
{ text: "Everything you can imagine is real.", author: "Pablo Picasso" },
|
|
150
|
+
{
|
|
151
|
+
text: "I have just three things to teach: simplicity, patience, compassion.",
|
|
152
|
+
author: "Lao Tzu",
|
|
153
|
+
},
|
|
154
|
+
{ text: "Act without expectation.", author: "Lao Tzu" },
|
|
155
|
+
{
|
|
156
|
+
text: "Man stands in his own shadow and wonders why it is dark.",
|
|
157
|
+
author: "Zen proverb",
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
text: "To the mind that is still, the whole universe surrenders.",
|
|
161
|
+
author: "Lao Tzu",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
text: "Better than a thousand hollow words is one word that brings peace.",
|
|
165
|
+
author: "Buddha",
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
text: "Yesterday I was clever, so I wanted to change the world. Today I am wise, so I am changing myself.",
|
|
169
|
+
author: "Rumi",
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
text: "It is the mark of an educated mind to be able to entertain a thought without accepting it.",
|
|
173
|
+
author: "Aristotle",
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
text: "Accept what is, let go of what was, have faith in what will be.",
|
|
177
|
+
author: "Sonia Ricotti",
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
text: "The greatest weapon against stress is our ability to choose one thought over another.",
|
|
181
|
+
author: "William James",
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
text: "The moment you stop accepting challenges is the moment you stop moving forward.",
|
|
185
|
+
author: "Epictetus",
|
|
186
|
+
},
|
|
187
|
+
];
|
package/extensions/index.ts
CHANGED
|
@@ -195,7 +195,7 @@ export default async function (pi: ExtensionAPI) {
|
|
|
195
195
|
|
|
196
196
|
if (settings.header?.enable) {
|
|
197
197
|
const headerFactory =
|
|
198
|
-
getHeader(settings.header.type ?? "
|
|
198
|
+
getHeader(settings.header.type ?? "zen") ?? getHeader("zen")!;
|
|
199
199
|
ctx.ui.setHeader((_tui, theme) =>
|
|
200
200
|
headerFactory(_tui, theme, pi, settings, getHeaderEnv),
|
|
201
201
|
);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import type { EditorFrameFactory, HeaderRendererFactory } from "./types";
|
|
7
7
|
|
|
8
8
|
import { BlockyEditor, LinearEditor, MinimalistEditor } from "../editor";
|
|
9
|
-
import { createBoxHeader } from "../headers";
|
|
9
|
+
import { createBoxHeader, createZenHeader } from "../headers";
|
|
10
10
|
|
|
11
11
|
const editorFrames = new Map<string, EditorFrameFactory>();
|
|
12
12
|
const headers = new Map<string, HeaderRendererFactory>();
|
|
@@ -53,3 +53,4 @@ registerEditorFrame(
|
|
|
53
53
|
);
|
|
54
54
|
|
|
55
55
|
registerHeader("box", createBoxHeader);
|
|
56
|
+
registerHeader("zen", createZenHeader);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@leo-alvarenga/pi-zen-frame",
|
|
3
3
|
"description": "A pi-coding-agent extension that gives the TUI editor a simple yet polished look and feel",
|
|
4
4
|
"author": "Leonardo A. Alvarenga",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.22.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "github.com/leo-alvarenga/pi-mono",
|
|
8
8
|
"publishConfig": {
|