poe-code 12.0.6 → 12.0.7
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/README.md +20 -1
- package/dist/index.js +46 -5
- package/dist/index.js.map +2 -2
- package/dist/metafile.json +1 -1
- package/package.json +46 -5
- package/packages/package-lint/dist/bundle-policy.d.ts +144 -1
- package/packages/package-lint/dist/bundle-policy.js +289 -60
- package/packages/package-lint/dist/model.d.ts +2 -1
- package/packages/package-lint/dist/model.js +8 -1
- package/packages/safe-fs/dist/bridge/filesystem.d.ts +88 -0
- package/packages/safe-fs/dist/bridge/index.d.ts +6 -0
- package/packages/safe-fs/dist/bridge/stats.d.ts +4 -0
- package/packages/safe-fs/dist/bridge/types.d.ts +75 -0
- package/packages/safe-fs/dist/bridge/values.d.ts +6 -0
- package/packages/safe-fs/dist/contracts/errors.d.ts +3 -2
- package/packages/safe-fs/dist/contracts/path.d.ts +1 -6
- package/packages/safe-fs/dist/contracts/virtual-path.d.ts +7 -0
- package/packages/safe-fs/dist/core.d.ts +11 -0
- package/packages/safe-fs/dist/fs/mount/comparison.d.ts +1 -0
- package/packages/safe-fs/dist/fs/overlay/index.d.ts +2 -1
- package/packages/safe-fs/dist/fs/readonly/index.d.ts +2 -1
- package/packages/safe-fs/dist/fs/s3/authority.d.ts +3 -9
- package/packages/safe-fs/dist/fs/s3/registry.d.ts +10 -0
- package/packages/safe-fs/dist/fs/webdav/webdav.d.ts +2 -1
- package/packages/safe-fs/dist/node/stats.d.ts +1 -4
- package/packages/safe-fs/dist/node/values.d.ts +1 -6
- package/packages/safe-fs/dist/node-host.d.ts +1 -0
- package/packages/safe-fs/dist/node-unavailable.d.ts +1 -0
- package/packages/safe-fs/dist/platform/browser.d.ts +12 -0
- package/packages/safe-fs/dist/platform/node.d.ts +13 -0
- package/packages/safejs/dist/browser/chunks/chunk-MUKMA7ZY.js +4053 -0
- package/packages/safejs/dist/browser/chunks/chunk-MUKMA7ZY.js.map +7 -0
- package/packages/safejs/dist/browser/safe-fs-core.js +55 -0
- package/packages/safejs/dist/browser/safe-fs-core.js.map +7 -0
- package/packages/safejs/dist/browser/safe-fs.js +55 -0
- package/packages/safejs/dist/browser/safe-fs.js.map +7 -0
- package/packages/safejs/dist/chunks/chunk-F7NY24BF.js +2603 -0
- package/packages/safejs/dist/chunks/chunk-F7NY24BF.js.map +7 -0
- package/packages/safejs/dist/chunks/{chunk-KJSS53IH.js → chunk-NTYX57KK.js} +6 -4
- package/packages/safejs/dist/chunks/{chunk-KJSS53IH.js.map → chunk-NTYX57KK.js.map} +1 -1
- package/packages/safejs/dist/chunks/{chunk-B3G3JVCW.js → chunk-YBQUQPZV.js} +637 -3120
- package/packages/safejs/dist/chunks/chunk-YBQUQPZV.js.map +7 -0
- package/packages/safejs/dist/cli.js +3 -2
- package/packages/safejs/dist/cli.js.map +1 -1
- package/packages/safejs/dist/index.js +3 -2
- package/packages/safejs/dist/index.js.map +1 -1
- package/packages/safejs/dist/safe-fs-core.js +80 -0
- package/packages/safejs/dist/safe-fs-core.js.map +7 -0
- package/packages/safejs/dist/safe-fs-node.js +94 -0
- package/packages/safejs/dist/safe-fs-node.js.map +7 -0
- package/packages/safejs/dist/safe-fs.js +20 -18
- package/packages/terminal-pilot/dist/commands/index.d.ts +2 -2
- package/packages/terminal-pilot/dist/commands/installer.d.ts +1 -1
- package/packages/tiny-mcp-client/dist/index.d.ts +1 -1
- package/packages/toolcraft/dist/mcp.d.ts +3 -3
- package/packages/safejs/dist/chunks/chunk-B3G3JVCW.js.map +0 -7
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { collectCanonicalDeclarations } from "./bundle-policy.js";
|
|
2
3
|
import { parse as parseYaml } from "yaml";
|
|
3
4
|
import { createNpmPacklistProvider, loadPackageFileView } from "./packlist.js";
|
|
4
5
|
import { scanRuntimeFileAssets } from "./runtime-files.js";
|
|
@@ -107,6 +108,7 @@ async function loadPackage(fs, rootDir, relDir, isRoot) {
|
|
|
107
108
|
ecosystem,
|
|
108
109
|
main: typeof pkg.main === "string" ? pkg.main : undefined,
|
|
109
110
|
exports: pkg.exports,
|
|
111
|
+
imports: pkg.imports,
|
|
110
112
|
bin: toBinRecord(pkg.bin, typeof pkg.name === "string" ? pkg.name : relDir),
|
|
111
113
|
files: Array.isArray(pkg.files)
|
|
112
114
|
? pkg.files.filter((f) => typeof f === "string")
|
|
@@ -448,12 +450,17 @@ export async function loadBuildView(fs, rootDir) {
|
|
|
448
450
|
catch {
|
|
449
451
|
return undefined;
|
|
450
452
|
}
|
|
453
|
+
let metafile;
|
|
451
454
|
try {
|
|
452
|
-
|
|
455
|
+
metafile = JSON.parse(raw);
|
|
453
456
|
}
|
|
454
457
|
catch {
|
|
455
458
|
return undefined;
|
|
456
459
|
}
|
|
460
|
+
if (metafile.canonicalBundle || metafile.browserCanonicalBundle) {
|
|
461
|
+
Object.assign(metafile, await collectCanonicalDeclarations(rootDir, fs));
|
|
462
|
+
}
|
|
463
|
+
return parseMetafile(metafile);
|
|
457
464
|
}
|
|
458
465
|
/** All workspace packages plus the root package. */
|
|
459
466
|
export function allPackages(model) {
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { FileSystem } from "../contracts/filesystem.js";
|
|
2
|
+
import type { BridgePrimitives, BufferEncodingOption, FsBridgeDirent, FsBridgeEncoding, FsBridgeStats, MakeDirectoryOptions, Mode, ObjectEncodingOptions, StatOptions } from "./types.js";
|
|
3
|
+
type Encoding = FsBridgeEncoding | "buffer";
|
|
4
|
+
type ReadOptions = ObjectEncodingOptions & {
|
|
5
|
+
flag?: string | number | undefined;
|
|
6
|
+
signal?: AbortSignal | undefined;
|
|
7
|
+
};
|
|
8
|
+
type DirectoryOptions = {
|
|
9
|
+
encoding?: Encoding | null | undefined;
|
|
10
|
+
recursive?: boolean | undefined;
|
|
11
|
+
withFileTypes?: boolean | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare class FileSystemBridge<Binary extends Uint8Array> {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(fs: FileSystem, options: {
|
|
16
|
+
readonly cwd?: string;
|
|
17
|
+
readonly signal?: AbortSignal;
|
|
18
|
+
}, primitives: BridgePrimitives<Binary>);
|
|
19
|
+
readFile(path: unknown, options?: {
|
|
20
|
+
encoding?: null | undefined;
|
|
21
|
+
flag?: string | number | undefined;
|
|
22
|
+
signal?: AbortSignal | undefined;
|
|
23
|
+
} | null): Promise<Binary>;
|
|
24
|
+
readFile(path: unknown, options: FsBridgeEncoding | (ReadOptions & {
|
|
25
|
+
encoding: FsBridgeEncoding;
|
|
26
|
+
})): Promise<string>;
|
|
27
|
+
readFile(path: unknown, options?: ReadOptions | FsBridgeEncoding | null): Promise<string | Binary>;
|
|
28
|
+
writeFile(path: unknown, data: unknown, options?: unknown): Promise<void>;
|
|
29
|
+
appendFile(path: unknown, data: unknown, options?: unknown): Promise<void>;
|
|
30
|
+
stat(path: unknown, options?: StatOptions & {
|
|
31
|
+
bigint?: false | undefined;
|
|
32
|
+
}): Promise<FsBridgeStats>;
|
|
33
|
+
stat(path: unknown, options: StatOptions & {
|
|
34
|
+
bigint: true;
|
|
35
|
+
}): Promise<never>;
|
|
36
|
+
stat(path: unknown, options?: StatOptions): Promise<FsBridgeStats>;
|
|
37
|
+
lstat(path: unknown, options?: StatOptions & {
|
|
38
|
+
bigint?: false | undefined;
|
|
39
|
+
}): Promise<FsBridgeStats>;
|
|
40
|
+
lstat(path: unknown, options: StatOptions & {
|
|
41
|
+
bigint: true;
|
|
42
|
+
}): Promise<never>;
|
|
43
|
+
lstat(path: unknown, options?: StatOptions): Promise<FsBridgeStats>;
|
|
44
|
+
readdir(path: unknown, options?: FsBridgeEncoding | (ObjectEncodingOptions & {
|
|
45
|
+
withFileTypes?: false | undefined;
|
|
46
|
+
recursive?: boolean | undefined;
|
|
47
|
+
}) | null): Promise<string[]>;
|
|
48
|
+
readdir(path: unknown, options: "buffer" | (DirectoryOptions & {
|
|
49
|
+
encoding: "buffer";
|
|
50
|
+
withFileTypes?: false | undefined;
|
|
51
|
+
})): Promise<Binary[]>;
|
|
52
|
+
readdir(path: unknown, options: ObjectEncodingOptions & {
|
|
53
|
+
withFileTypes: true;
|
|
54
|
+
recursive?: boolean | undefined;
|
|
55
|
+
}): Promise<FsBridgeDirent[]>;
|
|
56
|
+
readdir(path: unknown, options: DirectoryOptions & {
|
|
57
|
+
encoding: "buffer";
|
|
58
|
+
withFileTypes: true;
|
|
59
|
+
}): Promise<FsBridgeDirent<Binary>[]>;
|
|
60
|
+
mkdir(path: unknown, options: MakeDirectoryOptions & {
|
|
61
|
+
recursive: true;
|
|
62
|
+
}): Promise<string | undefined>;
|
|
63
|
+
mkdir(path: unknown, options?: Mode | (MakeDirectoryOptions & {
|
|
64
|
+
recursive?: false | undefined;
|
|
65
|
+
}) | null): Promise<void>;
|
|
66
|
+
mkdir(path: unknown, options?: Mode | MakeDirectoryOptions | null): Promise<string | undefined>;
|
|
67
|
+
access(path: unknown, mode?: number): Promise<void>;
|
|
68
|
+
rm(path: unknown, value?: unknown): Promise<void>;
|
|
69
|
+
rmdir(path: unknown, value?: unknown): Promise<void>;
|
|
70
|
+
rename(source: unknown, destination: unknown): Promise<void>;
|
|
71
|
+
copyFile(source: unknown, destination: unknown, mode?: number): Promise<void>;
|
|
72
|
+
cp(source: unknown, destination: unknown, value?: unknown): Promise<void>;
|
|
73
|
+
readlink(path: unknown, options?: ObjectEncodingOptions | FsBridgeEncoding | null): Promise<string>;
|
|
74
|
+
readlink(path: unknown, options: BufferEncodingOption): Promise<Binary>;
|
|
75
|
+
readlink(path: unknown, options?: ObjectEncodingOptions | BufferEncodingOption | string | null): Promise<string | Binary>;
|
|
76
|
+
realpath(path: unknown, options?: ObjectEncodingOptions | FsBridgeEncoding | null): Promise<string>;
|
|
77
|
+
realpath(path: unknown, options: BufferEncodingOption): Promise<Binary>;
|
|
78
|
+
realpath(path: unknown, options?: ObjectEncodingOptions | BufferEncodingOption | string | null): Promise<string | Binary>;
|
|
79
|
+
mkdtemp(prefix: string, options?: ObjectEncodingOptions | FsBridgeEncoding | null): Promise<string>;
|
|
80
|
+
mkdtemp(prefix: string, options: BufferEncodingOption): Promise<Binary>;
|
|
81
|
+
mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncodingOption | string | null): Promise<string | Binary>;
|
|
82
|
+
symlink(target: unknown, path: unknown, type?: unknown): Promise<void>;
|
|
83
|
+
link(existing: unknown, path: unknown): Promise<void>;
|
|
84
|
+
chmod(path: unknown, value: unknown): Promise<void>;
|
|
85
|
+
utimes(path: unknown, atime: unknown, mtime: unknown): Promise<void>;
|
|
86
|
+
truncate(path: unknown, length?: number): Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FileSystem } from "../contracts/filesystem.js";
|
|
2
|
+
import { FileSystemBridge } from "./filesystem.js";
|
|
3
|
+
import type { FsBridgeOptions } from "./types.js";
|
|
4
|
+
export type { FsBridgeCodec, FsBridgeDirent, FsBridgeEncoding, FsBridgeFileSystem, FsBridgeOptions, FsBridgeStats } from "./types.js";
|
|
5
|
+
export type FsBridge = FileSystemBridge<Uint8Array<ArrayBuffer>>;
|
|
6
|
+
export declare function createFsBridge(fs: FileSystem, options: FsBridgeOptions): FsBridge;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FsBridgeDirent, FsBridgeStats } from "./types.js";
|
|
2
|
+
import type { FileStat, FileType } from "../contracts/filesystem.js";
|
|
3
|
+
export declare function bridgeStats(stat: FileStat): FsBridgeStats;
|
|
4
|
+
export declare function bridgeDirent<Name extends string | Uint8Array>(name: Name, parentPath: string, type: FileType): FsBridgeDirent<Name>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { FileSystem, FsOptions } from "../contracts/filesystem.js";
|
|
2
|
+
export interface FsBridgeCodec {
|
|
3
|
+
isEncoding(encoding: string): boolean;
|
|
4
|
+
encode(text: string, encoding: string): Uint8Array;
|
|
5
|
+
decode(bytes: Uint8Array, encoding: string): string;
|
|
6
|
+
}
|
|
7
|
+
export interface FsBridgeOptions {
|
|
8
|
+
readonly codec: FsBridgeCodec;
|
|
9
|
+
readonly cwd?: string;
|
|
10
|
+
readonly signal?: AbortSignal;
|
|
11
|
+
}
|
|
12
|
+
export interface FsBridgeFileSystem extends FileSystem {
|
|
13
|
+
rmdir?(path: string, options?: FsOptions): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export type FsBridgeEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex";
|
|
16
|
+
export interface ObjectEncodingOptions {
|
|
17
|
+
encoding?: FsBridgeEncoding | null | undefined;
|
|
18
|
+
}
|
|
19
|
+
export type BufferEncodingOption = "buffer" | {
|
|
20
|
+
encoding: "buffer";
|
|
21
|
+
};
|
|
22
|
+
export type Mode = number | string;
|
|
23
|
+
export interface MakeDirectoryOptions {
|
|
24
|
+
recursive?: boolean | undefined;
|
|
25
|
+
mode?: Mode | undefined;
|
|
26
|
+
}
|
|
27
|
+
export interface StatOptions {
|
|
28
|
+
bigint?: boolean | undefined;
|
|
29
|
+
}
|
|
30
|
+
export interface FsBridgePredicates {
|
|
31
|
+
isFile(): boolean;
|
|
32
|
+
isDirectory(): boolean;
|
|
33
|
+
isSymbolicLink(): boolean;
|
|
34
|
+
isBlockDevice(): boolean;
|
|
35
|
+
isCharacterDevice(): boolean;
|
|
36
|
+
isFIFO(): boolean;
|
|
37
|
+
isSocket(): boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface FsBridgeStats extends FsBridgePredicates {
|
|
40
|
+
dev: number;
|
|
41
|
+
ino: number;
|
|
42
|
+
mode: number;
|
|
43
|
+
nlink: number;
|
|
44
|
+
uid: number;
|
|
45
|
+
gid: number;
|
|
46
|
+
rdev: number;
|
|
47
|
+
size: number;
|
|
48
|
+
blksize: number;
|
|
49
|
+
blocks: number;
|
|
50
|
+
atimeMs: number;
|
|
51
|
+
mtimeMs: number;
|
|
52
|
+
ctimeMs: number;
|
|
53
|
+
birthtimeMs: number;
|
|
54
|
+
atime: Date;
|
|
55
|
+
mtime: Date;
|
|
56
|
+
ctime: Date;
|
|
57
|
+
birthtime: Date;
|
|
58
|
+
}
|
|
59
|
+
export interface FsBridgeDirent<Name extends string | Uint8Array = string> extends FsBridgePredicates {
|
|
60
|
+
name: Name;
|
|
61
|
+
parentPath: string;
|
|
62
|
+
path: string;
|
|
63
|
+
}
|
|
64
|
+
export interface BridgePrimitives<Binary extends Uint8Array> {
|
|
65
|
+
readonly codec: FsBridgeCodec;
|
|
66
|
+
copyBytes(bytes: Uint8Array): Binary;
|
|
67
|
+
pathValue?(value: unknown): unknown;
|
|
68
|
+
randomSuffix(): string;
|
|
69
|
+
readonly paths: {
|
|
70
|
+
isAbsolute(path: string): boolean;
|
|
71
|
+
dirname(path: string): string;
|
|
72
|
+
relative(from: string, to: string): string;
|
|
73
|
+
resolve(cwd: string, ...paths: string[]): string;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function record(value: unknown, name: string): Record<string, unknown>;
|
|
2
|
+
export declare function onlyKeys(value: Record<string, unknown>, allowed: readonly string[]): void;
|
|
3
|
+
export declare function booleanValue(value: unknown, fallback?: boolean): boolean;
|
|
4
|
+
export declare function abortError(): Error;
|
|
5
|
+
export declare function checkSignal(signal: AbortSignal | undefined): void;
|
|
6
|
+
export declare function withSignal<Value>(signal: AbortSignal | undefined, operation: () => Promise<Value>): Promise<Value>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { PlatformErrno } from "#safe-fs-platform";
|
|
2
|
+
export type { PlatformErrno } from "#safe-fs-platform";
|
|
1
3
|
declare const descriptions: {
|
|
2
4
|
readonly EACCES: "permission denied";
|
|
3
5
|
readonly EAGAIN: "resource temporarily unavailable";
|
|
@@ -37,7 +39,7 @@ export interface FsErrorOptions extends ErrorOptions {
|
|
|
37
39
|
}
|
|
38
40
|
export declare class FsError extends Error {
|
|
39
41
|
readonly code: ErrnoCode;
|
|
40
|
-
readonly errno:
|
|
42
|
+
readonly errno: PlatformErrno;
|
|
41
43
|
readonly syscall?: string;
|
|
42
44
|
readonly path?: string;
|
|
43
45
|
readonly dest?: string;
|
|
@@ -46,4 +48,3 @@ export declare class FsError extends Error {
|
|
|
46
48
|
export declare function isErrnoCode(code: unknown): code is ErrnoCode;
|
|
47
49
|
export declare function isFsError(error: unknown, code?: ErrnoCode): error is FsError;
|
|
48
50
|
export declare function toFsError(error: unknown, options?: FsErrorOptions): FsError;
|
|
49
|
-
export {};
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
|
+
export { assertPathWithin, isPathWithin, normalizePath, relativePath, resolvePath, validatePath } from "./virtual-path.js";
|
|
2
3
|
export declare const posixPath: typeof posix;
|
|
3
4
|
export declare const basename: typeof posix.basename;
|
|
4
5
|
export declare const dirname: typeof posix.dirname;
|
|
5
6
|
export declare const extname: typeof posix.extname;
|
|
6
7
|
export declare const joinPath: typeof posix.join;
|
|
7
8
|
export declare const isAbsolutePath: typeof posix.isAbsolute;
|
|
8
|
-
export declare function validatePath(path: string): void;
|
|
9
|
-
export declare function resolvePath(cwd: string, ...paths: string[]): string;
|
|
10
|
-
export declare function normalizePath(path: string, cwd?: string): string;
|
|
11
|
-
export declare function relativePath(from: string, to: string): string;
|
|
12
|
-
export declare function isPathWithin(root: string, path: string): boolean;
|
|
13
|
-
export declare function assertPathWithin(root: string, path: string): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function validatePath(path: string): void;
|
|
2
|
+
export declare function resolvePath(cwd: string, ...paths: string[]): string;
|
|
3
|
+
export declare function normalizePath(path: string, cwd?: string): string;
|
|
4
|
+
export declare function dirname(path: string): string;
|
|
5
|
+
export declare function relativePath(from: string, to: string): string;
|
|
6
|
+
export declare function isPathWithin(root: string, path: string): boolean;
|
|
7
|
+
export declare function assertPathWithin(root: string, path: string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./contracts/errors.js";
|
|
2
|
+
export * from "./contracts/filesystem.js";
|
|
3
|
+
export * from "./contracts/io.js";
|
|
4
|
+
export { assertPathWithin, isPathWithin, normalizePath, relativePath, resolvePath, validatePath } from "./contracts/virtual-path.js";
|
|
5
|
+
export * from "./fs/memory/index.js";
|
|
6
|
+
export * from "./fs/readonly/index.js";
|
|
7
|
+
export * from "./fs/mount/index.js";
|
|
8
|
+
export * from "./fs/overlay/index.js";
|
|
9
|
+
export * from "./fs/webdav/index.js";
|
|
10
|
+
export * from "./bridge/index.js";
|
|
11
|
+
export { compareEntries } from "./fs/mount/comparison.js";
|
|
@@ -11,6 +11,7 @@ export interface EntryView extends EntryLocation {
|
|
|
11
11
|
}
|
|
12
12
|
export type EntryViewResolver = (path: string, options: FsOptions) => Promise<EntryLocation>;
|
|
13
13
|
export type EntryAuthority = (own: EntryView, peer: EntryView, options: FsOptions) => Promise<EntryComparison>;
|
|
14
|
+
export declare function assertCallbackAuthorityAllowed(): void;
|
|
14
15
|
export declare function registerEntryView(filesystem: FileSystem, resolver: EntryViewResolver): void;
|
|
15
16
|
export declare function registerEntryAuthority(filesystem: FileSystem, authority: EntryAuthority): void;
|
|
16
17
|
export declare function resolveEntryView(filesystem: FileSystem, path: string, options?: FsOptions): Promise<EntryView>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ByteSource } from "../../contracts/io.js";
|
|
2
|
+
import type { AppendFileOptions, CopyFileOptions, DirectoryEntry, FileStat, FileSystem, FileSystemCapabilities, FsOptions, MkdirOptions, ReadFileOptions, ReadStreamOptions, RemoveOptions, WriteFileOptions } from "../../contracts/filesystem.js";
|
|
2
3
|
export interface OverlayFileSystemOptions {
|
|
3
4
|
readonly upper: FileSystem;
|
|
4
5
|
readonly lower: FileSystem;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ByteSource } from "../../contracts/io.js";
|
|
2
|
+
import type { AppendFileOptions, CopyFileOptions, DirectoryEntry, FileStat, FileSystem, FileSystemCapabilities, FsOptions, MkdirOptions, ReadFileOptions, ReadStreamOptions, RemoveOptions, WriteFileOptions } from "../../contracts/filesystem.js";
|
|
2
3
|
export declare class ReadOnlyFileSystem implements FileSystem {
|
|
3
4
|
#private;
|
|
4
5
|
constructor(filesystem: FileSystem);
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { EntryView } from "../mount/comparison.js";
|
|
1
|
+
import type { FileStat, FileSystem } from "../../contracts/filesystem.js";
|
|
3
2
|
import type { S3HeadOutput, S3ObjectInput } from "./transport.js";
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
readonly key: string;
|
|
7
|
-
}
|
|
3
|
+
export { registerS3EntryOwner, getOwnedS3Entry, compareOwnedS3Entries } from "./registry.js";
|
|
4
|
+
export type { OwnedS3Entry } from "./registry.js";
|
|
8
5
|
export declare function recordMockS3Head(output: S3HeadOutput, input: S3ObjectInput, storage: object): void;
|
|
9
6
|
export declare function queryS3Head(input: S3ObjectInput, action: () => Promise<S3HeadOutput>): Promise<S3HeadOutput>;
|
|
10
7
|
export declare function recordS3Stat(filesystem: FileSystem, path: string, stat: FileStat, metadata: S3HeadOutput | undefined): void;
|
|
11
|
-
export declare function registerS3EntryOwner(filesystem: FileSystem, normalize: (path: string) => string, intact: () => boolean, baseComparison: NonNullable<FileSystem["compareEntry"]>, comparison?: NonNullable<FileSystem["compareEntry"]>): void;
|
|
12
|
-
export declare function getOwnedS3Entry(view: EntryView): OwnedS3Entry | undefined;
|
|
13
|
-
export declare function compareOwnedS3Entries(own: EntryView, peer: EntryView, options: FsOptions): Promise<EntryComparison>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FileStat, FileSystem, FsOptions, EntryComparison } from "../../contracts/filesystem.js";
|
|
2
|
+
import type { EntryView } from "../mount/comparison.js";
|
|
3
|
+
export interface OwnedS3Entry {
|
|
4
|
+
readonly storage: object;
|
|
5
|
+
readonly key: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function recordS3Observation(filesystem: FileSystem, path: string, stat: FileStat, entry: OwnedS3Entry): void;
|
|
8
|
+
export declare function registerS3EntryOwner(filesystem: FileSystem, normalize: (path: string) => string, intact: () => boolean, baseComparison: NonNullable<FileSystem["compareEntry"]>, comparison?: NonNullable<FileSystem["compareEntry"]>): void;
|
|
9
|
+
export declare function getOwnedS3Entry(view: EntryView): OwnedS3Entry | undefined;
|
|
10
|
+
export declare function compareOwnedS3Entries(own: EntryView, peer: EntryView, options: FsOptions): Promise<EntryComparison>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PlatformComparisonCallback } from "#safe-fs-platform";
|
|
1
2
|
import type { ByteSource } from "../../contracts/io.js";
|
|
2
3
|
import type { AppendFileOptions, CopyFileOptions, DirectoryEntry, EntryComparison, FileStat, FileSystem, FsOptions, MkdirOptions, ReadFileOptions, ReadStreamOptions, RemoveOptions, WriteFileOptions } from "../../contracts/filesystem.js";
|
|
3
4
|
export type WebDavFetch = (url: string, init: RequestInit) => Promise<Response>;
|
|
@@ -27,7 +28,7 @@ export interface WebDavFileSystemOptions {
|
|
|
27
28
|
readonly timeoutMs?: number;
|
|
28
29
|
readonly overwritePolicy?: "lock" | "etag";
|
|
29
30
|
readonly atomicEmptyDirectory?: WebDavAtomicEmptyDirectoryBinding;
|
|
30
|
-
readonly compareEntry?: (this: FileSystem, ...args: Parameters<NonNullable<FileSystem["compareEntry"]>>) => ReturnType<NonNullable<FileSystem["compareEntry"]
|
|
31
|
+
readonly compareEntry?: PlatformComparisonCallback<(this: FileSystem, ...args: Parameters<NonNullable<FileSystem["compareEntry"]>>) => ReturnType<NonNullable<FileSystem["compareEntry"]>>>;
|
|
31
32
|
}
|
|
32
33
|
export declare class WebDavFileSystem implements FileSystem {
|
|
33
34
|
readonly capabilities: Readonly<{
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { FileStat, FileType } from "../contracts/filesystem.js";
|
|
3
|
-
export declare function nodeStats(stat: FileStat): Stats;
|
|
4
|
-
export declare function nodeDirent<Name extends string | Buffer>(name: Name, parentPath: string, type: FileType): Dirent<Name>;
|
|
1
|
+
export { bridgeDirent as nodeDirent, bridgeStats as nodeStats } from "../bridge/stats.js";
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare function onlyKeys(value: Record<string, unknown>, allowed: readonly string[]): void;
|
|
3
|
-
export declare function booleanValue(value: unknown, fallback?: boolean): boolean;
|
|
4
|
-
export declare function abortError(): Error;
|
|
5
|
-
export declare function checkSignal(signal: AbortSignal | undefined): void;
|
|
6
|
-
export declare function withSignal<Value>(signal: AbortSignal | undefined, operation: () => Promise<Value>): Promise<Value>;
|
|
1
|
+
export { abortError, booleanValue, checkSignal, onlyKeys, record, withSignal } from "../bridge/values.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FsOptions } from "../contracts/filesystem.js";
|
|
2
|
+
export type PlatformErrno = number | undefined;
|
|
3
|
+
export type PlatformComparisonCallback<Callback> = Callback & never;
|
|
4
|
+
export declare const platform: Readonly<{
|
|
5
|
+
errno(_code: string): PlatformErrno;
|
|
6
|
+
callbackAuthorities: false;
|
|
7
|
+
randomUUID(): string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const comparisonContext: Readonly<{
|
|
10
|
+
active(options: FsOptions): boolean;
|
|
11
|
+
run<Result>(options: FsOptions, action: (nested: FsOptions) => Promise<Result>): Promise<Result>;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import type { FsOptions } from "../contracts/filesystem.js";
|
|
3
|
+
export type PlatformErrno = number;
|
|
4
|
+
export type PlatformComparisonCallback<Callback> = Callback;
|
|
5
|
+
export declare const platform: Readonly<{
|
|
6
|
+
errno(code: string): PlatformErrno;
|
|
7
|
+
callbackAuthorities: true;
|
|
8
|
+
randomUUID: typeof randomUUID;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const comparisonContext: Readonly<{
|
|
11
|
+
active(_options: FsOptions): boolean;
|
|
12
|
+
run<Result>(options: FsOptions, action: (nested: FsOptions) => Promise<Result>): Promise<Result>;
|
|
13
|
+
}>;
|