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

@@ -44,6 +44,7 @@ import {
transitionPermissionMode,
} from '../utils/permissions/permissionSetup.js'
import { getLeaderToolUseConfirmQueue } from '../utils/swarm/leaderPermissionBridge.js'
import { ContentBlockParam } from '@anthropic-ai/sdk/resources'
/** How long after a failure before replBridgeEnabled is auto-cleared (stops retries). */
export const BRIDGE_FAILURE_DISMISS_MS = 10_000
@@ -226,7 +227,7 @@ export function useReplBridge(
'../bridge/inboundAttachments.js'
)
const rawContent = fields.content
let sanitized: string | Array<{ type: string; [key: string]: unknown }> = typeof rawContent === 'string' ? rawContent : rawContent as Array<{ type: string; [key: string]: unknown }>
let sanitized: string | Array<{ type: string; [key: string]: unknown }> = typeof rawContent === 'string' ? rawContent : rawContent as unknown as Array<{ type: string; [key: string]: unknown }>
if (feature('KAIROS_GITHUB_WEBHOOKS')) {
/* eslint-disable @typescript-eslint/no-require-imports */
const { sanitizeInboundWebhookContent } =
@@ -236,7 +237,7 @@ export function useReplBridge(
sanitized = sanitizeInboundWebhookContent(sanitized)
}
}
const content = await resolveAndPrepend(msg, sanitized)
const content = await resolveAndPrepend(msg, sanitized as string | ContentBlockParam[])
const preview =
typeof content === 'string'

View File

@@ -98,7 +98,7 @@ export function useSSHSession({
createToolStub(request.tool_name)
const syntheticMessage = createSyntheticAssistantMessage(
request,
request as unknown as Parameters<typeof createSyntheticAssistantMessage>[0],
requestId,
)