* Base64-encode a string as UTF-16LE for PowerShell's -EncodedCommand. * Same encoding the parser uses (parser.ts toUtf16LeBase64). The output * is [A-Za-z0-9+/=] only — survives ANY shell-quoting layer, including * @anthropic-ai/sandbox-runtime's shellquote.quote() which would otherwise * corru
(psCommand: string)
| 21 | * quotes. Review 2964609818. |
| 22 | */ |
| 23 | function encodePowerShellCommand(psCommand: string): string { |
| 24 | return Buffer.from(psCommand, 'utf16le').toString('base64') |
| 25 | } |
| 26 | |
| 27 | export function createPowerShellProvider(shellPath: string): ShellProvider { |
| 28 | let currentSandboxTmpDir: string | undefined |
no test coverage detected