mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 22:05:50 +00:00
* style(B1-1): 格式化 ink/buddy/cli/context/screens/tasks/services/keybindings/state (43 files) 纯格式化:移除分号、React Compiler import、import 多行展开。 修复了 Box.tsx 和 ScrollBox.tsx 中无效的 global.d.ts import。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style(B1-2): 格式化 commands (79 files) 纯格式化:移除分号、React Compiler import、import 多行展开。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style(B1-3): 格式化 components/messages,permissions,mcp,sandbox,shell (104 files) 纯格式化:移除分号、React Compiler import、import 多行展开。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style(B1-4): 格式化 components/PromptInput,FeedbackSurvey,tasks,agents,skills,design-system,wizard (73 files) 纯格式化:移除分号、React Compiler import、import 多行展开。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style(B1-5): 格式化 components其余 + hooks + tools (232 files) 纯格式化:移除分号、React Compiler import、import 多行展开。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style(B1-6): 格式化 main/entrypoints/utils/moreright (21 files) 纯格式化:移除分号、React Compiler import、import 多行展开。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: 更新 README,新增 Run.ps1/TODO.md,删除 V6.md - README.md: 大幅重写,更详细版本历史和配置示例 - Run.ps1: 新增 Windows 启动脚本 - TODO.md: 新增包完成清单 - V6.md: 删除(架构重构规划已不适用) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: 修复以前的问题 * fix: 修复 login 面板的问题 --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
99 lines
3.3 KiB
TypeScript
99 lines
3.3 KiB
TypeScript
import * as React from 'react'
|
|
import { Box, Text } from '../../ink.js'
|
|
import { env } from '../../utils/env.js'
|
|
|
|
export type ClawdPose =
|
|
| 'default'
|
|
| 'arms-up' // both arms raised (used during jump)
|
|
| 'look-left' // both pupils shifted left
|
|
| 'look-right' // both pupils shifted right
|
|
|
|
type Props = {
|
|
pose?: ClawdPose
|
|
}
|
|
|
|
// Standard-terminal pose fragments. Each row is split into segments so we can
|
|
// vary only the parts that change (eyes, arms) while keeping the body/bg spans
|
|
// stable. All poses end up 9 cols wide.
|
|
//
|
|
// arms-up: the row-2 arm shapes (▝▜ / ▛▘) move to row 1 as their
|
|
// bottom-heavy mirrors (▗▟ / ▙▖) — same silhouette, one row higher.
|
|
//
|
|
// look-* use top-quadrant eye chars (▙/▟) so both eyes change from the
|
|
// default (▛/▜, bottom pupils) — otherwise only one eye would appear to move.
|
|
type Segments = {
|
|
/** row 1 left (no bg): optional raised arm + side */
|
|
r1L: string
|
|
/** row 1 eyes (with bg): left-eye, forehead, right-eye */
|
|
r1E: string
|
|
/** row 1 right (no bg): side + optional raised arm */
|
|
r1R: string
|
|
/** row 2 left (no bg): arm + body curve */
|
|
r2L: string
|
|
/** row 2 right (no bg): body curve + arm */
|
|
r2R: string
|
|
}
|
|
|
|
const POSES: Record<ClawdPose, Segments> = {
|
|
default: { r1L: ' ▐', r1E: '▛███▜', r1R: '▌', r2L: '▝▜', r2R: '▛▘' },
|
|
'look-left': { r1L: ' ▐', r1E: '▟███▟', r1R: '▌', r2L: '▝▜', r2R: '▛▘' },
|
|
'look-right': { r1L: ' ▐', r1E: '▙███▙', r1R: '▌', r2L: '▝▜', r2R: '▛▘' },
|
|
'arms-up': { r1L: '▗▟', r1E: '▛███▜', r1R: '▙▖', r2L: ' ▜', r2R: '▛ ' },
|
|
}
|
|
|
|
// Apple Terminal uses a bg-fill trick (see below), so only eye poses make
|
|
// sense. Arm poses fall back to default.
|
|
const APPLE_EYES: Record<ClawdPose, string> = {
|
|
default: ' ▗ ▖ ',
|
|
'look-left': ' ▘ ▘ ',
|
|
'look-right': ' ▝ ▝ ',
|
|
'arms-up': ' ▗ ▖ ',
|
|
}
|
|
|
|
export function Clawd({ pose = 'default' }: Props = {}): React.ReactNode {
|
|
if (env.terminal === 'Apple_Terminal') {
|
|
return <AppleTerminalClawd pose={pose} />
|
|
}
|
|
const p = POSES[pose]
|
|
return (
|
|
<Box flexDirection="column">
|
|
<Text>
|
|
<Text color="clawd_body">{p.r1L}</Text>
|
|
<Text color="clawd_body" backgroundColor="clawd_background">
|
|
{p.r1E}
|
|
</Text>
|
|
<Text color="clawd_body">{p.r1R}</Text>
|
|
</Text>
|
|
<Text>
|
|
<Text color="clawd_body">{p.r2L}</Text>
|
|
<Text color="clawd_body" backgroundColor="clawd_background">
|
|
█████
|
|
</Text>
|
|
<Text color="clawd_body">{p.r2R}</Text>
|
|
</Text>
|
|
<Text color="clawd_body">
|
|
{' '}▘▘ ▝▝{' '}
|
|
</Text>
|
|
</Box>
|
|
)
|
|
}
|
|
|
|
function AppleTerminalClawd({ pose }: { pose: ClawdPose }): React.ReactNode {
|
|
// Apple's Terminal renders vertical space between chars by default.
|
|
// It does NOT render vertical space between background colors
|
|
// so we use background color to draw the main shape.
|
|
return (
|
|
<Box flexDirection="column" alignItems="center">
|
|
<Text>
|
|
<Text color="clawd_body">▗</Text>
|
|
<Text color="clawd_background" backgroundColor="clawd_body">
|
|
{APPLE_EYES[pose]}
|
|
</Text>
|
|
<Text color="clawd_body">▖</Text>
|
|
</Text>
|
|
<Text backgroundColor="clawd_body">{' '.repeat(7)}</Text>
|
|
<Text color="clawd_body">▘▘ ▝▝</Text>
|
|
</Box>
|
|
)
|
|
}
|