Kode-cli/src/components/messages/AssistantLocalCommandOutputMessage.tsx
CrazyBoyM 6cf566fb40 feat: Add comprehensive GPT-5 support with Responses API integration
- Add GPT-5 model definitions (gpt-5, gpt-5-mini, gpt-5-nano, gpt-5-chat-latest)
- Implement GPT-5 Responses API support with intelligent fallback to Chat Completions
- Add GPT-5 specific parameter handling (max_completion_tokens, temperature=1)
- Support custom tools and freeform function calling capabilities
- Add reasoning effort and verbosity control parameters
- Implement GPT-5 connection testing service
- Add model capability detection and automatic parameter transformation
- Support both official OpenAI and third-party GPT-5 providers
- Add todo list and sticker request UI components
- Improve notebook support with better type definitions
- Enhance debug logging and error handling for GPT-5
- Update model selector with GPT-5 compatibility checks

This commit provides full GPT-5 support while maintaining backward compatibility with existing models.
2025-08-13 01:38:15 +08:00

50 lines
1.1 KiB
TypeScript

import * as React from 'react'
import { extractTag } from '../../utils/messages'
import { getTheme } from '../../utils/theme'
import { Box, Text } from 'ink'
export function AssistantLocalCommandOutputMessage({
content,
}: {
content: string
}): React.ReactNode[] {
const stdout = extractTag(content, 'local-command-stdout')
const stderr = extractTag(content, 'local-command-stderr')
if (!stdout && !stderr) {
return []
}
const theme = getTheme()
let insides = [
format(stdout?.trim(), theme.text),
format(stderr?.trim(), theme.error),
].filter(Boolean)
if (insides.length === 0) {
insides = [
<React.Fragment key="0">
<Text>(No output)</Text>
</React.Fragment>
]
}
return [
<Box key="0" gap={1}>
<Box>
<Text color={theme.secondaryText}>{' '} </Text>
</Box>
{insides.map((_, index) => (
<Box key={index} flexDirection="column">
{_}
</Box>
))}
</Box>,
]
}
function format(content: string | undefined, color: string): React.ReactNode {
if (!content) {
return null
}
return <Text color={color}>{content}</Text>
}