MCPcopy Index your code
hub / github.com/coder/mux / deletePath

Method deletePath

src/node/services/memoryService.ts:810–833  ·  view source on GitHub ↗
(
    ctx: MemoryScopeContext,
    virtualPath: string,
    actor: MemoryActor
  )

Source from the content-addressed store, hash-verified

808 }
809
810 async deletePath(
811 ctx: MemoryScopeContext,
812 virtualPath: string,
813 actor: MemoryActor
814 ): Promise<MemoryCommandResult> {
815 return this.runCommand(async () => {
816 const parsed = parseMemoryPath(virtualPath);
817 const scope = this.requireFilePath(parsed, virtualPath);
818 const store = await this.resolveStore(ctx, scope, parsed.relPath);
819 return this.locks.withLock(store.physicalRoot, async () => {
820 const kind = await store.kind(parsed.relPath);
821 if (kind === null) {
822 throw new MemoryCommandError(`No memory file or directory at ${virtualPath}`);
823 }
824 await store.remove(parsed.relPath);
825 await this.recordDelete(ctx, scope, parsed.relPath);
826 this.emitChange(ctx, scope, parsed.relPath, actor);
827 return {
828 success: true as const,
829 output: `Deleted ${toVirtualPath(scope, parsed.relPath)}`,
830 };
831 });
832 });
833 }
834
835 async rename(
836 ctx: MemoryScopeContext,

Callers 4

deleteInboxIfPresentFunction · 0.80
executeMemoryCommandFunction · 0.80
routerFunction · 0.80

Calls 10

runCommandMethod · 0.95
requireFilePathMethod · 0.95
resolveStoreMethod · 0.95
recordDeleteMethod · 0.95
emitChangeMethod · 0.95
parseMemoryPathFunction · 0.85
toVirtualPathFunction · 0.85
withLockMethod · 0.80
kindMethod · 0.65
removeMethod · 0.65

Tested by

no test coverage detected