File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -8,15 +8,16 @@ import { logger } from './util/logger'
88 * Checks if a prompt appears to be a terminal command that can be run directly.
99 * Returns the command if it is a terminal command, null otherwise.
1010 */
11- export async function checkTerminalCommand (
12- prompt : string ,
11+ export async function checkTerminalCommand ( params : {
12+ prompt : string
1313 options : {
1414 clientSessionId : string
1515 fingerprintId : string
1616 userInputId : string
1717 userId : string | undefined
18- } ,
19- ) : Promise < string | null > {
18+ }
19+ } ) : Promise < string | null > {
20+ const { prompt, options } = params
2021 if ( ! prompt ?. trim ( ) ) {
2122 return null
2223 }
Original file line number Diff line number Diff line change @@ -133,11 +133,14 @@ export const mainPrompt = async (
133133 if ( prompt && mainAgentTemplate . toolNames . includes ( 'run_terminal_command' ) ) {
134134 // Check if this is a direct terminal command
135135 const startTime = Date . now ( )
136- const terminalCommand = await checkTerminalCommand ( prompt , {
137- clientSessionId,
138- fingerprintId,
139- userInputId : promptId ,
140- userId,
136+ const terminalCommand = await checkTerminalCommand ( {
137+ prompt,
138+ options : {
139+ clientSessionId,
140+ fingerprintId,
141+ userInputId : promptId ,
142+ userId,
143+ } ,
141144 } )
142145 const duration = Date . now ( ) - startTime
143146
You can’t perform that action at this time.
0 commit comments