@astrofoundry/pi-astro 0.14.5 โ†’ 0.14.6

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.
@@ -1,18 +1,15 @@
1
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
2
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
3
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
4
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
5
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
6
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
7
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
8
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
9
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
10
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
11
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
12
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
13
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
14
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
15
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
16
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
17
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
18
- โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
1
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
2
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
3
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
4
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
5
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
6
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
7
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
8
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
9
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
10
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
11
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
12
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
13
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
14
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
15
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
@@ -14,6 +14,12 @@ export interface WelcomeStats {
14
14
 
15
15
  const TITLE = "โ˜… ASTRO PI โ˜…";
16
16
  const HINT = "Press any key to launch ยท auto-dismiss in 6s";
17
+ const FRAME_TL = "โ•ญ";
18
+ const FRAME_TR = "โ•ฎ";
19
+ const FRAME_BL = "โ•ฐ";
20
+ const FRAME_BR = "โ•ฏ";
21
+ const FRAME_HORIZONTAL = "โ”€";
22
+ const FRAME_VERTICAL = "โ”‚";
17
23
 
18
24
  function formatTokens(n: number | undefined): string {
19
25
  if (n === undefined || n <= 0) return "โ€”";
@@ -69,16 +75,30 @@ class CompositeMask implements Mask {
69
75
  }
70
76
  }
71
77
 
78
+ function truncate(line: string, width: number): string {
79
+ return visibleWidth(line) <= width ? line : line.slice(0, width);
80
+ }
81
+
72
82
  export function composeWelcome(width: number, seed: number, stats: WelcomeStats): string[] {
73
83
  const hasVersion = !!stats.pkgVersion;
74
- const versionRow = 1;
75
- const artStartRow = hasVersion ? 2 : 1;
76
- const totalRows = artStartRow + artHeight() + 6;
84
+ const aw = artWidth();
85
+ const ah = artHeight();
86
+ const frameWidth = aw + 2;
77
87
  const safeWidth = Math.max(40, width);
78
- const artStartCol = Math.max(0, Math.floor((safeWidth - artWidth()) / 2));
88
+
89
+ const versionRow = 1;
90
+ const frameTopRow = hasVersion ? 2 : 1;
91
+ const artStartRow = frameTopRow + 1;
92
+ const frameBottomRow = artStartRow + ah;
93
+ const taglineRow = frameBottomRow + 2;
94
+ const statsRow = taglineRow + 2;
95
+ const hintRow = statsRow + 2;
96
+ const totalRows = hintRow + 1;
97
+
98
+ const frameStartCol = Math.max(0, Math.floor((safeWidth - frameWidth) / 2));
79
99
 
80
100
  const mask = new CompositeMask(totalRows, safeWidth);
81
- mask.occupyArt(artStartRow, artStartCol, artHeight(), artWidth());
101
+ mask.occupyArt(frameTopRow, frameStartCol, frameBottomRow - frameTopRow + 1, frameWidth);
82
102
 
83
103
  const titleLine = fg(PALETTE.title, TITLE);
84
104
  const titlePlaced = centerInLine(titleLine, safeWidth);
@@ -93,53 +113,43 @@ export function composeWelcome(width: number, seed: number, stats: WelcomeStats)
93
113
 
94
114
  const taglineRaw = pickMessage(seed);
95
115
  const taglineLine = fg(PALETTE.tagline, taglineRaw);
96
- const taglineRow = artStartRow + artHeight() + 1;
97
116
  const taglinePlaced = centerInLine(taglineLine, safeWidth);
98
117
  mask.occupy(taglineRow, taglinePlaced.col, visibleWidth(taglineLine));
99
118
 
100
119
  const statsRaw = statsLine(stats);
101
120
  const statsColored = fg(PALETTE.stats, statsRaw);
102
- const statsRow = taglineRow + 2;
103
121
  const statsPlaced = centerInLine(statsColored, safeWidth);
104
122
  mask.occupy(statsRow, statsPlaced.col, visibleWidth(statsColored));
105
123
 
106
124
  const hintColored = fg(PALETTE.hint, HINT);
107
- const hintRow = statsRow + 2;
108
125
  const hintPlaced = centerInLine(hintColored, safeWidth);
109
126
  mask.occupy(hintRow, hintPlaced.col, visibleWidth(hintColored));
110
127
 
111
128
  const stars = renderStarfield(safeWidth, totalRows, seed, mask);
112
129
  const artLines = renderArt();
113
130
 
131
+ const frameTop = fg(PALETTE.title, FRAME_TL + FRAME_HORIZONTAL.repeat(aw) + FRAME_TR);
132
+ const frameBot = fg(PALETTE.title, FRAME_BL + FRAME_HORIZONTAL.repeat(aw) + FRAME_BR);
133
+ const frameLeft = fg(PALETTE.title, FRAME_VERTICAL);
134
+ const frameRight = fg(PALETTE.title, FRAME_VERTICAL);
135
+ const padLeft = " ".repeat(frameStartCol);
136
+
114
137
  const composed: string[] = [];
115
138
  for (let r = 0; r < totalRows; r++) {
116
139
  let line = stars[r] ?? " ".repeat(safeWidth);
117
140
 
118
- if (r === 0) line = overlay(line, titlePlaced.line, safeWidth);
119
- if (versionPlaced && r === versionRow) line = overlay(line, versionPlaced.line, safeWidth);
120
- if (r === taglineRow) line = overlay(line, taglinePlaced.line, safeWidth);
121
- if (r === statsRow) line = overlay(line, statsPlaced.line, safeWidth);
122
- if (r === hintRow) line = overlay(line, hintPlaced.line, safeWidth);
123
-
124
- if (r >= artStartRow && r < artStartRow + artHeight()) {
141
+ if (r === 0) line = truncate(titlePlaced.line, safeWidth);
142
+ else if (versionPlaced && r === versionRow) line = truncate(versionPlaced.line, safeWidth);
143
+ else if (r === frameTopRow) line = truncate(padLeft + frameTop, safeWidth);
144
+ else if (r === frameBottomRow) line = truncate(padLeft + frameBot, safeWidth);
145
+ else if (r > frameTopRow && r < frameBottomRow) {
125
146
  const artLine = artLines[r - artStartRow];
126
- const artLineWidth = visibleWidth(artLine);
127
- line = overlayAt(line, " ".repeat(artStartCol) + artLine, safeWidth, artStartCol, artLineWidth);
128
- }
147
+ line = truncate(padLeft + frameLeft + artLine + frameRight, safeWidth);
148
+ } else if (r === taglineRow) line = truncate(taglinePlaced.line, safeWidth);
149
+ else if (r === statsRow) line = truncate(statsPlaced.line, safeWidth);
150
+ else if (r === hintRow) line = truncate(hintPlaced.line, safeWidth);
129
151
 
130
152
  composed.push(line);
131
153
  }
132
154
  return composed;
133
155
  }
134
-
135
- function overlay(starLine: string, payload: string, width: number): string {
136
- return truncate(payload, width);
137
- }
138
-
139
- function overlayAt(_starLine: string, payload: string, width: number, _startCol: number, _payloadWidth: number): string {
140
- return truncate(payload, width);
141
- }
142
-
143
- function truncate(line: string, width: number): string {
144
- return visibleWidth(line) <= width ? line : line.slice(0, width);
145
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrofoundry/pi-astro",
3
- "version": "0.14.5",
3
+ "version": "0.14.6",
4
4
  "description": "Personal pi customizations (extensions, skills, prompts, themes) for the pi coding agent.",
5
5
  "keywords": [
6
6
  "pi-package"