mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-22 16:25:51 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
import React from 'react'
|
||||
import { MessageResponse } from 'src/components/MessageResponse.js'
|
||||
import { Text, stringWidth } from '@anthropic/ink'
|
||||
import { truncateToWidthNoEllipsis } from 'src/utils/format.js'
|
||||
import type { Output } from './TaskStopTool.js'
|
||||
import React from 'react';
|
||||
import { MessageResponse } from 'src/components/MessageResponse.js';
|
||||
import { Text, stringWidth } from '@anthropic/ink';
|
||||
import { truncateToWidthNoEllipsis } from 'src/utils/format.js';
|
||||
import type { Output } from './TaskStopTool.js';
|
||||
|
||||
export function renderToolUseMessage(): React.ReactNode {
|
||||
return ''
|
||||
return '';
|
||||
}
|
||||
|
||||
const MAX_COMMAND_DISPLAY_LINES = 2
|
||||
const MAX_COMMAND_DISPLAY_CHARS = 160
|
||||
const MAX_COMMAND_DISPLAY_LINES = 2;
|
||||
const MAX_COMMAND_DISPLAY_CHARS = 160;
|
||||
|
||||
function truncateCommand(command: string): string {
|
||||
const lines = command.split('\n')
|
||||
let truncated = command
|
||||
const lines = command.split('\n');
|
||||
let truncated = command;
|
||||
|
||||
if (lines.length > MAX_COMMAND_DISPLAY_LINES) {
|
||||
truncated = lines.slice(0, MAX_COMMAND_DISPLAY_LINES).join('\n')
|
||||
truncated = lines.slice(0, MAX_COMMAND_DISPLAY_LINES).join('\n');
|
||||
}
|
||||
|
||||
if (stringWidth(truncated) > MAX_COMMAND_DISPLAY_CHARS) {
|
||||
truncated = truncateToWidthNoEllipsis(truncated, MAX_COMMAND_DISPLAY_CHARS)
|
||||
truncated = truncateToWidthNoEllipsis(truncated, MAX_COMMAND_DISPLAY_CHARS);
|
||||
}
|
||||
|
||||
return truncated.trim()
|
||||
return truncated.trim();
|
||||
}
|
||||
|
||||
export function renderToolResultMessage(
|
||||
@@ -32,12 +32,12 @@ export function renderToolResultMessage(
|
||||
{ verbose }: { verbose: boolean },
|
||||
): React.ReactNode {
|
||||
if (process.env.USER_TYPE === 'ant') {
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
const rawCommand = output.command ?? ''
|
||||
const command = verbose ? rawCommand : truncateCommand(rawCommand)
|
||||
const suffix = command !== rawCommand ? '… · stopped' : ' · stopped'
|
||||
const rawCommand = output.command ?? '';
|
||||
const command = verbose ? rawCommand : truncateCommand(rawCommand);
|
||||
const suffix = command !== rawCommand ? '… · stopped' : ' · stopped';
|
||||
|
||||
return (
|
||||
<MessageResponse>
|
||||
@@ -46,5 +46,5 @@ export function renderToolResultMessage(
|
||||
{suffix}
|
||||
</Text>
|
||||
</MessageResponse>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user