mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 05:45:51 +00:00
feat: 问就是封包
This commit is contained in:
@@ -235,7 +235,7 @@ export function ConsoleOAuthFlow({
|
||||
await installOAuthTokens(result);
|
||||
const orgResult = await validateForceLoginOrg();
|
||||
if (!orgResult.valid) {
|
||||
throw new Error(orgResult.message);
|
||||
throw new Error((orgResult as { valid: false; message: string }).message);
|
||||
}
|
||||
setOAuthStatus({
|
||||
state: 'success'
|
||||
|
||||
@@ -59,8 +59,11 @@ type FeedbackData = {
|
||||
description: string;
|
||||
platform: string;
|
||||
gitRepo: boolean;
|
||||
terminal: string;
|
||||
version: string | null;
|
||||
transcript: Message[];
|
||||
errors: unknown;
|
||||
lastApiRequest: unknown;
|
||||
subagentTranscripts?: {
|
||||
[agentId: string]: Message[];
|
||||
};
|
||||
@@ -203,8 +206,8 @@ export function Feedback({
|
||||
...diskTranscripts,
|
||||
...teammateTranscripts
|
||||
};
|
||||
const reportData = {
|
||||
latestAssistantMessageId: lastAssistantMessageId,
|
||||
const reportData: FeedbackData = {
|
||||
latestAssistantMessageId: lastAssistantMessageId as string | null,
|
||||
message_count: messages.length,
|
||||
datetime: new Date().toISOString(),
|
||||
description,
|
||||
|
||||
@@ -50,7 +50,7 @@ export function FileEditToolDiff(props) {
|
||||
}
|
||||
return t2;
|
||||
}
|
||||
function DiffBody(t0) {
|
||||
function DiffBody(t0: { promise: Promise<DiffData>; file_path: string }) {
|
||||
const $ = _c(6);
|
||||
const {
|
||||
promise,
|
||||
|
||||
@@ -134,7 +134,7 @@ function Highlighted(t0) {
|
||||
} else {
|
||||
t1 = $[0];
|
||||
}
|
||||
const hl = use(t1);
|
||||
const hl = use(t1) as NonNullable<Awaited<ReturnType<typeof getCliHighlightPromise>>> | null;
|
||||
let t2;
|
||||
if ($[1] !== codeWithSpaces || $[2] !== hl || $[3] !== language) {
|
||||
bb0: {
|
||||
|
||||
@@ -129,7 +129,7 @@ function MarkdownBody(t0) {
|
||||
} = t0;
|
||||
const [theme] = useTheme();
|
||||
configureMarked();
|
||||
let elements;
|
||||
let elements: React.ReactNode[];
|
||||
if ($[0] !== children || $[1] !== dimColor || $[2] !== highlight || $[3] !== theme) {
|
||||
const tokens = cachedLexer(stripPromptXMLTags(children));
|
||||
elements = [];
|
||||
@@ -156,7 +156,7 @@ function MarkdownBody(t0) {
|
||||
$[3] = theme;
|
||||
$[4] = elements;
|
||||
} else {
|
||||
elements = $[4];
|
||||
elements = $[4] as React.ReactNode[];
|
||||
}
|
||||
const elements_0 = elements;
|
||||
let t1;
|
||||
|
||||
@@ -606,7 +606,7 @@ export function areMessagePropsEqual(prev: Props, next: Props): boolean {
|
||||
// Only re-render on lastThinkingBlockId change if this message actually
|
||||
// has thinking content — otherwise every message in scrollback re-renders
|
||||
// whenever streaming thinking starts/stops (CC-941).
|
||||
if (prev.lastThinkingBlockId !== next.lastThinkingBlockId && hasThinkingContent(next.message)) {
|
||||
if (prev.lastThinkingBlockId !== next.lastThinkingBlockId && hasThinkingContent(next.message as any)) {
|
||||
return false;
|
||||
}
|
||||
// Verbose toggle changes thinking block visibility/expansion
|
||||
|
||||
@@ -334,7 +334,7 @@ export function MessageSelector({
|
||||
<Box flexDirection="column" paddingLeft={1} borderStyle="single" borderRight={false} borderTop={false} borderBottom={false} borderLeft={true} borderLeftDimColor>
|
||||
<UserMessageOption userMessage={messageToRestore} color="text" isCurrent={false} />
|
||||
<Text dimColor>
|
||||
({formatRelativeTimeAgo(new Date(messageToRestore.timestamp))})
|
||||
({formatRelativeTimeAgo(new Date(messageToRestore.timestamp as number))})
|
||||
</Text>
|
||||
</Box>
|
||||
<RestoreOptionDescription selectedRestoreOption={selectedRestoreOption} canRestoreCode={!!canRestoreCode_0} diffStatsForRestore={diffStatsForRestore} />
|
||||
|
||||
@@ -95,7 +95,8 @@ export function Settings(t0) {
|
||||
}
|
||||
let t7;
|
||||
if ($[13] !== contentHeight) {
|
||||
t7 = false ? [<Tab key="gates" title="Gates"><Gates onOwnsEscChange={setGatesOwnsEsc} contentHeight={contentHeight} /></Tab>] : [];
|
||||
const GatesComponent = Gates as any;
|
||||
t7 = false ? [<Tab key="gates" title="Gates"><GatesComponent onOwnsEscChange={setGatesOwnsEsc} contentHeight={contentHeight} /></Tab>] : [];
|
||||
$[13] = contentHeight;
|
||||
$[14] = t7;
|
||||
} else {
|
||||
|
||||
@@ -206,7 +206,7 @@ function Diagnostics(t0) {
|
||||
const {
|
||||
promise
|
||||
} = t0;
|
||||
const diagnostics = use(promise);
|
||||
const diagnostics = use(promise) as any[];
|
||||
if (diagnostics.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -272,10 +272,10 @@ export function GlimmerMessage(t0) {
|
||||
$[57] = shim;
|
||||
$[58] = colPos;
|
||||
} else {
|
||||
before = $[55];
|
||||
after = $[56];
|
||||
shim = $[57];
|
||||
colPos = $[58];
|
||||
before = $[55] as string;
|
||||
after = $[56] as string;
|
||||
shim = $[57] as string;
|
||||
colPos = $[58] as number;
|
||||
}
|
||||
let t3;
|
||||
if ($[59] !== before || $[60] !== messageColor) {
|
||||
|
||||
@@ -31,7 +31,7 @@ export function StatusNotices(t0) {
|
||||
const context = {
|
||||
config: t1,
|
||||
agentDefinitions,
|
||||
memoryFiles: use(t2)
|
||||
memoryFiles: use(t2) as any
|
||||
};
|
||||
const activeNotices = getActiveNotices(context);
|
||||
if (activeNotices.length === 0) {
|
||||
|
||||
@@ -45,9 +45,9 @@ export default function TextInput(props: Props): React.ReactNode {
|
||||
// biome-ignore lint/correctness/useHookAtTopLevel: feature() is a compile-time constant
|
||||
useVoiceState(s => s.voiceState) : 'idle' as const;
|
||||
const isVoiceRecording = voiceState === 'recording';
|
||||
const audioLevels = feature('VOICE_MODE') ?
|
||||
const audioLevels = (feature('VOICE_MODE') ?
|
||||
// biome-ignore lint/correctness/useHookAtTopLevel: feature() is a compile-time constant
|
||||
useVoiceState(s_0 => s_0.voiceAudioLevels) : [];
|
||||
useVoiceState(s_0 => s_0.voiceAudioLevels) : []) as number[];
|
||||
const smoothedRef = useRef<number[]>(new Array(CURSOR_WAVEFORM_WIDTH).fill(0));
|
||||
const needsAnimation = isVoiceRecording && !reducedMotion;
|
||||
const [animRef, animTime] = feature('VOICE_MODE') ?
|
||||
|
||||
@@ -72,7 +72,7 @@ export function ThemePicker(t0) {
|
||||
} = usePreviewTheme();
|
||||
const syntaxHighlightingDisabled = useAppState(_temp) ?? false;
|
||||
const setAppState = useSetAppState();
|
||||
useRegisterKeybindingContext("ThemePicker");
|
||||
useRegisterKeybindingContext("ThemePicker", undefined);
|
||||
const syntaxToggleShortcut = useShortcutDisplay("theme:toggleSyntaxHighlighting", "ThemePicker", "ctrl+t");
|
||||
let t8;
|
||||
if ($[3] !== setAppState || $[4] !== syntaxHighlightingDisabled) {
|
||||
|
||||
@@ -16,7 +16,7 @@ const HEADROOM = 3;
|
||||
import { logForDebugging } from '../utils/debug.js';
|
||||
import { sleep } from '../utils/sleep.js';
|
||||
import { renderableSearchText } from '../utils/transcriptSearch.js';
|
||||
import { isNavigableMessage, type MessageActionsNav, type MessageActionsState, type NavigableMessage, stripSystemReminders, toolCallOf } from './messageActions.js';
|
||||
import { isNavigableMessage, type MessageActionsNav, type MessageActionsState, type NavigableMessage, type NavigableType, stripSystemReminders, toolCallOf } from './messageActions.js';
|
||||
|
||||
// Fallback extractor: lower + cache here for callers without the
|
||||
// Messages.tsx tool-lookup path (tests, static contexts). Messages.tsx
|
||||
@@ -151,7 +151,7 @@ function computeStickyPromptText(msg: RenderableMessage): string | null {
|
||||
raw = block.text;
|
||||
} else if (msg.type === 'attachment' && msg.attachment.type === 'queued_command' && msg.attachment.commandMode !== 'task-notification' && !msg.attachment.isMeta) {
|
||||
const p = msg.attachment.prompt;
|
||||
raw = typeof p === 'string' ? p : p.flatMap(b => b.type === 'text' ? [b.text] : []).join('\n');
|
||||
raw = typeof p === 'string' ? p : (p as any[]).flatMap(b => b.type === 'text' ? [b.text] : []).join('\n');
|
||||
}
|
||||
if (raw === null) return null;
|
||||
const t = stripSystemReminders(raw);
|
||||
@@ -345,7 +345,7 @@ export function VirtualMessageList({
|
||||
useImperativeHandle(cursorNavRef, (): MessageActionsNav => {
|
||||
const select = (m: NavigableMessage) => setCursor?.({
|
||||
uuid: m.uuid,
|
||||
msgType: m.type,
|
||||
msgType: m.type as NavigableType,
|
||||
expanded: false,
|
||||
toolName: toolCallOf(m)?.name
|
||||
});
|
||||
|
||||
@@ -251,7 +251,7 @@ export function ToolSelector(t0) {
|
||||
let t9;
|
||||
if ($[22] !== selectedSet) {
|
||||
t9 = bucketTools => {
|
||||
const selected = count(bucketTools, t_5 => selectedSet.has(t_5.name));
|
||||
const selected = count(bucketTools, (t_5: any) => selectedSet.has(t_5.name));
|
||||
const needsSelection = selected < bucketTools.length;
|
||||
return () => {
|
||||
const toolNames_1 = bucketTools.map(_temp4);
|
||||
@@ -321,7 +321,7 @@ export function ToolSelector(t0) {
|
||||
if (bucketTools_0.length === 0) {
|
||||
return;
|
||||
}
|
||||
const selected_0 = count(bucketTools_0, t_8 => selectedSet.has(t_8.name));
|
||||
const selected_0 = count(bucketTools_0, (t_8: any) => selectedSet.has(t_8.name));
|
||||
const isFullySelected = selected_0 === bucketTools_0.length;
|
||||
navigableItems.push({
|
||||
id,
|
||||
|
||||
@@ -47,7 +47,7 @@ export function MemoryFileSelector(t0) {
|
||||
onSelect,
|
||||
onCancel
|
||||
} = t0;
|
||||
const existingMemoryFiles = use(getMemoryFiles());
|
||||
const existingMemoryFiles = use(getMemoryFiles()) as MemoryFileInfo[];
|
||||
const userMemoryPath = join(getClaudeConfigHomeDir(), "CLAUDE.md");
|
||||
const projectMemoryPath = join(getOriginalCwd(), "CLAUDE.md");
|
||||
const hasUserMemory = existingMemoryFiles.some(f => f.path === userMemoryPath);
|
||||
|
||||
@@ -337,7 +337,7 @@ function renderToolUseProgressMessage(tool: Tool, tools: Tools, lookups: ReturnT
|
||||
columns: number;
|
||||
rows: number;
|
||||
}): React.ReactNode {
|
||||
const toolProgressMessages = progressMessagesForMessage.filter((msg): msg is ProgressMessage<ToolProgressData> => msg.data.type !== 'hook_progress');
|
||||
const toolProgressMessages = progressMessagesForMessage.filter((msg): msg is ProgressMessage<ToolProgressData> => (msg.data as { type?: string }).type !== 'hook_progress');
|
||||
try {
|
||||
const toolMessages = tool.renderToolUseProgressMessage?.(toolProgressMessages, {
|
||||
tools,
|
||||
|
||||
@@ -40,8 +40,6 @@ const NULL_RENDERING_TYPES = [
|
||||
'auto_mode',
|
||||
'auto_mode_exit',
|
||||
'output_token_usage',
|
||||
'pen_mode_enter',
|
||||
'pen_mode_exit',
|
||||
'verify_plan_reminder',
|
||||
'current_session_memory',
|
||||
'compaction_reminder',
|
||||
@@ -65,6 +63,6 @@ export function isNullRenderingAttachment(
|
||||
): boolean {
|
||||
return (
|
||||
msg.type === 'attachment' &&
|
||||
NULL_RENDERING_ATTACHMENT_TYPES.has(msg.attachment.type)
|
||||
NULL_RENDERING_ATTACHMENT_TYPES.has(msg.attachment.type as Attachment['type'])
|
||||
)
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ function AskUserQuestionPermissionRequestBody(t0) {
|
||||
$[10] = theme;
|
||||
$[11] = maxHeight;
|
||||
} else {
|
||||
maxHeight = $[11];
|
||||
maxHeight = $[11] as number;
|
||||
}
|
||||
const t3 = Math.min(Math.max(maxHeight, MIN_CONTENT_HEIGHT), maxAllowedHeight);
|
||||
const t4 = Math.max(maxWidth, MIN_CONTENT_WIDTH);
|
||||
@@ -177,7 +177,7 @@ function AskUserQuestionPermissionRequestBody(t0) {
|
||||
const pasteId = nextPasteIdRef.current;
|
||||
const newContent = {
|
||||
id: pasteId,
|
||||
type: "image",
|
||||
type: "image" as const,
|
||||
content: base64Image,
|
||||
mediaType: mediaType || "image/png",
|
||||
filename: filename || "Pasted image",
|
||||
|
||||
@@ -151,7 +151,7 @@ export function ExitPlanModePermissionRequest({
|
||||
const options = useMemo(() => buildPlanApprovalOptions({
|
||||
showClearContext,
|
||||
showUltraplan,
|
||||
usedPercent: showClearContext ? getContextUsedPercent(usage, mode) : null,
|
||||
usedPercent: showClearContext ? getContextUsedPercent(usage as any, mode) : null,
|
||||
isAutoModeAvailable,
|
||||
isBypassPermissionsModeAvailable,
|
||||
onFeedbackChange: setPlanFeedback
|
||||
|
||||
@@ -62,7 +62,7 @@ function PermissionDecisionInfoItem(t0) {
|
||||
return <Box flexDirection="column">{Array.from(decisionReason.reasons.entries()).map(t2 => {
|
||||
const [subcommand, result] = t2 as [string, { behavior: string; decisionReason?: { type: string }; suggestions?: unknown }];
|
||||
const icon = result.behavior === "allow" ? color("success", theme)(figures.tick) : color("error", theme)(figures.cross);
|
||||
return <Box flexDirection="column" key={subcommand}><Text>{icon} {subcommand}</Text>{result.decisionReason !== undefined && result.decisionReason.type !== "subcommandResults" && <Text><Text dimColor={true}>{" "}⎿{" "}</Text><Ansi>{decisionReasonDisplayString(result.decisionReason)}</Ansi></Text>}{result.behavior === "ask" && <SuggestedRules suggestions={result.suggestions} />}</Box>;
|
||||
return <Box flexDirection="column" key={subcommand}><Text>{icon} {subcommand}</Text>{result.decisionReason !== undefined && result.decisionReason.type !== "subcommandResults" && <Text><Text dimColor={true}>{" "}⎿{" "}</Text><Ansi>{decisionReasonDisplayString(result.decisionReason as any)}</Ansi></Text>}{result.behavior === "ask" && <SuggestedRules suggestions={result.suggestions} />}</Box>;
|
||||
})}</Box>;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -102,7 +102,7 @@ function SedEditPermissionRequestInner(t0) {
|
||||
const {
|
||||
oldContent,
|
||||
fileExists
|
||||
} = use(contentPromise);
|
||||
} = use(contentPromise) as any;
|
||||
let t1;
|
||||
if ($[4] !== oldContent || $[5] !== sedInfo) {
|
||||
t1 = applySedSubstitution(oldContent, sedInfo);
|
||||
|
||||
@@ -310,7 +310,7 @@ function ShellOutputContent(t0) {
|
||||
const {
|
||||
content,
|
||||
bytesTotal
|
||||
} = use(outputPromise);
|
||||
} = use(outputPromise) as any;
|
||||
if (!content) {
|
||||
let t1;
|
||||
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
|
||||
Reference in New Issue
Block a user