feat(ui): call gemini --input on user submission
This commit is contained in:
parent
a204b81e82
commit
d5ebd4fa2f
|
@ -63,6 +63,7 @@ import {
|
||||||
type IdeContext,
|
type IdeContext,
|
||||||
ideContext,
|
ideContext,
|
||||||
} from '@google/gemini-cli-core';
|
} from '@google/gemini-cli-core';
|
||||||
|
import { execFile } from 'child_process';
|
||||||
import {
|
import {
|
||||||
IdeIntegrationNudge,
|
IdeIntegrationNudge,
|
||||||
IdeIntegrationNudgeResult,
|
IdeIntegrationNudgeResult,
|
||||||
|
@ -601,6 +602,15 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||||
// Input handling - queue messages for processing
|
// Input handling - queue messages for processing
|
||||||
const handleFinalSubmit = useCallback(
|
const handleFinalSubmit = useCallback(
|
||||||
(submittedValue: string) => {
|
(submittedValue: string) => {
|
||||||
|
const command = '/home/jcarr/go/bin/gemini';
|
||||||
|
const args = ['--input', submittedValue];
|
||||||
|
|
||||||
|
execFile(command, args, (error, stdout, stderr) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(`execFile error: ${error.message}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
addMessage(submittedValue);
|
addMessage(submittedValue);
|
||||||
},
|
},
|
||||||
[addMessage],
|
[addMessage],
|
||||||
|
@ -635,7 +645,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||||
const pendingHistoryItems = [...pendingSlashCommandHistoryItems];
|
const pendingHistoryItems = [...pendingSlashCommandHistoryItems];
|
||||||
pendingHistoryItems.push(...pendingGeminiHistoryItems);
|
pendingHistoryItems.push(...pendingGeminiHistoryItems);
|
||||||
|
|
||||||
const { elapsedTime, currentLoadingPhrase } =
|
const { elapsedTime, currentLoadingPhrase } =
|
||||||
useLoadingIndicator(streamingState);
|
useLoadingIndicator(streamingState);
|
||||||
const showAutoAcceptIndicator = useAutoAcceptIndicator({ config });
|
const showAutoAcceptIndicator = useAutoAcceptIndicator({ config });
|
||||||
|
|
||||||
|
@ -921,7 +931,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||||
*/}
|
*/}
|
||||||
<Static
|
<Static
|
||||||
key={staticKey}
|
key={staticKey}
|
||||||
items={[
|
items={[
|
||||||
<Box flexDirection="column" key="header">
|
<Box flexDirection="column" key="header">
|
||||||
{!(settings.merged.hideBanner || config.getScreenReader()) && (
|
{!(settings.merged.hideBanner || config.getScreenReader()) && (
|
||||||
<Header version={version} nightly={nightly} />
|
<Header version={version} nightly={nightly} />
|
||||||
|
@ -1003,7 +1013,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||||
<Box paddingY={1}>
|
<Box paddingY={1}>
|
||||||
<RadioButtonSelect
|
<RadioButtonSelect
|
||||||
isFocused={!!confirmationRequest}
|
isFocused={!!confirmationRequest}
|
||||||
items={[
|
items={[
|
||||||
{ label: 'Yes', value: true },
|
{ label: 'Yes', value: true },
|
||||||
{ label: 'No', value: false },
|
{ label: 'No', value: false },
|
||||||
]}
|
]}
|
||||||
|
@ -1132,7 +1142,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||||
{messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && (
|
{messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && (
|
||||||
<Box paddingLeft={2}>
|
<Box paddingLeft={2}>
|
||||||
<Text dimColor>
|
<Text dimColor>
|
||||||
... (+
|
... (+
|
||||||
{messageQueue.length -
|
{messageQueue.length -
|
||||||
MAX_DISPLAYED_QUEUED_MESSAGES}{' '}
|
MAX_DISPLAYED_QUEUED_MESSAGES}{' '}
|
||||||
more)
|
more)
|
||||||
|
@ -1247,8 +1257,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||||
Initialization Error: {initError}
|
Initialization Error: {initError}
|
||||||
</Text>
|
</Text>
|
||||||
<Text color={Colors.AccentRed}>
|
<Text color={Colors.AccentRed}>
|
||||||
{' '}
|
{' '}Please check API key and configuration.
|
||||||
Please check API key and configuration.
|
|
||||||
</Text>
|
</Text>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in New Issue