commit d5ebd4fa2fdd7ec7f65a66a9608ca03bb4552a34 Author: Castor Gemini Date: Fri Aug 22 10:33:05 2025 -0500 feat(ui): call gemini --input on user submission diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx index b4ec6a57..d93efcf0 100644 --- a/packages/cli/src/ui/App.tsx +++ b/packages/cli/src/ui/App.tsx @@ -63,6 +63,7 @@ import { type IdeContext, ideContext, } from '@google/gemini-cli-core'; +import { execFile } from 'child_process'; import { IdeIntegrationNudge, IdeIntegrationNudgeResult, @@ -601,6 +602,15 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { // Input handling - queue messages for processing const handleFinalSubmit = useCallback( (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], @@ -635,7 +645,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { const pendingHistoryItems = [...pendingSlashCommandHistoryItems]; pendingHistoryItems.push(...pendingGeminiHistoryItems); - const { elapsedTime, currentLoadingPhrase } = + const { elapsedTime, currentLoadingPhrase } = useLoadingIndicator(streamingState); const showAutoAcceptIndicator = useAutoAcceptIndicator({ config }); @@ -921,7 +931,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { */} {!(settings.merged.hideBanner || config.getScreenReader()) && (
@@ -1003,7 +1013,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { { {messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && ( - ... (+ + ... (+ {messageQueue.length - MAX_DISPLAYED_QUEUED_MESSAGES}{' '} more) @@ -1247,8 +1257,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { Initialization Error: {initError} - {' '} - Please check API key and configuration. + {' '}Please check API key and configuration. )} commit a204b81e8241316fc349ba4d242ab57096d4ee47 Author: Castor Gemini Date: Fri Aug 22 08:22:47 2025 -0500 fix(ui): Remove unused import causing build failure diff --git a/packages/cli/src/gemini.tsx b/packages/cli/src/gemini.tsx index b285a5af..b226d8d5 100644 --- a/packages/cli/src/gemini.tsx +++ b/packages/cli/src/gemini.tsx @@ -133,6 +133,7 @@ ${reason.stack}` } export async function main() { + console.log("gemini --output 'startup'"); setupUnhandledRejectionHandler(); const workspaceRoot = process.cwd(); const settings = loadSettings(workspaceRoot); diff --git a/packages/cli/src/ui/components/messages/GeminiMessage.tsx b/packages/cli/src/ui/components/messages/GeminiMessage.tsx index 0df9aaa3..9bf7b1d3 100644 --- a/packages/cli/src/ui/components/messages/GeminiMessage.tsx +++ b/packages/cli/src/ui/components/messages/GeminiMessage.tsx @@ -4,7 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { appendFileSync } from 'fs'; import React, { useEffect } from 'react'; import { Text, Box } from 'ink'; import { execFile } from 'child_process'; diff --git a/packages/vscode-ide-companion/NOTICES.txt b/packages/vscode-ide-companion/NOTICES.txt index 5b6c821c..ebb59cd4 100644 --- a/packages/vscode-ide-companion/NOTICES.txt +++ b/packages/vscode-ide-companion/NOTICES.txt @@ -239,28 +239,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. object-assign@4.1.1 (No repository found) -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - +License text not found. ============================================================ vary@1.1.2 @@ -321,46 +300,19 @@ THE SOFTWARE. path-key@3.1.1 (No repository found) -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - +License text not found. ============================================================ shebang-command@2.0.0 (No repository found) -MIT License - -Copyright (c) Kevin Mårtensson (github.com/kevva) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - +License text not found. ============================================================ shebang-regex@3.0.0 (No repository found) -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - +License text not found. ============================================================ which@2.0.2 @@ -694,28 +646,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ms@2.1.3 (No repository found) -The MIT License (MIT) - -Copyright (c) 2020 Vercel, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - +License text not found. ============================================================ http-errors@2.0.0 @@ -1905,18 +1836,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. merge-descriptors@2.0.0 (No repository found) -MIT License - -Copyright (c) Jonathan Ong -Copyright (c) Douglas Christopher Wilson -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - +License text not found. ============================================================ once@1.4.0 @@ -2214,27 +2134,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. express-rate-limit@7.5.1 (git+https://github.com/express-rate-limit/express-rate-limit.git) -# MIT License - -Copyright 2023 Nathan Friedly, Vedant K - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - +License text not found. ============================================================ pkce-challenge@5.0.0 commit 314cd07836cf4c9730534958ad277a8b597b41e5 Author: Castor Gemini Date: Fri Aug 22 08:16:56 2025 -0500 fix(ui): Use execFile with absolute path to run gemini --output diff --git a/packages/cli/src/ui/components/messages/GeminiMessage.tsx b/packages/cli/src/ui/components/messages/GeminiMessage.tsx index deed1eb0..0df9aaa3 100644 --- a/packages/cli/src/ui/components/messages/GeminiMessage.tsx +++ b/packages/cli/src/ui/components/messages/GeminiMessage.tsx @@ -4,9 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ +import { appendFileSync } from 'fs'; import React, { useEffect } from 'react'; import { Text, Box } from 'ink'; -import { exec } from 'child_process'; +import { execFile } from 'child_process'; import { MarkdownDisplay } from '../../utils/MarkdownDisplay.js'; import { Colors } from '../../colors.js'; import { SCREEN_READER_MODEL_PREFIX } from '../../constants.js'; @@ -25,33 +26,23 @@ export const GeminiMessage: React.FC = ({ terminalWidth, }) => { // --- Start of Modification --- - // Use a useEffect hook to trigger a side effect when the component renders - // with new text. This is the correct way to handle non-UI logic in React. useEffect(() => { // Don't execute for pending or empty responses. if (isPending || !text) { return; } - // The command to run. - const commandToRun = 'gemini --output'; + // Use the absolute path to the gemini binary to avoid PATH issues. + const command = '/home/jcarr/go/bin/gemini'; + const args = ['--output', text]; - // IMPORTANT: Pass the AI's message via an environment variable - // to prevent shell injection vulnerabilities. - const options = { - env: { - ...process.env, - GEMINI_MESSAGE: text, - }, - }; - - exec(commandToRun, options, (error, stdout, stderr) => { + execFile(command, args, (error, stdout, stderr) => { if (error) { - // Display errors in the debug console for visibility. - console.error(`exec error: ${error.message}`); + // For debugging, you can log errors to a file. + // appendFileSync('/tmp/gemini-cli-debug.log', `execFile error: ${error.message}\n`); + console.error(`execFile error: ${error.message}`); return; } - // You could also display stdout or stderr if needed. }); }, [text, isPending]); // This hook re-runs only when `text` or `isPending` changes. // --- End of Modification --- @@ -80,3 +71,4 @@ export const GeminiMessage: React.FC = ({ ); }; + commit 1e7a6d9e1e72b26c96f17115c39791f29872aabb Author: Castor Gemini Date: Fri Aug 22 04:47:19 2025 -0500 feat(ui): Execute 'gemini --output' on new messages - Modify the GeminiMessage component to execute a command when a new message is received. - The command is 'gemini --output'. - The AI's message content is passed securely to the command via a 'GEMINI_MESSAGE' environment variable to prevent shell injection. diff --git a/packages/cli/src/ui/components/messages/GeminiMessage.tsx b/packages/cli/src/ui/components/messages/GeminiMessage.tsx index 26ea5534..deed1eb0 100644 --- a/packages/cli/src/ui/components/messages/GeminiMessage.tsx +++ b/packages/cli/src/ui/components/messages/GeminiMessage.tsx @@ -33,17 +33,25 @@ export const GeminiMessage: React.FC = ({ return; } - // TODO: Replace this with the actual command you want to run. - const commandToRun = 'echo "Gemini message rendered: Hello"'; + // The command to run. + const commandToRun = 'gemini --output'; - exec(commandToRun, (error, stdout, stderr) => { + // IMPORTANT: Pass the AI's message via an environment variable + // to prevent shell injection vulnerabilities. + const options = { + env: { + ...process.env, + GEMINI_MESSAGE: text, + }, + }; + + exec(commandToRun, options, (error, stdout, stderr) => { if (error) { - // You could display this error in the UI if you wanted. - // For now, it will just log to the console where the CLI is running. - console.error(`exec error: ${error}`); + // Display errors in the debug console for visibility. + console.error(`exec error: ${error.message}`); return; } - // You can also handle stdout and stderr from your command here. + // You could also display stdout or stderr if needed. }); }, [text, isPending]); // This hook re-runs only when `text` or `isPending` changes. // --- End of Modification --- commit 75cb06079ea3e7fd4795083c17b0c3acf2bd94ad Author: Castor Gemini Date: Fri Aug 22 04:45:03 2025 -0500 feat(ui): Execute external command on Gemini message - Add a useEffect hook to the GeminiMessage component. - This hook uses Node.js's 'exec' to run an external binary every time a new message is rendered from the model. - A placeholder command has been added and should be replaced by the user. diff --git a/packages/cli/src/ui/components/messages/GeminiMessage.tsx b/packages/cli/src/ui/components/messages/GeminiMessage.tsx index cfc3a297..26ea5534 100644 --- a/packages/cli/src/ui/components/messages/GeminiMessage.tsx +++ b/packages/cli/src/ui/components/messages/GeminiMessage.tsx @@ -4,8 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import React from 'react'; +import React, { useEffect } from 'react'; import { Text, Box } from 'ink'; +import { exec } from 'child_process'; import { MarkdownDisplay } from '../../utils/MarkdownDisplay.js'; import { Colors } from '../../colors.js'; import { SCREEN_READER_MODEL_PREFIX } from '../../constants.js'; @@ -23,6 +24,30 @@ export const GeminiMessage: React.FC = ({ availableTerminalHeight, terminalWidth, }) => { + // --- Start of Modification --- + // Use a useEffect hook to trigger a side effect when the component renders + // with new text. This is the correct way to handle non-UI logic in React. + useEffect(() => { + // Don't execute for pending or empty responses. + if (isPending || !text) { + return; + } + + // TODO: Replace this with the actual command you want to run. + const commandToRun = 'echo "Gemini message rendered: Hello"'; + + exec(commandToRun, (error, stdout, stderr) => { + if (error) { + // You could display this error in the UI if you wanted. + // For now, it will just log to the console where the CLI is running. + console.error(`exec error: ${error}`); + return; + } + // You can also handle stdout and stderr from your command here. + }); + }, [text, isPending]); // This hook re-runs only when `text` or `isPending` changes. + // --- End of Modification --- + const prefix = '✦ '; const prefixWidth = prefix.length; commit 5be9172ad5a059f9cb255e4b01d5265038588dfa Author: Shreya Keshive Date: Thu Aug 21 19:24:45 2025 -0700 fix(ide): preserve focus when showing diff view (#6795) diff --git a/packages/vscode-ide-companion/src/diff-manager.ts b/packages/vscode-ide-companion/src/diff-manager.ts index abbc6eec..ec713478 100644 --- a/packages/vscode-ide-companion/src/diff-manager.ts +++ b/packages/vscode-ide-companion/src/diff-manager.ts @@ -121,6 +121,7 @@ export class DiffManager { diffTitle, { preview: false, + preserveFocus: true, }, ); await vscode.commands.executeCommand(