mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 13:55:50 +00:00
更新大量 tsx 原始文件; 已经迁移 login panel; 部分 (#121)
* 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>
This commit is contained in:
@@ -1,166 +1,80 @@
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import * as React from 'react';
|
||||
import { DIAMOND_FILLED, DIAMOND_OPEN } from '../../constants/figures.js';
|
||||
import { NO_CONTENT_MESSAGE } from '../../constants/messages.js';
|
||||
import { Box, Text } from '../../ink.js';
|
||||
import { extractTag } from '../../utils/messages.js';
|
||||
import { Markdown } from '../Markdown.js';
|
||||
import { MessageResponse } from '../MessageResponse.js';
|
||||
import * as React from 'react'
|
||||
import { DIAMOND_FILLED, DIAMOND_OPEN } from '../../constants/figures.js'
|
||||
import { NO_CONTENT_MESSAGE } from '../../constants/messages.js'
|
||||
import { Box, Text } from '../../ink.js'
|
||||
import { extractTag } from '../../utils/messages.js'
|
||||
import { Markdown } from '../Markdown.js'
|
||||
import { MessageResponse } from '../MessageResponse.js'
|
||||
|
||||
type Props = {
|
||||
content: string;
|
||||
};
|
||||
export function UserLocalCommandOutputMessage(t0) {
|
||||
const $ = _c(4);
|
||||
const {
|
||||
content
|
||||
} = t0;
|
||||
let lines;
|
||||
let t1;
|
||||
if ($[0] !== content) {
|
||||
t1 = Symbol.for("react.early_return_sentinel");
|
||||
bb0: {
|
||||
const stdout = extractTag(content, "local-command-stdout");
|
||||
const stderr = extractTag(content, "local-command-stderr");
|
||||
if (!stdout && !stderr) {
|
||||
let t2;
|
||||
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t2 = <MessageResponse><Text dimColor={true}>{NO_CONTENT_MESSAGE}</Text></MessageResponse>;
|
||||
$[3] = t2;
|
||||
} else {
|
||||
t2 = $[3];
|
||||
}
|
||||
t1 = t2;
|
||||
break bb0;
|
||||
}
|
||||
lines = [];
|
||||
if (stdout?.trim()) {
|
||||
lines.push(<IndentedContent key="stdout">{stdout.trim()}</IndentedContent>);
|
||||
}
|
||||
if (stderr?.trim()) {
|
||||
lines.push(<IndentedContent key="stderr">{stderr.trim()}</IndentedContent>);
|
||||
}
|
||||
}
|
||||
$[0] = content;
|
||||
$[1] = lines;
|
||||
$[2] = t1;
|
||||
} else {
|
||||
lines = $[1];
|
||||
t1 = $[2];
|
||||
}
|
||||
if (t1 !== Symbol.for("react.early_return_sentinel")) {
|
||||
return t1;
|
||||
}
|
||||
return lines;
|
||||
content: string
|
||||
}
|
||||
function IndentedContent(t0) {
|
||||
const $ = _c(5);
|
||||
const {
|
||||
children
|
||||
} = t0;
|
||||
if (children.startsWith(`${DIAMOND_OPEN} `) || children.startsWith(`${DIAMOND_FILLED} `)) {
|
||||
let t1;
|
||||
if ($[0] !== children) {
|
||||
t1 = <CloudLaunchContent>{children}</CloudLaunchContent>;
|
||||
$[0] = children;
|
||||
$[1] = t1;
|
||||
} else {
|
||||
t1 = $[1];
|
||||
}
|
||||
return t1;
|
||||
|
||||
export function UserLocalCommandOutputMessage({
|
||||
content,
|
||||
}: Props): React.ReactNode {
|
||||
const stdout = extractTag(content, 'local-command-stdout')
|
||||
const stderr = extractTag(content, 'local-command-stderr')
|
||||
if (!stdout && !stderr) {
|
||||
return (
|
||||
<MessageResponse>
|
||||
<Text dimColor>{NO_CONTENT_MESSAGE}</Text>
|
||||
</MessageResponse>
|
||||
)
|
||||
}
|
||||
let t1;
|
||||
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t1 = <Text dimColor={true}>{" \u23BF "}</Text>;
|
||||
$[2] = t1;
|
||||
} else {
|
||||
t1 = $[2];
|
||||
|
||||
const lines: React.ReactNode[] = []
|
||||
if (stdout?.trim()) {
|
||||
lines.push(<IndentedContent key="stdout">{stdout.trim()}</IndentedContent>)
|
||||
}
|
||||
let t2;
|
||||
if ($[3] !== children) {
|
||||
t2 = <Box flexDirection="row">{t1}<Box flexDirection="column" flexGrow={1}><Markdown>{children}</Markdown></Box></Box>;
|
||||
$[3] = children;
|
||||
$[4] = t2;
|
||||
} else {
|
||||
t2 = $[4];
|
||||
if (stderr?.trim()) {
|
||||
lines.push(<IndentedContent key="stderr">{stderr.trim()}</IndentedContent>)
|
||||
}
|
||||
return t2;
|
||||
return lines
|
||||
}
|
||||
function CloudLaunchContent(t0) {
|
||||
const $ = _c(19);
|
||||
const {
|
||||
children
|
||||
} = t0;
|
||||
const diamond = children[0];
|
||||
let label;
|
||||
let rest;
|
||||
let t1;
|
||||
if ($[0] !== children) {
|
||||
const nl = children.indexOf("\n");
|
||||
const header = nl === -1 ? children.slice(2) : children.slice(2, nl);
|
||||
rest = nl === -1 ? "" : children.slice(nl + 1).trim();
|
||||
const sep = header.indexOf(" \xB7 ");
|
||||
label = sep === -1 ? header : header.slice(0, sep);
|
||||
t1 = sep === -1 ? "" : header.slice(sep);
|
||||
$[0] = children;
|
||||
$[1] = label;
|
||||
$[2] = rest;
|
||||
$[3] = t1;
|
||||
} else {
|
||||
label = $[1];
|
||||
rest = $[2];
|
||||
t1 = $[3];
|
||||
|
||||
function IndentedContent({ children }: { children: string }): React.ReactNode {
|
||||
if (
|
||||
children.startsWith(`${DIAMOND_OPEN} `) ||
|
||||
children.startsWith(`${DIAMOND_FILLED} `)
|
||||
) {
|
||||
return <CloudLaunchContent>{children}</CloudLaunchContent>
|
||||
}
|
||||
const suffix = t1;
|
||||
let t2;
|
||||
if ($[4] !== diamond) {
|
||||
t2 = <Text color="background">{diamond} </Text>;
|
||||
$[4] = diamond;
|
||||
$[5] = t2;
|
||||
} else {
|
||||
t2 = $[5];
|
||||
}
|
||||
let t3;
|
||||
if ($[6] !== label) {
|
||||
t3 = <Text bold={true}>{label}</Text>;
|
||||
$[6] = label;
|
||||
$[7] = t3;
|
||||
} else {
|
||||
t3 = $[7];
|
||||
}
|
||||
let t4;
|
||||
if ($[8] !== suffix) {
|
||||
t4 = suffix && <Text dimColor={true}>{suffix}</Text>;
|
||||
$[8] = suffix;
|
||||
$[9] = t4;
|
||||
} else {
|
||||
t4 = $[9];
|
||||
}
|
||||
let t5;
|
||||
if ($[10] !== t2 || $[11] !== t3 || $[12] !== t4) {
|
||||
t5 = <Text>{t2}{t3}{t4}</Text>;
|
||||
$[10] = t2;
|
||||
$[11] = t3;
|
||||
$[12] = t4;
|
||||
$[13] = t5;
|
||||
} else {
|
||||
t5 = $[13];
|
||||
}
|
||||
let t6;
|
||||
if ($[14] !== rest) {
|
||||
t6 = rest && <Box flexDirection="row"><Text dimColor={true}>{" \u23BF "}</Text><Text dimColor={true}>{rest}</Text></Box>;
|
||||
$[14] = rest;
|
||||
$[15] = t6;
|
||||
} else {
|
||||
t6 = $[15];
|
||||
}
|
||||
let t7;
|
||||
if ($[16] !== t5 || $[17] !== t6) {
|
||||
t7 = <Box flexDirection="column">{t5}{t6}</Box>;
|
||||
$[16] = t5;
|
||||
$[17] = t6;
|
||||
$[18] = t7;
|
||||
} else {
|
||||
t7 = $[18];
|
||||
}
|
||||
return t7;
|
||||
return (
|
||||
<Box flexDirection="row">
|
||||
<Text dimColor>{' ⎿ '}</Text>
|
||||
<Box flexDirection="column" flexGrow={1}>
|
||||
<Markdown>{children}</Markdown>
|
||||
</Box>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
function CloudLaunchContent({
|
||||
children,
|
||||
}: {
|
||||
children: string
|
||||
}): React.ReactNode {
|
||||
const diamond = children[0]!
|
||||
const nl = children.indexOf('\n')
|
||||
const header = nl === -1 ? children.slice(2) : children.slice(2, nl)
|
||||
const rest = nl === -1 ? '' : children.slice(nl + 1).trim()
|
||||
const sep = header.indexOf(' · ')
|
||||
const label = sep === -1 ? header : header.slice(0, sep)
|
||||
const suffix = sep === -1 ? '' : header.slice(sep)
|
||||
return (
|
||||
<Box flexDirection="column">
|
||||
<Text>
|
||||
<Text color="background">{diamond} </Text>
|
||||
<Text bold>{label}</Text>
|
||||
{suffix && <Text dimColor>{suffix}</Text>}
|
||||
</Text>
|
||||
{rest && (
|
||||
<Box flexDirection="row">
|
||||
<Text dimColor>{' ⎿ '}</Text>
|
||||
<Text dimColor>{rest}</Text>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user