
import { localize } from '../../../../../nls.js';
import { TerminalSettingId } from '../../../../../platform/terminal/common/terminal.js';
import { terminalProfileBaseProperties } from '../../../../../platform/terminal/common/terminalPlatformConfiguration.js';
import { PolicyCategory } from '../../../../../base/common/policy.js';

var TerminalChatAgentToolsSettingId;
(function(TerminalChatAgentToolsSettingId) {
    TerminalChatAgentToolsSettingId["EnableAutoApprove"] = "chat.tools.terminal.enableAutoApprove";
    TerminalChatAgentToolsSettingId["AutoApprove"] = "chat.tools.terminal.autoApprove";
    TerminalChatAgentToolsSettingId["AutoApproveWorkspaceNpmScripts"] = "chat.tools.terminal.autoApproveWorkspaceNpmScripts";
    TerminalChatAgentToolsSettingId["IgnoreDefaultAutoApproveRules"] = "chat.tools.terminal.ignoreDefaultAutoApproveRules";
    TerminalChatAgentToolsSettingId["BlockDetectedFileWrites"] = "chat.tools.terminal.blockDetectedFileWrites";
    TerminalChatAgentToolsSettingId["ShellIntegrationTimeout"] = "chat.tools.terminal.shellIntegrationTimeout";
    TerminalChatAgentToolsSettingId["AutoReplyToPrompts"] = "chat.tools.terminal.autoReplyToPrompts";
    TerminalChatAgentToolsSettingId["OutputLocation"] = "chat.tools.terminal.outputLocation";
    TerminalChatAgentToolsSettingId["TerminalSandboxEnabled"] = "chat.tools.terminal.sandbox.enabled";
    TerminalChatAgentToolsSettingId["TerminalSandboxNetworkAllowedDomains"] = "chat.tools.terminal.sandbox.network.allowedDomains";
    TerminalChatAgentToolsSettingId["TerminalSandboxNetworkDeniedDomains"] = "chat.tools.terminal.sandbox.network.deniedDomains";
    TerminalChatAgentToolsSettingId["TerminalSandboxNetworkAllowTrustedDomains"] = "chat.tools.terminal.sandbox.network.allowTrustedDomains";
    TerminalChatAgentToolsSettingId["TerminalSandboxLinuxFileSystem"] = "chat.tools.terminal.sandbox.linuxFileSystem";
    TerminalChatAgentToolsSettingId["TerminalSandboxMacFileSystem"] = "chat.tools.terminal.sandbox.macFileSystem";
    TerminalChatAgentToolsSettingId["PreventShellHistory"] = "chat.tools.terminal.preventShellHistory";
    TerminalChatAgentToolsSettingId["EnforceTimeoutFromModel"] = "chat.tools.terminal.enforceTimeoutFromModel";
    TerminalChatAgentToolsSettingId["IdlePollInterval"] = "chat.tools.terminal.idlePollInterval";
    TerminalChatAgentToolsSettingId["TerminalProfileLinux"] = "chat.tools.terminal.terminalProfile.linux";
    TerminalChatAgentToolsSettingId["TerminalProfileMacOs"] = "chat.tools.terminal.terminalProfile.osx";
    TerminalChatAgentToolsSettingId["TerminalProfileWindows"] = "chat.tools.terminal.terminalProfile.windows";
    TerminalChatAgentToolsSettingId["DeprecatedTerminalSandboxNetwork"] = "chat.tools.terminal.sandbox.network";
    TerminalChatAgentToolsSettingId["DeprecatedAutoApproveCompatible"] = "chat.agent.terminal.autoApprove";
    TerminalChatAgentToolsSettingId["DeprecatedAutoApprove1"] = "chat.agent.terminal.allowList";
    TerminalChatAgentToolsSettingId["DeprecatedAutoApprove2"] = "chat.agent.terminal.denyList";
    TerminalChatAgentToolsSettingId["DeprecatedAutoApprove3"] = "github.copilot.chat.agent.terminal.allowList";
    TerminalChatAgentToolsSettingId["DeprecatedAutoApprove4"] = "github.copilot.chat.agent.terminal.denyList";
})(TerminalChatAgentToolsSettingId || (TerminalChatAgentToolsSettingId = {}));
const autoApproveBoolean = {
    type: "boolean",
    enum: [true, false],
    enumDescriptions: [( localize(13899, "Automatically approve the pattern.")), ( localize(13900, "Require explicit approval for the pattern."))],
    description: ( localize(
        13901,
        "The start of a command to match against. A regular expression can be provided by wrapping the string in `/` characters."
    ))
};
const terminalChatAgentProfileSchema = {
    type: "object",
    required: ["path"],
    properties: {
        path: {
            description: ( localize(13902, "A path to a shell executable.")),
            type: "string"
        },
        ...terminalProfileBaseProperties
    }
};
const terminalChatAgentToolsConfiguration = {
    [TerminalChatAgentToolsSettingId.EnableAutoApprove]: {
        description: ( localize(
            13903,
            "Controls whether to allow auto approval in the run in terminal tool."
        )),
        type: "boolean",
        default: true,
        policy: {
            name: "ChatToolsTerminalEnableAutoApprove",
            category: PolicyCategory.IntegratedTerminal,
            minimumVersion: "1.104",
            localization: {
                description: {
                    key: "autoApproveMode.description",
                    value: ( localize(
                        13903,
                        "Controls whether to allow auto approval in the run in terminal tool."
                    ))
                }
            }
        }
    },
    [TerminalChatAgentToolsSettingId.AutoApprove]: {
        markdownDescription: [( localize(
            13904,
            "A list of commands or regular expressions that control whether the run in terminal tool commands require explicit approval. These will be matched against the start of a command. A regular expression can be provided by wrapping the string in {0} characters followed by optional flags such as {1} for case-insensitivity.",
            "`/`",
            "`i`"
        )), ( localize(
            13905,
            "Set to {0} to automatically approve commands, {1} to always require explicit approval or {2} to unset the value.",
            "`true`",
            "`false`",
            "`null`"
        )), ( localize(
            13906,
            "Note that these commands and regular expressions are evaluated for every _sub-command_ within the full _command line_, so {0} for example will need both {1} and {2} to match a {3} entry and must not match a {4} entry in order to auto approve. Inline commands such as {5} (process substitution) should also be detected.",
            "`foo && bar`",
            "`foo`",
            "`bar`",
            "`true`",
            "`false`",
            "`<(foo)`"
        )), ( localize(
            13907,
            "An object can be used to match against the full command line instead of matching sub-commands and inline commands, for example {0}. In order to be auto approved _both_ the sub-command and command line must not be explicitly denied, then _either_ all sub-commands or command line needs to be approved.",
            "`{ approve: false, matchCommandLine: true }`"
        )), ( localize(
            13908,
            "Note that there's a default set of rules to allow and also deny commands. Consider setting {0} to {1} to ignore all default rules to ensure there are no conflicts with your own rules. Do this at your own risk, the default denial rules are designed to protect you against running dangerous commands.",
            `\`#${TerminalChatAgentToolsSettingId.IgnoreDefaultAutoApproveRules}#\``,
            "`true`"
        )), [( localize(13909, "Examples:")), `|${( localize(13910, "Value"))}|${( localize(13911, "Description"))}|`, "|---|---|", "| `\"mkdir\": true` | " + ( localize(13912, "Allow all commands starting with {0}", "`mkdir`")), "| `\"npm run build\": true` | " + ( localize(13913, "Allow all commands starting with {0}", "`npm run build`")), "| `\"bin/test.sh\": true` | " + ( localize(
            13914,
            "Allow all commands that match the path {0} ({1}, {2}, etc.)",
            "`bin/test.sh`",
            "`bin\\test.sh`",
            "`./bin/test.sh`"
        )), "| `\"/^git (status\\|show\\\\b.*)$/\": true` | " + ( localize(
            13915,
            "Allow {0} and all commands starting with {1}",
            "`git status`",
            "`git show`"
        )), "| `\"/^Get-ChildItem\\\\b/i\": true` | " + ( localize(13916, "will allow {0} commands regardless of casing", "`Get-ChildItem`")), "| `\"/.*/\": true` | " + ( localize(13917, "Allow all commands (denied commands still require approval)")), "| `\"rm\": false` | " + ( localize(
            13918,
            "Require explicit approval for all commands starting with {0}",
            "`rm`"
        )), "| `\"/\\\\.ps1/i\": { approve: false, matchCommandLine: true }` | " + ( localize(
            13919,
            "Require explicit approval for any _command line_ that contains {0} regardless of casing",
            "`\".ps1\"`"
        )), "| `\"rm\": null` | " + ( localize(13920, "Unset the default {0} value for {1}", "`false`", "`rm`"))].join("\n")].join("\n\n"),
        type: "object",
        additionalProperties: {
            anyOf: [autoApproveBoolean, {
                type: "object",
                properties: {
                    approve: autoApproveBoolean,
                    matchCommandLine: {
                        type: "boolean",
                        enum: [true, false],
                        enumDescriptions: [( localize(13921, "Match against the full command line, eg. `foo && bar`.")), ( localize(
                            13922,
                            "Match against sub-commands and inline commands, eg. `foo && bar` will need both `foo` and `bar` to match."
                        ))],
                        description: ( localize(
                            13923,
                            "Whether to match against the full command line, as opposed to splitting by sub-commands and inline commands."
                        ))
                    }
                },
                required: ["approve"]
            }, {
                type: "null",
                description: ( localize(
                    13924,
                    "Ignore the pattern, this is useful for unsetting the same pattern set at a higher scope."
                ))
            }]
        },
        default: {
            cd: true,
            echo: true,
            ls: true,
            dir: true,
            pwd: true,
            cat: true,
            head: true,
            tail: true,
            findstr: true,
            wc: true,
            tr: true,
            cut: true,
            cmp: true,
            which: true,
            basename: true,
            dirname: true,
            realpath: true,
            readlink: true,
            stat: true,
            file: true,
            od: true,
            du: true,
            df: true,
            sleep: true,
            nl: true,
            grep: true,
            "/^git(\\s+(-C\\s+\\S+|--no-pager))*\\s+status\\b/": true,
            "/^git(\\s+(-C\\s+\\S+|--no-pager))*\\s+log\\b/": true,
            "/^git(\\s+(-C\\s+\\S+|--no-pager))*\\s+log\\b.*\\s--output(=|\\s|$)/": false,
            "/^git(\\s+(-C\\s+\\S+|--no-pager))*\\s+show\\b/": true,
            "/^git(\\s+(-C\\s+\\S+|--no-pager))*\\s+diff\\b/": true,
            "/^git(\\s+(-C\\s+\\S+|--no-pager))*\\s+ls-files\\b/": true,
            "/^git(\\s+(-C\\s+\\S+|--no-pager))*\\s+grep\\b/": true,
            "/^git(\\s+(-C\\s+\\S+|--no-pager))*\\s+branch\\b/": true,
            "/^git(\\s+(-C\\s+\\S+|--no-pager))*\\s+branch\\b.*\\s-(d|D|m|M|-delete|-force)\\b/": false,
            "/^docker\\s+(ps|images|info|version|inspect|logs|top|stats|port|diff|search|events)\\b/": true,
            "/^docker\\s+(container|image|network|volume|context|system)\\s+(ls|ps|inspect|history|show|df|info)\\b/": true,
            "/^docker\\s+compose\\s+(ps|ls|top|logs|images|config|version|port|events)\\b/": true,
            "Get-ChildItem": true,
            "Get-Content": true,
            "Get-Date": true,
            "Get-Random": true,
            "Get-Location": true,
            "Set-Location": true,
            "Write-Host": true,
            "Write-Output": true,
            "Out-String": true,
            "Split-Path": true,
            "Join-Path": true,
            "Start-Sleep": true,
            "Where-Object": true,
            "/^Select-[a-z0-9]/i": true,
            "/^Measure-[a-z0-9]/i": true,
            "/^Compare-[a-z0-9]/i": true,
            "/^Format-[a-z0-9]/i": true,
            "/^Sort-[a-z0-9]/i": true,
            "/^npm\\s+(ls|list|outdated|view|info|show|explain|why|root|prefix|bin|search|doctor|fund|repo|bugs|docs|home|help(-search)?)\\b/": true,
            "/^npm\\s+config\\s+(list|get)\\b/": true,
            "/^npm\\s+pkg\\s+get\\b/": true,
            "/^npm\\s+audit$/": true,
            "/^npm\\s+cache\\s+verify\\b/": true,
            "/^yarn\\s+(list|outdated|info|why|bin|help|versions)\\b/": true,
            "/^yarn\\s+licenses\\b/": true,
            "/^yarn\\s+audit\\b(?!.*\\bfix\\b)/": true,
            "/^yarn\\s+config\\s+(list|get)\\b/": true,
            "/^yarn\\s+cache\\s+dir\\b/": true,
            "/^pnpm\\s+(ls|list|outdated|why|root|bin|doctor)\\b/": true,
            "/^pnpm\\s+licenses\\b/": true,
            "/^pnpm\\s+audit\\b(?!.*\\bfix\\b)/": true,
            "/^pnpm\\s+config\\s+(list|get)\\b/": true,
            "npm ci": true,
            "/^yarn\\s+install\\s+--frozen-lockfile\\b/": true,
            "/^pnpm\\s+install\\s+--frozen-lockfile\\b/": true,
            column: true,
            "/^column\\b.*\\s-c\\s+[0-9]{4,}/": false,
            date: true,
            "/^date\\b.*\\s(-s|--set)\\b/": false,
            find: true,
            "/^find\\b.*\\s-(delete|exec|execdir|fprint|fprintf|fls|ok|okdir)\\b/": false,
            rg: true,
            "/^rg\\b.*\\s(--pre|--hostname-bin)\\b/": false,
            sed: true,
            "/^sed\\b.*\\s(-[a-zA-Z]*(e|f)[a-zA-Z]*|--expression|--file)\\b/": false,
            "/^sed\\b.*s\\/.*\\/.*\\/[ew]/": false,
            "/^sed\\b.*;W/": false,
            sort: true,
            "/^sort\\b.*\\s-(o|S)\\b/": false,
            tree: true,
            "/^tree\\b.*\\s-o\\b/": false,
            "/^xxd$/": true,
            "/^xxd\\b(\\s+-\\S+)*\\s+[^-\\s]\\S*$/": true,
            rm: false,
            rmdir: false,
            del: false,
            "Remove-Item": false,
            ri: false,
            rd: false,
            erase: false,
            dd: false,
            kill: false,
            ps: false,
            top: false,
            "Stop-Process": false,
            spps: false,
            taskkill: false,
            "taskkill.exe": false,
            curl: false,
            wget: false,
            "Invoke-RestMethod": false,
            "Invoke-WebRequest": false,
            "irm": false,
            "iwr": false,
            chmod: false,
            chown: false,
            "Set-ItemProperty": false,
            "sp": false,
            "Set-Acl": false,
            jq: false,
            xargs: false,
            eval: false,
            "Invoke-Expression": false,
            iex: false
        }
    },
    [TerminalChatAgentToolsSettingId.IgnoreDefaultAutoApproveRules]: {
        type: "boolean",
        default: false,
        tags: ["experimental"],
        markdownDescription: ( localize(
            13925,
            "Whether to ignore the built-in default auto-approve rules used by the run in terminal tool as defined in {0}. When this setting is enabled, the run in terminal tool will ignore any rule that comes from the default set but still follow rules defined in the user, remote and workspace settings. Use this setting at your own risk; the default auto-approve rules are designed to protect you against running dangerous commands.",
            `\`#${TerminalChatAgentToolsSettingId.AutoApprove}#\``
        ))
    },
    [TerminalChatAgentToolsSettingId.AutoApproveWorkspaceNpmScripts]: {
        restricted: true,
        type: "boolean",
        default: true,
        tags: ["experimental"],
        markdownDescription: ( localize(
            13926,
            "Whether to automatically approve npm, yarn, and pnpm run commands when the script is defined in a workspace package.json file. Since the workspace is trusted, scripts defined in package.json are considered safe to run without explicit approval."
        ))
    },
    [TerminalChatAgentToolsSettingId.BlockDetectedFileWrites]: {
        type: "string",
        enum: ["never", "outsideWorkspace", "all"],
        enumDescriptions: [( localize(13927, "Allow all detected file writes.")), ( localize(
            13928,
            "Block file writes detected outside the workspace. This depends on the shell integration feature working correctly to determine the current working directory of the terminal."
        )), ( localize(13929, "Block all detected file writes."))],
        default: "outsideWorkspace",
        tags: ["experimental"],
        markdownDescription: ( localize(
            13930,
            "Controls whether detected file write operations are blocked in the run in terminal tool. When detected, this will require explicit approval regardless of whether the command would normally be auto approved. Note that this cannot detect all possible methods of writing files, this is what is currently detected:\n\n- File redirection (detected via the bash or PowerShell tree sitter grammar)\n- `sed` in-place editing (`-i`, `-I`, `--in-place`)"
        ))
    },
    [TerminalChatAgentToolsSettingId.ShellIntegrationTimeout]: {
        markdownDescription: ( localize(
            13931,
            "Configures the duration in milliseconds to wait for shell integration to be detected when the run in terminal tool launches a new terminal. Set to `0` to skip the wait entirely, the default value `-1` uses a variable wait time based on the value of {0} and whether it's a remote window. A large value can be useful if your shell starts very slowly.",
            `\`#${TerminalSettingId.ShellIntegrationEnabled}#\``
        )),
        type: "integer",
        minimum: -1,
        maximum: 60000,
        default: -1,
        markdownDeprecationMessage: ( localize(
            13932,
            "Use {0} instead",
            `\`#${TerminalSettingId.ShellIntegrationTimeout}#\``
        ))
    },
    [TerminalChatAgentToolsSettingId.IdlePollInterval]: {
        markdownDescription: ( localize(
            13933,
            "Configures the idle poll interval in milliseconds used by the run in terminal tool to detect when commands have finished executing. Lower values make command detection faster but may cause false positives on slow systems. This primarily affects terminals without shell integration where idle detection is used instead of shell integration events."
        )),
        type: "integer",
        minimum: 50,
        maximum: 10000,
        default: 1000
    },
    [TerminalChatAgentToolsSettingId.TerminalProfileLinux]: {
        restricted: true,
        markdownDescription: ( localize(
            13934,
            "The terminal profile to use on Linux for chat agent's run in terminal tool."
        )),
        type: ["object", "null"],
        default: null,
        "anyOf": [{
            type: "null"
        }, terminalChatAgentProfileSchema],
        defaultSnippets: [{
            body: {
                path: "${1}"
            }
        }]
    },
    [TerminalChatAgentToolsSettingId.TerminalProfileMacOs]: {
        restricted: true,
        markdownDescription: ( localize(
            13935,
            "The terminal profile to use on macOS for chat agent's run in terminal tool."
        )),
        type: ["object", "null"],
        default: null,
        "anyOf": [{
            type: "null"
        }, terminalChatAgentProfileSchema],
        defaultSnippets: [{
            body: {
                path: "${1}"
            }
        }]
    },
    [TerminalChatAgentToolsSettingId.TerminalProfileWindows]: {
        restricted: true,
        markdownDescription: ( localize(
            13936,
            "The terminal profile to use on Windows for chat agent's run in terminal tool."
        )),
        type: ["object", "null"],
        default: null,
        "anyOf": [{
            type: "null"
        }, terminalChatAgentProfileSchema],
        defaultSnippets: [{
            body: {
                path: "${1}"
            }
        }]
    },
    [TerminalChatAgentToolsSettingId.AutoReplyToPrompts]: {
        type: "boolean",
        default: false,
        tags: ["experimental"],
        markdownDescription: ( localize(
            13937,
            "Whether to automatically respond to prompts in the terminal such as `Confirm? y/n`. This is an experimental feature and may not work in all scenarios.\n\n**This feature is inherently risky to use as you're deferring potentially sensitive decisions to an LLM. Use at your own risk.**"
        ))
    },
    [TerminalChatAgentToolsSettingId.OutputLocation]: {
        markdownDescription: ( localize(13938, "Where to show the output from the run in terminal tool.")),
        type: "string",
        enum: ["terminal", "chat"],
        enumDescriptions: [( localize(13939, "Reveal the terminal in the panel or editor in addition to chat.")), ( localize(13940, "Reveal the terminal output within chat only."))],
        default: "chat",
        tags: ["experimental"],
        experiment: {
            mode: "auto"
        }
    },
    [TerminalChatAgentToolsSettingId.TerminalSandboxEnabled]: {
        markdownDescription: ( localize(
            13941,
            "Controls whether to run commands in a sandboxed terminal for the run in terminal tool."
        )),
        type: "boolean",
        default: false,
        tags: ["preview"],
        restricted: true,
        experiment: {
            mode: "auto"
        }
    },
    [TerminalChatAgentToolsSettingId.TerminalSandboxNetworkAllowedDomains]: {
        markdownDescription: ( localize(
            13942,
            "Note: this setting is applicable only when {0} is enabled. Allowed domains for network access in the terminal sandbox. Supports wildcards like {1} and an empty list means no network access.",
            `\`#${TerminalChatAgentToolsSettingId.TerminalSandboxEnabled}#\``,
            "`*.example.com`"
        )),
        type: "array",
        items: {
            type: "string"
        },
        default: [],
        tags: ["preview"],
        restricted: true
    },
    [TerminalChatAgentToolsSettingId.TerminalSandboxNetworkDeniedDomains]: {
        markdownDescription: ( localize(
            13943,
            "Note: this setting is applicable only when {0} is enabled. Array of denied domains for network access in the terminal sandbox (checked first, takes precedence over {1}).",
            `\`#${TerminalChatAgentToolsSettingId.TerminalSandboxEnabled}#\``,
            `\`#${TerminalChatAgentToolsSettingId.TerminalSandboxNetworkAllowedDomains}#\``
        )),
        type: "array",
        items: {
            type: "string"
        },
        default: [],
        tags: ["preview"],
        restricted: true
    },
    [TerminalChatAgentToolsSettingId.TerminalSandboxNetworkAllowTrustedDomains]: {
        markdownDescription: ( localize(
            13944,
            "Note: this setting is applicable only when {0} is enabled. When enabled, the Trusted Domains list is included in the allowed domains for network access in the terminal sandbox.",
            `\`#${TerminalChatAgentToolsSettingId.TerminalSandboxEnabled}#\``
        )),
        type: "boolean",
        default: false,
        tags: ["preview"],
        restricted: true
    },
    [TerminalChatAgentToolsSettingId.TerminalSandboxLinuxFileSystem]: {
        markdownDescription: ( localize(
            13945,
            "Note: this setting is applicable only when {0} is enabled. Controls file system access in the terminal sandbox on Linux. Paths do not support glob patterns, only literal paths (ex: ./src/, ~/.ssh, .env). **bubblewrap** and **socat** should be installed for this setting to work.",
            `\`#${TerminalChatAgentToolsSettingId.TerminalSandboxEnabled}#\``
        )),
        type: "object",
        properties: {
            denyRead: {
                type: "array",
                description: ( localize(
                    13946,
                    "Array of paths to deny read access. Leave empty to allow reading all paths."
                )),
                items: {
                    type: "string"
                },
                default: []
            },
            allowWrite: {
                type: "array",
                description: ( localize(
                    13947,
                    "Array of paths to allow write access. Leave empty to disallow all writes."
                )),
                items: {
                    type: "string"
                },
                default: ["."]
            },
            denyWrite: {
                type: "array",
                description: ( localize(
                    13948,
                    "Array of paths to deny write access within allowed paths (takes precedence over allowWrite)."
                )),
                items: {
                    type: "string"
                },
                default: []
            }
        },
        default: {
            denyRead: [],
            allowWrite: ["."],
            denyWrite: []
        },
        tags: ["preview"],
        restricted: true
    },
    [TerminalChatAgentToolsSettingId.TerminalSandboxMacFileSystem]: {
        markdownDescription: ( localize(
            13949,
            "Note: this setting is applicable only when {0} is enabled. Controls file system access in the terminal sandbox on macOS. Paths also support git-style glob patterns(ex: *.ts, ./src, ./src/**/*.ts, file?.txt).",
            `\`#${TerminalChatAgentToolsSettingId.TerminalSandboxEnabled}#\``
        )),
        type: "object",
        properties: {
            denyRead: {
                type: "array",
                description: ( localize(
                    13950,
                    "Array of paths to deny read access. Leave empty to allow reading all paths."
                )),
                items: {
                    type: "string"
                },
                default: []
            },
            allowWrite: {
                type: "array",
                description: ( localize(
                    13951,
                    "Array of paths to allow write access. Leave empty to disallow all writes."
                )),
                items: {
                    type: "string"
                },
                default: ["."]
            },
            denyWrite: {
                type: "array",
                description: ( localize(
                    13952,
                    "Array of paths to deny write access within allowed paths (takes precedence over allowWrite)."
                )),
                items: {
                    type: "string"
                },
                default: []
            }
        },
        default: {
            denyRead: [],
            allowWrite: ["."],
            denyWrite: []
        },
        tags: ["preview"],
        restricted: true
    },
    [TerminalChatAgentToolsSettingId.PreventShellHistory]: {
        type: "boolean",
        default: true,
        markdownDescription: [( localize(
            13953,
            "Whether to exclude commands run by the terminal tool from the shell history. See below for the supported shells and the method used for each:"
        )), `- \`bash\`: ${( localize(
            13954,
            "Sets `HISTCONTROL=ignorespace` and prepends the command with space"
        ))}`, `- \`zsh\`: ${( localize(
            13955,
            "Sets `HIST_IGNORE_SPACE` option and prepends the command with space"
        ))}`, `- \`fish\`: ${( localize(
            13956,
            "Sets `fish_private_mode` to prevent any command from entering history"
        ))}`, `- \`pwsh\`: ${( localize(
            13957,
            "Sets a custom history handler via PSReadLine's `AddToHistoryHandler` to prevent any command from entering history"
        ))}`].join("\n")
    },
    [TerminalChatAgentToolsSettingId.EnforceTimeoutFromModel]: {
        restricted: true,
        type: "boolean",
        default: true,
        tags: ["experimental"],
        experiment: {
            mode: "auto"
        },
        markdownDescription: ( localize(
            13958,
            "Whether to enforce the timeout value provided by the model in the run in terminal tool. When enabled, if the model provides a timeout parameter, the tool will stop tracking the command after that duration and return the output collected so far."
        ))
    }
};
for (const id of [
    TerminalChatAgentToolsSettingId.DeprecatedAutoApprove1,
    TerminalChatAgentToolsSettingId.DeprecatedAutoApprove2,
    TerminalChatAgentToolsSettingId.DeprecatedAutoApprove3,
    TerminalChatAgentToolsSettingId.DeprecatedAutoApprove4,
    TerminalChatAgentToolsSettingId.DeprecatedAutoApproveCompatible
]) {
    terminalChatAgentToolsConfiguration[id] = {
        deprecated: true,
        markdownDeprecationMessage: ( localize(
            13959,
            "Use {0} instead",
            `\`#${TerminalChatAgentToolsSettingId.AutoApprove}#\``
        ))
    };
}
terminalChatAgentToolsConfiguration[TerminalChatAgentToolsSettingId.DeprecatedTerminalSandboxNetwork] = {
    type: "object",
    deprecated: true,
    markdownDeprecationMessage: ( localize(
        13960,
        "This setting has been split into {0}, {1}, and {2}.",
        `\`#${TerminalChatAgentToolsSettingId.TerminalSandboxNetworkAllowedDomains}#\``,
        `\`#${TerminalChatAgentToolsSettingId.TerminalSandboxNetworkDeniedDomains}#\``,
        `\`#${TerminalChatAgentToolsSettingId.TerminalSandboxNetworkAllowTrustedDomains}#\``
    ))
};

export { TerminalChatAgentToolsSettingId, terminalChatAgentToolsConfiguration };
