feat: 全部类型问题解决

This commit is contained in:
claude-code-best
2026-04-11 10:24:00 +08:00
parent 7088fe3c8b
commit 6a70056910
135 changed files with 671 additions and 503 deletions

3
src/commands/ant-trace/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

3
src/commands/autofix-pr/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

View File

@@ -44,7 +44,7 @@ export function deriveFirstPrompt(
typeof content === 'string'
? content
: content.find(
(block): block is { type: 'text'; text: string } =>
(block: { type: string; text?: string }): block is { type: 'text'; text: string } =>
block.type === 'text',
)?.text
if (!raw) return 'Branched conversation'

3
src/commands/break-cache/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

View File

@@ -154,7 +154,7 @@ function BridgeDisconnectDialog({ onDone }: Props): React.ReactNode {
type: 'utf8',
errorCorrectionLevel: 'L',
small: true,
})
} as Parameters<typeof qrToString>[1])
.then(setQrText)
.catch(() => setQrText(''))
}, [showQR, displayUrl])

View File

@@ -162,7 +162,7 @@ function BtwSideQuestion({
*/
function stripInProgressAssistantMessage(messages: Message[]): Message[] {
const last = messages.at(-1)
if (last?.type === 'assistant' && last.message.stop_reason === null) {
if (last?.type === 'assistant' && last.message!.stop_reason === null) {
return messages.slice(0, -1)
}
return messages

View File

@@ -128,7 +128,7 @@ export async function call(
return React.createElement(CompanionCard, {
companion,
lastReaction,
onDone,
onDone: onDone as unknown as Parameters<typeof CompanionCard>[0]['onDone'],
})
}

3
src/commands/bughunter/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

View File

@@ -1,5 +1,6 @@
import { feature } from 'bun:bundle'
import chalk from 'chalk'
import type { SDKStatus } from '../../entrypoints/agentSdkTypes.js'
import { markPostCompaction } from 'src/bootstrap/state.js'
import { getSystemPrompt } from '../../constants/prompts.js'
import { getSystemContext, getUserContext } from '../../context.js'
@@ -223,7 +224,7 @@ async function compactViaReactive(
context.setStreamMode?.('requesting')
context.setResponseLength?.(() => 0)
context.onCompactProgress?.({ type: 'compact_end' })
context.setSDKStatus?.(null)
context.setSDKStatus?.("" as SDKStatus)
}
}

3
src/commands/ctx_viz/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

3
src/commands/env/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

View File

@@ -55,7 +55,7 @@ export async function call(
AgentTool.call(
input,
context,
context.canUseTool,
context.canUseTool!,
lastAssistantMessage
).catch(error => {
logForDebugging(`Fork subagent async error: ${error}`, { level: 'error' })

3
src/commands/good-claude/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

View File

@@ -1,4 +1,30 @@
// Auto-generated stub — replace with real implementation
export type Workflow = any;
export type State = any;
export type Warning = any;
export type Workflow = 'claude' | 'claude-review' | string
export type Warning = {
title: string
message: string
instructions: string[]
}
export type State = {
step: string
selectedRepoName: string
currentRepo: string
useCurrentRepo: boolean
apiKeyOrOAuthToken: string
useExistingKey: boolean
currentWorkflowInstallStep: number
warnings: Warning[]
secretExists: boolean
secretName: string
useExistingSecret: boolean
workflowExists: boolean
selectedWorkflows: Workflow[]
selectedApiKeyOption: 'existing' | 'new' | 'oauth'
authType: 'api_key' | 'oauth_token'
workflowAction?: string
error?: string
errorReason?: string
errorInstructions?: string[]
[key: string]: unknown
}

3
src/commands/issue/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

3
src/commands/mock-limits/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

3
src/commands/oauth-refresh/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

3
src/commands/onboarding/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

3
src/commands/perf-issue/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

View File

@@ -25,7 +25,9 @@ function getEnvVarForProvider(provider: string): string {
// Get merged env: process.env + settings.env (from userSettings)
function getMergedEnv(): Record<string, string> {
const settings = getSettings_DEPRECATED()
const merged = { ...process.env }
const merged: Record<string, string> = Object.fromEntries(
Object.entries(process.env).filter((e): e is [string, string] => e[1] !== undefined)
)
if (settings?.env) {
Object.assign(merged, settings.env)
}

View File

@@ -23,6 +23,7 @@ import {
formatPreconditionError,
getRemoteTaskSessionUrl,
registerRemoteAgentTask,
type BackgroundRemoteSessionPrecondition,
} from '../../tasks/RemoteAgentTask/RemoteAgentTask.js'
import { isEnterpriseSubscriber, isTeamSubscriber } from '../../utils/auth.js'
import { detectCurrentRepositoryWithHost } from '../../utils/detectRepository.js'
@@ -147,7 +148,7 @@ export async function launchRemoteReview(
',',
) as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
})
const reasons = blockers.map(formatPreconditionError).join('\n')
const reasons = (blockers as BackgroundRemoteSessionPrecondition[]).map(formatPreconditionError).join('\n')
return [
{
type: 'text',

3
src/commands/share/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

3
src/commands/summary/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default

3
src/commands/teleport/index.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Command } from '../../types/command.js'
declare const _default: Command
export default _default