import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"; import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform"; import { TerminalCapability } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities"; import { ITerminalSandboxService } from "@codingame/monaco-vscode-api/vscode/vs/platform/sandbox/common/terminalSandboxService.service"; export interface ITerminalSandboxResolvedNetworkDomains { allowedDomains: string[]; deniedDomains: string[]; } export declare enum TerminalSandboxPrerequisiteCheck { Config = "config", Dependencies = "dependencies", Bubblewrap = "bubblewrap" } export declare enum TerminalSandboxPreCheckRemediation { DisableUnprivilagedusernamespaceRestriction = "disableUserNamespaceRestriction" } export interface ITerminalSandboxPrerequisiteCheckResult { enabled: boolean; sandboxConfigPath: string | undefined; failedCheck: TerminalSandboxPrerequisiteCheck | undefined; missingDependencies?: string[]; remediations?: readonly TerminalSandboxPreCheckRemediation[]; detail?: string; } export interface ITerminalSandboxWrapResult { command: string; isSandboxWrapped: boolean; blockedDomains?: string[]; deniedDomains?: string[]; requiresUnsandboxConfirmation?: boolean; requiresAllowNetworkConfirmation?: boolean; } export type TerminalSandboxFileAccessPermission = "read" | "write"; export interface ITerminalSandboxFileAccessCheckResult { allowed: boolean; denied: string[]; } export interface ITerminalSandboxPrecheckInputs { /** * Whether the current caller is using the default approval permission flow. */ readonly isDefaultApprovalPermissionEnabled?: boolean; } export interface ITerminalSandboxCommand { /** * Normalized command name without path or executable suffix. * For example, `/usr/bin/git` and `git.exe` both normalize to `git`. */ keyword: string; /** * Command arguments after the executable token. These are used for * argument-sensitive sandbox allow-list rules, such as matching a specific * subcommand while ignoring global options. */ args: readonly string[]; } /** * Abstraction over terminal operations needed by the install flow. * Provided by the browser-layer caller so the common-layer service * does not import browser types directly. */ export interface ISandboxDependencyInstallTerminal { sendText(text: string, addNewLine?: boolean): Promise; focus(): void; capabilities: { get(id: TerminalCapability.CommandDetection): { onCommandFinished: Event<{ exitCode: number | undefined; }>; } | undefined; onDidAddCapability: Event<{ id: TerminalCapability; }>; }; onDidInputData: Event; onDisposed: Event; } export interface ISandboxDependencyInstallOptions { /** * Creates or obtains a terminal for running the install command. */ createTerminal(): Promise; /** * Focuses the terminal for password entry. */ focusTerminal(terminal: ISandboxDependencyInstallTerminal): Promise; } export interface ISandboxDependencyInstallResult { exitCode: number | undefined; } export declare class NullTerminalSandboxService implements ITerminalSandboxService { readonly _serviceBrand: undefined; isEnabled(): Promise; isSandboxAllowNetworkEnabled(): Promise; getOS(): Promise; checkForSandboxingPrereqs(): Promise; wrapCommand(command: string): Promise; checkFileAccess(): Promise; getSandboxConfigPath(): Promise; getTempDir(): URI | undefined; setNeedsForceUpdateConfigFile(): void; getResolvedNetworkDomains(): ITerminalSandboxResolvedNetworkDomains; getMissingSandboxDependencies(): Promise; installMissingSandboxDependencies(): Promise; runSandboxRemediation(): Promise; }