/
Alex_Ural
/
opencode
Обзор
Документация
Войти
/
Alex_Ural
/
opencode
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
packages/tui/src/util/presentation.ts
38 строк
1 KB
Dax
refactor(tui): extract standalone package (#31193)
07 июн 2026, 08:24
Не верифицирован
07 июн 2026, 08:24
106f8e9
Код
Авторство
О чём код?
const logo = { left: [" ", "█▀▀█ █▀▀█ █▀▀█ █▀▀▄", "█__█ █__█ █^^^ █__█", "▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀~~▀"], right: [" ▄ ", "█▀▀▀ █▀▀█ █▀▀█ █▀▀█", "█___ █__█ █__█ █^^^", "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀"], } 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(" "), "", ` ${weak("Session")}${bold}${input.title}${reset}`, ` ${weak("Continue")}${bold}opencode -s ${input.sessionID}${reset}`, "", ].join("\n") }