mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 22:33:05 -07:00
fix: resolve build and linting issues
This commit is contained in:
@@ -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' };
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user