From 42bf5859c8861db9782f8e9bc80ad9573a5f2f37 Mon Sep 17 00:00:00 2001 From: dal Date: Tue, 9 Sep 2025 09:27:03 -0600 Subject: [PATCH] fix on files --- apps/cli/src/components/banner.tsx | 10 ++--- apps/cli/src/components/simple-big-text.tsx | 41 +++++++++++++++++++++ apps/cli/src/index.tsx | 2 +- packages/database/package.json | 4 ++ packages/database/src/types.ts | 30 +++++++++++++++ packages/server-shared/src/chats/index.ts | 3 +- 6 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 apps/cli/src/components/simple-big-text.tsx create mode 100644 packages/database/src/types.ts diff --git a/apps/cli/src/components/banner.tsx b/apps/cli/src/components/banner.tsx index 1ee45f0d0..06c4bf9a5 100644 --- a/apps/cli/src/components/banner.tsx +++ b/apps/cli/src/components/banner.tsx @@ -1,5 +1,6 @@ import { Box, Text } from 'ink'; -import BigText from 'ink-big-text'; +import React from 'react'; +import { SimpleBigText } from './simple-big-text.js'; interface BannerProps { showSubtitle?: boolean; @@ -8,17 +9,16 @@ interface BannerProps { /** * Shared Buster banner component for consistent branding across CLI + * Uses SimpleBigText to avoid font loading issues in standalone binaries */ export function BusterBanner({ showSubtitle = true, inline = false }: BannerProps = {}) { const content = ( <> - - - + {showSubtitle && ( - + Welcome to Buster )} diff --git a/apps/cli/src/components/simple-big-text.tsx b/apps/cli/src/components/simple-big-text.tsx new file mode 100644 index 000000000..0ffae4670 --- /dev/null +++ b/apps/cli/src/components/simple-big-text.tsx @@ -0,0 +1,41 @@ +import { Text } from 'ink'; +import React from 'react'; + +interface SimpleBigTextProps { + text: string; + color?: string; +} + +/** + * Simple big text renderer that doesn't require external font files + * Uses inline ASCII art for each letter + */ +export function SimpleBigText({ text, color = 'white' }: SimpleBigTextProps) { + const letters: Record = { + B: ['██████╗ ', '██╔══██╗', '██████╔╝', '██╔══██╗', '██████╔╝', '╚═════╝ '], + U: ['██╗ ██╗', '██║ ██║', '██║ ██║', '██║ ██║', '╚██████╔╝', ' ╚═════╝ '], + S: ['███████╗', '██╔════╝', '███████╗', '╚════██║', '███████║', '╚══════╝'], + T: ['████████╗', '╚══██╔══╝', ' ██║ ', ' ██║ ', ' ██║ ', ' ╚═╝ '], + E: ['███████╗', '██╔════╝', '█████╗ ', '██╔══╝ ', '███████╗', '╚══════╝'], + R: ['██████╗ ', '██╔══██╗', '██████╔╝', '██╔══██╗', '██║ ██║', '╚═╝ ╚═╝'], + }; + + // Convert text to uppercase and get the ASCII art for each letter + const upperText = text.toUpperCase(); + const lines: string[] = ['', '', '', '', '', '']; + + for (const char of upperText) { + const letter = letters[char]; + if (letter) { + for (let i = 0; i < 6; i++) { + lines[i] += letter[i] + ' '; + } + } else if (char === ' ') { + for (let i = 0; i < 6; i++) { + lines[i] += ' '; + } + } + } + + return {lines.join('\n')}; +} diff --git a/apps/cli/src/index.tsx b/apps/cli/src/index.tsx index a75b9b277..d75a4bf97 100644 --- a/apps/cli/src/index.tsx +++ b/apps/cli/src/index.tsx @@ -10,7 +10,7 @@ import { InitCommand } from './commands/init.js'; program .name('buster') .description('Buster CLI - AI-powered data analytics platform') - .version('0.1.0'); + .version('0.3.0'); // Auth command - authentication management program diff --git a/packages/database/package.json b/packages/database/package.json index 9c8f8be0f..27a4fe381 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -7,6 +7,10 @@ "types": "./dist/index.d.ts", "default": "./dist/index.js" }, + "./types": { + "types": "./dist/types.d.ts", + "default": "./dist/types.js" + }, "./helpers/*": { "types": "./dist/helpers/*/index.d.ts", "default": "./dist/helpers/*/index.js" diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts new file mode 100644 index 000000000..27f908a4d --- /dev/null +++ b/packages/database/src/types.ts @@ -0,0 +1,30 @@ +/** + * Type-only exports for message schemas + * This file provides types without triggering database connection + */ + +// Export message schema types +export type { + ChatMessageReasoning_status, + ChatMessageResponseMessage, + ChatMessageReasoningMessage, + ChatMessageReasoningMessage_Text, + ChatMessageReasoningMessage_Files, + ChatMessageReasoningMessage_Pills, + ChatMessageReasoningMessage_File, + ChatMessageReasoningMessage_Pill, + ChatMessageReasoningMessage_PillContainer, + ChatMessageResponseMessage_FileMetadata, + ChatMessageResponseMessage_Text, + ChatMessageResponseMessage_File, + ReasoningFileType, + ResponseMessageFileType, + ReasoingMessage_ThoughtFileType, +} from './schemas/message-schemas'; + +// Export the schemas themselves (these are just objects, no side effects) +export { + StatusSchema, + ResponseMessageSchema, + ReasoningMessageSchema, +} from './schemas/message-schemas'; diff --git a/packages/server-shared/src/chats/index.ts b/packages/server-shared/src/chats/index.ts index 9b4a4d7e5..d76e6380d 100644 --- a/packages/server-shared/src/chats/index.ts +++ b/packages/server-shared/src/chats/index.ts @@ -6,6 +6,7 @@ export * from './requests'; export * from './responses'; // Re-export message schemas from database package to maintain backward compatibility +// Using /types entry point to avoid triggering database connection export { StatusSchema, ResponseMessageSchema, @@ -25,4 +26,4 @@ export { type ReasoningFileType, type ResponseMessageFileType, type ReasoingMessage_ThoughtFileType, -} from '@buster/database'; +} from '@buster/database/types';