From d458dbbfb9bddae288d9c23b8fb790fc5fb4bcbe Mon Sep 17 00:00:00 2001 From: mkorwel Date: Fri, 13 Mar 2026 18:40:53 +0000 Subject: [PATCH] fix: resolve build and linting issues --- .../cli/src/ui/hooks/slashCommandProcessor.ts | 26 ++++++++++++------- .../cli/src/ui/hooks/useHistoryManager.ts | 4 +-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts index b4e10de0aa..058f002280 100644 --- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts @@ -503,22 +503,28 @@ export const useSlashCommandProcessor = ( return { type: 'handled' }; case 'agentConfig': { const props = result.props; + const name = isRecord(props) ? props['name'] : undefined; + const displayName = isRecord(props) + ? props['displayName'] + : undefined; + const definition = isRecord(props) + ? props['definition'] + : undefined; + if ( - !isRecord(props) || - typeof props['name'] !== 'string' || - // eslint-disable-next-line no-restricted-syntax - typeof props['displayName'] !== 'string' || - !props['definition'] - ) { throw new Error( + typeof name !== 'string' || + typeof displayName !== 'string' || + !definition + ) { + throw new Error( 'Received invalid properties for agentConfig dialog action.', ); } - actions.openAgentConfigDialog( - props['name'], - props['displayName'], + name, + displayName, // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion - props['definition'] as AgentDefinition, + definition as AgentDefinition, ); return { type: 'handled' }; } diff --git a/packages/cli/src/ui/hooks/useHistoryManager.ts b/packages/cli/src/ui/hooks/useHistoryManager.ts index 8c8701ff5f..eaf1563b90 100644 --- a/packages/cli/src/ui/hooks/useHistoryManager.ts +++ b/packages/cli/src/ui/hooks/useHistoryManager.ts @@ -68,8 +68,8 @@ export function useHistory({ isResuming: boolean = false, ): number => { const id = getNextMessageId(baseTimestamp); - // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion - const newItem: HistoryItem = { ...itemData, id } as HistoryItem; + const newItem: HistoryItem = { ...itemData, id }; + setHistory((prevHistory) => { if (prevHistory.length > 0) {