mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 13:55:50 +00:00
feat: 完成一大波类型修复, 虽然 any 很多
This commit is contained in:
@@ -18,7 +18,7 @@ import { getClaudeCodeUserAgent } from '../../utils/userAgent.js'
|
||||
|
||||
const bootstrapResponseSchema = lazySchema(() =>
|
||||
z.object({
|
||||
client_data: z.record(z.unknown()).nullish(),
|
||||
client_data: z.record(z.string(), z.unknown()).nullish(),
|
||||
additional_model_options: z
|
||||
.array(
|
||||
z
|
||||
|
||||
@@ -1201,7 +1201,7 @@ async function* queryModel(
|
||||
cachedMCEnabled = featureEnabled && modelSupported
|
||||
const config = getCachedMCConfig()
|
||||
logForDebugging(
|
||||
`Cached MC gate: enabled=${featureEnabled} modelSupported=${modelSupported} model=${options.model} supportedModels=${jsonStringify(config.supportedModels)}`,
|
||||
`Cached MC gate: enabled=${featureEnabled} modelSupported=${modelSupported} model=${options.model} supportedModels=${jsonStringify((config as any).supportedModels)}`,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1704,8 +1704,8 @@ async function* queryModel(
|
||||
enablePromptCaching,
|
||||
options.querySource,
|
||||
useCachedMC,
|
||||
consumedCacheEdits,
|
||||
consumedPinnedEdits,
|
||||
consumedCacheEdits as any,
|
||||
consumedPinnedEdits as any,
|
||||
options.skipCacheWrite,
|
||||
),
|
||||
system,
|
||||
@@ -3151,7 +3151,7 @@ export function addCacheBreakpoints(
|
||||
}
|
||||
insertBlockAfterToolResults(msg.content, dedupedNewEdits)
|
||||
// Pin so this block is re-sent at the same position in future calls
|
||||
pinCacheEdits(i, newCacheEdits)
|
||||
pinCacheEdits(i, newCacheEdits as any)
|
||||
|
||||
logForDebugging(
|
||||
`Added cache_edits block with ${dedupedNewEdits.edits.length} deletion(s) to message[${i}]: ${dedupedNewEdits.edits.map(e => e.cache_reference).join(', ')}`,
|
||||
|
||||
@@ -107,7 +107,7 @@ async function retryWithBackoff<T>(
|
||||
return result.value
|
||||
}
|
||||
|
||||
lastError = result.error || `${operation} failed`
|
||||
lastError = (result as any).error || `${operation} failed`
|
||||
logDebug(
|
||||
`${operation} attempt ${attempt}/${MAX_RETRIES} failed: ${lastError}`,
|
||||
)
|
||||
|
||||
@@ -232,7 +232,7 @@ export async function getSessionLogs(
|
||||
// Update our lastUuid to the last entry's UUID
|
||||
const lastEntry = logs.at(-1)
|
||||
if (lastEntry && 'uuid' in lastEntry && lastEntry.uuid) {
|
||||
lastUuidMap.set(sessionId, lastEntry.uuid)
|
||||
lastUuidMap.set(sessionId, lastEntry.uuid as string)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user