Ver código fonte

fix: replace pixel art logo with plain K I R I N C O D E text

- cli/ui.ts: simplified logo() to plain spaced text
- tui/logo.ts: replaced pixel arrays with simple strings
- tui/presentation.ts: session epilogue uses plain text
KirinCode 1 mês atrás
pai
commit
a77fa12115

+ 4 - 62
packages/kirincode/src/cli/ui.ts

@@ -1,13 +1,7 @@
 import { EOL } from "os"
 import { Schema } from "effect"
-import { logo as glyphs } from "./logo"
 
-const wordmark = [
-  `⠀                                ▄     `,
-  `██▀▄ █▀▀█ █▀▀▄ █▀▀█ █▀▀▄ █▀▀█ █▀▀█ █▀▀▄ █▀▀█`,
-  `█▀ █ █  █ █▄▄▀ █  █ █▀ █ █   █  █ █  █ █▀▀▀`,
-  `█▀ █ █▀▀▀ █  █ █▀▀▀ █▀ █ █   █▀▀▀ █▀▀▀ ▀▀▀▀`,
-]
+const wordmark = `K I R I N C O D E`
 
 export class CancelledError extends Schema.TaggedErrorClass<CancelledError>()("UICancelledError", {}) {}
 
@@ -46,61 +40,9 @@ export function empty() {
 }
 
 export function logo(pad?: string) {
-  if (!process.stdout.isTTY && !process.stderr.isTTY) {
-    const result = []
-    for (const row of wordmark) {
-      if (pad) result.push(pad)
-      result.push(row)
-      result.push(EOL)
-    }
-    return result.join("").trimEnd()
-  }
-
-  const result: string[] = []
-  const reset = "\x1b[0m"
-  const left = {
-    fg: "\x1b[90m",
-    shadow: "\x1b[38;5;235m",
-    bg: "\x1b[48;5;235m",
-  }
-  const right = {
-    fg: reset,
-    shadow: "\x1b[38;5;238m",
-    bg: "\x1b[48;5;238m",
-  }
-  const gap = " "
-  const draw = (line: string, fg: string, shadow: string, bg: string) => {
-    const parts: string[] = []
-    for (const char of line) {
-      if (char === "_") {
-        parts.push(bg, " ", reset)
-        continue
-      }
-      if (char === "^") {
-        parts.push(fg, bg, "▀", reset)
-        continue
-      }
-      if (char === "~") {
-        parts.push(shadow, "▀", reset)
-        continue
-      }
-      if (char === " ") {
-        parts.push(" ")
-        continue
-      }
-      parts.push(fg, char, reset)
-    }
-    return parts.join("")
-  }
-  glyphs.left.forEach((row, index) => {
-    if (pad) result.push(pad)
-    result.push(draw(row, left.fg, left.shadow, left.bg))
-    result.push(gap)
-    const other = glyphs.right[index] ?? ""
-    result.push(draw(other, right.fg, right.shadow, right.bg))
-    result.push(EOL)
-  })
-  return result.join("").trimEnd()
+  const label = `${Style.TEXT_HIGHLIGHT_BOLD}${wordmark}${Style.TEXT_NORMAL}`
+  if (pad) return `${pad}${label}`
+  return label
 }
 
 export async function input(prompt: string): Promise<string> {

+ 5 - 17
packages/tui/src/logo.ts

@@ -1,23 +1,11 @@
 export const logo = {
-  left: [
-    "                   ",
-    "█▀▀▄ █▀▀█ █▀▀▄ █▀▀█",
-    "█__▌ █▀▀▌ █▀▀█ █▀▀▌",
-    "█^^▌ █▀▀▌ █▀█_ █▀▀▌",
-    "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀",
-  ],
-  right: [
-    "                  ▄     ",
-    "██▀▄ █▀▀█ █▀▀█ █▀▀▄ █▀▀█",
-    "█▀ █ █___ █__█ █__▌ █▀▀▀",
-    "█▀ █ █___ █^^█ █^^▌ █▀▀▀",
-    "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀",
-  ],
+  left: ["K I R I N"],
+  right: ["C O D E"],
 }
 
 export const go = {
-  left: ["    ", "█▀▀▀", "█_^█", "▀▀▀▀"],
-  right: ["    ", "█▀▀█", "█__█", "▀▀▀▀"],
+  left: ["GO"],
+  right: [""],
 }
 
-export const marks = "_^~,"
+export const marks = ""

+ 2 - 37
packages/tui/src/util/presentation.ts

@@ -1,48 +1,13 @@
-const logo = {
-  // K I R I | N C O D E  (9 letters, split 4+5)
-  left: [
-    "                   ",
-    "█▀▀▄ █▀▀█ █▀▀▄ █▀▀█",
-    "█__▌ █▀▀▌ █▀▀█ █▀▀▌",
-    "█^^▌ █▀▀▌ █▀█_ █▀▀▌",
-    "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀",
-  ],
-  right: [
-    "                  ▄     ",
-    "██▀▄ █▀▀█ █▀▀█ █▀▀▄ █▀▀█",
-    "█▀ █ █___ █__█ █__▌ █▀▀▀",
-    "█▀ █ █___ █^^█ █^^▌ █▀▀▀",
-    "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀",
-  ],
-}
+const wordmark = "K I R I N C O D E"
 
 const reset = "\x1b[0m"
 const bold = "\x1b[1m"
 const dim = "\x1b[90m"
 
-function wordmark(pad = "") {
-  const draw = (line: string, fg: string, shadow: string, bg: string) =>
-    [...line]
-      .map((char) => {
-        if (char === "_") return `${bg} ${reset}`
-        if (char === "^") return `${fg}${bg}▀${reset}`
-        if (char === "~") return `${shadow}▀${reset}`
-        if (char === " ") return " "
-        return `${fg}${char}${reset}`
-      })
-      .join("")
-
-  return logo.left.map((line, index) => {
-    const left = draw(line, dim, "\x1b[38;5;235m", "\x1b[48;5;235m")
-    const right = draw(logo.right[index] ?? "", reset, "\x1b[38;5;238m", "\x1b[48;5;238m")
-    return `${pad}${left} ${right}`
-  })
-}
-
 export function sessionEpilogue(input: { title: string; sessionID?: string }) {
   const weak = (text: string) => `${dim}${text.padEnd(10, " ")}${reset}`
   return [
-    ...wordmark("  "),
+    `  ${bold}${wordmark}${reset}`,
     "",
     `  ${weak("Session")}${bold}${input.title}${reset}`,
     `  ${weak("Continue")}${bold}kirincode -s ${input.sessionID}${reset}`,