gnhf 0.1.38 → 0.1.39
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/dist/cli.mjs +15 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -17702,6 +17702,18 @@ function meteorCountForFrequency(frequency) {
|
|
|
17702
17702
|
function meteorsStartingBefore(meteors, rowOffset, maxStartRow) {
|
|
17703
17703
|
return meteors.filter((meteor) => rowOffset + meteor.y < maxStartRow);
|
|
17704
17704
|
}
|
|
17705
|
+
function generateSideMeteorShower(terminalWidth, sideWidth, height, count, seed) {
|
|
17706
|
+
if (sideWidth <= 0 || height <= 0 || count <= 0) return [];
|
|
17707
|
+
const leftCount = Math.max(1, Math.ceil(count / 2));
|
|
17708
|
+
const rightCount = count - leftCount;
|
|
17709
|
+
const leftMeteors = generateMeteorShower(sideWidth, height, leftCount, seed);
|
|
17710
|
+
const rightXOffset = terminalWidth - sideWidth;
|
|
17711
|
+
const rightMeteors = generateMeteorShower(sideWidth, height, rightCount, seed + 1).map((meteor) => ({
|
|
17712
|
+
...meteor,
|
|
17713
|
+
x: meteor.x + rightXOffset
|
|
17714
|
+
}));
|
|
17715
|
+
return [...leftMeteors, ...rightMeteors];
|
|
17716
|
+
}
|
|
17705
17717
|
function placeStarsInCells(cells, stars, row, xMin, xMax, xOffset, now) {
|
|
17706
17718
|
for (const star of stars) {
|
|
17707
17719
|
if (star.y !== row || star.x < xMin || star.x >= xMax) continue;
|
|
@@ -17900,6 +17912,7 @@ var Renderer = class {
|
|
|
17900
17912
|
sideStars = [];
|
|
17901
17913
|
topMeteors = [];
|
|
17902
17914
|
bottomMeteors = [];
|
|
17915
|
+
sideMeteors = [];
|
|
17903
17916
|
cachedWidth = 0;
|
|
17904
17917
|
cachedHeight = 0;
|
|
17905
17918
|
meteorFrequency;
|
|
@@ -17995,6 +18008,7 @@ var Renderer = class {
|
|
|
17995
18008
|
this.topStars = generateStarField(w, h, STAR_DENSITY, this.seedTop).map((s) => shrinkBig(s, s.y >= topHeight - proximityRows));
|
|
17996
18009
|
this.bottomStars = generateStarField(w, h, STAR_DENSITY, this.seedBottom).map((s) => shrinkBig(s, s.y < proximityRows));
|
|
17997
18010
|
this.sideStars = generateStarField(w, Math.max(BASE_CONTENT_ROWS, availableHeight), STAR_DENSITY, this.seedSide);
|
|
18011
|
+
this.sideMeteors = generateSideMeteorShower(w, Math.max(0, Math.floor((w - CONTENT_WIDTH) / 2)), Math.min(BASE_CONTENT_ROWS, availableHeight), meteorCountForFrequency(this.meteorFrequency), this.seedSide + METEOR_SEED_OFFSET);
|
|
17998
18012
|
this.topMeteors = generateMeteorShower(w, topHeight, topHeight > 0 ? meteorCountForFrequency(this.meteorFrequency) : 0, this.seedTop + METEOR_SEED_OFFSET);
|
|
17999
18013
|
this.bottomMeteors = generateMeteorShower(w, bottomHeight, bottomHeight > 0 ? meteorCountForFrequency(this.meteorFrequency) : 0, this.seedBottom + METEOR_SEED_OFFSET);
|
|
18000
18014
|
return true;
|
|
@@ -18007,7 +18021,7 @@ var Renderer = class {
|
|
|
18007
18021
|
const h = process$1.stdout.rows || 24;
|
|
18008
18022
|
const resized = this.ensureStarFields(w, h);
|
|
18009
18023
|
this.updateTerminalTitle(now);
|
|
18010
|
-
const nextCells = buildFrameCells(this.prompt, this.agentName, this.state, this.topStars, this.bottomStars, this.sideStars, now, w, h, this.topMeteors, this.bottomMeteors);
|
|
18024
|
+
const nextCells = buildFrameCells(this.prompt, this.agentName, this.state, this.topStars, this.bottomStars, this.sideStars, now, w, h, this.topMeteors, this.bottomMeteors, this.sideMeteors);
|
|
18011
18025
|
if (this.isFirstFrame || resized) {
|
|
18012
18026
|
process$1.stdout.write("\x1B[H" + nextCells.map(rowToString).join("\n"));
|
|
18013
18027
|
this.isFirstFrame = false;
|