mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-22 00:05:51 +00:00
chore: 移除多处仅内部使用的 export 关键字
下列符号均仅在本文件内被引用,export 关键字冗余;保留符号本体不动: - internalLogging.ts: getContainerId(line 88 内部调用) - api/errors.ts: isMediaSizeError(line 151 内部调用) - api/withRetry.ts: parseMaxTokensContextOverflowError(line 389/724 内部调用) - statsCache.ts: STATS_CACHE_VERSION(7 处内部使用) - startupProfiler.ts: logStartupPerf(line 128 内部调用) - bashCommandHelpers.ts: CommandIdentityCheckers(3 处内部参数类型) Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>
This commit is contained in:
@@ -15,7 +15,7 @@ import { createPermissionRequestMessage } from 'src/utils/permissions/permission
|
|||||||
import { BashTool } from './BashTool.js'
|
import { BashTool } from './BashTool.js'
|
||||||
import { bashCommandIsSafeAsync_DEPRECATED } from './bashSecurity.js'
|
import { bashCommandIsSafeAsync_DEPRECATED } from './bashSecurity.js'
|
||||||
|
|
||||||
export type CommandIdentityCheckers = {
|
type CommandIdentityCheckers = {
|
||||||
isNormalizedCdCommand: (command: string) => boolean
|
isNormalizedCdCommand: (command: string) => boolean
|
||||||
isNormalizedGitCommand: (command: string) => boolean
|
isNormalizedGitCommand: (command: string) => boolean
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ export function getPromptTooLongTokenGap(
|
|||||||
* wording drift causes graceful degradation (errorDetails stays undefined,
|
* wording drift causes graceful degradation (errorDetails stays undefined,
|
||||||
* caller short-circuits), not a false negative.
|
* caller short-circuits), not a false negative.
|
||||||
*/
|
*/
|
||||||
export function isMediaSizeError(raw: string): boolean {
|
function isMediaSizeError(raw: string): boolean {
|
||||||
return (
|
return (
|
||||||
(raw.includes('image exceeds') && raw.includes('maximum')) ||
|
(raw.includes('image exceeds') && raw.includes('maximum')) ||
|
||||||
(raw.includes('image dimensions exceed') && raw.includes('many-image')) ||
|
(raw.includes('image dimensions exceed') && raw.includes('many-image')) ||
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ export function getRetryDelay(
|
|||||||
return baseDelay + jitter
|
return baseDelay + jitter
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parseMaxTokensContextOverflowError(error: APIError):
|
function parseMaxTokensContextOverflowError(error: APIError):
|
||||||
| {
|
| {
|
||||||
inputTokens: number
|
inputTokens: number
|
||||||
maxTokens: number
|
maxTokens: number
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const getKubernetesNamespace = memoize(async (): Promise<string | null> => {
|
|||||||
/**
|
/**
|
||||||
* Get the OCI container ID from within a running container
|
* Get the OCI container ID from within a running container
|
||||||
*/
|
*/
|
||||||
export const getContainerId = memoize(async (): Promise<string | null> => {
|
const getContainerId = memoize(async (): Promise<string | null> => {
|
||||||
if (process.env.USER_TYPE !== 'ant') {
|
if (process.env.USER_TYPE !== 'ant') {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ export function getStartupPerfLogPath(): string {
|
|||||||
* Log startup performance phases to Statsig.
|
* Log startup performance phases to Statsig.
|
||||||
* Only logs if this session was sampled at startup.
|
* Only logs if this session was sampled at startup.
|
||||||
*/
|
*/
|
||||||
export function logStartupPerf(): void {
|
function logStartupPerf(): void {
|
||||||
// Only log if we were sampled (decision made at module load)
|
// Only log if we were sampled (decision made at module load)
|
||||||
if (!STATSIG_LOGGING_SAMPLED) return
|
if (!STATSIG_LOGGING_SAMPLED) return
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { logError } from './log.js'
|
|||||||
import { jsonParse, jsonStringify } from './slowOperations.js'
|
import { jsonParse, jsonStringify } from './slowOperations.js'
|
||||||
import type { DailyActivity, DailyModelTokens, SessionStats } from './stats.js'
|
import type { DailyActivity, DailyModelTokens, SessionStats } from './stats.js'
|
||||||
|
|
||||||
export const STATS_CACHE_VERSION = 3
|
const STATS_CACHE_VERSION = 3
|
||||||
const MIN_MIGRATABLE_VERSION = 1
|
const MIN_MIGRATABLE_VERSION = 1
|
||||||
const STATS_CACHE_FILENAME = 'stats-cache.json'
|
const STATS_CACHE_FILENAME = 'stats-cache.json'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user