feat: 问就是封包

This commit is contained in:
claude-code-best
2026-03-31 23:32:58 +08:00
parent d7a729ca68
commit dd9cd782a7
67 changed files with 423 additions and 172 deletions

View File

@@ -159,7 +159,7 @@ export async function getAnthropicClient({
? process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION
: getAWSRegion()
const bedrockArgs: ConstructorParameters<typeof AnthropicBedrock>[0] = {
const bedrockArgs: any = {
...ARGS,
awsRegion,
...(isEnvTruthy(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH) && {
@@ -290,7 +290,7 @@ export async function getAnthropicClient({
const vertexArgs: ConstructorParameters<typeof AnthropicVertex>[0] = {
...ARGS,
region: getVertexRegionForModel(model),
googleAuth,
googleAuth: googleAuth as any,
...(isDebugToStdErr() && { logger: createStderrLogger() }),
}
// we have always been lying about the return type - this doesn't support batching or models

View File

@@ -108,7 +108,7 @@ export function getPromptTooLongTokenGap(
return undefined
}
const { actualTokens, limitTokens } = parsePromptTooLongTokenCounts(
msg.errorDetails,
msg.errorDetails as string,
)
if (actualTokens === undefined || limitTokens === undefined) {
return undefined
@@ -148,7 +148,7 @@ export function isMediaSizeErrorMessage(msg: AssistantMessage): boolean {
return (
msg.isApiErrorMessage === true &&
msg.errorDetails !== undefined &&
isMediaSizeError(msg.errorDetails)
isMediaSizeError(msg.errorDetails as string)
)
}
export const CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE = 'Credit balance is too low'