blyuecode 0.1.1 → 0.1.3

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/ui/Banner.js CHANGED
@@ -1,9 +1,24 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from 'react';
3
3
  import { Box, Text, useStdout } from 'ink';
4
+ import { readFileSync } from 'fs';
5
+ import { fileURLToPath } from 'url';
6
+ import { dirname, join } from 'path';
4
7
  import { hueAt } from './animColor.js';
5
8
  import { MakerMark } from './MakerMark.js';
6
- // ---------- BLYUE ----------
9
+ function getVersion() {
10
+ try {
11
+ const here = dirname(fileURLToPath(import.meta.url));
12
+ const pkgPath = join(here, '..', '..', 'package.json');
13
+ return JSON.parse(readFileSync(pkgPath, 'utf8')).version || '0.0.0';
14
+ }
15
+ catch {
16
+ return '0.0.0';
17
+ }
18
+ }
19
+ // ─────────────────────────────────────────────
20
+ // BLYUE — 44 cols wide
21
+ // ─────────────────────────────────────────────
7
22
  const BLYUE_BIG = [
8
23
  '██████╗ ██╗ ██╗ ██╗ ██╗ ██╗ ███████╗',
9
24
  '██╔══██╗██║ ╚██╗ ██╔╝ ██║ ██║ ██╔════╝',
@@ -18,30 +33,46 @@ const BLYUE_SMALL = [
18
33
  '| _ \\| |__| |_| | |_| | _| ',
19
34
  '|___/|____|\\___/ \\___/|___|',
20
35
  ];
21
- // ---------- CODE ----------
36
+ // ─────────────────────────────────────────────
37
+ // CODE — 33 cols wide, centered with 5-space lead
38
+ // ─────────────────────────────────────────────
22
39
  const CODE_BIG = [
23
- ' ██████╗ ██████╗ ██████╗ ███████╗',
24
- '██╔════╝██╔═══██╗██╔══██╗██╔════╝',
25
- '██║ ██║ ██║██║ ██║█████╗ ',
26
- '██║ ██║ ██║██║ ██║██╔══╝ ',
27
- '╚██████╗╚██████╔╝██████╔╝███████╗',
28
- ' ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝',
40
+ ' ██████╗ ██████╗ ██████╗ ███████╗',
41
+ ' ██╔════╝██╔═══██╗██╔══██╗██╔════╝',
42
+ ' ██║ ██║ ██║██║ ██║█████╗ ',
43
+ ' ██║ ██║ ██║██║ ██║██╔══╝ ',
44
+ ' ╚██████╗╚██████╔╝██████╔╝███████╗',
45
+ ' ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝',
29
46
  ];
30
47
  const CODE_SMALL = [
31
- '█▀▀ █▀█ █▀▄ █▀▀',
32
- '█▄▄ █▄█ █▄▀ ██▄',
48
+ ' █▀▀ █▀█ █▀▄ █▀▀',
49
+ ' █▄▄ █▄█ █▄▀ ██▄',
33
50
  ];
34
- export const Banner = () => {
51
+ export const Banner = ({ freezeAfter = 3000 }) => {
35
52
  const { stdout } = useStdout();
36
53
  const width = stdout?.columns ?? 80;
37
54
  const wide = width >= 60;
38
55
  const blyue = wide ? BLYUE_BIG : BLYUE_SMALL;
39
56
  const code = wide ? CODE_BIG : CODE_SMALL;
40
57
  const [t, setT] = useState(0);
58
+ const [frozen, setFrozen] = useState(freezeAfter <= 0);
59
+ // Animation tick — 100ms = 10fps, no flicker
41
60
  useEffect(() => {
42
- const interval = setInterval(() => setT((v) => (v + 1 / 160) % 1), 50);
61
+ if (frozen)
62
+ return;
63
+ const interval = setInterval(() => {
64
+ setT((v) => (v + 1 / 320) % 1); // half-speed gradient
65
+ }, 100);
43
66
  return () => clearInterval(interval);
44
- }, []);
67
+ }, [frozen]);
68
+ // Freeze after N ms so it never redraws during typing
69
+ useEffect(() => {
70
+ if (freezeAfter <= 0)
71
+ return;
72
+ const timer = setTimeout(() => setFrozen(true), freezeAfter);
73
+ return () => clearTimeout(timer);
74
+ }, [freezeAfter]);
45
75
  const brand = hueAt(t);
46
- return (_jsxs(Box, { flexDirection: "column", children: [_jsx(MakerMark, { color: brand }), _jsx(Text, { children: " " }), blyue.map((line, i) => (_jsx(Text, { color: hueAt((t + i * 0.06) % 1), bold: true, children: line }, 'b' + i))), code.map((line, i) => (_jsx(Text, { color: hueAt((t + i * 0.06 + 0.35) % 1), bold: true, children: line }, 'c' + i))), _jsx(Text, { children: " " }), _jsx(Text, { color: "gray", children: "a coding agent \u00B7 v0.1.0" }), _jsx(Text, { children: " " })] }));
76
+ const version = getVersion();
77
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(MakerMark, { color: brand }), _jsx(Text, { children: " " }), blyue.map((line, i) => (_jsx(Text, { color: hueAt((t + i * 0.06) % 1), bold: true, children: line }, 'b' + i))), code.map((line, i) => (_jsx(Text, { color: hueAt((t + i * 0.06 + 0.35) % 1), bold: true, children: line }, 'c' + i))), _jsx(Text, { children: " " }), _jsx(Text, { color: "gray", children: 'a coding agent · v' + version }), _jsx(Text, { children: " " })] }));
47
78
  };
package/dist/ui/Chat.js CHANGED
@@ -52,8 +52,8 @@ export const Chat = () => {
52
52
  if (modelPickerOpen) {
53
53
  return (_jsx(Box, { flexDirection: "column", children: _jsx(ModelPicker, { current: currentModel, onSelect: handleModelSelect, onCancel: () => setModelPickerOpen(false) }) }));
54
54
  }
55
- // Truncate model name so footer fits on one line
56
- const maxModelLen = Math.max(12, width - 24);
55
+ // Aggressive truncation so footer fits on one line
56
+ const maxModelLen = Math.max(10, width - 14);
57
57
  const shortModel = currentModel.length > maxModelLen
58
58
  ? '…' + currentModel.slice(-(maxModelLen - 1))
59
59
  : currentModel || 'unset';
@@ -68,5 +68,5 @@ export const Chat = () => {
68
68
  return _jsx(Text, { color: theme.muted, children: item.text.trim() }, i);
69
69
  }
70
70
  return (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.text, children: item.text }) }, i));
71
- }), _jsx(Box, { marginTop: 1, children: _jsx(InputBar, { value: input, onChange: setInput, onSubmit: handleSubmit, loading: loading }) }), _jsxs(Text, { color: theme.muted, children: [' ', _jsx(Text, { color: theme.accent, children: "/model" }), ' · ', _jsx(Text, { color: theme.text, children: shortModel })] })] }));
71
+ }), _jsx(Box, { marginTop: 1, children: _jsx(InputBar, { value: input, onChange: setInput, onSubmit: handleSubmit, loading: loading }) }), _jsxs(Text, { children: [_jsx(Text, { color: theme.accent, children: " /model" }), _jsxs(Text, { color: theme.muted, children: [" ", shortModel] })] })] }));
72
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blyuecode",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "BLYUE Code — a coding agent by Lumen",
5
5
  "type": "module",
6
6
  "license": "MIT",