Merge remote-tracking branch 'origin/master' into fs-overwrite-diff-bound-v2
# Conflicts: # docs/subsystems/lsp.i18n.yaml # packages/fs/fs-local/README.i18n.yaml # packages/fs/fs-local/README.md # packages/fs/fs-local/README.zh.md # packages/fs/fs-local/src/index.ts
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
|
||||
import { Context } from 'cordis'
|
||||
import { constants as bufferConstants } from 'node:buffer'
|
||||
import { resolve } from 'node:path'
|
||||
import { isAbsolute, relative, resolve, sep } from 'node:path'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
import z from 'schemastery'
|
||||
import { FileSystem, FsError, FsVersion } from '@deepseek-ai/dsh-fs'
|
||||
import type {
|
||||
@@ -108,6 +109,19 @@ export class LocalFileSystem extends FileSystem {
|
||||
return { targetKey: local.targetKey, displayPath: local.displayPath }
|
||||
}
|
||||
|
||||
override processPath(target: FsTarget): string {
|
||||
return String(target.targetKey)
|
||||
}
|
||||
|
||||
override fileUrl(target: FsTarget): string {
|
||||
return pathToFileURL(this.processPath(target)).href
|
||||
}
|
||||
|
||||
override contains(parent: FsTarget, child: FsTarget): boolean {
|
||||
const path = relative(this.processPath(parent), this.processPath(child))
|
||||
return path === '' || (path !== '..' && !path.startsWith(`..${sep}`) && !isAbsolute(path))
|
||||
}
|
||||
|
||||
override async stat(target: FsTarget, signal?: AbortSignal): Promise<FsInfo | undefined> {
|
||||
if (signal?.aborted) throw new FsError('stat aborted', 'FS_ABORTED')
|
||||
const info = await probe(target.targetKey)
|
||||
|
||||
Reference in New Issue
Block a user