fix: 修复类型问题

This commit is contained in:
claude-code-best
2026-04-10 17:34:01 +08:00
parent e70319e8f5
commit ff03fe7fcb
18 changed files with 70 additions and 56 deletions

View File

@@ -81,7 +81,7 @@ function BuiltinStatusLineInner({
const tokenDisplay = `${formatTokens(usedTokens)}/${formatTokens(contextWindowSize)}`;
return (
<Box wrap="truncate">
<Box>
{/* Model name */}
<Text>{shortModel}</Text>

View File

@@ -163,7 +163,7 @@ const SuggestionItemRow = memo(function SuggestionItemRow({
{paddedDisplayText}
</Text>
{tagText ? (
<Text color={item.tag === 'local' ? ('yellow' as const) : undefined} dimColor={item.tag !== 'local'}>
<Text color={item.tag === 'local' ? 'ansi:yellow' : undefined} dimColor={item.tag !== 'local'}>
{tagText}
</Text>
) : null}

View File

@@ -9,6 +9,7 @@ import {
type PromptCommand,
} from '../../commands.js'
import { Box, Text } from '@anthropic/ink'
import type { Theme } from '@anthropic/ink'
import {
estimateSkillFrontmatterTokens,
getSkillsPath,
@@ -140,7 +141,7 @@ export function SkillsMenu({ onExit, commands }: Props): React.ReactNode {
}
const getScopeTag = (
source: SkillSource,
source: string,
): { label: string; color: string } | undefined => {
switch (source) {
case 'projectSettings':
@@ -169,6 +170,7 @@ export function SkillsMenu({ onExit, commands }: Props): React.ReactNode {
<Text>{getCommandName(skill)}</Text>
{scopeTag && (
<Text color={scopeTag.color as keyof Theme}> [{scopeTag.label}]</Text>
)}
<Text dimColor>
{pluginName ? ` · ${pluginName}` : ''} · {tokenDisplay} description

View File

@@ -29,6 +29,7 @@ import {
formatReviewStageCounts,
RemoteSessionProgress,
} from './RemoteSessionProgress.js'
import { AssistantMessage } from 'src/types/message.js'
type Props = {
session: DeepImmutable<RemoteAgentTaskState>
@@ -122,7 +123,7 @@ function UltraplanSessionDetail({
let lastBlock: { name: string; input: unknown } | null = null
for (const msg of session.log) {
if (msg.type !== 'assistant') continue
const content = msg.message?.content ?? []
const content = (msg.message as { content?: unknown[] })?.content ?? []
for (const block of content as Array<{type: string; name: string; input: unknown}>) {
if (block.type !== 'tool_use') continue
calls++
@@ -612,7 +613,7 @@ export function RemoteSessionDetailDialog({
{lastMessages.map((msg, i) => (
<Message
key={i}
message={msg}
message={msg as AssistantMessage}
lookups={EMPTY_LOOKUPS}
addMargin={i > 0}
tools={toolUseContext.options.tools}