mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 06:15:51 +00:00
Fix type (#1242)
* 完善所有用到的type对象,并添加中文注释 * 补充遗失的type * 修复claude-for-chrome-mcp中的type和interface类型缺失 * 完善注释
This commit is contained in:
@@ -1897,12 +1897,12 @@ export function getAccountInformation() {
|
||||
accountInfo.apiKeySource = apiKeySource
|
||||
}
|
||||
|
||||
// We don't know the organization if we're relying on an external API key or auth token
|
||||
// 如果我们依赖外部 API 密钥或认证令牌,则不知道组织
|
||||
if (
|
||||
authTokenSource === 'claude.ai' ||
|
||||
apiKeySource === '/login managed key'
|
||||
) {
|
||||
// Get organization name from OAuth account info
|
||||
// 从 OAuth 账户信息获取组织名称
|
||||
const orgName = getOauthAccountInfo()?.organizationName
|
||||
if (orgName) {
|
||||
accountInfo.organization = orgName
|
||||
|
||||
@@ -2,6 +2,7 @@ import {
|
||||
type ClaudeForChromeContext,
|
||||
createClaudeForChromeMcpServer,
|
||||
type Logger,
|
||||
type LoggerDetail,
|
||||
type PermissionMode,
|
||||
} from '@ant/claude-for-chrome-mcp'
|
||||
import { initializeAnalyticsSink } from '../../services/analytics/sink.js'
|
||||
@@ -276,19 +277,19 @@ export async function runClaudeInChromeMcpServer(): Promise<void> {
|
||||
}
|
||||
|
||||
class DebugLogger implements Logger {
|
||||
silly(message: string, ...args: unknown[]): void {
|
||||
logForDebugging(format(message, ...args), { level: 'debug' })
|
||||
silly(message: string, detail?: LoggerDetail): void {
|
||||
logForDebugging(format(message, detail ?? ''), { level: 'debug' })
|
||||
}
|
||||
debug(message: string, ...args: unknown[]): void {
|
||||
logForDebugging(format(message, ...args), { level: 'debug' })
|
||||
debug(message: string, detail?: LoggerDetail): void {
|
||||
logForDebugging(format(message, detail ?? ''), { level: 'debug' })
|
||||
}
|
||||
info(message: string, ...args: unknown[]): void {
|
||||
logForDebugging(format(message, ...args), { level: 'info' })
|
||||
info(message: string, detail?: LoggerDetail): void {
|
||||
logForDebugging(format(message, detail ?? ''), { level: 'info' })
|
||||
}
|
||||
warn(message: string, ...args: unknown[]): void {
|
||||
logForDebugging(format(message, ...args), { level: 'warn' })
|
||||
warn(message: string, detail?: LoggerDetail): void {
|
||||
logForDebugging(format(message, detail ?? ''), { level: 'warn' })
|
||||
}
|
||||
error(message: string, ...args: unknown[]): void {
|
||||
logForDebugging(format(message, ...args), { level: 'error' })
|
||||
error(message: string, detail?: LoggerDetail): void {
|
||||
logForDebugging(format(message, detail ?? ''), { level: 'error' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type {
|
||||
ComputerUseHostAdapter,
|
||||
Logger,
|
||||
LoggerDetail,
|
||||
} from '@ant/computer-use-mcp/types'
|
||||
import { format } from 'util'
|
||||
import { logForDebugging } from '../debug.js'
|
||||
@@ -10,20 +11,20 @@ import { getChicagoEnabled, getChicagoSubGates } from './gates.js'
|
||||
import { requireComputerUseSwift } from './swiftLoader.js'
|
||||
|
||||
class DebugLogger implements Logger {
|
||||
silly(message: string, ...args: unknown[]): void {
|
||||
logForDebugging(format(message, ...args), { level: 'debug' })
|
||||
silly(message: string, detail?: LoggerDetail): void {
|
||||
logForDebugging(format(message, detail ?? ''), { level: 'debug' })
|
||||
}
|
||||
debug(message: string, ...args: unknown[]): void {
|
||||
logForDebugging(format(message, ...args), { level: 'debug' })
|
||||
debug(message: string, detail?: LoggerDetail): void {
|
||||
logForDebugging(format(message, detail ?? ''), { level: 'debug' })
|
||||
}
|
||||
info(message: string, ...args: unknown[]): void {
|
||||
logForDebugging(format(message, ...args), { level: 'info' })
|
||||
info(message: string, detail?: LoggerDetail): void {
|
||||
logForDebugging(format(message, detail ?? ''), { level: 'info' })
|
||||
}
|
||||
warn(message: string, ...args: unknown[]): void {
|
||||
logForDebugging(format(message, ...args), { level: 'warn' })
|
||||
warn(message: string, detail?: LoggerDetail): void {
|
||||
logForDebugging(format(message, detail ?? ''), { level: 'warn' })
|
||||
}
|
||||
error(message: string, ...args: unknown[]): void {
|
||||
logForDebugging(format(message, ...args), { level: 'error' })
|
||||
error(message: string, detail?: LoggerDetail): void {
|
||||
logForDebugging(format(message, detail ?? ''), { level: 'error' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user