Share the command file-write parser contract across terminal auto-approval
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
## Context
PR https://github.com/microsoft/vscode/pull/328882 moves `SedFileWriteParser` into `vs/platform/terminal/common/autoApprove` so workbench and Agent Host can reuse it.
The parser structurally satisfies workbench's `ICommandFileWriteParser`, but cannot explicitly declare `implements ICommandFileWriteParser` because that interface still lives under the workbench contribution layer.
## Debt
Move the command-specific file-write parser contract to the shared terminal auto-approval layer, for example:
```text
src/vs/platform/terminal/common/autoApprove/commandFileWriteParser.ts
```
Then:
- Have `SedFileWriteParser` explicitly implement the shared interface.
- Update workbench's parser registry to import the shared interface.
- Use the shared contract for future command-specific write parsers (`tee`, `dd`, `perl -i`, etc.).
- Keep destination approval policy in workbench and Agent Host; only the parser contract belongs in the shared layer.
This is an organizational/type-contract cleanup and should not change runtime behavior.
Contributor guide
Assessment
This issue has not been assessed yet.