bingocode 1.1.114 → 1.1.116

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bingocode",
3
- "version": "1.1.114",
3
+ "version": "1.1.116",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claude": "bin/claude-win.cjs",
@@ -72,9 +72,9 @@ async function buildSpawnEnv(): Promise<NodeJS.ProcessEnv> {
72
72
  return base;
73
73
  }
74
74
 
75
- // Top height: Home fits LogoV2 + Toolbar, other pages more compact
76
- const TOP_H_HOME = Number(process.env.CLI_TOP_H_HOME || 9);
77
- const TOP_H_COMPACT = Number(process.env.CLI_TOP_H_COMPACT || 6);
75
+ // Top height: Home = Clawd(3 rows) + border(2) = 5; Compact = 1 row + border(2) = 3
76
+ const TOP_H_HOME = Number(process.env.CLI_TOP_H_HOME || 5);
77
+ const TOP_H_COMPACT = Number(process.env.CLI_TOP_H_COMPACT || 3);
78
78
  // Bottom bar height
79
79
  const BOTTOM_H = Number(process.env.CLI_BOTTOM_H || 3);
80
80
 
@@ -91,13 +91,12 @@ const i18nMap = {
91
91
  about: 'Bingo CLI - Version Info & About',
92
92
  aboutContent: [
93
93
  'Bingo is an AI assistant terminal client.',
94
- 'Author: leanchy (Email: leanchy07@outlook.com)',
95
- 'Github: github.com/leanchy/bingo-claude-code-offline-installer',
96
94
  '1. API Config: Press "P" or select "API Config" to set up your keys.',
97
95
  '2. Model Slots: Configure specific models in the Provider panel.',
98
96
  '3. Background Service: Bingo runs a local server to manage sessions.',
99
97
  '4. Start Chat: Run `bingocode` or `claude` in any terminal to start.',
100
98
  ].join('\n'),
99
+ aboutFooter: 'Author: leanchy (leanchy07@outlook.com) · github.com/leanchy/bingo-claude-code-offline-installer',
101
100
  mark: '→ Mark Session',
102
101
  unmark: '→ Unmark Session',
103
102
  tipsSimple: 'L Lang | ESC Back | ←→ Menu | ↩ Enter | ? Help',
@@ -119,13 +118,12 @@ const i18nMap = {
119
118
  about: 'Bingo CLI Terminal - Version Info & About',
120
119
  aboutContent: [
121
120
  'Bingo is an AI assistant terminal client.',
122
- 'Author: leanchy (Email: leanchy07@outlook.com)',
123
- 'Github: github.com/leanchy/bingo-claude-code-offline-installer',
124
121
  '1. API Config: Press "P" or select "API Config" to set up your keys.',
125
122
  '2. Model Slots: Configure specific models in the Provider panel.',
126
123
  '3. Background Service: Bingo runs a local server to manage sessions.',
127
124
  '4. Start Chat: Run `bingocode` or `claude` in any terminal to start.',
128
125
  ].join('\n'),
126
+ aboutFooter: 'Author: leanchy (leanchy07@outlook.com) · github.com/leanchy/bingo-claude-code-offline-installer',
129
127
  mark: '→ Mark Session',
130
128
  unmark: '→ Unmark Session',
131
129
  tipsSimple: 'L Lang | ESC Back | ←→ Menu | ↩ Enter | ? Help',
@@ -1156,6 +1154,9 @@ export const CliMenuManager: React.FC = () => {
1156
1154
  API Base: {apiUrl}
1157
1155
  </Hint>
1158
1156
  </Box>
1157
+ <Box marginTop={1}>
1158
+ <Text color="gray">{(i18nMap[lang] as any).aboutFooter}</Text>
1159
+ </Box>
1159
1160
  </Box>
1160
1161
  );
1161
1162
  }
@@ -1189,15 +1190,13 @@ export const CliMenuManager: React.FC = () => {
1189
1190
  page={page}
1190
1191
  width={VIEW_W}
1191
1192
  height={TOP_H}
1192
- homeLogo={<LogoV2 />}
1193
- compactLogo={<CondensedLogo />}
1194
- ip={apiUrl ? apiUrl.replace(/^https?:\/\//, '') : undefined}
1195
1193
  toolbar={
1196
1194
  <TopToolbar
1197
1195
  ready={configReady}
1198
1196
  page={page}
1199
1197
  animEnabled={animEnabled}
1200
1198
  tipsEnabled={tipsEnabled}
1199
+ ip={apiUrl ? apiUrl.replace(/^https?:\/\//, '') : undefined}
1201
1200
  />
1202
1201
  }
1203
1202
  />
@@ -256,23 +256,20 @@ export const ChipRow: React.FC<{ children: React.ReactNode }> = memo(({ children
256
256
  </Box>
257
257
  ));
258
258
 
259
- // TopBar (logo + toolbar horizontal arrangement, with ready state and placeholder)
259
+ // TopBar (full-width toolbar, no separate logo slot)
260
260
  export const TopBar: React.FC<{
261
261
  ready: boolean;
262
262
  page: string | null;
263
263
  width?: number;
264
264
  height?: number;
265
- homeLogo: React.ReactNode;
266
- compactLogo: React.ReactNode;
265
+ homeLogo?: React.ReactNode;
266
+ compactLogo?: React.ReactNode;
267
267
  toolbar?: React.ReactNode;
268
268
  ip?: string;
269
- }> = memo(({ ready, page, width = 80, height = 5, homeLogo, compactLogo, toolbar, ip }) => (
269
+ }> = memo(({ width = 80, height = 5, toolbar }) => (
270
270
  <Panel width={width} height={height} borderStyle="round" paddingX={1} paddingY={0}>
271
- <Box width={width - 2} flexDirection="row" justifyContent="space-between" alignItems="center">
272
- <Box>
273
- {ready ? (page === null ? homeLogo : compactLogo) : <FallbackTop ip={ip} />}
274
- </Box>
275
- {toolbar ? <Box>{toolbar}</Box> : <Box><Hint dim>{ready ? '' : '…'}</Hint></Box>}
271
+ <Box width={width - 4} flexDirection="row" alignItems="flex-start">
272
+ {toolbar ?? null}
276
273
  </Box>
277
274
  </Panel>
278
275
  ));
@@ -1,111 +1,98 @@
1
- //@C:M ID=M.UI.TopToolbar;K=M;V=1.2;P=top toolbar;D=CLI;M=cli;S=ui
2
- import React, { memo, useMemo } from 'react';
3
- import { Box } from 'ink';
4
- import { Chip, ChipRow } from './CliMenuUi.tsx';
5
- import { useTheme } from '../components/design-system/ThemeProvider.js';
6
- import { getGlobalConfig, getCurrentProjectConfig, isPathTrusted, checkHasTrustDialogAccepted } from '../utils/config.ts';
7
- import { getCwd } from '../utils/cwd.js';
8
- // Update: Import respectively according to the new interface
9
- import type { ClawdPose } from '../components/LogoV2/Clawd.tsx';
10
- import { Clawd } from '../components/LogoV2/Clawd.tsx';
11
- import { AnimatedClawd } from '../components/LogoV2/AnimatedClawd.tsx';
12
-
13
- type Props = {
14
- ready: boolean;
15
- page: string | null;
16
- animEnabled: boolean;
17
- tipsEnabled: boolean;
18
- };
19
-
20
- function basename(p: string) {
21
- if (!p) return '';
22
- const parts = p.split(/[/\\]/).filter(Boolean);
23
- return parts[parts.length - 1] || p;
24
- }
25
- function ellipsisPath(p: string, keep = 2) {
26
- if (!p) return '';
27
- const parts = p.split(/[/\\]/).filter(Boolean);
28
- if (parts.length <= keep) return p;
29
- return '…/' + parts.slice(-keep).join('/');
30
- }
31
-
32
- //@C:F ID=F.UI.TopToolbar;K=F;V=1.2;P=toolbar;D=CLI;M=cli;S=ui;In=Props;Out=JSX.Element
33
- export const TopToolbar: React.FC<Props> = memo(({ ready, page, animEnabled, tipsEnabled }) => {
34
- const [theme] = useTheme();
35
-
36
- // Only read config and trust status when ready
37
- const { cwd, trustAccepted, trustedPath, projectName } = useMemo(() => {
38
- if (!ready) {
39
- return { cwd: '', trustAccepted: undefined as undefined|boolean, trustedPath: undefined as undefined|boolean, projectName: '' };
40
- }
41
- const _cwd = getCwd();
42
- const _trustAccepted = checkHasTrustDialogAccepted();
43
- const _trustedPath = isPathTrusted(_cwd);
44
- let _projectName = '';
45
- try {
46
- const prj = getCurrentProjectConfig();
47
- _projectName = (prj && (prj.name || prj.projectName || prj.id)) || basename(_cwd);
48
- } catch {
49
- _projectName = basename(_cwd);
50
- }
51
- return { cwd: _cwd, trustAccepted: _trustAccepted, trustedPath: _trustedPath, projectName: _projectName };
52
- }, [ready]);
53
-
54
- const compact = page !== null;
55
- const cwdShort = useMemo(() => ellipsisPath(cwd, compact ? 2 : 3), [cwd, compact]);
56
-
57
- // Theme name
58
- const themeLabel = String(theme || (ready ? (getGlobalConfig()?.theme ?? 'system') : '…'));
59
-
60
- // Static Clawd pose
61
- const clawdPose: ClawdPose = useMemo(() => {
62
- if (!ready) return 'default';
63
- if (page === null) return animEnabled ? 'arms-up' : 'default';
64
- return tipsEnabled ? 'look-left' : 'look-right';
65
- }, [ready, page, animEnabled, tipsEnabled]);
66
-
67
- const uiTone = (String(theme) === 'dark') ? 'accent' : (String(theme) === 'highContrast' ? 'warning' : 'info');
68
-
69
- return (
70
- <Box flexDirection="column" minHeight={3}>
71
- <ChipRow>
72
- {/* Left: Clawd + Core Status */}
73
- <Box>
74
- <Box marginRight={2}>
75
- {animEnabled ? <AnimatedClawd /> : <Clawd pose={clawdPose} />}
76
- </Box>
77
-
78
- <Chip label="Theme" value={themeLabel} tone="accent" />
79
- <Chip label="Project" value={projectName || '—'} tone="info" />
80
- <Chip label="CWD" value={cwdShort || '—'} tone="subtle" />
81
- {trustedPath === undefined || trustAccepted === undefined ? (
82
- <Chip label="Trust" value="…" tone="subtle" />
83
- ) : trustedPath && trustAccepted ? (
84
- <Chip label="Trust" value="✅ Trusted" tone="success" />
85
- ) : (
86
- <Chip label="Trust" value="🔒 Untrusted" tone="warning" />
87
- )}
88
- </Box>
89
-
90
- {/* Right: UI Status merged display */}
91
- <Box>
92
- <Chip
93
- label="UI"
94
- value={`Anim ${animEnabled ? 'On' : 'Off'} · Tips ${tipsEnabled ? 'On' : 'Off'}`}
95
- tone={uiTone as any}
96
- />
97
- </Box>
98
- </ChipRow>
99
-
100
- {!compact && (
101
- <ChipRow>
102
- <Box>
103
- <Chip label="Shortcuts" value="N New · R Resume · P Provider · G Theme · ? Help" tone="subtle" />
104
- </Box>
105
- </ChipRow>
106
- )}
107
- </Box>
108
- );
109
- });
110
-
111
- export default TopToolbar;
1
+ //@C:M ID=M.UI.TopToolbar;K=M;V=1.3;P=top toolbar;D=CLI;M=cli;S=ui
2
+ import React, { memo, useMemo } from 'react';
3
+ import { Box, Text } from 'ink';
4
+ import { Chip } from './CliMenuUi.tsx';
5
+ import { useTheme } from '../components/design-system/ThemeProvider.js';
6
+ import { getGlobalConfig } from '../utils/config.ts';
7
+ import type { ClawdPose } from '../components/LogoV2/Clawd.tsx';
8
+ import { Clawd } from '../components/LogoV2/Clawd.tsx';
9
+ import { AnimatedClawd } from '../components/LogoV2/AnimatedClawd.tsx';
10
+
11
+ type Props = {
12
+ ready: boolean;
13
+ page: string | null;
14
+ animEnabled: boolean;
15
+ tipsEnabled: boolean;
16
+ ip?: string;
17
+ };
18
+
19
+ //@C:F ID=F.UI.TopToolbar;K=F;V=1.4;P=toolbar;D=CLI;M=cli;S=ui;In=Props;Out=JSX.Element
20
+ export const TopToolbar: React.FC<Props> = memo(({ ready, page, animEnabled, tipsEnabled, ip }) => {
21
+ const [theme] = useTheme();
22
+
23
+ const { version } = useMemo(() => {
24
+ try {
25
+ const cfg = getGlobalConfig();
26
+ return { version: (cfg as any)?.version ?? '' };
27
+ } catch {
28
+ return { version: '' };
29
+ }
30
+ }, []);
31
+
32
+ const themeLabel = String(theme || (ready ? (getGlobalConfig()?.theme ?? 'system') : '…'));
33
+ const uiChipValue = `Anim ${animEnabled ? 'On' : 'Off'} · Tips ${tipsEnabled ? 'On' : 'Off'}`;
34
+ const uiTone = (String(theme) === 'dark') ? 'accent' : (String(theme) === 'highContrast' ? 'warning' : 'info');
35
+
36
+ const clawdPose: ClawdPose = useMemo(() => {
37
+ if (!ready) return 'default';
38
+ if (page === null) return animEnabled ? 'arms-up' : 'default';
39
+ return tipsEnabled ? 'look-left' : 'look-right';
40
+ }, [ready, page, animEnabled, tipsEnabled]);
41
+
42
+ // ── Compact mode (page !== null): single line, no logo ──────────────
43
+ if (page !== null) {
44
+ return (
45
+ <Box flexDirection="row" alignItems="center">
46
+ <Text bold>Bingo Code</Text>
47
+ <Box marginLeft={1}>
48
+ <Chip label="Theme" value={themeLabel} tone="accent" />
49
+ </Box>
50
+ <Chip label="UI" value={uiChipValue} tone={uiTone as any} />
51
+ {ip ? (
52
+ <Text color="green" dimColor> · IP: {ip}</Text>
53
+ ) : (
54
+ <Text color="yellow" dimColor> · {ready ? 'Server ready' : 'Starting…'}</Text>
55
+ )}
56
+ </Box>
57
+ );
58
+ }
59
+
60
+ // ── Home mode (page === null): Clawd left + 3-row right column ───────
61
+ return (
62
+ <Box flexDirection="row" alignItems="flex-start">
63
+ {/* Left: Clawd sprite */}
64
+ <Box marginRight={2}>
65
+ {animEnabled ? <AnimatedClawd /> : <Clawd pose={clawdPose} />}
66
+ </Box>
67
+
68
+ {/* Right: 3 rows */}
69
+ <Box flexDirection="column">
70
+ {/* Row 1: brand + version + chips */}
71
+ <Box flexDirection="row" alignItems="center">
72
+ <Text bold>Welcome to Bingo Code</Text>
73
+ {version ? <Text dimColor> v{version}</Text> : null}
74
+ <Box marginLeft={1}>
75
+ <Chip label="Theme" value={themeLabel} tone="accent" />
76
+ </Box>
77
+ <Chip label="UI" value={uiChipValue} tone={uiTone as any} />
78
+ </Box>
79
+
80
+ {/* Row 2: IP / server status */}
81
+ <Box>
82
+ {ip ? (
83
+ <Text color="green" dimColor>IP: {ip}</Text>
84
+ ) : (
85
+ <Text color="yellow" dimColor>{ready ? 'Server ready' : 'Starting server…'}</Text>
86
+ )}
87
+ </Box>
88
+
89
+ {/* Row 3: keyboard shortcuts */}
90
+ <Box>
91
+ <Text dimColor>N New · R Resume · P Provider · G Theme · ? Help</Text>
92
+ </Box>
93
+ </Box>
94
+ </Box>
95
+ );
96
+ });
97
+
98
+ export default TopToolbar;