From 7658e47eafc041f50e475b4aa7a39e02b08a3afe Mon Sep 17 00:00:00 2001 From: Sehoon Shon Date: Tue, 10 Mar 2026 13:36:03 -0400 Subject: [PATCH] fix(cli): resolve typescript and lint errors in ported changes --- packages/cli/src/core/initializer.ts | 1 + packages/cli/src/ui/commands/chatCommand.ts | 6 +++--- packages/cli/src/ui/components/SessionBrowser.tsx | 1 + packages/cli/src/ui/hooks/useSessionBrowser.ts | 3 ++- packages/core/src/teleportation/agyProvider.ts | 1 + packages/core/src/teleportation/converter.ts | 3 ++- packages/core/src/teleportation/trajectory_teleporter.ts | 1 + 7 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/core/initializer.ts b/packages/cli/src/core/initializer.ts index 065b2ab381..0878d842c9 100644 --- a/packages/cli/src/core/initializer.ts +++ b/packages/cli/src/core/initializer.ts @@ -20,6 +20,7 @@ import { validateTheme } from './theme.js'; import type { AccountSuspensionInfo } from '../ui/contexts/UIStateContext.js'; import { pathToFileURL } from 'node:url'; +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ export interface InitializationResult { authError: string | null; diff --git a/packages/cli/src/ui/commands/chatCommand.ts b/packages/cli/src/ui/commands/chatCommand.ts index 4f39af178e..0366250f2a 100644 --- a/packages/cli/src/ui/commands/chatCommand.ts +++ b/packages/cli/src/ui/commands/chatCommand.ts @@ -177,7 +177,7 @@ const resumeCheckpointCommand: SlashCommand = { const { logger, config } = context.services; await logger.initialize(); - let conversation: Content[] = []; + let conversation: readonly Content[] = []; let authType: string | undefined; const loadExternalTrajectory = async ( @@ -186,7 +186,7 @@ const resumeCheckpointCommand: SlashCommand = { ): Promise => { let record: ConversationRecord | null = null; if (config && config.getEnableExtensionReloading() !== false) { - /* eslint-disable @typescript-eslint/no-unsafe-type-assertion, @typescript-eslint/no-explicit-any */ + /* eslint-disable @typescript-eslint/no-unsafe-type-assertion, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */ const extensions = (config as any)._extensionLoader?.getExtensions ? (config as any)._extensionLoader.getExtensions() : []; @@ -203,7 +203,7 @@ const resumeCheckpointCommand: SlashCommand = { } } } - /* eslint-enable @typescript-eslint/no-unsafe-type-assertion, @typescript-eslint/no-explicit-any */ + /* eslint-enable @typescript-eslint/no-unsafe-type-assertion, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */ } if (!record) return null; diff --git a/packages/cli/src/ui/components/SessionBrowser.tsx b/packages/cli/src/ui/components/SessionBrowser.tsx index c7be859048..544771ba49 100644 --- a/packages/cli/src/ui/components/SessionBrowser.tsx +++ b/packages/cli/src/ui/components/SessionBrowser.tsx @@ -21,6 +21,7 @@ import { } from '../../utils/sessionUtils.js'; import { useTabbedNavigation } from '../hooks/useTabbedNavigation.js'; import { TabHeader, type Tab } from './shared/TabHeader.js'; +/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return */ /** * Props for the main SessionBrowser component. diff --git a/packages/cli/src/ui/hooks/useSessionBrowser.ts b/packages/cli/src/ui/hooks/useSessionBrowser.ts index 971feb396b..e36eae4b7c 100644 --- a/packages/cli/src/ui/hooks/useSessionBrowser.ts +++ b/packages/cli/src/ui/hooks/useSessionBrowser.ts @@ -21,6 +21,7 @@ import { type SessionInfo, } from '../../utils/sessionUtils.js'; import type { Part } from '@google/genai'; +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ export { convertSessionToHistoryFormats }; @@ -96,7 +97,7 @@ export const useSessionBrowser = ( filePath = path.join(chatsDir, fileName); // Load up the conversation. - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + conversation = JSON.parse(await fs.readFile(filePath, 'utf8')); } diff --git a/packages/core/src/teleportation/agyProvider.ts b/packages/core/src/teleportation/agyProvider.ts index 1a146c40dd..bc4ed4245f 100644 --- a/packages/core/src/teleportation/agyProvider.ts +++ b/packages/core/src/teleportation/agyProvider.ts @@ -37,4 +37,5 @@ const agyProvider: TrajectoryProvider = { }, }; +// eslint-disable-next-line import/no-default-export export default agyProvider; diff --git a/packages/core/src/teleportation/converter.ts b/packages/core/src/teleportation/converter.ts index 92ee99f520..73cd1e895a 100644 --- a/packages/core/src/teleportation/converter.ts +++ b/packages/core/src/teleportation/converter.ts @@ -5,7 +5,6 @@ */ /* eslint-disable @typescript-eslint/no-unsafe-type-assertion */ -/* eslint-disable @typescript-eslint/no-explicit-any */ import type { ConversationRecord, @@ -14,6 +13,8 @@ import type { } from '../services/chatRecordingService.js'; import { CoreToolCallStatus } from '../scheduler/types.js'; import { + /* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return */ + EDIT_TOOL_NAME, GLOB_TOOL_NAME, GREP_TOOL_NAME, diff --git a/packages/core/src/teleportation/trajectory_teleporter.ts b/packages/core/src/teleportation/trajectory_teleporter.ts index 6276ff2c61..abbdec1760 100644 --- a/packages/core/src/teleportation/trajectory_teleporter.ts +++ b/packages/core/src/teleportation/trajectory_teleporter.ts @@ -7,6 +7,7 @@ // @ts-nocheck import * as crypto from 'node:crypto'; import { Trajectory } from './exa/proto_ts/dist/exa/gemini_coder/proto/trajectory_pb.js'; +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ const DEFAULT_KEY = Buffer.from('safeCodeiumworldKeYsecretBalloon'); const NONCE_SIZE = 12; // GCM default nonce size