henergyqueai 0.9.0 → 0.9.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.
@@ -18,7 +18,7 @@ import {
18
18
  waiting,
19
19
  write,
20
20
  } from "../src/ui.js";
21
- import { brand, flutter, still } from "../src/butterfly.js";
21
+ import { HEIGHT as LOGO_HEIGHT, brand, flutter, still } from "../src/butterfly.js";
22
22
  import { choose, clearScreen } from "../src/confiance.js";
23
23
  import {
24
24
  MODES,
@@ -36,8 +36,9 @@ import { expandReferences } from "../src/references.js";
36
36
  import { stopAll } from "../src/background.js";
37
37
  import { loadHooks } from "../src/hooks.js";
38
38
 
39
- const VERSION = "0.9.0";
40
- const HEADER_HEIGHT = 9;
39
+ const VERSION = "0.9.2";
40
+ // Le papillon, une ligne vide, le trait, l'aide et une ligne vide.
41
+ const HEADER_HEIGHT = LOGO_HEIGHT + 4;
41
42
  const BODY_ROW = HEADER_HEIGHT + 1;
42
43
  const CONFIG = path.join(homedir(), ".henergyqueai", "config.json");
43
44
  const DEFAULT_BASE = process.env.HENERGYQUEAI_URL || "https://henergyqueai.fr";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "henergyqueai",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "L’assistant HenergyqueAI dans votre terminal : il lit votre projet, propose des modifications et lance des commandes, avec votre accord.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/butterfly.js CHANGED
@@ -1,7 +1,5 @@
1
- // The butterfly is pixel art: each character cell carries two pixels, the upper
2
- // one as the foreground of "▀" and the lower one as its background. Only the
3
- // left half of the wings is written down and then mirrored, so the drawing can
4
- // never drift out of symmetry.
1
+ // Les créatures sont en pixel art : chaque caractère porte deux pixels, celui
2
+ // du haut en couleur de « ▀ » et celui du bas en fond.
5
3
  const plain = !process.stdout.isTTY || process.env.NO_COLOR;
6
4
 
7
5
  const INK = {
@@ -11,6 +9,8 @@ const INK = {
11
9
  d: "#95503f",
12
10
  e: "#784e3e",
13
11
  f: "#5d3b2f",
12
+ o: "#3f261e",
13
+ w: "#fff1e4",
14
14
  };
15
15
 
16
16
  const fg = (hex) => {
@@ -22,59 +22,70 @@ const bg = (hex) => {
22
22
  return `48;2;${(v >> 16) & 255};${(v >> 8) & 255};${v & 255}`;
23
23
  };
24
24
 
25
- // Antennae are written whole: mirroring them would undo the head turning.
26
- const HEADS = {
27
- gauche: ["·b..........b..", "..b........b..."],
28
- face: ["..b.........b..", "...b.......b..."],
29
- droite: ["..b..........b·", "...b........b.."],
30
- };
31
-
32
- const mirror = (rows) =>
33
- rows.map(([half, body]) => half + body + [...half].reverse().join(""));
34
-
35
- const OUVERT = mirror([
36
- [".bbbb..", "e"],
37
- ["bbaabb.", "e"],
38
- ["bbaabbe", "f"],
39
- [".bbbcce", "f"],
40
- ["..cccc.", "f"],
41
- ["..cddc.", "f"],
42
- ["...dd..", "e"],
43
- [".......", "e"],
44
- ]);
45
-
46
- const MI = mirror([
47
- ["...bbb.", "e"],
48
- ["..bbaab", "e"],
49
- ["..bbaab", "f"],
50
- ["...bbcc", "f"],
51
- ["...cccc", "f"],
52
- ["...cddc", "f"],
53
- ["....dd.", "e"],
54
- [".......", "e"],
55
- ]);
56
-
57
- const FERME = mirror([
58
- ["....bb.", "e"],
59
- ["....baa", "e"],
60
- ["....bba", "f"],
61
- ["....bbc", "f"],
62
- [".....cc", "f"],
63
- [".....cd", "f"],
64
- ["......d", "e"],
65
- [".......", "e"],
66
- ]);
67
-
68
- // One full wingbeat, with the head glancing left then right between beats.
25
+ // Le papillon choisi par le sondage (n° 5, « Profil · deux ailes ») : posé,
26
+ // vu de côté, l'aile du fond dépasse derrière la première. Ses ailes
27
+ // respirent doucement. Le même que dans VS Code, à la taille du terminal.
69
28
  export const FRAMES = [
70
- [...HEADS.face, ...OUVERT],
71
- [...HEADS.gauche, ...MI],
72
- [...HEADS.gauche, ...FERME],
73
- [...HEADS.gauche, ...MI],
74
- [...HEADS.face, ...OUVERT],
75
- [...HEADS.droite, ...MI],
76
- [...HEADS.droite, ...FERME],
77
- [...HEADS.droite, ...MI],
29
+ [
30
+ "......ooooeo..c",
31
+ ".....ofwacoo.c.",
32
+ "....owaabcooo..",
33
+ "...ofabbbcooo..",
34
+ "...owbbccdooo..",
35
+ "..ofboccddoooo.",
36
+ "..owbboddoeewo.",
37
+ "...ofwfwoeeeeo.",
38
+ "..oeefeefeeoo..",
39
+ "...ooooooooo.o.",
40
+ ],
41
+ [
42
+ "........ooo...c",
43
+ "......ooooeo.c.",
44
+ "....oofwacooo..",
45
+ "...ofabbbcooo..",
46
+ "...owbbccdooo..",
47
+ "..ofboccddoooo.",
48
+ "..owbboddoeewo.",
49
+ "...ofwfwoeeeeo.",
50
+ "..oeefeefeeoo..",
51
+ "...ooooooooo.o.",
52
+ ],
53
+ [
54
+ "........ooo...c",
55
+ "......ooooeo.c.",
56
+ ".....ofwacooo..",
57
+ "....owaabcooo..",
58
+ "...ofabbbcooo..",
59
+ "..ofboccddoooo.",
60
+ "..owbboddoeewo.",
61
+ "...ofwfwoeeeeo.",
62
+ "..oeefeefeeoo..",
63
+ "...ooooooooo.o.",
64
+ ],
65
+ [
66
+ "........ooo...c",
67
+ "......ooooeo.c.",
68
+ "....oofwacooo..",
69
+ "...ofabbbcooo..",
70
+ "...owbbccdooo..",
71
+ "..ofboccddoooo.",
72
+ "..owbboddoeewo.",
73
+ "...ofwfwoeeeeo.",
74
+ "..oeefeefeeoo..",
75
+ "...ooooooooo.o.",
76
+ ],
77
+ [
78
+ "......ooooeo..c",
79
+ ".....ofwacoo.c.",
80
+ "....owaabcooo..",
81
+ "...ofabbbcooo..",
82
+ "...owbbccdooo..",
83
+ "..ofboccddoooo.",
84
+ "..owbboddoeewo.",
85
+ "...ofwfwoeeeeo.",
86
+ "..oeefeefeeoo..",
87
+ "...ooooooooo.o.",
88
+ ],
78
89
  ];
79
90
 
80
91
  // Les deux autres créatures du jardin, à la même taille que le papillon :
@@ -213,6 +224,14 @@ const CREATURES = {
213
224
 
214
225
  export const WIDTH = 15;
215
226
  export const HEIGHT = 5;
227
+ const fit = (grid) => {
228
+ if (grid.length >= HEIGHT * 2 - 1) return grid;
229
+ const side = ".".repeat(Math.floor((WIDTH - grid[0].length) / 2));
230
+ const empty = ".".repeat(WIDTH);
231
+ const rows = [empty, empty, ...grid.map((row) => (side + row).padEnd(WIDTH, "."))];
232
+ while (rows.length < HEIGHT * 2) rows.push(empty);
233
+ return rows;
234
+ };
216
235
 
217
236
  // Turns a pixel grid into five printable lines.
218
237
  export function paint(grid, ink = INK) {
@@ -242,7 +261,7 @@ export const still = () => paint(FRAMES[0]);
242
261
  // l'abeille pour Oryne, le papillon pour Aelyr.
243
262
  export function creature(model, frame = 0) {
244
263
  const { frames, ink } = CREATURES[model] || CREATURES.aelyr;
245
- return paint(frames[frame % frames.length], ink);
264
+ return paint(fit(frames[frame % frames.length]), ink);
246
265
  }
247
266
 
248
267
  export const brand = (text) =>
@@ -10,7 +10,7 @@ import path from "node:path";
10
10
  import { execute } from "./tools.js";
11
11
  import { MODES, saveUserSetting } from "./reglages.js";
12
12
  import { listSessions, saveSession } from "./sessions.js";
13
- import { creature } from "./butterfly.js";
13
+ import { HEIGHT as LOGO_HEIGHT, WIDTH as LOGO_WIDTH, creature } from "./butterfly.js";
14
14
  import { interactiveDefinitions, runAgentTurn } from "./agent-loop.js";
15
15
  import { compactHistory, historySize } from "./compact.js";
16
16
  import { listTasks, manageTasks } from "./tasks.js";
@@ -111,7 +111,7 @@ const EXAMPLES = [
111
111
  const pick = (list) => list[Math.floor(Math.random() * list.length)];
112
112
  const SHELL_MARKER = "\n\n--- Commandes lancées par l’utilisateur ---\n";
113
113
  const NOTE_MARKER = "\n\n--- Consignes ajoutées au projet ---\n";
114
- const HEADER_HEIGHT = 7;
114
+ const HEADER_HEIGHT = LOGO_HEIGHT + 2;
115
115
  const LONG_TURN = 30000;
116
116
  const INIT_PROMPT =
117
117
  "Analyse ce projet : structure, commandes d’installation, de build, de test et de lancement, architecture d’ensemble et conventions qui ne se devinent pas en lisant un seul fichier. Crée ensuite à la racine un fichier HENERGYQUEAI.md concis, destiné à un assistant de code qui découvre le projet. S’il existe déjà, améliore-le sans perdre ce qu’il contient. N’invente rien, ne liste pas chaque fichier et reste court.";
@@ -639,7 +639,7 @@ function Header({ palette, model, mode, root, frame, busy, status }) {
639
639
  },
640
640
  h(
641
641
  Box,
642
- { flexDirection: "column", width: 15, marginRight: 3, flexShrink: 0 },
642
+ { flexDirection: "column", width: LOGO_WIDTH, marginRight: 3, flexShrink: 0 },
643
643
  ...logo.map((line, index) => h(Text, { key: index }, line)),
644
644
  ),
645
645
  h(