feat(ext/sw): GitHost.writeFileCreateOnly() refuses to overwrite

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-04-27 18:06:48 -04:00
parent 98c962796f
commit 86b5941875
4 changed files with 89 additions and 0 deletions

View File

@@ -11,6 +11,11 @@ export interface GitHost {
/// Create or update a file in the repo with a commit message.
writeFile(path: string, content: Uint8Array, message: string): Promise<void>;
/// Like writeFile, but throws if the file already exists. Used by setup
/// wizard to refuse to clobber existing vault state. Implementation must
/// pre-check existence and only POST/PUT-create — never include a sha.
writeFileCreateOnly(path: string, content: Uint8Array, message: string): Promise<void>;
/// Delete a file from the repo with a commit message.
deleteFile(path: string, message: string): Promise<void>;