mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
Adds `bun run setup` and `bun run doctor` for local installs, and replaces the wizard's paste-your-Chat-key step with a browser handoff that never puts the key in a URL.
29 lines
772 B
TypeScript
29 lines
772 B
TypeScript
import chalk from 'chalk'
|
|
|
|
const BRAND = '#e6e6e6'
|
|
|
|
export const isRich = () => chalk.level > 0
|
|
|
|
export const theme = {
|
|
accent: chalk.hex(BRAND),
|
|
heading: chalk.bold.hex(BRAND),
|
|
muted: chalk.hex('#8a8f98'),
|
|
success: chalk.hex('#33c482'),
|
|
warn: chalk.hex('#ffb020'),
|
|
error: chalk.hex('#e23d2d'),
|
|
command: chalk.hex(BRAND),
|
|
}
|
|
|
|
export const glyph = {
|
|
pass: theme.success('✓'),
|
|
warn: theme.warn('!'),
|
|
fail: theme.error('✗'),
|
|
skip: theme.muted('○'),
|
|
} as const
|
|
|
|
/** OSC 8 clickable terminal hyperlink; plain text when not a rich TTY. */
|
|
export function link(label: string, url: string): string {
|
|
if (!isRich() || !process.stdout.isTTY) return `${label} (${url})`
|
|
return `\x1b]8;;${url}\x1b\\${chalk.underline.hex(BRAND)(label)}\x1b]8;;\x1b\\`
|
|
}
|