style: 完成所有文件的lint

This commit is contained in:
claude-code-best
2026-05-01 21:39:30 +08:00
parent d136872cc9
commit 6182015005
1333 changed files with 68255 additions and 77882 deletions

View File

@@ -1,72 +1,62 @@
import { useCallback, useState } from 'react'
import { setTeleportedSessionInfo } from 'src/bootstrap/state.js'
import { useCallback, useState } from 'react';
import { setTeleportedSessionInfo } from 'src/bootstrap/state.js';
import {
type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
logEvent,
} from 'src/services/analytics/index.js'
import type { TeleportRemoteResponse } from 'src/utils/conversationRecovery.js'
import type { CodeSession } from 'src/utils/teleport/api.js'
import { errorMessage, TeleportOperationError } from '../utils/errors.js'
import { teleportResumeCodeSession } from '../utils/teleport.js'
} from 'src/services/analytics/index.js';
import type { TeleportRemoteResponse } from 'src/utils/conversationRecovery.js';
import type { CodeSession } from 'src/utils/teleport/api.js';
import { errorMessage, TeleportOperationError } from '../utils/errors.js';
import { teleportResumeCodeSession } from '../utils/teleport.js';
export type TeleportResumeError = {
message: string
formattedMessage?: string
isOperationError: boolean
}
message: string;
formattedMessage?: string;
isOperationError: boolean;
};
export type TeleportSource = 'cliArg' | 'localCommand'
export type TeleportSource = 'cliArg' | 'localCommand';
export function useTeleportResume(source: TeleportSource) {
const [isResuming, setIsResuming] = useState(false)
const [error, setError] = useState<TeleportResumeError | null>(null)
const [selectedSession, setSelectedSession] = useState<CodeSession | null>(
null,
)
const [isResuming, setIsResuming] = useState(false);
const [error, setError] = useState<TeleportResumeError | null>(null);
const [selectedSession, setSelectedSession] = useState<CodeSession | null>(null);
const resumeSession = useCallback(
async (session: CodeSession): Promise<TeleportRemoteResponse | null> => {
setIsResuming(true)
setError(null)
setSelectedSession(session)
setIsResuming(true);
setError(null);
setSelectedSession(session);
// Log teleport session selection
logEvent('tengu_teleport_resume_session', {
source:
source as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
session_id:
session.id as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
})
source: source as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
session_id: session.id as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
});
try {
const result = await teleportResumeCodeSession(session.id)
const result = await teleportResumeCodeSession(session.id);
// Track teleported session for reliability logging
setTeleportedSessionInfo({ sessionId: session.id })
setIsResuming(false)
return result
setTeleportedSessionInfo({ sessionId: session.id });
setIsResuming(false);
return result;
} catch (err) {
const teleportError: TeleportResumeError = {
message:
err instanceof TeleportOperationError
? err.message
: errorMessage(err),
formattedMessage:
err instanceof TeleportOperationError
? err.formattedMessage
: undefined,
message: err instanceof TeleportOperationError ? err.message : errorMessage(err),
formattedMessage: err instanceof TeleportOperationError ? err.formattedMessage : undefined,
isOperationError: err instanceof TeleportOperationError,
}
setError(teleportError)
setIsResuming(false)
return null
};
setError(teleportError);
setIsResuming(false);
return null;
}
},
[source],
)
);
const clearError = useCallback(() => {
setError(null)
}, [])
setError(null);
}, []);
return {
resumeSession,
@@ -74,5 +64,5 @@ export function useTeleportResume(source: TeleportSource) {
error,
selectedSession,
clearError,
}
};
}