@almadar/workspace 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2032,6 +2032,16 @@ var WorkspaceServiceImpl = class {
2032
2032
  });
2033
2033
  await this.emit({ kind: "file", relPath, content });
2034
2034
  }
2035
+ async removeFile(relPath) {
2036
+ const abs = sandboxedPath(this.workDir, relPath);
2037
+ let removed = false;
2038
+ await this.withLock(abs, async () => {
2039
+ if (!this.backend.exists(abs)) return;
2040
+ await this.backend.unlink(abs);
2041
+ removed = true;
2042
+ });
2043
+ if (removed) await this.emit({ kind: "file-removed", relPath });
2044
+ }
2035
2045
  async listTree(relPath) {
2036
2046
  const base = relPath === void 0 ? this.workDir : sandboxedPath(this.workDir, relPath);
2037
2047
  if (!this.backend.exists(base)) return [];