import type { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform"; import type { ITerminalSandboxCommand } from "./terminalSandboxService.js"; export interface ITerminalSandboxCommandRuleContext { readonly os: OperatingSystem; } export interface ITerminalSandboxCommandRule { readonly keywords: readonly string[]; readonly value: T; readonly subcommands?: readonly string[]; readonly optionsWithValue?: ReadonlySet; /** Context-wide guard for rules, such as OS-specific sandbox capabilities. */ readonly condition?: (context: ITerminalSandboxCommandRuleContext) => boolean; /** Command-specific guard for argument-sensitive rules. */ readonly when?: (command: ITerminalSandboxCommand) => boolean; } export declare function matchesTerminalSandboxCommandRule(command: ITerminalSandboxCommand, rule: ITerminalSandboxCommandRule, context?: ITerminalSandboxCommandRuleContext): boolean; /** * Returns the first non-option argument, treating it as the command's subcommand. * Options are skipped, and options listed in `optionsWithValue` also skip the * following argument so global option values are not mistaken for subcommands. * * For example, with `-C` in `optionsWithValue`, `git -C repo commit` returns * `commit` instead of `repo`. */ export declare function getCommandSubcommand(args: readonly string[], optionsWithValue?: ReadonlySet): string | undefined;