mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-05 23:56:45 -07:00
fix: resolve build and linting issues
This commit is contained in:
@@ -503,22 +503,28 @@ export const useSlashCommandProcessor = (
|
|||||||
return { type: 'handled' };
|
return { type: 'handled' };
|
||||||
case 'agentConfig': {
|
case 'agentConfig': {
|
||||||
const props = result.props;
|
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 (
|
if (
|
||||||
!isRecord(props) ||
|
typeof name !== 'string' ||
|
||||||
typeof props['name'] !== 'string' ||
|
typeof displayName !== 'string' ||
|
||||||
// eslint-disable-next-line no-restricted-syntax
|
!definition
|
||||||
typeof props['displayName'] !== 'string' ||
|
) {
|
||||||
!props['definition']
|
throw new Error(
|
||||||
) { throw new Error(
|
|
||||||
'Received invalid properties for agentConfig dialog action.',
|
'Received invalid properties for agentConfig dialog action.',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
actions.openAgentConfigDialog(
|
actions.openAgentConfigDialog(
|
||||||
props['name'],
|
name,
|
||||||
props['displayName'],
|
displayName,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||||
props['definition'] as AgentDefinition,
|
definition as AgentDefinition,
|
||||||
);
|
);
|
||||||
return { type: 'handled' };
|
return { type: 'handled' };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ export function useHistory({
|
|||||||
isResuming: boolean = false,
|
isResuming: boolean = false,
|
||||||
): number => {
|
): number => {
|
||||||
const id = getNextMessageId(baseTimestamp);
|
const id = getNextMessageId(baseTimestamp);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
const newItem: HistoryItem = { ...itemData, id };
|
||||||
const newItem: HistoryItem = { ...itemData, id } as HistoryItem;
|
|
||||||
|
|
||||||
setHistory((prevHistory) => {
|
setHistory((prevHistory) => {
|
||||||
if (prevHistory.length > 0) {
|
if (prevHistory.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user