77import * as vscode from 'vscode' ;
88import { spawn , ChildProcessWithoutNullStreams } from 'node:child_process' ;
99import { NEURO } from '~/constants' ;
10- import { checkWorkspaceTrust } from '~/utils' ;
10+ import { checkWorkspaceTrust , checkVirtualWorkspace } from '~/utils' ;
1111import { logOutput , delayAsync , getFence } from '~/utils' ;
1212import { ActionData , actionValidationAccept , actionValidationFailure , ActionValidationResult , RCEAction , contextFailure , stripToActions } from '~/neuro_client_helper' ;
1313import { CONFIG , PERMISSIONS , getPermissionLevel } from '~/config' ;
@@ -49,7 +49,7 @@ export const terminalAccessHandlers = {
4949 } ,
5050 permissions : [ PERMISSIONS . terminalAccess ] ,
5151 handler : handleRunCommand ,
52- validator : [ checkWorkspaceTrust ] ,
52+ validator : [ checkVirtualWorkspace , checkWorkspaceTrust ] ,
5353 promptGenerator : ( actionData : ActionData ) => `run "${ actionData . params ?. command } " in the "${ actionData . params ?. shell } " shell.` ,
5454 } ,
5555 'kill_terminal_process' : {
@@ -64,15 +64,15 @@ export const terminalAccessHandlers = {
6464 } ,
6565 permissions : [ PERMISSIONS . terminalAccess ] ,
6666 handler : handleKillTerminal ,
67- validator : [ checkLiveTerminals , checkWorkspaceTrust ] ,
67+ validator : [ checkLiveTerminals , checkVirtualWorkspace , checkWorkspaceTrust ] ,
6868 promptGenerator : ( actionData : ActionData ) => `kill the "${ actionData . params ?. shell } " shell.` ,
6969 } ,
7070 'get_currently_running_shells' : {
7171 name : 'get_currently_running_shells' ,
7272 description : 'Get the list of terminal processes that are spawned.' ,
7373 permissions : [ PERMISSIONS . terminalAccess ] ,
7474 handler : handleGetCurrentlyRunningShells ,
75- validator : [ checkWorkspaceTrust ] ,
75+ validator : [ checkVirtualWorkspace , checkWorkspaceTrust ] ,
7676 promptGenerator : 'get the list of currently running shells.' ,
7777 } ,
7878} satisfies Record < string , RCEAction > ;
0 commit comments