mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-19 06:45:50 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
import React from 'react'
|
||||
import { MessageResponse } from 'src/components/MessageResponse.js'
|
||||
import { Text } from '@anthropic/ink'
|
||||
import { countCharInString } from 'src/utils/stringUtils.js'
|
||||
import type { Input, Output } from './RemoteTriggerTool.js'
|
||||
import React from 'react';
|
||||
import { MessageResponse } from 'src/components/MessageResponse.js';
|
||||
import { Text } from '@anthropic/ink';
|
||||
import { countCharInString } from 'src/utils/stringUtils.js';
|
||||
import type { Input, Output } from './RemoteTriggerTool.js';
|
||||
|
||||
export function renderToolUseMessage(input: Partial<Input>): React.ReactNode {
|
||||
return `${input.action ?? ''}${input.trigger_id ? ` ${input.trigger_id}` : ''}`
|
||||
return `${input.action ?? ''}${input.trigger_id ? ` ${input.trigger_id}` : ''}`;
|
||||
}
|
||||
|
||||
export function renderToolResultMessage(output: Output): React.ReactNode {
|
||||
const lines = countCharInString(output.json, '\n') + 1
|
||||
const lines = countCharInString(output.json, '\n') + 1;
|
||||
return (
|
||||
<MessageResponse>
|
||||
<Text>
|
||||
HTTP {output.status} <Text dimColor>({lines} lines)</Text>
|
||||
</Text>
|
||||
</MessageResponse>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -42,9 +42,7 @@ mock.module('src/constants/oauth.js', () => {
|
||||
})
|
||||
|
||||
mock.module('src/utils/remoteTriggerAudit.js', () => ({
|
||||
appendRemoteTriggerAuditRecord: async (
|
||||
record: Record<string, unknown>,
|
||||
) => {
|
||||
appendRemoteTriggerAuditRecord: async (record: Record<string, unknown>) => {
|
||||
const fullRecord = {
|
||||
auditId: `audit-${auditRecords.length + 1}`,
|
||||
createdAt: Date.now(),
|
||||
@@ -87,10 +85,9 @@ describe('RemoteTriggerTool audit', () => {
|
||||
const { RemoteTriggerTool } = await import('../RemoteTriggerTool')
|
||||
|
||||
await expect(
|
||||
RemoteTriggerTool.call(
|
||||
{ action: 'run' },
|
||||
{ abortController: new AbortController() } as any,
|
||||
),
|
||||
RemoteTriggerTool.call({ action: 'run' }, {
|
||||
abortController: new AbortController(),
|
||||
} as any),
|
||||
).rejects.toThrow('run requires trigger_id')
|
||||
|
||||
expect(auditRecords).toHaveLength(1)
|
||||
|
||||
Reference in New Issue
Block a user