style: 完成所有文件的lint

This commit is contained in:
claude-code-best
2026-05-01 21:39:30 +08:00
parent d136872cc9
commit 6182015005
1333 changed files with 68255 additions and 77882 deletions

View File

@@ -1,5 +1,13 @@
import { describe, expect, test } from 'bun:test'
import type { CoreTool, Tool, Tools, AnyObject, ToolResult, ValidationResult, PermissionResult } from '@claude-code-best/agent-tools'
import type {
CoreTool,
Tool,
Tools,
AnyObject,
ToolResult,
ValidationResult,
PermissionResult,
} from '@claude-code-best/agent-tools'
import type { Tool as HostTool } from '../../../../src/Tool.js'
describe('agent-tools compatibility', () => {
@@ -12,17 +20,29 @@ describe('agent-tools compatibility', () => {
aliases: [],
searchHint: 'test tool',
inputSchema: {} as any,
async call() { return { data: 'ok' } as any },
async description() { return 'test' },
async prompt() { return 'test prompt' },
async call() {
return { data: 'ok' } as any
},
async description() {
return 'test'
},
async prompt() {
return 'test prompt'
},
isConcurrencySafe: () => false,
isEnabled: () => true,
isReadOnly: () => false,
async checkPermissions() { return { behavior: 'allow' as const, updatedInput: {} } },
async checkPermissions() {
return { behavior: 'allow' as const, updatedInput: {} }
},
toAutoClassifierInput: () => '',
userFacingName: () => 'test',
maxResultSizeChars: 100000,
mapToolResultToToolResultBlockParam: () => ({ type: 'tool_result', tool_use_id: '1', content: 'ok' }),
mapToolResultToToolResultBlockParam: () => ({
type: 'tool_result',
tool_use_id: '1',
content: 'ok',
}),
renderToolUseMessage: () => null,
}

View File

@@ -12,8 +12,12 @@ describe('toolMatchesName', () => {
})
test('matches alias', () => {
expect(toolMatchesName({ name: 'bash', aliases: ['shell', 'sh'] }, 'shell')).toBe(true)
expect(toolMatchesName({ name: 'bash', aliases: ['shell', 'sh'] }, 'sh')).toBe(true)
expect(
toolMatchesName({ name: 'bash', aliases: ['shell', 'sh'] }, 'shell'),
).toBe(true)
expect(
toolMatchesName({ name: 'bash', aliases: ['shell', 'sh'] }, 'sh'),
).toBe(true)
})
test('handles empty aliases', () => {

View File

@@ -186,10 +186,7 @@ export interface CoreTool<
// ── Output ──
maxResultSizeChars: number
userFacingName(input: Partial<z.infer<Input>> | undefined): string
mapToolResultToToolResultBlockParam(
content: Output,
toolUseID: string,
): any
mapToolResultToToolResultBlockParam(content: Output, toolUseID: string): any
// ── Optional output helpers ──
isResultTruncated?(output: Output): boolean